From a6e780d56c1fb4d91251cd105b0d8d839e6bd25b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B1=9F=E7=8E=AE?= Date: Fri, 14 Apr 2023 14:34:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/wms/pdm/rest/WorkorderController.java | 8 ++ .../nl/wms/pdm/service/WorkordeService.java | 2 + .../service/impl/WorkorderServiceImpl.java | 5 +- .../sch/task/call/empty/YZCallEmptyTask.java | 118 +++++++++--------- .../call/material/SZCallMaterialTask.java | 112 +++++++++-------- .../send/material/SZSendMaterialTask.java | 112 +++++++++-------- .../send/material/YZSendMaterialTask.java | 118 +++++++++--------- .../src/main/java/org/nl/wms/wms.xls | Bin 266240 -> 266240 bytes lms/nladmin-ui/src/api/wms/pdm/workorder.js | 9 +- .../src/views/wms/pdm/workerorder/index.vue | 59 +++------ .../src/views/wms/pub/MaterDialog.vue | 7 +- 11 files changed, 279 insertions(+), 271 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/rest/WorkorderController.java b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/rest/WorkorderController.java index f8792a0..5bc23d5 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/rest/WorkorderController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/rest/WorkorderController.java @@ -142,4 +142,12 @@ public class WorkorderController { return new ResponseEntity<>(workordeService.getDtl(param),HttpStatus.OK); } + @PostMapping("/getMaterial") + @Log("获取工单物料") + @ApiOperation("获取工单物料") + //@SaCheckPermission("produceshiftorder:list") + public ResponseEntity getMaterial(){ + return new ResponseEntity<>(workordeService.getMaterial(),HttpStatus.OK); + } + } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/WorkordeService.java b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/WorkordeService.java index 911b33c..8317fc1 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/WorkordeService.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/WorkordeService.java @@ -121,4 +121,6 @@ public interface WorkordeService { * @return */ JSONArray getDtl(JSONObject param); + + JSONArray getMaterial(); } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java index e375477..c22b728 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java @@ -122,7 +122,6 @@ public class WorkorderServiceImpl implements WorkordeService { } work_order.put("vehicle_type", vehicle_type); work_order.put("device_id", dto.getDevice_id()); - work_order.put("device_code", device_code); work_order.put("order_status", WorkOrderEnum.ORDER_STATUS_UNPRODUCED.value()); work_order.put("is_urgent", dto.getIs_urgent()); work_order.put("is_pri", dto.getIs_pri()); @@ -460,4 +459,8 @@ public class WorkorderServiceImpl implements WorkordeService { return resultJSONArray; } + @Override + public JSONArray getMaterial() { + return WQLObject.getWQLObject("md_me_materialbase").query().getResultJSONArray(0); + } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/YZCallEmptyTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/YZCallEmptyTask.java index 2522c83..3af134c 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/YZCallEmptyTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/YZCallEmptyTask.java @@ -134,74 +134,78 @@ public class YZCallEmptyTask extends AbstractAcsTask { @Transactional(rollbackFor = Exception.class) public void cancelTask(JSONObject task, OperationType operation_type) { - task.put("task_status", TaskStatus.CANCELLED.value()); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(task); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(task); - } - WQLObject.getWQLObject("sch_base_task").update(task); - - WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); - JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(point1) - && LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) - && task.getString("task_code").equals(point1.getString("task_code"))) { - point1.put("lock_type", LockType.UNLOCKED.value()); - point1.put("task_code", ""); + if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) { + task.put("task_status", TaskStatus.CANCELLED.value()); if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(point1); + TaskUtils.addACSUpdateColum(task); } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(point1); + TaskUtils.addCurrentUpdateColum(task); } - point_table.update(point1); - } + WQLObject.getWQLObject("sch_base_task").update(task); - JSONObject point2 = new JSONObject(); - point2.put("lock_type", LockType.UNLOCKED.value()); - point2.put("task_code", ""); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(point2); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(point2); + WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); + JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(point1) + && LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) + && task.getString("task_code").equals(point1.getString("task_code"))) { + point1.put("lock_type", LockType.UNLOCKED.value()); + point1.put("task_code", ""); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(point1); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(point1); + } + point_table.update(point1); + } + + JSONObject point2 = new JSONObject(); + point2.put("lock_type", LockType.UNLOCKED.value()); + point2.put("task_code", ""); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(point2); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(point2); + } + point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } - point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } @Transactional(rollbackFor = Exception.class) public void finishTask(JSONObject task, OperationType operation_type) { - task.put("task_status", TaskStatus.FINISHED.value()); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(task); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(task); - } - WQLObject.getWQLObject("sch_base_task").update(task); + if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) { + task.put("task_status", TaskStatus.FINISHED.value()); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(task); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(task); + } + WQLObject.getWQLObject("sch_base_task").update(task); - WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); - JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); - if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) - && task.getString("task_code").equals(point1.getString("task_code"))) { - point1.put("lock_type", LockType.UNLOCKED.value()); - point1.put("task_code", ""); - point1.put("vehicle_type", ""); - point1.put("vehicle_code", ""); - point1.put("point_status", PointStatus.EMPTY.value()); - TaskUtils.addCurrentUpdateColum(point1); - point_table.update(point1); - } + WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); + JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); + if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) + && task.getString("task_code").equals(point1.getString("task_code"))) { + point1.put("lock_type", LockType.UNLOCKED.value()); + point1.put("task_code", ""); + point1.put("vehicle_type", ""); + point1.put("vehicle_code", ""); + point1.put("point_status", PointStatus.EMPTY.value()); + TaskUtils.addCurrentUpdateColum(point1); + point_table.update(point1); + } - JSONObject point2 = new JSONObject(); - point2.put("lock_type", LockType.UNLOCKED.value()); - point2.put("task_code", ""); - point2.put("vehicle_type", task.getString("vehicle_type")); - point2.put("vehicle_code", task.getString("vehicle_code")); - point2.put("point_status", PointStatus.NOT_EMPTY.value()); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(point2); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(point2); + JSONObject point2 = new JSONObject(); + point2.put("lock_type", LockType.UNLOCKED.value()); + point2.put("task_code", ""); + point2.put("vehicle_type", task.getString("vehicle_type")); + point2.put("vehicle_code", task.getString("vehicle_code")); + point2.put("point_status", PointStatus.NOT_EMPTY.value()); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(point2); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(point2); + } + point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } - point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/SZCallMaterialTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/SZCallMaterialTask.java index e4a3e51..57052c8 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/SZCallMaterialTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/SZCallMaterialTask.java @@ -139,71 +139,75 @@ public class SZCallMaterialTask extends AbstractAcsTask { @Transactional(rollbackFor = Exception.class) public void cancelTask(JSONObject task, OperationType operation_type) { - task.put("task_status", TaskStatus.CANCELLED.value()); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(task); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(task); - } - WQLObject.getWQLObject("sch_base_task").update(task); - - WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); - JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(point1) - && LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) - && task.getString("task_code").equals(point1.getString("task_code"))) { - point1.put("lock_type", LockType.UNLOCKED.value()); - point1.put("task_code", ""); + if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) { + task.put("task_status", TaskStatus.CANCELLED.value()); if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(point1); + TaskUtils.addACSUpdateColum(task); } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(point1); + TaskUtils.addCurrentUpdateColum(task); } - point_table.update(point1); - } + WQLObject.getWQLObject("sch_base_task").update(task); - JSONObject point2 = new JSONObject(); - point2.put("lock_type", LockType.UNLOCKED.value()); - point2.put("task_code", ""); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(point2); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(point2); + WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); + JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(point1) + && LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) + && task.getString("task_code").equals(point1.getString("task_code"))) { + point1.put("lock_type", LockType.UNLOCKED.value()); + point1.put("task_code", ""); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(point1); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(point1); + } + point_table.update(point1); + } + + JSONObject point2 = new JSONObject(); + point2.put("lock_type", LockType.UNLOCKED.value()); + point2.put("task_code", ""); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(point2); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(point2); + } + point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } - point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } @Transactional(rollbackFor = Exception.class) public void finishTask(JSONObject task, OperationType operation_type) { - task.put("task_status", TaskStatus.FINISHED.value()); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(task); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(task); - } - WQLObject.getWQLObject("sch_base_task").update(task); + if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) { + task.put("task_status", TaskStatus.FINISHED.value()); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(task); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(task); + } + WQLObject.getWQLObject("sch_base_task").update(task); - WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); - JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); - if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) - && task.getString("task_code").equals(point1.getString("task_code"))) { - point1.put("lock_type", LockType.UNLOCKED.value()); - point1.put("task_code", ""); - point1.put("vehicle_type", ""); - point1.put("vehicle_code", ""); - point1.put("point_status", PointStatus.EMPTY.value()); - TaskUtils.addCurrentUpdateColum(point1); - point_table.update(point1); - } + WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); + JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); + if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) + && task.getString("task_code").equals(point1.getString("task_code"))) { + point1.put("lock_type", LockType.UNLOCKED.value()); + point1.put("task_code", ""); + point1.put("vehicle_type", ""); + point1.put("vehicle_code", ""); + point1.put("point_status", PointStatus.EMPTY.value()); + TaskUtils.addCurrentUpdateColum(point1); + point_table.update(point1); + } - JSONObject point2 = new JSONObject(); - point2.put("lock_type", LockType.UNLOCKED.value()); - point2.put("task_code", ""); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(point2); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(point2); + JSONObject point2 = new JSONObject(); + point2.put("lock_type", LockType.UNLOCKED.value()); + point2.put("task_code", ""); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(point2); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(point2); + } + point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } - point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/SZSendMaterialTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/SZSendMaterialTask.java index e631cc8..62b9135 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/SZSendMaterialTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/SZSendMaterialTask.java @@ -129,71 +129,75 @@ public class SZSendMaterialTask extends AbstractAcsTask { @Transactional(rollbackFor = Exception.class) public void cancelTask(JSONObject task, OperationType operation_type) { - task.put("task_status", TaskStatus.CANCELLED.value()); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(task); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(task); - } - WQLObject.getWQLObject("sch_base_task").update(task); - - WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); - JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); - if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) - && task.getString("task_code").equals(point1.getString("task_code"))) { - point1.put("lock_type", LockType.UNLOCKED.value()); - point1.put("task_code", ""); + if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) { + task.put("task_status", TaskStatus.CANCELLED.value()); if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(point1); + TaskUtils.addACSUpdateColum(task); } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(point1); + TaskUtils.addCurrentUpdateColum(task); } - point_table.update(point1); - } + WQLObject.getWQLObject("sch_base_task").update(task); - JSONObject point2 = new JSONObject(); - point2.put("lock_type", LockType.UNLOCKED.value()); - point2.put("task_code", ""); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(point2); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(point2); + WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); + JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); + if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) + && task.getString("task_code").equals(point1.getString("task_code"))) { + point1.put("lock_type", LockType.UNLOCKED.value()); + point1.put("task_code", ""); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(point1); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(point1); + } + point_table.update(point1); + } + + JSONObject point2 = new JSONObject(); + point2.put("lock_type", LockType.UNLOCKED.value()); + point2.put("task_code", ""); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(point2); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(point2); + } + point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } - point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } @Transactional(rollbackFor = Exception.class) public void finishTask(JSONObject task, OperationType operation_type) { - task.put("task_status", TaskStatus.FINISHED.value()); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(task); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(task); - } - WQLObject.getWQLObject("sch_base_task").update(task); + if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) { + task.put("task_status", TaskStatus.FINISHED.value()); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(task); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(task); + } + WQLObject.getWQLObject("sch_base_task").update(task); - WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); - JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(point1) - && LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) - && task.getString("task_code").equals(point1.getString("task_code"))) { - point1.put("lock_type", LockType.UNLOCKED.value()); - point1.put("task_code", ""); - TaskUtils.addCurrentUpdateColum(point1); - point_table.update(point1); - } + WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); + JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(point1) + && LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) + && task.getString("task_code").equals(point1.getString("task_code"))) { + point1.put("lock_type", LockType.UNLOCKED.value()); + point1.put("task_code", ""); + TaskUtils.addCurrentUpdateColum(point1); + point_table.update(point1); + } - JSONObject point2 = new JSONObject(); - point2.put("lock_type", LockType.UNLOCKED.value()); - point2.put("task_code", ""); - point2.put("vehicle_type", task.getString("vehicle_type")); - point2.put("vehicle_code", task.getString("vehicle_code")); - point2.put("point_status", PointStatus.NOT_EMPTY.value()); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(point2); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(point2); + JSONObject point2 = new JSONObject(); + point2.put("lock_type", LockType.UNLOCKED.value()); + point2.put("task_code", ""); + point2.put("vehicle_type", task.getString("vehicle_type")); + point2.put("vehicle_code", task.getString("vehicle_code")); + point2.put("point_status", PointStatus.NOT_EMPTY.value()); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(point2); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(point2); + } + point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } - point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/YZSendMaterialTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/YZSendMaterialTask.java index f6c8045..4c8410d 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/YZSendMaterialTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/YZSendMaterialTask.java @@ -121,74 +121,78 @@ public class YZSendMaterialTask extends AbstractAcsTask { @Transactional(rollbackFor = Exception.class) public void cancelTask(JSONObject task, OperationType operation_type) { - task.put("task_status", TaskStatus.CANCELLED.value()); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(task); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(task); - } - WQLObject.getWQLObject("sch_base_task").update(task); - - WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); - JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); - if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) - && task.getString("task_code").equals(point1.getString("task_code"))) { - point1.put("lock_type", LockType.UNLOCKED.value()); - point1.put("task_code", ""); + if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) { + task.put("task_status", TaskStatus.CANCELLED.value()); if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(point1); + TaskUtils.addACSUpdateColum(task); } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(point1); + TaskUtils.addCurrentUpdateColum(task); } - point_table.update(point1); - } + WQLObject.getWQLObject("sch_base_task").update(task); - JSONObject point2 = new JSONObject(); - point2.put("lock_type", LockType.UNLOCKED.value()); - point2.put("task_code", ""); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(point2); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(point2); + WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); + JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); + if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) + && task.getString("task_code").equals(point1.getString("task_code"))) { + point1.put("lock_type", LockType.UNLOCKED.value()); + point1.put("task_code", ""); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(point1); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(point1); + } + point_table.update(point1); + } + + JSONObject point2 = new JSONObject(); + point2.put("lock_type", LockType.UNLOCKED.value()); + point2.put("task_code", ""); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(point2); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(point2); + } + point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } - point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } @Transactional(rollbackFor = Exception.class) public void finishTask(JSONObject task, OperationType operation_type) { - task.put("task_status", TaskStatus.FINISHED.value()); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(task); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(task); - } - WQLObject.getWQLObject("sch_base_task").update(task); + if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) { + task.put("task_status", TaskStatus.FINISHED.value()); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(task); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(task); + } + WQLObject.getWQLObject("sch_base_task").update(task); - WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); - JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(point1) - && LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) - && task.getString("task_code").equals(point1.getString("task_code"))) { - point1.put("lock_type", LockType.UNLOCKED.value()); - point1.put("task_code", ""); - point1.put("vehicle_type", ""); - point1.put("vehicle_code", ""); - point1.put("point_status", PointStatus.EMPTY.value()); - TaskUtils.addCurrentUpdateColum(point1); - point_table.update(point1); - } + WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); + JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(point1) + && LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) + && task.getString("task_code").equals(point1.getString("task_code"))) { + point1.put("lock_type", LockType.UNLOCKED.value()); + point1.put("task_code", ""); + point1.put("vehicle_type", ""); + point1.put("vehicle_code", ""); + point1.put("point_status", PointStatus.EMPTY.value()); + TaskUtils.addCurrentUpdateColum(point1); + point_table.update(point1); + } - JSONObject point2 = new JSONObject(); - point2.put("lock_type", LockType.UNLOCKED.value()); - point2.put("task_code", ""); - point2.put("vehicle_type", task.getString("vehicle_type")); - point2.put("vehicle_code", task.getString("vehicle_code")); - point2.put("point_status", PointStatus.NOT_EMPTY.value()); - if (operation_type == OperationType.AUTO) { - TaskUtils.addACSUpdateColum(point2); - } else if (operation_type == OperationType.MANUAL) { - TaskUtils.addCurrentUpdateColum(point2); + JSONObject point2 = new JSONObject(); + point2.put("lock_type", LockType.UNLOCKED.value()); + point2.put("task_code", ""); + point2.put("vehicle_type", task.getString("vehicle_type")); + point2.put("vehicle_code", task.getString("vehicle_code")); + point2.put("point_status", PointStatus.NOT_EMPTY.value()); + if (operation_type == OperationType.AUTO) { + TaskUtils.addACSUpdateColum(point2); + } else if (operation_type == OperationType.MANUAL) { + TaskUtils.addCurrentUpdateColum(point2); + } + point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } - point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/wms.xls b/lms/nladmin-system/src/main/java/org/nl/wms/wms.xls index 36ae0511d7c42c49bf8e0d3b7fc62621e08a3845..6a50c5de25dfa40b53d9ce1823682063f78109f7 100644 GIT binary patch delta 36 pcmZozAkeTtU_%ZI>xJ%lo>Q9(S=tL(7=f4xh?%z+vas}X0|5IG3>g3b delta 36 pcmZozAkeTtU_%ZI>xU~zI#ZepS=tL(7=f4xh?%z+vas}X0|5OY3@88q diff --git a/lms/nladmin-ui/src/api/wms/pdm/workorder.js b/lms/nladmin-ui/src/api/wms/pdm/workorder.js index 4d4f364..00a7e76 100644 --- a/lms/nladmin-ui/src/api/wms/pdm/workorder.js +++ b/lms/nladmin-ui/src/api/wms/pdm/workorder.js @@ -96,4 +96,11 @@ export function getDtl(data) { }) } -export default { add, edit, del, submits, getDevice, getTable, openStart, saveReport, finish, getReportWork, forceFinish, getDtl } +export function getMaterial() { + return request({ + url: 'api/workorder/getMaterial', + method: 'post' + }) +} + +export default { add, edit, del, submits, getDevice, getTable, openStart, saveReport, finish, getReportWork, forceFinish, getDtl, getMaterial } diff --git a/lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue b/lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue index eb73861..5027529 100644 --- a/lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue +++ b/lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue @@ -110,7 +110,7 @@ - + - + @@ -198,10 +198,14 @@ {{ dict.label.pdm_workorder_status[scope.row.order_status] }} - - - + + + + + - - +