|
|
@ -55,6 +55,7 @@ public class SortingServiceImpl implements SortingService { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Map createAgvTask(JSONObject jsonObject) { |
|
|
|
log.info("sorting下发agv任务:{}", jsonObject); |
|
|
|
try { |
|
|
@ -75,6 +76,7 @@ public class SortingServiceImpl implements SortingService { |
|
|
|
String vehicle_type = jsonObject.getString("vehicle_type"); |
|
|
|
//托盘上的堆垛信息
|
|
|
|
JSONArray jsonArray = JSONUtil.parseArray(jsonObject.get("pallet_detail")); |
|
|
|
JSONArray jsonArray1 = JSONUtil.parseArray(jsonObject.get("pallet_detail2")); |
|
|
|
SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(pointCode); |
|
|
|
if (ObjectUtil.isEmpty(schBasePoint)) { |
|
|
|
log.info("点位编码不存在:{}", pointCode); |
|
|
@ -122,6 +124,10 @@ public class SortingServiceImpl implements SortingService { |
|
|
|
taskParam.put("config_code", "SortingSMTTask"); |
|
|
|
connectorTask.apply(taskParam); |
|
|
|
} |
|
|
|
iSchBasePointService.update(new UpdateWrapper<SchBasePoint>() |
|
|
|
.set("is_lock", true) |
|
|
|
.set("remark", task_code) |
|
|
|
.eq("point_code", pointCode)); |
|
|
|
} else if ("1".equals(vehicle_type)) { |
|
|
|
//TODO:呼叫两个空笼框
|
|
|
|
if (SortingEnum.TASK_TYPE_ONE.getValue().equals(task_type) && SortingEnum.IS_EMPTY.getValue().equals(is_empty)) { |
|
|
@ -130,10 +136,18 @@ public class SortingServiceImpl implements SortingService { |
|
|
|
taskParam.put("config_code", "SortingTwoCNTTask"); |
|
|
|
taskParam.put("task_code", task_code + "A"); |
|
|
|
connectorTask.apply(taskParam); |
|
|
|
iSchBasePointService.update(new UpdateWrapper<SchBasePoint>() |
|
|
|
.set("is_lock", true) |
|
|
|
.set("remark", task_code) |
|
|
|
.eq("point_code", pointCode + "_01")); |
|
|
|
taskParam.put("device_code", pointCode + "_02"); |
|
|
|
taskParam.put("task_seq", "2"); |
|
|
|
taskParam.put("task_code", task_code + "B"); |
|
|
|
connectorTask.apply(taskParam); |
|
|
|
iSchBasePointService.update(new UpdateWrapper<SchBasePoint>() |
|
|
|
.set("is_lock", true) |
|
|
|
.set("remark", task_code) |
|
|
|
.eq("point_code", pointCode + "_02")); |
|
|
|
//TODO:将两个笼框放到线边库
|
|
|
|
} else if (SortingEnum.TASK_TYPE_TWO.getValue().equals(task_type) && SortingEnum.NOT_EMPTY.getValue().equals(is_empty)) { |
|
|
|
if (StrUtil.isEmpty(jsonObject.getString("vehicle_code2"))) { |
|
|
@ -144,23 +158,33 @@ public class SortingServiceImpl implements SortingService { |
|
|
|
log.info("物料信息为空!"); |
|
|
|
return MapOf.of("status", 400, "msg", "物料信息为空!"); |
|
|
|
} |
|
|
|
if (CollUtil.isEmpty(jsonArray1) || jsonArray1.size() < 1) { |
|
|
|
log.info("第二个物料信息为空!"); |
|
|
|
return MapOf.of("status", 400, "msg", "第二个物料信息为空!"); |
|
|
|
} |
|
|
|
taskParam.put("config_code", "SortingSMTTask"); |
|
|
|
taskParam.put("task_seq", "1"); |
|
|
|
taskParam.put("vehicle_code", jsonObject.getString("vehicle_code2")); |
|
|
|
taskParam.put("device_code", pointCode + "_02"); |
|
|
|
taskParam.put("task_code", task_code + "B"); |
|
|
|
connectorTask.apply(taskParam); |
|
|
|
taskParam.put("vehicle_code", vehicle_code); |
|
|
|
taskParam.put("task_seq", "2"); |
|
|
|
taskParam.put("device_code", pointCode + "_01"); |
|
|
|
taskParam.put("task_code", task_code + "A"); |
|
|
|
connectorTask.apply(taskParam); |
|
|
|
iSchBasePointService.update(new UpdateWrapper<SchBasePoint>() |
|
|
|
.set("is_lock", true) |
|
|
|
.set("remark", task_code) |
|
|
|
.eq("point_code", pointCode + "_01")); |
|
|
|
taskParam.put("task_seq", "1"); |
|
|
|
taskParam.put("vehicle_code", jsonObject.getString("vehicle_code2")); |
|
|
|
taskParam.put("device_code", pointCode + "_02"); |
|
|
|
taskParam.put("task_code", task_code + "B"); |
|
|
|
taskParam.put("ext_data", jsonObject.put("pallet_detail",jsonArray1)); |
|
|
|
connectorTask.apply(taskParam); |
|
|
|
iSchBasePointService.update(new UpdateWrapper<SchBasePoint>() |
|
|
|
.set("is_lock", true) |
|
|
|
.set("remark", task_code) |
|
|
|
.eq("point_code", pointCode + "_02")); |
|
|
|
} |
|
|
|
} |
|
|
|
iSchBasePointService.update(new UpdateWrapper<SchBasePoint>() |
|
|
|
.set("is_lock", true) |
|
|
|
.set("remark", task_code) |
|
|
|
.eq("point_code", pointCode)); |
|
|
|
|
|
|
|
return MapOf.of("status", 200, "msg", "sucess"); |
|
|
|
} catch (Exception ex) { |
|
|
|
log.info("sorting下发任务失败:{}", ex.getMessage()); |
|
|
|