|
@ -80,18 +80,17 @@ public class MJXLTask extends AbstractTask { |
|
|
task.setRemark("未找到所需点位!"); |
|
|
task.setRemark("未找到所需点位!"); |
|
|
taskService.update(task); |
|
|
taskService.update(task); |
|
|
// 消息通知
|
|
|
// 消息通知
|
|
|
log.info("满架下料未找到当前符合条件的点位materialType:{},",materialType); |
|
|
log.info("满架下料未找到当前符合条件的点位materialType:{},", materialType); |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
// 设置终点并修改创建成功状态
|
|
|
// 设置终点并修改创建成功状态
|
|
|
task.setPoint_code2(point.getPoint_code()); |
|
|
task.setPoint_code2(point.getNext_wait_point()); |
|
|
task.setTask_status(TaskStatus.CREATED.getCode()); |
|
|
task.setTask_status(TaskStatus.CREATED.getCode()); |
|
|
task.setRemark(""); |
|
|
task.setRemark(""); |
|
|
taskService.update(task); |
|
|
taskService.update(task); |
|
|
|
|
|
|
|
|
//发起任务时先把点位占用,防止发起重复任务
|
|
|
//发起任务时先把点位占用,防止发起重复任务
|
|
|
point.setIng_task_code(task.getTask_code()); |
|
|
point.setIng_task_code(task.getTask_code()); |
|
|
point.setVehicle_qty(point.getVehicle_qty() + 1); |
|
|
|
|
|
point.setVehicle_type(materialType); |
|
|
point.setVehicle_type(materialType); |
|
|
pointService.update(point); |
|
|
pointService.update(point); |
|
|
|
|
|
|
|
@ -122,17 +121,17 @@ public class MJXLTask extends AbstractTask { |
|
|
//TBX2找B区
|
|
|
//TBX2找B区
|
|
|
regionCode = "GHS2"; |
|
|
regionCode = "GHS2"; |
|
|
} |
|
|
} |
|
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode,"2"); |
|
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "2"); |
|
|
for (SchBasePoint schBasePoint : schBasePointList) { |
|
|
for (SchBasePoint schBasePoint : schBasePointList) { |
|
|
if (!schBasePoint.getPoint_code().endsWith("01") && |
|
|
if (!schBasePoint.getPoint_code().endsWith("01") && |
|
|
!schBasePoint.getPoint_code().endsWith("06")) { |
|
|
!schBasePoint.getPoint_code().endsWith("06")) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
if ((ObjectUtil.isEmpty(schBasePoint.getVehicle_type())|| |
|
|
if ((ObjectUtil.isEmpty(schBasePoint.getVehicle_type()) || |
|
|
materialType.equals(schBasePoint.getVehicle_type())) |
|
|
materialType.equals(schBasePoint.getVehicle_type())) |
|
|
&& "2".equals(schBasePoint.getPoint_status()) |
|
|
&& "2".equals(schBasePoint.getPoint_status()) |
|
|
&& schBasePoint.getVehicle_qty() < 3) { |
|
|
&& schBasePoint.getVehicle_qty() < 3) { |
|
|
log.info("满架下料找到当前符合条件的点位{}",schBasePoint.getPoint_code()); |
|
|
log.info("满架下料找到当前符合条件的点位{}", schBasePoint.getPoint_code()); |
|
|
return schBasePoint; |
|
|
return schBasePoint; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -163,7 +162,7 @@ public class MJXLTask extends AbstractTask { |
|
|
.eq(PdmBdWorkorder::getWorkorder_code, extGroupData.getString("workorder_code"))) |
|
|
.eq(PdmBdWorkorder::getWorkorder_code, extGroupData.getString("workorder_code"))) |
|
|
: null; |
|
|
: null; |
|
|
String startPoint = taskObj.getPoint_code1(); // 获取起点
|
|
|
String startPoint = taskObj.getPoint_code1(); // 获取起点
|
|
|
String endPoint = taskObj.getPoint_code2(); // 获取终点
|
|
|
String endPoint = taskObj.getPoint_code2().substring(0,taskObj.getPoint_code2().length()-2); // 获取终点
|
|
|
SchBasePoint startPointObj = pointService.getById(startPoint); |
|
|
SchBasePoint startPointObj = pointService.getById(startPoint); |
|
|
SchBasePoint endPointObj = pointService.getById(endPoint); |
|
|
SchBasePoint endPointObj = pointService.getById(endPoint); |
|
|
// 根据传来的类型去对任务进行操作
|
|
|
// 根据传来的类型去对任务进行操作
|
|
@ -179,6 +178,7 @@ public class MJXLTask extends AbstractTask { |
|
|
// 终点解锁
|
|
|
// 终点解锁
|
|
|
endPointObj.setIng_task_code(""); |
|
|
endPointObj.setIng_task_code(""); |
|
|
endPointObj.setVehicle_code(ObjectUtil.isEmpty(endPointObj.getVehicle_code()) ? vehicle_code + "," : endPointObj.getVehicle_code() + vehicle_code + ","); |
|
|
endPointObj.setVehicle_code(ObjectUtil.isEmpty(endPointObj.getVehicle_code()) ? vehicle_code + "," : endPointObj.getVehicle_code() + vehicle_code + ","); |
|
|
|
|
|
endPointObj.setVehicle_qty(endPointObj.getVehicle_qty() + 1); |
|
|
pointService.update(endPointObj); |
|
|
pointService.update(endPointObj); |
|
|
// 要把数据存到组盘表 -> 改造公共方法,返回id
|
|
|
// 要把数据存到组盘表 -> 改造公共方法,返回id
|
|
|
SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup(); |
|
|
SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup(); |
|
@ -222,8 +222,7 @@ public class MJXLTask extends AbstractTask { |
|
|
if (ObjectUtil.isNotEmpty(endPointObj)) { |
|
|
if (ObjectUtil.isNotEmpty(endPointObj)) { |
|
|
endPointObj.setIng_task_code(""); |
|
|
endPointObj.setIng_task_code(""); |
|
|
//任务取消把原先占用的位置释放
|
|
|
//任务取消把原先占用的位置释放
|
|
|
endPointObj.setVehicle_qty(endPointObj.getVehicle_qty()-1); |
|
|
if (endPointObj.getVehicle_qty() <= 0) { |
|
|
if(endPointObj.getVehicle_qty()<=0){ |
|
|
|
|
|
endPointObj.setVehicle_type(null); |
|
|
endPointObj.setVehicle_type(null); |
|
|
} |
|
|
} |
|
|
pointService.update(endPointObj); |
|
|
pointService.update(endPointObj); |
|
@ -245,7 +244,16 @@ public class MJXLTask extends AbstractTask { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) { |
|
|
protected void feedbackTaskState(JSONObject param, SchBaseTask schBaseTask, BaseResponse result) { |
|
|
//无需重算,返回当前点位即可
|
|
|
//重新计算固化室放货点位
|
|
|
|
|
|
try { |
|
|
|
|
|
JSONObject extGroupData = JSONObject.parseObject(schBaseTask.getExt_group_data()); |
|
|
|
|
|
SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() |
|
|
|
|
|
.eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code1())); |
|
|
|
|
|
SchBasePoint point = findNextPoint(startPoint, extGroupData); |
|
|
|
|
|
schBaseTask.setPoint_code2(point.getPoint_code()+"0"+(point.getVehicle_qty()+1)); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.error("error:{}", e, e.getMessage()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|