|
|
|
@ -91,53 +91,19 @@ public class WcsTaskController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Log(title = "wz-wcs任务下发", businessType = BusinessType.UPDATE) |
|
|
|
@Log(title = "查询库区状态", businessType = BusinessType.UPDATE) |
|
|
|
@PostMapping("/toWzWcs/wcsIncomingTrayCheck") |
|
|
|
@PostMapping("/toWzWcs/queryAreaStatus") |
|
|
|
@RepeatSubmit |
|
|
|
@RepeatSubmit |
|
|
|
public WcsResponseVo wcsIncomingTrayCheck(WcsCreateTaskDto bo) { |
|
|
|
public WcsResponseVo queryAreaStatus(WcsCreateTaskDto dto) { |
|
|
|
if (bo != null) { |
|
|
|
if (dto != null) { |
|
|
|
List<WcsCreateTaskBody> body = bo.getBody(); |
|
|
|
String businessType = dto.getHeader().getBusinessType(); |
|
|
|
if (!body.isEmpty()) { |
|
|
|
if(businessType.equals("queryAreaStatus")){ |
|
|
|
for (WcsCreateTaskBody by : body) { |
|
|
|
|
|
|
|
String taskId = by.getTaskId(); |
|
|
|
|
|
|
|
String trayCode = by.getTrayCode(); |
|
|
|
|
|
|
|
String taskType = by.getTaskType(); |
|
|
|
|
|
|
|
String fromBinCode = by.getFromBinCode(); |
|
|
|
|
|
|
|
String toBinCode = by.getToBinCode(); |
|
|
|
|
|
|
|
String dataChange = by.getDataChange(); |
|
|
|
|
|
|
|
String priority = by.getPriority(); |
|
|
|
|
|
|
|
LambdaQueryWrapper<BusinDataTask> lqwDataTask = new LambdaQueryWrapper<BusinDataTask>() |
|
|
|
|
|
|
|
.eq(BusinDataTask::getContainerId, trayCode) |
|
|
|
|
|
|
|
.in(BusinDataTask::getTaskStatus, "1", "2"); |
|
|
|
|
|
|
|
BusinDataTask one = iBusinDataTaskService.getOne(lqwDataTask); |
|
|
|
|
|
|
|
if (dataChange.equals("1")) { |
|
|
|
|
|
|
|
if (one != null) { |
|
|
|
|
|
|
|
return WcsResponseVo.error(500, "该托盘" + trayCode + "存在未完成的任务"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
BusinDataTask businDataTask = new BusinDataTask(); |
|
|
|
|
|
|
|
businDataTask.setTaskCode(taskId); |
|
|
|
|
|
|
|
businDataTask.setTaskType(taskType); |
|
|
|
|
|
|
|
businDataTask.setContainerId(Long.valueOf(trayCode)); |
|
|
|
|
|
|
|
businDataTask.setFromSide(fromBinCode); |
|
|
|
|
|
|
|
businDataTask.setToSide(toBinCode); |
|
|
|
|
|
|
|
businDataTask.setCreateTime(DateUtils.getNowDate()); |
|
|
|
|
|
|
|
businDataTask.setPriority(priority); |
|
|
|
|
|
|
|
boolean save = iBusinDataTaskService.save(businDataTask); |
|
|
|
|
|
|
|
if (save) { |
|
|
|
|
|
|
|
//调用下游接口下任务
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else if (dataChange.equals("2")) { |
|
|
|
List<WcsCreateTaskBody> body = dto.getBody(); |
|
|
|
if (one == null) { |
|
|
|
if (!body.isEmpty()) { |
|
|
|
return WcsResponseVo.error(500, "未查询到该托盘" + trayCode + "存在未完成的任务"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
one.setTaskStatus("6"); |
|
|
|
|
|
|
|
iBusinDataTaskService.updateById(one); |
|
|
|
|
|
|
|
//推送给下游
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return WcsResponseVo.success(); |
|
|
|
return WcsResponseVo.success(); |
|
|
|
|