rev:限制任务号相同

This commit is contained in:
2025-11-21 14:15:39 +08:00
parent c1c1dd685a
commit 49da58b4a4
3 changed files with 64 additions and 2 deletions

View File

@@ -113,6 +113,18 @@ public class MesToWmsServiceImpl implements MesToWmsService {
jsonItem.put("task_type",json.getString("task_type"));
}
// 判断是否有相同任务号的任务
SchBaseTask taskCode = taskService.getByCode(jsonItem.getString("TaskCode"));
if (ObjectUtil.isNotEmpty(taskCode)) {
JSONObject jsonErro = new JSONObject();
jsonErro.put("TaskCode", jsonItem.getString("TaskCode"));
jsonErro.put("ReturnStatus", 1);
jsonErro.put("ReturnInfo", "5.不能立即派送" + "此任务号已下发过任务!");
jsonErro.put("ReturnCount", null);
jsonErro.put("MsgTime", DateUtil.now());
erroList.add(jsonErro);
}
taskCreateList.add(jsonItem);
}
}