From a6e29e9c9c44d8d82bc8b517875430238ae572fd Mon Sep 17 00:00:00 2001 From: lyd <1419499670@qq.com> Date: Wed, 16 Nov 2022 16:16:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=B7=E7=A2=BE=E9=80=81=E6=96=99-=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E6=97=B6=E9=97=B4=EF=BC=8C=E9=9D=99=E7=BD=AE=E6=97=B6?= =?UTF-8?q?=E9=97=B4=EF=BC=8C=E9=98=88=E5=80=BC=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tasks/sendMaterial/HnSendMaterialTask.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/HnSendMaterialTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/HnSendMaterialTask.java index 42a6d0f..a389333 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/HnSendMaterialTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/sendMaterial/HnSendMaterialTask.java @@ -16,6 +16,7 @@ import org.nl.modules.wql.core.bean.WQLObject; import org.nl.wms.sch.SchTaskDto; import org.nl.wms.sch.manage.AbstractAcsTask; import org.nl.wms.sch.manage.TaskStatusEnum; +import org.nl.wms.sch.manage.UpdateTaskStatusEnum; import org.nl.wms.sch.tasks.AcsTaskDto; import org.nl.wms.util.IdUtil; import org.springframework.stereotype.Service; @@ -78,12 +79,13 @@ public class HnSendMaterialTask extends AbstractAcsTask { public void updateTaskStatus(JSONObject task, String status) { WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); + WQLObject materialTab = WQLObject.getWQLObject("MD_ME_MaterialBase"); String task_id = task.getString("task_id"); JSONObject taskObj = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0); //任务取消 - if (StrUtil.equals(status, "0")) { + if (StrUtil.equals(status, UpdateTaskStatusEnum.CANCEL.getCode())) { // 取消删除任务 if (StrUtil.equals(taskObj.getString("task_status"), TaskStatusEnum.FINISHED.getCode())) { throw new BadRequestException("已完成不能取消!"); @@ -99,7 +101,7 @@ public class HnSendMaterialTask extends AbstractAcsTask { taskTab.update(taskObj); } - if ("1".equals(status)) { + if (UpdateTaskStatusEnum.EXECUTION.getCode().equals(status)) { // 更新任务状态为执行中 taskObj.put("task_status", TaskStatusEnum.EXECUTING.getCode()); taskObj.put("update_time", DateUtil.now()); @@ -107,7 +109,7 @@ public class HnSendMaterialTask extends AbstractAcsTask { taskTab.update(taskObj); } - if (StrUtil.equals(status, "2")) { + if (StrUtil.equals(status, UpdateTaskStatusEnum.FORCEFINISH.getCode())) { // 更改任务状态为完成 taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode()); taskObj.put("update_optid", SecurityUtils.getCurrentUserId()); @@ -147,11 +149,15 @@ public class HnSendMaterialTask extends AbstractAcsTask { regionIoObj.put("create_time", DateUtil.now()); regionIoTab.insert(regionIoObj); + JSONObject materialObj = materialTab.query("material_id = '" + workorderObj.getString("material_id") + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(materialObj)) throw new BadRequestException("物料不存在!"); + //完成后入库 - point2Obj.put("instorage_time", DateUtil.now()); + point2Obj.put("instorage_time", taskObj.getString("create_time")); // 入库时间为任务生成的时间 point2Obj.put("pcsn", DateUtil.format(DateUtil.parse(DateUtil.today()), "yyyyMMdd")); point2Obj.put("ivt_qty", requestObj.getString("qty")); - point2Obj.put("standing_time", workorderObj.getString("standing_time")); + point2Obj.put("standing_time", materialObj.getString("standing_time")); + point2Obj.put("warn_time", materialObj.getString("standing_time")); point2Obj.put("material_id", workorderObj.getString("material_id")); point2Obj.put("vehicle_type", workorderObj.getString("vehicle_type")); point2Obj.put("vehicle_code", taskObj.getString("vehicle_code"));