From 1fdb697f08cfb51adbdad256beb4329725f8f3fc Mon Sep 17 00:00:00 2001 From: liuxy Date: Sun, 8 Jan 2023 16:23:04 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/nl/wms/sch/tasks/OutTask.java | 15 +- .../inbill/service/CheckOutBillService.java | 5 + .../outbill/rest/CheckOutBillController.java | 7 + .../service/impl/CheckOutBillServiceImpl.java | 669 ++++++++++++++++-- .../org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql | 264 +++++++ .../src/views/wms/st/outbill/DivDialog.vue | 33 + .../src/views/wms/st/outbill/checkoutbill.js | 9 +- 7 files changed, 934 insertions(+), 68 deletions(-) create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/OutTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/OutTask.java index 99ec5d55b..a24390f03 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/OutTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/OutTask.java @@ -67,6 +67,11 @@ public class OutTask extends AbstractAcsTask { .remark(json.getString("remark")) .build(); resultList.add(dto); + + // 更新任务为下发 + JSONObject paramMap = new JSONObject(); + paramMap.put("task_status", TaskStatusEnum.ISSUE.getCode()); + wo_Task.update(paramMap,"task_id ='"+json.getString("task_id")+"'"); } else { // 2.有任务组:按照执行顺序下发 大到小 JSONArray taskArr = wo_Task.query("task_group_id = '" + json.getString("task_group_id") + "' order by sort_seq DESC").getResultJSONArray(0); @@ -89,12 +94,12 @@ public class OutTask extends AbstractAcsTask { .build(); resultList.add(dto); } - } - // 更新分配明细执行状态为:执行中 - JSONObject paramMap = new JSONObject(); - paramMap.put("work_status", "02"); - dis_tab.update(paramMap,"task_id ='"+json.getString("task_id")+"'"); + // 更新任务为下发 + JSONObject paramMap = new JSONObject(); + paramMap.put("task_status", TaskStatusEnum.ISSUE.getCode()); + wo_Task.update(paramMap,"task_group_id ='"+json.getString("task_group_id")+"'"); + } } return resultList; } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java index 852405a5a..80d5fe4c6 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java @@ -121,6 +121,11 @@ public interface CheckOutBillService { * @param whereJson / */ void oneSetPoint(JSONObject whereJson); + /** + * 设置全部站点 + * @param whereJson / + */ + void allSetPoint(JSONObject whereJson); /** * 查询可分配库存 * @param whereJson / diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java index 0256f86a9..7c458dc89 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java @@ -138,6 +138,13 @@ public class CheckOutBillController { checkOutBillService.oneSetPoint(whereJson); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } + @PostMapping("/allSetPoint") + @Log("设置全部站点") + @ApiOperation("设置全部站点") + public ResponseEntity allSetPoint(@RequestBody JSONObject whereJson) { + checkOutBillService.allSetPoint(whereJson); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } @GetMapping("/getOutBillTask") @Log("查询出库单分配任务") @ApiOperation("查询出库单分配任务") diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java index aca3eaecd..93251c61c 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java @@ -104,7 +104,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { UserStorServiceImpl userStorService = new UserStorServiceImpl(); String in_stor_id = userStorService.getInStor(); - if (ObjectUtil.isNotEmpty(in_stor_id)) map.put("in_stor_id",in_stor_id); + if (ObjectUtil.isNotEmpty(in_stor_id)) map.put("in_stor_id", in_stor_id); JSONObject jo = WQL.getWO("QST_IVT_CHECKOUTBILL").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "bill_code desc"); return jo; @@ -299,7 +299,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { map.put("update_time", now); map.put("is_delete", "0"); map.put("is_upload", "0"); - map.put("out_stor_id",map.getString("out_stor_id")); + map.put("out_stor_id", map.getString("out_stor_id")); if (ObjectUtil.isNotEmpty(user)) { if (!user.equals("mes") || user.equals("sap")) { Long deptId = SecurityUtils.getDeptId(); @@ -586,10 +586,10 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { if (ObjectUtil.isEmpty(task_status)) { String work_status = json.getString("work_status"); if (StrUtil.equals(work_status, "01")) { - json.put("task_status","01"); + json.put("task_status", "01"); } if (StrUtil.equals(work_status, "99")) { - json.put("task_status","07"); + json.put("task_status", "07"); } } } @@ -608,12 +608,12 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { paramMap.put("task_id", ""); paramMap.put("work_status", "00"); paramMap.put("point_id", ""); - disTab.update(paramMap,"task_id = '"+task_id+"'"); + disTab.update(paramMap, "task_id = '" + task_id + "'"); // 删除此任务 JSONObject paramMap2 = new JSONObject(); - paramMap2.put("is_delete","1" ); - taskTab.update(paramMap2,"task_id = '"+task_id+"'"); + paramMap2.put("is_delete", "1"); + taskTab.update(paramMap2, "task_id = '" + task_id + "'"); } @Override @@ -809,10 +809,10 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { for (int j = 0; j < ivtAllArr.size(); j++) { JSONObject ivt = ivtAllArr.getJSONObject(j); double canuse_qty = ivt.getDoubleValue("canuse_qty"); - assign_qty = NumberUtil.add(assign_qty,canuse_qty); + assign_qty = NumberUtil.add(assign_qty, canuse_qty); if (unassign_qty >= canuse_qty) { - unassign_qty = NumberUtil.sub(unassign_qty,canuse_qty); + unassign_qty = NumberUtil.sub(unassign_qty, canuse_qty); // ivt.put("change_qty", canuse_qty + ""); } else { // ivt.put("change_qty", unassign_qty + ""); @@ -883,7 +883,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { double canuse_qty = jsonIvt.getDoubleValue("canuse_qty"); jsonIvt.put("change_qty", canuse_qty + ""); unassign_qty = 0; - assign_qty = NumberUtil.add(assign_qty,canuse_qty); + assign_qty = NumberUtil.add(assign_qty, canuse_qty); //更新库存 jsonIvt.put("bill_type_scode", jo_mst.getString("bill_type")); @@ -1029,7 +1029,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { for (int j = 0; j < ivtAllArr.size(); j++) { JSONObject ivt = ivtAllArr.getJSONObject(j); double canuse_qty = ivt.getDoubleValue("canuse_qty"); - assign_qty = NumberUtil.add(assign_qty,canuse_qty); + assign_qty = NumberUtil.add(assign_qty, canuse_qty); if (unassign_qty >= canuse_qty) { unassign_qty = unassign_qty - canuse_qty; @@ -1101,7 +1101,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("库存不足"); double canuse_qty = jsonIvt.getDoubleValue("canuse_qty"); - assign_qty = NumberUtil.add(assign_qty,canuse_qty); + assign_qty = NumberUtil.add(assign_qty, canuse_qty); jsonIvt.put("change_qty", canuse_qty + ""); unassign_qty = 0; @@ -1282,8 +1282,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { JSONObject jo_dtl = wo_dtl.query("iostorinvdtl_id = '" + iostorinvdtl_id + "'").uniqueResult(0); - jo_dtl.put("assign_qty", NumberUtil.sub(jo_dtl.getDoubleValue("assign_qty") ,plan_qty)); - jo_dtl.put("unassign_qty", NumberUtil.sub(jo_dtl.getDoubleValue("plan_qty"),jo_dtl.getDoubleValue("assign_qty"))); + jo_dtl.put("assign_qty", NumberUtil.sub(jo_dtl.getDoubleValue("assign_qty"), plan_qty)); + jo_dtl.put("unassign_qty", NumberUtil.sub(jo_dtl.getDoubleValue("plan_qty"), jo_dtl.getDoubleValue("assign_qty"))); if (jo_dtl.getDoubleValue("assign_qty") < 0) { jo_dtl.put("assign_qty", 0); @@ -1357,7 +1357,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { //查询主表信息 JSONObject jo_mst = wo_mst.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0); // 查询此分配明细下的所有相同箱号的分配明细 - JSONArray diss = wo_dis.query("box_no = '" + whereJson.getString("storagevehicle_code") + "' and iostorinv_id = '"+iostorinv_id+"'").getResultJSONArray(0); + JSONArray diss = wo_dis.query("box_no = '" + whereJson.getString("storagevehicle_code") + "' and iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0); for (int i = 0; i < diss.size(); i++) { JSONObject dis = diss.getJSONObject(i); @@ -1388,8 +1388,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { JSONObject jo_dtl = wo_dtl.query("iostorinvdtl_id = '" + iostorinvdtl_id + "'").uniqueResult(0); - jo_dtl.put("assign_qty", NumberUtil.sub(jo_dtl.getDoubleValue("assign_qty") ,plan_qty)); - jo_dtl.put("unassign_qty", NumberUtil.sub(jo_dtl.getDoubleValue("plan_qty"),jo_dtl.getDoubleValue("assign_qty"))); + jo_dtl.put("assign_qty", NumberUtil.sub(jo_dtl.getDoubleValue("assign_qty"), plan_qty)); + jo_dtl.put("unassign_qty", NumberUtil.sub(jo_dtl.getDoubleValue("plan_qty"), jo_dtl.getDoubleValue("assign_qty"))); if (jo_dtl.getDoubleValue("assign_qty") < 0) { jo_dtl.put("assign_qty", 0); @@ -1949,7 +1949,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { if (ObjectUtil.isNotEmpty(json)) { jsonAttr.put("placement_type","02"); }*/ - jsonAttr.put("placement_type","02"); + jsonAttr.put("placement_type", "02"); } else { // 调用验证方法进行校验 String out_order_seq = NumberUtil.add(jsonIsBlockL.getString("out_order_seq"), "1").toString(); @@ -1967,14 +1967,14 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { boolean left_verify2 = this.is_trueOrFalse(jsonParam); if (left_verify2) { - jsonAttr.put("placement_type","02"); + jsonAttr.put("placement_type", "02"); } } else { jsonParam.put("option", "4"); boolean left_verify2 = this.is_trueOrFalse(jsonParam); if (left_verify2) { - jsonAttr.put("placement_type","02"); + jsonAttr.put("placement_type", "02"); } } } @@ -1993,7 +1993,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { if (ObjectUtil.isNotEmpty(json)) { jsonAttr.put("placement_type","03"); }*/ - jsonAttr.put("placement_type","03"); + jsonAttr.put("placement_type", "03"); } else { // 调用验证方法进行校验 String out_order_seq = NumberUtil.sub(jsonIsBlockR.getString("out_order_seq"), "1").toString(); @@ -2011,14 +2011,14 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { boolean right_verify2 = this.is_trueOrFalse(jsonParam); if (right_verify2) { - jsonAttr.put("placement_type","03"); + jsonAttr.put("placement_type", "03"); } } else { jsonParam.put("option", "4"); boolean right_verify2 = this.is_trueOrFalse(jsonParam); if (right_verify2) { - jsonAttr.put("placement_type","03"); + jsonAttr.put("placement_type", "03"); } } } @@ -2138,7 +2138,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } } else { - if (StrUtil.equals(jsonAttr.getString("placement_type"),"01")) { + if (StrUtil.equals(jsonAttr.getString("placement_type"), "01")) { throw new BadRequestException("任务生成失败,请重新选择"); } map.put("struct_code", jsonAttr.getString("struct_code")); @@ -2450,6 +2450,550 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } } + @Override + @Transactional(rollbackFor = Exception.class) + public void allSetPoint(JSONObject whereJson) { + //出库分配表 + WQLObject wo_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis"); + //点位表 + WQLObject wo_Point = WQLObject.getWQLObject("SCH_BASE_Point"); + //任务表 + WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task"); + //出库主表 + WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_IOStorInv"); + //仓位表 + WQLObject attrTab = WQLObject.getWQLObject("ST_IVT_StructAttr"); + // 库存表 + WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_StructIvt"); + + String point_code = whereJson.getString("point_code"); // 终点 + String iostorinv_id = whereJson.getString("iostorinv_id"); + String iostorinvdtl_id = whereJson.getString("iostorinvdtl_id"); + + //查询主表信息 + JSONObject jo_mst = wo_mst.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(jo_mst)) { + throw new BadRequestException("未查到相关出库单"); + } + + JSONObject jsonPoint2 = wo_Point.query("lock_type='1' and (vehicle_code='' or vehicle_code IS NULL) and point_code='" + point_code + "'").uniqueResult(0); + //如果终点站点被锁定或者有载具号,则不允许设置点位 + if (ObjectUtil.isEmpty(jsonPoint2)) { + throw new BadRequestException("该站点被锁定或者有载具号,不允许设置!"); + } + + // 查询此明细的所有未生成的分配明细(根据片区、排 分组) + JSONArray allRowArr = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "1") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .process() + .getResultJSONArray(0); + + for (int i = 0; i < allRowArr.size(); i++) { + // 调用当前排处理方法 + JSONObject jsonRow = allRowArr.getJSONObject(i); + jsonRow.put("iostorinv_id", iostorinv_id); + jsonRow.put("point_code", point_code); + jsonRow.put("iostorinvdtl_id", iostorinvdtl_id); + jsonRow.put("point_id", jsonPoint2.getString("point_id")); + this.rowDispose(jsonRow); + } + outTask.immediateNotifyAcs(null); + } + + @Transactional(rollbackFor = Exception.class) + public void rowDispose(JSONObject jsonRow) { + //出库分配表 + WQLObject wo_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis"); + //任务表 + WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task"); + + String point_code = jsonRow.getString("point_code"); + String iostorinvdtl_id = jsonRow.getString("iostorinvdtl_id"); + String point_id = jsonRow.getString("point_id"); + + /* + * 查询这一排的要出库的所有分配明细(正序) + */ + JSONArray disRowArr = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "2") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .addParam("block_num", jsonRow.getString("block_num")) + .addParam("row_num", jsonRow.getString("row_num")) + .process().getResultJSONArray(0); + + JSONArray disRowArrNew = new JSONArray(); + String option = ""; // 1.左 2.右 + String placement_type = jsonRow.getString("placement_type"); // 单通或双通 + // 双通 + if (StrUtil.equals(placement_type, "01")) { + + // 取右边第一个 + JSONObject jsonDisRight = disRowArr.getJSONObject(0); + // 取左边第一个 + JSONObject jsonDisLeft = disRowArr.getJSONObject(disRowArr.size() - 1); + + /* + * 判断左边被挡住的个数多还是右边被挡住的个数多 + */ + // 判断右边边被挡住的个数 + JSONObject isNumMap = new JSONObject(); + isNumMap.put("flag", "3"); + isNumMap.put("block_num", jsonDisRight.getString("block_num")); + isNumMap.put("row_num", jsonDisRight.getString("row_num")); + isNumMap.put("out_order_seq", jsonDisRight.getString("out_order_seq")); + JSONArray numArrFirst = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + // 调用共用方法计算被挡个数 + JSONArray rightNumArr = this.isNum(numArrFirst); + + // 判断左边被挡住的个数 + isNumMap.put("flag", "4"); + isNumMap.put("block_num", jsonDisLeft.getString("block_num")); + isNumMap.put("row_num", jsonDisLeft.getString("row_num")); + isNumMap.put("out_order_seq", jsonDisLeft.getString("out_order_seq")); + JSONArray numArrLast = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + // 调用共用方法计算被挡个数 + JSONArray leftNumArr = this.isNum(numArrLast); + // 判断哪边少 + if (rightNumArr.size() > leftNumArr.size()) { + /* + * 左边开始 + */ + // 查询仓位被锁住的货位 + isNumMap.put("flag", "5"); + isNumMap.put("block_num", jsonDisLeft.getString("block_num")); + isNumMap.put("row_num", jsonDisLeft.getString("row_num")); + isNumMap.put("out_order_seq", jsonDisLeft.getString("out_order_seq")); + JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + JSONArray numArr = this.isNum(isLockArr); + // 不为空则返回报错 + if (ObjectUtil.isNotEmpty(numArr)) { + String error = ""; + + for (int k = 0; k < numArr.size(); k++) { + JSONObject json = numArr.getJSONObject(k); + error += json.getString("struct_code") + ","; + } + + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务"); + } + // 重新按照排序查询 + disRowArrNew = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "22") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .addParam("block_num", jsonRow.getString("block_num")) + .addParam("row_num", jsonRow.getString("row_num")) + .process().getResultJSONArray(0); + + option = "1"; + + } else if (rightNumArr.size() < leftNumArr.size()) { + /* + * 右边开始 + */ + // 查询仓位被锁住的货位 + isNumMap.put("flag", "6"); + isNumMap.put("block_num", jsonDisRight.getString("block_num")); + isNumMap.put("row_num", jsonDisRight.getString("row_num")); + isNumMap.put("out_order_seq", jsonDisRight.getString("out_order_seq")); + JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + JSONArray numArr = this.isNum(isLockArr); + // 不为空则返回报错 + if (ObjectUtil.isNotEmpty(numArr)) { + String error = ""; + + for (int k = 0; k < numArr.size(); k++) { + JSONObject json = numArr.getJSONObject(k); + error += json.getString("struct_code") + ","; + } + + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务"); + } + + // 重新按照排序查询 + disRowArrNew = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "2") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .addParam("block_num", jsonRow.getString("block_num")) + .addParam("row_num", jsonRow.getString("row_num")) + .process().getResultJSONArray(0); + + option = "2"; + } else { + /* + * 相等默认右边开始 + */ + // 查询仓位被锁住的货位 + isNumMap.put("flag", "6"); + isNumMap.put("block_num", jsonDisRight.getString("block_num")); + isNumMap.put("row_num", jsonDisRight.getString("row_num")); + isNumMap.put("out_order_seq", jsonDisRight.getString("out_order_seq")); + JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + JSONArray numArr = this.isNum(isLockArr); + // 不为空则返回报错 + if (ObjectUtil.isNotEmpty(numArr)) { + String error = ""; + + for (int k = 0; k < numArr.size(); k++) { + JSONObject json = numArr.getJSONObject(k); + error += json.getString("struct_code") + ","; + } + + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务"); + } + + // 重新按照排序查询 + disRowArrNew = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "2") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .addParam("block_num", jsonRow.getString("block_num")) + .addParam("row_num", jsonRow.getString("row_num")) + .process().getResultJSONArray(0); + + option = "2"; + } + + } else if (StrUtil.equals(placement_type, "02")) { + // 左通 + JSONObject jsonDisLeft = disRowArr.getJSONObject(disRowArr.size() - 1); + + JSONObject isNumMap = new JSONObject(); + // 查询仓位被锁住的货位 + isNumMap.put("flag", "5"); + isNumMap.put("block_num", jsonDisLeft.getString("block_num")); + isNumMap.put("row_num", jsonDisLeft.getString("row_num")); + isNumMap.put("out_order_seq", jsonDisLeft.getString("out_order_seq")); + JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + JSONArray numArr = this.isNum(isLockArr); + // 不为空则返回报错 + if (ObjectUtil.isNotEmpty(numArr)) { + String error = ""; + + for (int k = 0; k < numArr.size(); k++) { + JSONObject json = numArr.getJSONObject(k); + error += json.getString("struct_code") + ","; + } + + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务"); + } + // 重新按照排序查询 + disRowArrNew = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "22") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .addParam("block_num", jsonRow.getString("block_num")) + .addParam("row_num", jsonRow.getString("row_num")) + .process().getResultJSONArray(0); + + option = "1"; + + } else if (StrUtil.equals(placement_type, "03")) { + // 右通 + JSONObject jsonDisRight = disRowArr.getJSONObject(0); + JSONObject isNumMap = new JSONObject(); + // 查询仓位被锁住的货位 + isNumMap.put("flag", "6"); + isNumMap.put("block_num", jsonDisRight.getString("block_num")); + isNumMap.put("row_num", jsonDisRight.getString("row_num")); + isNumMap.put("out_order_seq", jsonDisRight.getString("out_order_seq")); + JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + JSONArray numArr = this.isNum(isLockArr); + // 不为空则返回报错 + if (ObjectUtil.isNotEmpty(numArr)) { + String error = ""; + + for (int k = 0; k < numArr.size(); k++) { + JSONObject json = numArr.getJSONObject(k); + error += json.getString("struct_code") + ","; + } + + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务"); + } + + // 重新按照排序查询 + disRowArrNew = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "2") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .addParam("block_num", jsonRow.getString("block_num")) + .addParam("row_num", jsonRow.getString("row_num")) + .process().getResultJSONArray(0); + + option = "2"; + } + + /* + * 循环生成任务 + */ + boolean canOut = false; + int j = 0; + JSONObject jsonObject = disRowArrNew.getJSONObject(j); + + // 创建任务 + JSONObject param = new JSONObject(); + param.put("task_type", "010503"); + param.put("vehicle_code", jsonObject.getString("box_no")); + param.put("task_name", ""); + param.put("point_code1", jsonObject.getString("struct_code")); + param.put("point_code2", point_code); + param.put("material_id", jsonObject.getString("material_id")); + param.put("task_group_id", ""); // 任务组 + param.put("sort_seq", ""); // 任务组顺序号 + + String create_task_id = outTask.createTask(param); + + // 更新分配状态、任务标识、出库点位 + JSONObject jsonTask = wo_Task.query("task_id = '" + create_task_id + "'").uniqueResult(0); + JSONObject jsonUpdateMap = new JSONObject(); + jsonUpdateMap.put("work_status", "01"); + jsonUpdateMap.put("task_id", jsonTask.getLong("task_id")); + jsonUpdateMap.put("point_id", point_id); + wo_dis.update(jsonUpdateMap, "iostorinvdis_id = '" + jsonObject.getString("iostorinvdis_id") + "'"); + + // 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’ + JSONArray disArr = wo_dis.query("struct_id = '" + jsonObject.getString("struct_id") + + "' and iostorinv_id = '" + jsonObject.getString("iostorinv_id") + + "' and iostorinvdis_id <> '" + jsonObject.getString("iostorinvdis_id") + + "' and work_status = '00'").getResultJSONArray(0); + + // 依次更新相同仓位的分配明细状态、任务标识、出库点位 + for (int n = 0; n < disArr.size(); n++) { + JSONObject jsonObject2 = disArr.getJSONObject(n); + jsonObject2.put("work_status", "01"); + jsonObject2.put("task_id", jsonTask.getLong("task_id")); + jsonObject2.put("point_id", point_id); + wo_dis.update(jsonObject2); + } + + // 查询未被锁住的仓位 + JSONArray moveArr = new JSONArray(); + JSONObject map = new JSONObject(); + map.put("block_num", jsonObject.getString("block_num")); + map.put("row_num", jsonObject.getString("row_num")); + map.put("out_order_seq", jsonObject.getString("out_order_seq")); + + if (StrUtil.equals(option, "1")) { + // 左边 + map.put("flag", "7"); + moveArr = WQL.getWO("ST_OUTIVT04").addParamMap(map).process().getResultJSONArray(0); + } else { + // 右边 + map.put("flag", "8"); + moveArr = WQL.getWO("ST_OUTIVT04").addParamMap(map).process().getResultJSONArray(0); + } + + // 创建任务组 + long task_group_id = IdUtil.getSnowflake(1, 1).nextId(); + // 更新出库任务:任务组和顺序号 + jsonTask.put("task_group_id", task_group_id); + jsonTask.put("sort_seq", 0); + wo_Task.update(jsonTask); + + // 判断是否需要生成移库 + if (ObjectUtil.isNotEmpty(moveArr)) { + JSONObject moveParam = new JSONObject(); + moveParam.put("jsonAllBlockPoint", moveArr); + moveParam.put("iostorinvdis_id", jsonObject.getString("iostorinvdis_id")); + moveParam.put("task_group_id", task_group_id); + this.createMove(moveParam); + } + + /* + * 判断下一个出库仓位是否相邻 + */ + int out_order_seq = jsonObject.getIntValue("out_order_seq"); + boolean canAdd = true; + int nextNum = j + 1; + while (canAdd) { + // 判断数组是否到头 + if (nextNum <= disRowArrNew.size() - 1) { + JSONObject jsonNext = disRowArrNew.getJSONObject(nextNum); + int out_order_seq_next = jsonNext.getIntValue("out_order_seq"); + if (Math.abs(out_order_seq_next - out_order_seq) != nextNum) { + // 下发当前任务组 + outTask.immediateNotifyAcs(null); + + // 更新任务组 + task_group_id = IdUtil.getSnowflake(1, 1).nextId(); + canAdd = false; + + } else { + // 查询此任务组最后一个生成的任务 + JSONObject jsonTaskLast = wo_Task.query("task_group_id = '" + task_group_id + "' order by sort_seq ASC").uniqueResult(0); + // 创建任务并添加到任务组 + JSONObject param2 = new JSONObject(); + param2.put("task_type", "010503"); + param2.put("vehicle_code", jsonNext.getString("box_no")); + param2.put("task_name", ""); + param2.put("point_code1", jsonNext.getString("struct_code")); + param2.put("point_code2", point_code); + param2.put("material_id", jsonNext.getString("material_id")); + param2.put("task_group_id", task_group_id); // 任务组 + param2.put("sort_seq", jsonTaskLast.getIntValue("sort_seq") - 1); // 任务组顺序号 + + String create_task_id2 = outTask.createTask(param2); + + // 更新分配状态、任务标识、出库点位 + JSONObject jsonTask2 = wo_Task.query("task_id = '" + create_task_id2 + "'").uniqueResult(0); + JSONObject jsonUpdateMap2 = new JSONObject(); + jsonUpdateMap2.put("work_status", "01"); + jsonUpdateMap2.put("task_id", jsonTask2.getLong("task_id")); + jsonUpdateMap2.put("point_id", point_id); + wo_dis.update(jsonUpdateMap2, "iostorinvdis_id = '" + jsonNext.getString("iostorinvdis_id") + "'"); + + // 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’ + JSONArray disArr2 = wo_dis.query("struct_id = '" + jsonNext.getString("struct_id") + + "' and iostorinv_id = '" + jsonNext.getString("iostorinv_id") + + "' and iostorinvdis_id <> '" + jsonNext.getString("iostorinvdis_id") + + "' and work_status = '00'").getResultJSONArray(0); + + // 依次更新相同仓位的分配明细状态、任务标识、出库点位 + for (int m = 0; m < disArr2.size(); m++) { + JSONObject jsonObject3 = disArr2.getJSONObject(m); + jsonObject3.put("work_status", "01"); + jsonObject3.put("task_id", jsonTask2.getLong("task_id")); + jsonObject3.put("point_id", point_id); + wo_dis.update(jsonObject3); + } + + nextNum++; + } + } else { + canAdd = false; + canOut = true; + } + } + + if (canOut) { + // 下发当前任务组 + outTask.immediateNotifyAcs(null); + disRowArrNew.clear(); + + // 更新任务组 + task_group_id = IdUtil.getSnowflake(1, 1).nextId(); + } else { + // 迭代调用自身 + this.rowDispose(jsonRow); + } + } + + @Transactional(rollbackFor = Exception.class) + public void createMove(JSONObject whereJson) { + //任务表 + WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task"); + + JSONArray jsonAllBlockPoint = whereJson.getJSONArray("jsonAllBlockPoint"); + + for (int i = 0; i < jsonAllBlockPoint.size(); i++) { + JSONObject json = jsonAllBlockPoint.getJSONObject(i); + + JSONObject mapParam = new JSONObject();// 生成移库单传入参数 + JSONArray table = new JSONArray(); // 明细参数 + mapParam.put("bill_status", "10"); + mapParam.put("bill_type", "21"); + mapParam.put("buss_type", "21"); + mapParam.put("biz_date", DateUtil.today()); + mapParam.put("stor_code", "CP01"); + mapParam.put("stor_id", "1582991156504039424"); + mapParam.put("stor_name", "成品仓库"); + mapParam.put("is_task", "1"); + + // 查询移入货位 + JSONObject moveParam = new JSONObject(); + moveParam.put("box_no", json.getString("storagevehicle_code")); + moveParam.put("sect_id", RegionTypeEnum.ZZ01.getId()); + JSONObject jsonMove = rawAssistIStorService.autoDis(moveParam); + // 查询移出货位的库存物料 + JSONObject jsonMoveIvt = WQL.getWO("ST_OUTIVT03") + .addParam("flag", "6") + .addParam("struct_id", json.getString("struct_id")) + .process().uniqueResult(0); + + // 移库单明细 + JSONObject jsonMoveDtl = new JSONObject(); + jsonMoveDtl.put("is_task", "2"); + jsonMoveDtl.put("turnout_sect_id", json.getLongValue("sect_id")); + jsonMoveDtl.put("turnout_sect_code", json.getString("sect_code")); + jsonMoveDtl.put("turnout_sect_name", json.getString("sect_name")); + jsonMoveDtl.put("turnout_struct_id", json.getLongValue("struct_id")); + jsonMoveDtl.put("turnout_struct_code", json.getString("struct_code")); + jsonMoveDtl.put("turnout_struct_name", json.getString("struct_name")); + jsonMoveDtl.put("material_id", jsonMoveIvt.getLongValue("material_id")); + jsonMoveDtl.put("pcsn", jsonMoveIvt.getString("pcsn")); + jsonMoveDtl.put("quality_scode", "01"); + jsonMoveDtl.put("qty_unit_id", jsonMoveIvt.getLongValue("qty_unit_id")); + jsonMoveDtl.put("qty_unit_name", jsonMoveIvt.getString("unit_name")); + jsonMoveDtl.put("qty", jsonMoveIvt.getDoubleValue("canuse_qty")); + jsonMoveDtl.put("storagevehicle_code", json.getString("storagevehicle_code")); + jsonMoveDtl.put("turnin_sect_id", jsonMove.getLongValue("sect_id")); + jsonMoveDtl.put("turnin_sect_code", jsonMove.getString("sect_code")); + jsonMoveDtl.put("turnin_sect_name", jsonMove.getString("sect_name")); + jsonMoveDtl.put("turnin_struct_id", jsonMove.getLongValue("struct_id")); + jsonMoveDtl.put("turnin_struct_code", jsonMove.getString("struct_code")); + jsonMoveDtl.put("turnin_struct_name", jsonMove.getString("struct_name")); + jsonMoveDtl.put("source_billdtl_id", whereJson.getLongValue("iostorinvdis_id")); + + // 生成任务 + JSONObject param2 = new JSONObject(); + param2.put("task_type", "010503"); + param2.put("vehicle_code", json.getString("storagevehicle_code")); + param2.put("point_code1", json.getString("struct_code")); + param2.put("point_code2", jsonMove.getString("struct_code")); + param2.put("task_group_id", whereJson.getLongValue("task_group_id")); // 任务组 + param2.put("sort_seq", jsonAllBlockPoint.size() - i); // 任务组顺序号 + String move_task_id = outTask.createTask(param2); + + // 回显移库明细任务id + jsonMoveDtl.put("task_id", move_task_id); + table.add(jsonMoveDtl); + // 更新任务处理类 + JSONObject jsonTaskMove = wo_Task.query("task_id = '" + move_task_id + "'").uniqueResult(0); + jsonTaskMove.put("task_type", "010505"); + jsonTaskMove.put("handle_class", HandMoveStorAcsTask.class.getName()); + wo_Task.update(jsonTaskMove); + + mapParam.put("tableData", table); + // 调用移库单新增方法 + if (ObjectUtil.isNotEmpty(jsonAllBlockPoint)) { + handMoveStorService.insertDtl2(mapParam); + } + } + } + + /** + * 被挡的个数 + * + * @param arr + * @return + */ + @Transactional(rollbackFor = Exception.class) + public JSONArray isNum(JSONArray arr) { + WQLObject taskTab = WQLObject.getWQLObject("sch_base_task"); // 任务表 + + JSONArray result = new JSONArray(); + + for (int i = 0; i < arr.size(); i++) { + JSONObject json = arr.getJSONObject(i); + String struct_code = json.getString("struct_code"); + + JSONObject jsonTask1 = taskTab.query("point_code1 = '" + struct_code + "' and task_status in ('05','06')").uniqueResult(0); + JSONObject jsonTask2 = taskTab.query("point_code2 = '" + struct_code + "' and task_status in ('05','06')").uniqueResult(0); + + if (ObjectUtil.isNotEmpty(jsonTask1) || ObjectUtil.isNotEmpty(jsonTask2)) { + + } else { + result.add(json); + } + } + + return result; + } + @Transactional(rollbackFor = Exception.class) public boolean is_trueOrFalse(JSONObject json) { /* @@ -2482,7 +3026,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { if (ObjectUtil.isNotEmpty(jsondis)) { // 存在:判断是否生成任务 - if (!StrUtil.equals(jsondis.getString("work_status"),"00")) { + if (!StrUtil.equals(jsondis.getString("work_status"), "00")) { param = false; } else { throw new BadRequestException("此仓位不可生成任务,请按照顺序选择!"); @@ -2499,14 +3043,14 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { if (ObjectUtil.isEmpty(jsonTask1) && ObjectUtil.isEmpty(jsonTask2)) { // 未生成任务 - throw new BadRequestException("挡住仓位"+struct_code+"已锁定但未生成任务,请按照顺序选择"); + throw new BadRequestException("挡住仓位" + struct_code + "已锁定但未生成任务,请按照顺序选择"); } else { // 已生成 param = false; } } } - } else if (StrUtil.equals(json.getString("option"), "2")){ + } else if (StrUtil.equals(json.getString("option"), "2")) { // 双通 // 判断此货位在此出库单中是否存在 JSONObject jsondis = disTab.query("iostorinv_id = '" + iostorinv_id + "' and struct_code = '" + struct_code + "'").uniqueResult(0); @@ -2538,7 +3082,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { if (ObjectUtil.isNotEmpty(jsondis)) { // 存在:判断是否生成任务 - if (!StrUtil.equals(jsondis.getString("work_status"),"00")) { + if (!StrUtil.equals(jsondis.getString("work_status"), "00")) { param = true; } else { param = false; @@ -2673,11 +3217,11 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { JSONObject ivt = rows.getJSONObject(j); double canuse_qty = ivt.getDoubleValue("ivt_qty"); - assign_qty = NumberUtil.add(assign_qty,canuse_qty); + assign_qty = NumberUtil.add(assign_qty, canuse_qty); if (unassign_qty >= canuse_qty) { // unassign_qty = unassign_qty - canuse_qty; - unassign_qty = NumberUtil.sub(unassign_qty,canuse_qty); + unassign_qty = NumberUtil.sub(unassign_qty, canuse_qty); ivt.put("change_qty", canuse_qty + ""); } else { ivt.put("change_qty", canuse_qty + ""); @@ -2915,12 +3459,12 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { storPublicService.updateStructAndPoint(from_start); //查询对应明细 - JSONObject dtl_jo = WQLObject.getWQLObject("st_ivt_iostorinvdtl").query("iostorinvdtl_id = '"+dis.getString("iostorinvdtl_id")+"'").uniqueResult(0); + JSONObject dtl_jo = WQLObject.getWQLObject("st_ivt_iostorinvdtl").query("iostorinvdtl_id = '" + dis.getString("iostorinvdtl_id") + "'").uniqueResult(0); // 更新子卷包装关系表 状态 - 3 JSONObject jsonSub = subTab.query("container_name = '" + dis.getString("pcsn") + "' and status = '2'").uniqueResult(0); if (ObjectUtil.isEmpty(jsonSub)) throw new BadRequestException("此子卷不存在或不为入库状态:" + dis.getString("pcsn")); // 如果是拆分入库则将包装关系改为生成状态 - if (jo_mst.getString("bill_type").equals("1005") || (jo_mst.getString("bill_type").equals("1009") && StrUtil.isEmpty(dtl_jo.getString("source_bill_code")))){ + if (jo_mst.getString("bill_type").equals("1005") || (jo_mst.getString("bill_type").equals("1009") && StrUtil.isEmpty(dtl_jo.getString("source_bill_code")))) { jsonSub.put("status", "0"); } else { jsonSub.put("status", "3"); @@ -2933,8 +3477,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { wo_dis.update(jsonDis); } - JSONObject out_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '"+iostorinv_id+"'").uniqueResult(0); - if (out_jo.getString("bill_type").equals("1004")){ + JSONObject out_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0); + if (out_jo.getString("bill_type").equals("1004")) { //调拨出库自动生成调拨入库单 WQLObject dtl_wql = WQLObject.getWQLObject("st_ivt_iostorinvdtl"); WQLObject mst_wql = WQLObject.getWQLObject("ST_IVT_IOStorInv"); @@ -2957,13 +3501,13 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { jo_mst.put("bill_type", "0004"); jo_mst.put("buss_type", ((String) jo_mst.get("bill_type")).substring(0, 4)); //查询移入仓库的信息 - JSONObject in_stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("stor_id = '"+out_jo.getString("out_stor_id")+"'").uniqueResult(0); - if (ObjectUtil.isEmpty(in_stor)){ + JSONObject in_stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("stor_id = '" + out_jo.getString("out_stor_id") + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(in_stor)) { throw new BadRequestException("未查询到对应的移入仓库信息!"); } - jo_mst.put("stor_id",in_stor.getString("stor_id")); - jo_mst.put("stor_code",in_stor.getString("stor_code")); - jo_mst.put("stor_name",in_stor.getString("stor_name")); + jo_mst.put("stor_id", in_stor.getString("stor_id")); + jo_mst.put("stor_code", in_stor.getString("stor_code")); + jo_mst.put("stor_name", in_stor.getString("stor_name")); jo_mst.put("bill_status", "30"); jo_mst.put("input_optid", currentUserId + ""); jo_mst.put("input_optname", nickName); @@ -3014,13 +3558,13 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } } - if (out_jo.getString("bill_type").equals("1003")){ + if (out_jo.getString("bill_type").equals("1003")) { //更新改切子卷为该子卷的分切计划 - JSONObject source_dtl = WQLObject.getWQLObject("st_ivt_iostorinvdtl").query("iostorinv_id = '"+iostorinv_id+"' AND IFNULL(source_billdtl_id,'') <> ''").uniqueResult(0); + JSONObject source_dtl = WQLObject.getWQLObject("st_ivt_iostorinvdtl").query("iostorinv_id = '" + iostorinv_id + "' AND IFNULL(source_billdtl_id,'') <> ''").uniqueResult(0); - HashMap map = new HashMap<>(); - map.put("is_parent_ok","1"); - WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(map,"restruct_container_name = '"+source_dtl.getString("pcsn")+"'"); + HashMap map = new HashMap<>(); + map.put("is_parent_ok", "1"); + WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(map, "restruct_container_name = '" + source_dtl.getString("pcsn") + "'"); } @@ -3292,10 +3836,10 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { // System.out.println(acsTaskDtos.toString()); // 更新任务状态为下发 - jsonTask.put("task_status",TaskStatusEnum.ISSUE.getCode()); - jsonTask.put("update_optid",currentUserId); - jsonTask.put("update_optname",nickName); - jsonTask.put("update_time",now); + jsonTask.put("task_status", TaskStatusEnum.ISSUE.getCode()); + jsonTask.put("update_optid", currentUserId); + jsonTask.put("update_optname", nickName); + jsonTask.put("update_time", now); wo_Task.update(jsonTask); } @@ -3328,7 +3872,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { String sort_seq_last = NumberUtil.add(task.getString("sort_seq"), "1").toString(); JSONObject jsonTaskLast = wo_Task.query("task_group_id = '" + task_group_id + "' and sort_seq = '" + sort_seq_last + "' and task_status <> '07'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(jsonTaskLast)) throw new BadRequestException("请先完成"+jsonTaskLast.getString("task_code")+"的任务!"); + if (ObjectUtil.isNotEmpty(jsonTaskLast)) + throw new BadRequestException("请先完成" + jsonTaskLast.getString("task_code") + "的任务!"); } JSONObject dtljo = wo_dis.query("task_id='" + task_id + "'").uniqueResult(0); @@ -3573,19 +4118,19 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { JSONObject jsonDtl = dtlTab.query("iostorinv_id = '" + jsonMst.getString("iostorinv_id") + "'").uniqueResult(0); if (ObjectUtil.isNotEmpty(jsonDtl)) { // 送货单号 - oneMap.put("vbeln",jsonDtl.getString("vbeln")); + oneMap.put("vbeln", jsonDtl.getString("vbeln")); // 订单号 String source_bill_code = jsonDtl.getString("source_bill_code"); if (ObjectUtil.isNotEmpty(source_bill_code)) { try { - oneMap.put("order_no",source_bill_code.substring(0,source_bill_code.indexOf("-"))); + oneMap.put("order_no", source_bill_code.substring(0, source_bill_code.indexOf("-"))); } catch (Exception e) { - oneMap.put("order_no",source_bill_code); + oneMap.put("order_no", source_bill_code); } } } String pageNow = String.valueOf(j + 1); // 页码 - oneMap.put("page",pageNow+ "/" + MapUtil.getStr(whereJson,"pageNum")); + oneMap.put("page", pageNow + "/" + MapUtil.getStr(whereJson, "pageNum")); oneMap.put("consignee", jsonMst.getString("consignee")); // 收货单位 oneMap.put("receiver", jsonMst.getString("receiver")); // 收货人 String receiptaddress = jsonMst.getString("receiptaddress"); @@ -3611,9 +4156,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { double all_box_qty = 0; for (int t = 0; t < jsonAllBox.size(); t++) { JSONObject json = jsonAllBox.getJSONObject(t); - all_box_qty = NumberUtil.add(all_box_qty,json.getDoubleValue("box_qty")); + all_box_qty = NumberUtil.add(all_box_qty, json.getDoubleValue("box_qty")); } - oneMap.put("all_box_qty", NumberUtil.round(all_box_qty,2).toString()); + oneMap.put("all_box_qty", NumberUtil.round(all_box_qty, 2).toString()); oneMap.put("deliveryaddress", jsonMst.getString("deliveryaddress")); // 送货方地址 oneMap.put("deliveryname", jsonMst.getString("deliveryname")); // 送货方联系人 oneMap.put("deliveryphone", jsonMst.getString("deliveryphone")); // 送货方联系电话 @@ -3636,13 +4181,13 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { order_no = jsonSub.getString("sale_order_name"); // 规格: 厚度*幅宽 - String material_spec = jsonSub.getString("thickness_request") + "*" + jsonSub.getString("width"); + String material_spec = jsonSub.getString("thickness_request") + "*" + jsonSub.getString("width"); // 箱号 String box_no = json.getString("box_no"); String sub_box_no = ""; if (ObjectUtil.isNotEmpty(box_no)) { try { - sub_box_no = box_no.substring(box_no.lastIndexOf("@")+1, box_no.length()); + sub_box_no = box_no.substring(box_no.lastIndexOf("@") + 1, box_no.length()); } catch (Exception e) { sub_box_no = box_no; } @@ -3664,7 +4209,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { /* if (ObjectUtil.isNotEmpty(order_no)) { oneMap.put("order_no",order_no.substring(0,order_no.indexOf("-"))); }*/ - oneMap.put("all_qty",all_qty); // 合计 + oneMap.put("all_qty", all_qty); // 合计 workBook.fill(oneMap, sheet); workBook.fill(new FillWrapper("data", flData), sheet); workBook.finish(); @@ -3687,13 +4232,13 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { order_no = jsonSub.getString("sale_order_name"); // 规格: 厚度*幅宽 - String material_spec = jsonSub.getString("thickness_request") + "*" + jsonSub.getString("width"); + String material_spec = jsonSub.getString("thickness_request") + "*" + jsonSub.getString("width"); // 箱号 String box_no = json.getString("box_no"); String sub_box_no = ""; if (ObjectUtil.isNotEmpty(box_no)) { try { - sub_box_no = box_no.substring(box_no.lastIndexOf("@")+1, box_no.length()); + sub_box_no = box_no.substring(box_no.lastIndexOf("@") + 1, box_no.length()); } catch (Exception e) { sub_box_no = box_no; } @@ -3718,7 +4263,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { /* if (ObjectUtil.isNotEmpty(order_no)) { oneMap.put("order_no",order_no.substring(0,order_no.indexOf("-"))); }*/ - oneMap.put("all_qty",all_qty); // 合计 + oneMap.put("all_qty", all_qty); // 合计 WriteSheet sheet = EasyExcel.writerSheet(0).build(); workBook.fill(oneMap, sheet); workBook.fill(new FillWrapper("data", flData), sheet); @@ -3734,7 +4279,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { json.put("num", dtlArr.size()); return json; } - + @Override public JSONArray queryBox(JSONObject whereJson) { diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql new file mode 100644 index 000000000..db65cd530 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql @@ -0,0 +1,264 @@ +[交易说明] + 交易名: 一键生成任务逻辑 + 所属模块: + 功能简述: + 版权所有: + 表引用: + 版本经历: + +[数据库] + --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 + +[IO定义] + ################################################# + ## 表字段对应输入参数 + ################################################# + 输入.flag TYPEAS s_string + 输入.iostorinvdtl_id TYPEAS s_string + 输入.block_num TYPEAS s_string + 输入.row_num TYPEAS s_string + 输入.out_order_seq TYPEAS s_string + +[临时表] + --这边列出来的临时表就会在运行期动态创建 + +[临时变量] + --所有中间过程变量均可在此处定义 + +[业务过程] + + ########################################## + # 1、输入输出检查 # + ########################################## + + + ########################################## + # 2、主过程前处理 # + ########################################## + + + ########################################## + # 3、业务主过程 # + ########################################## + + IF 输入.flag = "1" + QUERY + SELECT + attr.block_num, + attr.row_num, + MAX(attr.placement_type) AS placement_type + FROM + ST_IVT_IOStorInvDis dis + LEFT JOIN st_ivt_structattr attr ON dis.struct_id = attr.struct_id + WHERE + dis.work_status = '00' + + OPTION 输入.iostorinvdtl_id <> "" + dis.iostorinvdtl_id = 输入.iostorinvdtl_id + ENDOPTION + + group by attr.block_num,attr.row_num + + order by attr.row_num ASC + + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "2" + QUERY + SELECT + max(dis.iostorinvdis_id) AS iostorinvdis_id, + max(dis.iostorinv_id) AS iostorinv_id, + max(dis.iostorinvdtl_id) AS iostorinvdtl_id, + max(dis.seq_no) AS seq_no, + max(dis.sect_id) AS sect_id, + max(dis.sect_code) AS sect_code, + max(dis.sect_name) AS sect_name, + max(dis.struct_id) AS struct_id, + max(dis.struct_code) AS struct_code, + max(dis.struct_name) AS struct_name, + max(dis.struct_name) AS struct_name, + max(dis.material_id) AS material_id, + max(dis.pcsn) AS pcsn, + max(dis.box_no) AS box_no, + max(dis.task_id) AS task_id, + max(dis.storagevehicle_code) AS storagevehicle_code, + max(dis.point_id) AS point_id, + max(attr.out_order_seq) AS out_order_seq, + max(attr.block_num) AS block_num, + max(attr.row_num) AS row_num + FROM + ST_IVT_IOStorInvDis dis + LEFT JOIN st_ivt_structattr attr ON dis.struct_id = attr.struct_id + WHERE + dis.work_status = '00' + + OPTION 输入.iostorinvdtl_id <> "" + dis.iostorinvdtl_id = 输入.iostorinvdtl_id + ENDOPTION + + OPTION 输入.block_num <> "" + attr.block_num = 输入.block_num + ENDOPTION + + OPTION 输入.row_num <> "" + attr.row_num = 输入.row_num + ENDOPTION + + group by attr.struct_id + + order by attr.out_order_seq ASC + + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "22" + QUERY + SELECT + max(dis.iostorinvdis_id) AS iostorinvdis_id, + max(dis.iostorinv_id) AS iostorinv_id, + max(dis.iostorinvdtl_id) AS iostorinvdtl_id, + max(dis.seq_no) AS seq_no, + max(dis.sect_id) AS sect_id, + max(dis.sect_code) AS sect_code, + max(dis.sect_name) AS sect_name, + max(dis.struct_id) AS struct_id, + max(dis.struct_code) AS struct_code, + max(dis.struct_name) AS struct_name, + max(dis.struct_name) AS struct_name, + max(dis.material_id) AS material_id, + max(dis.pcsn) AS pcsn, + max(dis.box_no) AS box_no, + max(dis.task_id) AS task_id, + max(dis.storagevehicle_code) AS storagevehicle_code, + max(dis.point_id) AS point_id, + max(attr.out_order_seq) AS out_order_seq, + max(attr.block_num) AS block_num, + max(attr.row_num) AS row_num + FROM + ST_IVT_IOStorInvDis dis + LEFT JOIN st_ivt_structattr attr ON dis.struct_id = attr.struct_id + WHERE + dis.work_status = '00' + + OPTION 输入.iostorinvdtl_id <> "" + dis.iostorinvdtl_id = 输入.iostorinvdtl_id + ENDOPTION + + OPTION 输入.block_num <> "" + attr.block_num = 输入.block_num + ENDOPTION + + OPTION 输入.row_num <> "" + attr.row_num = 输入.row_num + ENDOPTION + + group by attr.struct_id + + order by attr.out_order_seq ASC + + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "3" + QUERY + SELECT + attr.* + FROM + st_ivt_structattr attr + WHERE + attr.block_num = 输入.block_num + AND attr.row_num = 输入.row_num + AND attr.out_order_seq < 输入.out_order_seq + AND IFNULL( attr.storagevehicle_code, '' ) <> '' + + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "4" + QUERY + SELECT + attr.* + FROM + st_ivt_structattr attr + WHERE + attr.block_num = 输入.block_num + AND attr.row_num = 输入.row_num + AND attr.out_order_seq > 输入.out_order_seq + AND IFNULL( attr.storagevehicle_code, '' ) <> '' + + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "5" + QUERY + SELECT + attr.* + FROM + st_ivt_structattr attr + WHERE + attr.lock_type in ('2','3','6','7') + AND attr.block_num = 输入.block_num + AND attr.row_num = 输入.row_num + AND attr.out_order_seq > 输入.out_order_seq + AND IFNULL( attr.storagevehicle_code, '' ) <> '' + + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "6" + QUERY + SELECT + attr.* + FROM + st_ivt_structattr attr + WHERE + attr.lock_type in ('2','3','6','7') + AND attr.block_num = 输入.block_num + AND attr.row_num = 输入.row_num + AND attr.out_order_seq < 输入.out_order_seq + AND IFNULL( attr.storagevehicle_code, '' ) <> '' + + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "7" + QUERY + SELECT + attr.* + FROM + st_ivt_structattr attr + WHERE + attr.lock_type = '1' + AND attr.block_num = 输入.block_num + AND attr.row_num = 输入.row_num + AND attr.out_order_seq > 输入.out_order_seq + AND IFNULL( attr.storagevehicle_code, '' ) <> '' + + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "8" + QUERY + SELECT + attr.* + FROM + st_ivt_structattr attr + WHERE + attr.lock_type = '1' + AND attr.block_num = 输入.block_num + AND attr.row_num = 输入.row_num + AND attr.out_order_seq < 输入.out_order_seq + AND IFNULL( attr.storagevehicle_code, '' ) <> '' + + ENDSELECT + ENDQUERY + ENDIF diff --git a/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue b/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue index 5e91c9572..902f0e321 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue +++ b/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue @@ -185,6 +185,17 @@ > 设置站点 + + 一键设置 + @@ -279,6 +290,7 @@ export default { button2: true, button3: true, button4: true, + button5: true, tableDtl: [], openParam: [], mstrow: {}, @@ -423,21 +435,25 @@ export default { if (current.bill_status === '10') { this.button1 = false this.button2 = true + this.button5 = false this.button3 = false } else if (current.bill_status === '30') { this.button1 = false this.button2 = false this.button3 = false + this.button5 = false } else if (current.bill_status === '40') { this.button1 = true this.button2 = false this.button3 = true + this.button5 = false } this.queryTableDdis(current.iostorinvdtl_id) } else { this.button1 = true this.button2 = true this.button3 = true + this.button5 = true this.mstrow.iostorinvdtl_id = '' this.currentRow = {} this.tabledis = [] @@ -534,6 +550,23 @@ export default { }) } }, + allSetPoint() { + debugger + if (this.form2.point_code === '') { + this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO) + return + } + if (this.currentRow === '') { + this.crud.notify('请选择明细!', CRUD.NOTIFICATION_TYPE.INFO) + return + } + this.currentRow.point_code = this.form2.point_code + checkoutbill.allSetPoint(this.currentRow).then(res => { + this.queryTableDdis(this.currentRow.iostorinvdtl_id) + this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.INFO) + }).catch(() => { + }) + }, queryTableDtl() { checkoutbill.getOutBillDtl({ 'iostorinv_id': this.mstrow.iostorinv_id }).then(res => { this.tableDtl = res diff --git a/lms/nladmin-ui/src/views/wms/st/outbill/checkoutbill.js b/lms/nladmin-ui/src/views/wms/st/outbill/checkoutbill.js index 40d3e5c31..3cd77f155 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/checkoutbill.js +++ b/lms/nladmin-ui/src/views/wms/st/outbill/checkoutbill.js @@ -211,4 +211,11 @@ export function cancelTask(data) { data }) } -export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask } +export function allSetPoint(data) { + return request({ + url: '/api/checkoutbill/allSetPoint', + method: 'post', + data + }) +} +export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint } From 9e7fa14ef5fbc0136e88c8744b0cc4b24f9dc8bc Mon Sep 17 00:00:00 2001 From: liuxy Date: Sun, 8 Jan 2023 17:24:47 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../st/outbill/service/impl/CheckOutBillServiceImpl.java | 6 +++--- .../src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java index 93251c61c..516b89f80 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java @@ -2578,7 +2578,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { error += json.getString("struct_code") + ","; } - throw new BadRequestException("仓位:" + error + "被锁定且未下发任务"); + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); } // 重新按照排序查询 disRowArrNew = WQL.getWO("ST_OUTIVT04") @@ -2611,7 +2611,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { error += json.getString("struct_code") + ","; } - throw new BadRequestException("仓位:" + error + "被锁定且未下发任务"); + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); } // 重新按照排序查询 @@ -2644,7 +2644,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { error += json.getString("struct_code") + ","; } - throw new BadRequestException("仓位:" + error + "被锁定且未下发任务"); + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); } // 重新按照排序查询 diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql index db65cd530..d8000fb4c 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql @@ -157,7 +157,7 @@ group by attr.struct_id - order by attr.out_order_seq ASC + order by attr.out_order_seq DESC ENDSELECT ENDQUERY From 56de42b2cd5e153804c2327a2296322b160cf533 Mon Sep 17 00:00:00 2001 From: liuxy Date: Sun, 8 Jan 2023 18:15:52 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inbill/service/CheckOutBillService.java | 5 + .../outbill/rest/CheckOutBillController.java | 7 + .../service/impl/CheckOutBillServiceImpl.java | 397 ++++++++++++++++++ .../st/outbill/wql/QST_IVT_CHECKOUTBILL.wql | 3 +- .../org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql | 9 + .../src/views/wms/st/outbill/DivDialog.vue | 25 +- .../src/views/wms/st/outbill/checkoutbill.js | 9 +- 7 files changed, 452 insertions(+), 3 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java index 80d5fe4c6..3e8aef949 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java @@ -121,6 +121,11 @@ public interface CheckOutBillService { * @param whereJson / */ void oneSetPoint(JSONObject whereJson); + /** + * 设置一个站点 + * @param whereJson / + */ + void oneSetPoint2(JSONObject whereJson); /** * 设置全部站点 * @param whereJson / diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java index 7c458dc89..414f61364 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java @@ -138,6 +138,13 @@ public class CheckOutBillController { checkOutBillService.oneSetPoint(whereJson); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } + @PostMapping("/oneSetPoint2") + @Log("设置一个站点") + @ApiOperation("设置检验站点") + public ResponseEntity oneSetPoint2(@RequestBody JSONObject whereJson) { + checkOutBillService.oneSetPoint2(whereJson); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } @PostMapping("/allSetPoint") @Log("设置全部站点") @ApiOperation("设置全部站点") diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java index 516b89f80..1c9880db9 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java @@ -1488,6 +1488,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { JSONObject dis = WQL.getWO("QST_IVT_CHECKOUTBILL") .addParam("flag", "5") .addParam("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id")) + .addParam("iostorinvdis_id", whereJson.getString("iostorinvdis_id")) .addParam("struct_id", struct_id) .addParam("iostorinv_id", iostorinv_id) .addParam("bill_status", "01") @@ -2882,6 +2883,402 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } } + @Override + @Transactional(rollbackFor = Exception.class) + public void oneSetPoint2(JSONObject whereJson) { + //出库分配表 + WQLObject wo_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis"); + //点位表 + WQLObject wo_Point = WQLObject.getWQLObject("SCH_BASE_Point"); + //任务表 + WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task"); + //出库主表 + WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_IOStorInv"); + //仓位表 + WQLObject attrTab = WQLObject.getWQLObject("ST_IVT_StructAttr"); + + String struct_id = whereJson.getString("struct_id"); + String point_code = whereJson.getString("point_code"); // 终点 + String iostorinv_id = whereJson.getString("iostorinv_id"); + String iostorinvdtl_id = whereJson.getString("iostorinvdtl_id"); + String iostorinvdis_id = whereJson.getString("iostorinvdis_id"); + + //查询主表信息 + JSONObject jo_mst = wo_mst.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(jo_mst)) { + throw new BadRequestException("未查到相关出库单"); + } + + JSONObject jsonPoint2 = wo_Point.query("lock_type='1' and (vehicle_code='' or vehicle_code IS NULL) and point_code='" + point_code + "'").uniqueResult(0); + //如果终点站点被锁定或者有载具号,则不允许设置点位 + if (ObjectUtil.isEmpty(jsonPoint2)) { + throw new BadRequestException("该站点被锁定或者有载具号,不允许设置!"); + } + + // 查询未生成和生成未下发的分配记录 + JSONArray disArrOne = WQL.getWO("QST_IVT_CHECKOUTBILL") + .addParam("flag", "5") + .addParam("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id")) + .addParam("iostorinvdis_id", whereJson.getString("iostorinvdis_id")) + .addParam("struct_id", struct_id) + .addParam("iostorinv_id", iostorinv_id) + .addParam("bill_status", "01") + .addParam("is_issued", "0") + .process() + .getResultJSONArray(0); + if (ObjectUtil.isEmpty(disArrOne)) { + throw new BadRequestException("分配明细不存在或已执行、完成、!"); + } + + // 取第一个 + JSONObject jsonNoe = disArrOne.getJSONObject(0); + + JSONArray disRowArrNew = new JSONArray(); + String option = ""; // 1.左 2.右 + String placement_type = whereJson.getString("placement_type"); // 单通或双通 + // 双通 + if (StrUtil.equals(placement_type, "01")) { + + /* + * 判断左边被挡住的个数多还是右边被挡住的个数多 + */ + // 判断右边边被挡住的个数 + JSONObject isNumMap = new JSONObject(); + isNumMap.put("flag", "3"); + isNumMap.put("block_num", jsonNoe.getString("block_num")); + isNumMap.put("row_num", jsonNoe.getString("row_num")); + isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); + JSONArray numArrFirst = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + // 调用共用方法计算被挡个数 + JSONArray rightNumArr = this.isNum(numArrFirst); + + // 判断左边被挡住的个数 + isNumMap.put("flag", "4"); + isNumMap.put("block_num", jsonNoe.getString("block_num")); + isNumMap.put("row_num", jsonNoe.getString("row_num")); + isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); + JSONArray numArrLast = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + // 调用共用方法计算被挡个数 + JSONArray leftNumArr = this.isNum(numArrLast); + // 判断哪边少 + if (rightNumArr.size() > leftNumArr.size()) { + /* + * 左边开始 + */ + // 查询仓位被锁住的货位 + isNumMap.put("flag", "5"); + isNumMap.put("block_num", jsonNoe.getString("block_num")); + isNumMap.put("row_num", jsonNoe.getString("row_num")); + isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); + JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + JSONArray numArr = this.isNum(isLockArr); + // 不为空则返回报错 + if (ObjectUtil.isNotEmpty(numArr)) { + String error = ""; + + for (int k = 0; k < numArr.size(); k++) { + JSONObject json = numArr.getJSONObject(k); + error += json.getString("struct_code") + ","; + } + + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); + } + // 重新按照排序查询 + disRowArrNew = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "22") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .addParam("iostorinvdis_id", iostorinvdis_id) + .process().getResultJSONArray(0); + + option = "1"; + + } else if (rightNumArr.size() < leftNumArr.size()) { + /* + * 右边开始 + */ + // 查询仓位被锁住的货位 + isNumMap.put("flag", "6"); + isNumMap.put("block_num", jsonNoe.getString("block_num")); + isNumMap.put("row_num", jsonNoe.getString("row_num")); + isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); + JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + JSONArray numArr = this.isNum(isLockArr); + // 不为空则返回报错 + if (ObjectUtil.isNotEmpty(numArr)) { + String error = ""; + + for (int k = 0; k < numArr.size(); k++) { + JSONObject json = numArr.getJSONObject(k); + error += json.getString("struct_code") + ","; + } + + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); + } + + // 重新按照排序查询 + disRowArrNew = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "2") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .addParam("iostorinvdis_id", iostorinvdis_id) + .process().getResultJSONArray(0); + + option = "2"; + } else { + /* + * 相等默认右边开始 + */ + // 查询仓位被锁住的货位 + isNumMap.put("flag", "6"); + isNumMap.put("block_num", jsonNoe.getString("block_num")); + isNumMap.put("row_num", jsonNoe.getString("row_num")); + isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); + JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + JSONArray numArr = this.isNum(isLockArr); + // 不为空则返回报错 + if (ObjectUtil.isNotEmpty(numArr)) { + String error = ""; + + for (int k = 0; k < numArr.size(); k++) { + JSONObject json = numArr.getJSONObject(k); + error += json.getString("struct_code") + ","; + } + + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!"); + } + + // 重新按照排序查询 + disRowArrNew = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "2") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .addParam("iostorinvdis_id", iostorinvdis_id) + .process().getResultJSONArray(0); + + option = "2"; + } + + } else if (StrUtil.equals(placement_type, "02")) { + // 左通 + + JSONObject isNumMap = new JSONObject(); + // 查询仓位被锁住的货位 + isNumMap.put("flag", "5"); + isNumMap.put("block_num", jsonNoe.getString("block_num")); + isNumMap.put("row_num", jsonNoe.getString("row_num")); + isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); + JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + JSONArray numArr = this.isNum(isLockArr); + // 不为空则返回报错 + if (ObjectUtil.isNotEmpty(numArr)) { + String error = ""; + + for (int k = 0; k < numArr.size(); k++) { + JSONObject json = numArr.getJSONObject(k); + error += json.getString("struct_code") + ","; + } + + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务"); + } + // 重新按照排序查询 + disRowArrNew = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "22") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .addParam("iostorinvdis_id", iostorinvdis_id) + .process().getResultJSONArray(0); + + option = "1"; + + } else if (StrUtil.equals(placement_type, "03")) { + // 右通 + JSONObject isNumMap = new JSONObject(); + // 查询仓位被锁住的货位 + isNumMap.put("flag", "6"); + isNumMap.put("block_num", jsonNoe.getString("block_num")); + isNumMap.put("row_num", jsonNoe.getString("row_num")); + isNumMap.put("out_order_seq", jsonNoe.getString("out_order_seq")); + JSONArray isLockArr = WQL.getWO("ST_OUTIVT04").addParamMap(isNumMap).process().getResultJSONArray(0); + + JSONArray numArr = this.isNum(isLockArr); + // 不为空则返回报错 + if (ObjectUtil.isNotEmpty(numArr)) { + String error = ""; + + for (int k = 0; k < numArr.size(); k++) { + JSONObject json = numArr.getJSONObject(k); + error += json.getString("struct_code") + ","; + } + + throw new BadRequestException("仓位:" + error + "被锁定且未下发任务"); + } + + // 重新按照排序查询 + disRowArrNew = WQL.getWO("ST_OUTIVT04") + .addParam("flag", "2") + .addParam("iostorinvdtl_id", iostorinvdtl_id) + .addParam("iostorinvdis_id", iostorinvdis_id) + .process().getResultJSONArray(0); + + option = "2"; + } + + /* + * 循环生成任务 + */ + boolean canOut = false; + int j = 0; + JSONObject jsonObject = disRowArrNew.getJSONObject(j); + + // 创建任务 + JSONObject param = new JSONObject(); + param.put("task_type", "010503"); + param.put("vehicle_code", jsonObject.getString("box_no")); + param.put("task_name", ""); + param.put("point_code1", jsonObject.getString("struct_code")); + param.put("point_code2", point_code); + param.put("material_id", jsonObject.getString("material_id")); + param.put("task_group_id", ""); // 任务组 + param.put("sort_seq", ""); // 任务组顺序号 + + String create_task_id = outTask.createTask(param); + + // 更新分配状态、任务标识、出库点位 + JSONObject jsonTask = wo_Task.query("task_id = '" + create_task_id + "'").uniqueResult(0); + JSONObject jsonUpdateMap = new JSONObject(); + jsonUpdateMap.put("work_status", "01"); + jsonUpdateMap.put("task_id", jsonTask.getLong("task_id")); + jsonUpdateMap.put("point_id", jsonPoint2.getLongValue("point_id")); + wo_dis.update(jsonUpdateMap, "iostorinvdis_id = '" + jsonObject.getString("iostorinvdis_id") + "'"); + + // 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’ + JSONArray disArr = wo_dis.query("struct_id = '" + jsonObject.getString("struct_id") + + "' and iostorinv_id = '" + jsonObject.getString("iostorinv_id") + + "' and iostorinvdis_id <> '" + jsonObject.getString("iostorinvdis_id") + + "' and work_status = '00'").getResultJSONArray(0); + + // 依次更新相同仓位的分配明细状态、任务标识、出库点位 + for (int n = 0; n < disArr.size(); n++) { + JSONObject jsonObject2 = disArr.getJSONObject(n); + jsonObject2.put("work_status", "01"); + jsonObject2.put("task_id", jsonTask.getLong("task_id")); + jsonObject2.put("point_id", jsonPoint2.getLongValue("point_id")); + wo_dis.update(jsonObject2); + } + + // 查询未被锁住的仓位 + JSONArray moveArr = new JSONArray(); + JSONObject map = new JSONObject(); + map.put("block_num", jsonObject.getString("block_num")); + map.put("row_num", jsonObject.getString("row_num")); + map.put("out_order_seq", jsonObject.getString("out_order_seq")); + + if (StrUtil.equals(option, "1")) { + // 左边 + map.put("flag", "7"); + moveArr = WQL.getWO("ST_OUTIVT04").addParamMap(map).process().getResultJSONArray(0); + } else { + // 右边 + map.put("flag", "8"); + moveArr = WQL.getWO("ST_OUTIVT04").addParamMap(map).process().getResultJSONArray(0); + } + + // 创建任务组 + long task_group_id = IdUtil.getSnowflake(1, 1).nextId(); + // 更新出库任务:任务组和顺序号 + jsonTask.put("task_group_id", task_group_id); + jsonTask.put("sort_seq", 0); + wo_Task.update(jsonTask); + + // 判断是否需要生成移库 + if (ObjectUtil.isNotEmpty(moveArr)) { + JSONObject moveParam = new JSONObject(); + moveParam.put("jsonAllBlockPoint", moveArr); + moveParam.put("iostorinvdis_id", jsonObject.getString("iostorinvdis_id")); + moveParam.put("task_group_id", task_group_id); + this.createMove(moveParam); + } + + /* + * 判断下一个出库仓位是否相邻 + */ + int out_order_seq = jsonObject.getIntValue("out_order_seq"); + boolean canAdd = true; + int nextNum = j + 1; + while (canAdd) { + // 判断数组是否到头 + if (nextNum <= disRowArrNew.size() - 1) { + JSONObject jsonNext = disRowArrNew.getJSONObject(nextNum); + int out_order_seq_next = jsonNext.getIntValue("out_order_seq"); + if (Math.abs(out_order_seq_next - out_order_seq) != nextNum) { + // 下发当前任务组 + outTask.immediateNotifyAcs(null); + + // 更新任务组 + task_group_id = IdUtil.getSnowflake(1, 1).nextId(); + canAdd = false; + + } else { + // 查询此任务组最后一个生成的任务 + JSONObject jsonTaskLast = wo_Task.query("task_group_id = '" + task_group_id + "' order by sort_seq ASC").uniqueResult(0); + // 创建任务并添加到任务组 + JSONObject param2 = new JSONObject(); + param2.put("task_type", "010503"); + param2.put("vehicle_code", jsonNext.getString("box_no")); + param2.put("task_name", ""); + param2.put("point_code1", jsonNext.getString("struct_code")); + param2.put("point_code2", point_code); + param2.put("material_id", jsonNext.getString("material_id")); + param2.put("task_group_id", task_group_id); // 任务组 + param2.put("sort_seq", jsonTaskLast.getIntValue("sort_seq") - 1); // 任务组顺序号 + + String create_task_id2 = outTask.createTask(param2); + + // 更新分配状态、任务标识、出库点位 + JSONObject jsonTask2 = wo_Task.query("task_id = '" + create_task_id2 + "'").uniqueResult(0); + JSONObject jsonUpdateMap2 = new JSONObject(); + jsonUpdateMap2.put("work_status", "01"); + jsonUpdateMap2.put("task_id", jsonTask2.getLong("task_id")); + jsonUpdateMap2.put("point_id", jsonPoint2.getLongValue("point_id")); + wo_dis.update(jsonUpdateMap2, "iostorinvdis_id = '" + jsonNext.getString("iostorinvdis_id") + "'"); + + // 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’ + JSONArray disArr2 = wo_dis.query("struct_id = '" + jsonNext.getString("struct_id") + + "' and iostorinv_id = '" + jsonNext.getString("iostorinv_id") + + "' and iostorinvdis_id <> '" + jsonNext.getString("iostorinvdis_id") + + "' and work_status = '00'").getResultJSONArray(0); + + // 依次更新相同仓位的分配明细状态、任务标识、出库点位 + for (int m = 0; m < disArr2.size(); m++) { + JSONObject jsonObject3 = disArr2.getJSONObject(m); + jsonObject3.put("work_status", "01"); + jsonObject3.put("task_id", jsonTask2.getLong("task_id")); + jsonObject3.put("point_id", jsonPoint2.getLongValue("point_id")); + wo_dis.update(jsonObject3); + } + + nextNum++; + } + } else { + canAdd = false; + canOut = true; + } + } + + if (canOut) { + // 下发当前任务组 + outTask.immediateNotifyAcs(null); + disRowArrNew.clear(); + + // 更新任务组 + task_group_id = IdUtil.getSnowflake(1, 1).nextId(); + } else { + } + } + @Transactional(rollbackFor = Exception.class) public void createMove(JSONObject whereJson) { //任务表 diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql index 4869294a4..cd23a2dbb 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql @@ -365,7 +365,8 @@ attr.row_num, attr.col_num, attr.layer_num, - attr.block_num + attr.block_num, + attr.placement_type FROM ST_IVT_IOStorInvDis dis LEFT JOIN ST_IVT_IOStorInv ios ON ios.iostorinv_id = dis.iostorinv_id diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql index d8000fb4c..761b28921 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/ST_OUTIVT04.wql @@ -18,6 +18,7 @@ 输入.block_num TYPEAS s_string 输入.row_num TYPEAS s_string 输入.out_order_seq TYPEAS s_string + 输入.iostorinvdis_id TYPEAS s_string [临时表] --这边列出来的临时表就会在运行期动态创建 @@ -98,6 +99,10 @@ dis.iostorinvdtl_id = 输入.iostorinvdtl_id ENDOPTION + OPTION 输入.iostorinvdis_id <> "" + dis.iostorinvdis_id = 输入.iostorinvdis_id + ENDOPTION + OPTION 输入.block_num <> "" attr.block_num = 输入.block_num ENDOPTION @@ -143,6 +148,10 @@ WHERE dis.work_status = '00' + OPTION 输入.iostorinvdis_id <> "" + dis.iostorinvdis_id = 输入.iostorinvdis_id + ENDOPTION + OPTION 输入.iostorinvdtl_id <> "" dis.iostorinvdtl_id = 输入.iostorinvdtl_id ENDOPTION diff --git a/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue b/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue index 902f0e321..bc86fc2c0 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue +++ b/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue @@ -181,7 +181,7 @@ icon="el-icon-check" size="mini" :disabled="button4" - @click="oneSetPoint" + @click="oneSetPoint2" > 设置站点 @@ -550,6 +550,29 @@ export default { }) } }, + oneSetPoint2() { + if (this.form2.point_code === '') { + this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO) + return + } + if (this.currentDis.point_code) { + this.crud.notify('站点已设置!', CRUD.NOTIFICATION_TYPE.INFO) + return + } + if (this.currentDis.work_status !== '00') { + this.crud.notify('任务已生成!', CRUD.NOTIFICATION_TYPE.INFO) + return + } + if (this.currentDis.iostorinvdis_id !== null) { + this.currentDis.point_code = this.form2.point_code + checkoutbill.oneSetPoint2(this.currentDis).then(res => { + this.queryTableDdis(this.currentDis.iostorinvdtl_id) + this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.INFO) + }).catch(() => { + this.currentDis.point_code = '' + }) + } + }, allSetPoint() { debugger if (this.form2.point_code === '') { diff --git a/lms/nladmin-ui/src/views/wms/st/outbill/checkoutbill.js b/lms/nladmin-ui/src/views/wms/st/outbill/checkoutbill.js index 3cd77f155..5c692ba9c 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/checkoutbill.js +++ b/lms/nladmin-ui/src/views/wms/st/outbill/checkoutbill.js @@ -218,4 +218,11 @@ export function allSetPoint(data) { data }) } -export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint } +export function oneSetPoint2(data) { + return request({ + url: '/api/checkoutbill/oneSetPoint2', + method: 'post', + data + }) +} +export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint, oneSetPoint2 } From 8f0bfc0e9d2ae6668e27717afdef9b0b60d41e3e Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Sun, 8 Jan 2023 21:38:25 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acs/agv/server/impl/AgvServiceImpl.java | 1 - .../agv/ndcone/AgvNdcOneDeviceDriver.java | 37 ++- .../HongXiangConveyorDeviceDriver.java | 3 - .../SiemensConveyorDeviceDriver.java | 234 ++++++++++++++++-- .../data/ApplyLabelingAndBindingResponse.java | 5 + .../ext/wms/liKuData/DeviceStatusData.java | 3 + .../ext/wms/liKuData/DeviceStatusRequest.java | 3 + .../wms/liKuData/putEmptyPalletRequest.java | 14 ++ .../acs/ext/wms/rest/LiKuToACSController.java | 8 + .../acs/ext/wms/service/AcsToWmsService.java | 2 +- .../acs/ext/wms/service/LiKuToAcsService.java | 8 + .../service/impl/AcsToLiKuServiceImpl.java | 4 +- .../wms/service/impl/AcsToWmsServiceImpl.java | 1 + .../service/impl/LiKuToAcsServiceImpl.java | 45 ++++ .../wms/service/impl/WmsToAcsServiceImpl.java | 2 +- .../nl/acs/opc/DeviceOpcProtocolRunable.java | 2 +- .../service/impl/TaskFeedbackServiceImpl.java | 1 - .../quartz/task/QueryLKDeviceStatus.java | 44 ++++ .../quartz/task/QueryZDAgvTaskStatus.java | 164 ------------ .../main/resources/config/application-dev.yml | 11 +- .../resources/config/application-prod.yml | 2 +- .../src/main/resources/config/application.yml | 49 +++- .../src/main/resources/log/AcsToWms.xml | 32 +++ .../src/main/resources/log/AutoCreateInst.xml | 31 +++ .../log/OneNDCSocketConnectionAutoRun.xml | 32 +++ .../src/main/resources/log/ScannerBarcode.xml | 32 +++ .../src/main/resources/log/WmsToAcs.xml | 32 +++ .../src/main/resources/logback-spring.xml | 4 +- acs/nladmin-ui/src/App.vue | 2 +- 29 files changed, 587 insertions(+), 221 deletions(-) create mode 100644 acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/putEmptyPalletRequest.java create mode 100644 acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryLKDeviceStatus.java delete mode 100644 acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryZDAgvTaskStatus.java create mode 100644 acs/nladmin-system/src/main/resources/log/AcsToWms.xml create mode 100644 acs/nladmin-system/src/main/resources/log/AutoCreateInst.xml create mode 100644 acs/nladmin-system/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml create mode 100644 acs/nladmin-system/src/main/resources/log/ScannerBarcode.xml create mode 100644 acs/nladmin-system/src/main/resources/log/WmsToAcs.xml diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java index 6bd14f5b6..ae50b365b 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java @@ -97,7 +97,6 @@ public class AgvServiceImpl implements AgvService { if (address.indexOf("-") > 0) { String str = address.substring(address.indexOf("-"), address.length()); address = address.substring(0, address.indexOf("-")); - System.out.println(address); } } } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java index 28a354971..6e3c42fb7 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java @@ -9,6 +9,7 @@ import org.nl.acs.agv.server.NDCAgvService; import org.nl.acs.auto.run.OneNDCSocketConnectionAutoRun; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_storage.StandardStorageDeviceDriver; import org.nl.acs.device_driver.driver.AbstractDeviceDriver; @@ -107,6 +108,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; //货架 StandardStorageDeviceDriver standardStorageDeviceDriver; + // + SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; //分配 车id //(不需要WCS反馈) @@ -163,6 +166,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic standardOrdinarySiteDeviceDriver.setInst(inst); } + if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { + siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver(); + if(siemensConveyorDeviceDriver.getMove() == 1 && siemensConveyorDeviceDriver.getMode() == 2 ){ + data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); + } + } + if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) { data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); } @@ -215,6 +225,12 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic standardOrdinarySiteDeviceDriver.setInst(inst); } + if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { + siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver(); + data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); + siemensConveyorDeviceDriver.writing(2); + } + if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) { standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver(); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); @@ -261,9 +277,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - standardOrdinarySiteDeviceDriver.setAgvphase(phase); - standardOrdinarySiteDeviceDriver.setIndex(index); - standardOrdinarySiteDeviceDriver.setInst(inst); +// standardOrdinarySiteDeviceDriver.setAgvphase(phase); +// standardOrdinarySiteDeviceDriver.setIndex(index); +// standardOrdinarySiteDeviceDriver.setInst(inst); + data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); } if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) { @@ -311,16 +328,18 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic } if (StrUtil.equals(inst.getNext_device_code(), device_code)) { - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - standardOrdinarySiteDeviceDriver.setAgvphase(phase); - standardOrdinarySiteDeviceDriver.setIndex(index); - standardOrdinarySiteDeviceDriver.setInst(inst); - } if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) { standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver(); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); } + + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); +// standardOrdinarySiteDeviceDriver.setAgvphase(phase); +// standardOrdinarySiteDeviceDriver.setIndex(index); +// standardOrdinarySiteDeviceDriver.setInst(inst); + data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); + } } } logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java index 7d5bc398c..b12d79e5e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hongxiang_device/HongXiangConveyorDeviceDriver.java @@ -133,9 +133,6 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple String message = null; device_code = this.getDeviceCode(); - if (device_code.equals("A1_HK_05_1")){ - System.out.println("1"); - } heartbeat = this.itemProtocol.getItem_heartbeat(); mode = this.itemProtocol.getItem_mode(); move = this.itemProtocol.getItem_move(); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java index 57904d43b..db4ec0a31 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java @@ -12,6 +12,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; import org.nl.acs.AcsConfig; +import org.nl.acs.agv.server.NDCAgvService; import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device_driver.DeviceDriver; @@ -19,6 +20,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest; +import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; @@ -65,6 +67,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class); @Autowired DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); + @Autowired + NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class); //当前指令 Instruction inst = null; @@ -83,8 +87,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme //任务号 int task = 0; int last_task = 0; + int agvphase = 0; - + int phase = 0; + int index = 0; Boolean isonline = true; int hasGoods = 0; String message = null; @@ -137,16 +143,20 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme if (mode == 2) { logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireSucess:" + requireSucess); requireSucess = false; + requireApplyLabelingSuccess = false; + requireApplyLaStrangulationSuccess =false; + requireEmptyInSuccess =false; + requireEmptyOutSuccess =false; logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireSucess:" + requireSucess); } if (mode == 4) { logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireApplyLabelingSuccess:" + requireApplyLabelingSuccess); - requireApplyLabelingSuccess = false; + requireApplyLaStrangulationSuccess = false; logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireApplyLabelingSuccess:" + requireApplyLabelingSuccess); } if (mode == 5) { logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireApplyLaStrangulationSuccess:" + requireApplyLaStrangulationSuccess); - requireApplyLaStrangulationSuccess = false; + requireApplyLabelingSuccess = false; logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireApplyLaStrangulationSuccess:" + requireApplyLaStrangulationSuccess); } if (mode == 6) { @@ -198,22 +208,86 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme } SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { - siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver(); - int nextTask = siemensConveyorDeviceDriver.getTask(); - if (nextTask == task) { - inst_message = "指令号:" + instruction.getInstruction_code() + " " + instruction.getStart_point_code() + "->" + instruction.getNext_point_code() + " 载具号:" + instruction.getVehicle_code(); - if (StrUtil.equals(instruction.getInstruction_status(), "1")) { - inst = instruction; - finish_instruction(); - this.clearWrite(); + if(mode ==2 ){ + siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver(); + int nextTask = siemensConveyorDeviceDriver.getTask(); + if (nextTask == task) { + inst_message = "指令号:" + instruction.getInstruction_code() + " " + instruction.getStart_point_code() + "->" + instruction.getNext_point_code() + " 载具号:" + instruction.getVehicle_code(); + if (StrUtil.equals(instruction.getInstruction_status(), "1")) { + inst = instruction; + finish_instruction(); + this.clearWrite(); + } } } + } } } } + if (agvphase == 0x03) { + if (ObjectUtil.isNotEmpty(inst)) { + inst.setExecute_status("1"); + instructionService.update(inst); + byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); + agvphase = 0; + index = 0; + inst = null; + logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); + } else { + logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈"); + + } + } + + if (agvphase == 0x05) { + if (ObjectUtil.isNotEmpty(inst)) { + inst.setExecute_status("2"); + instructionService.update(inst); + byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); +// OneNDCSocketConnectionAutoRun.write(data); + agvphase = 0; + index = 0; + inst = null; + logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); + } else { + logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈"); + + } + } + + if (agvphase == 0x07) { + if (ObjectUtil.isNotEmpty(inst)) { + inst.setExecute_status("5"); + instructionService.update(inst); + byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); +// OneNDCSocketConnectionAutoRun.write(data); + agvphase = 0; + index = 0; + inst = null; + logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); + } else { + logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈"); + } + } + + if (agvphase == 0x09) { + if (ObjectUtil.isNotEmpty(inst)) { + inst.setExecute_status("6"); + instructionService.update(inst); + byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); +// OneNDCSocketConnectionAutoRun.write(data); + agvphase = 0; + index = 0; + inst = null; + logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); + } else { + logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈"); + + } + } } catch (Exception var17) { inst_message = var17.getMessage(); logServer.deviceExecuteLog(this.getDevice_code(), "", "", "读取信号值时出现异常:" + var17.getMessage()); @@ -270,15 +344,16 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme } break; case 4: - //申请贴标 - if (move > 0 && !requireApplyLabelingSuccess) { - applyLabeling(); + //申请捆扎 + if (move > 0 && !requireApplyLaStrangulationSuccess) { + applyLaStrangulation(); } break; case 5: - //申请困扎 - if (move > 0 && !requireApplyLaStrangulationSuccess) { - applyLaStrangulation(); + //申请贴标 + if (move > 0 && !requireApplyLabelingSuccess) { + applyLabeling(); + } break; case 6: @@ -286,6 +361,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme if (move > 0 && !requireEmptyInSuccess) { emptyIn(); } + if (move > 0 && !requireSucess) { + instruction_require(); + } break; case 7: //空托盘满垛出库申请 @@ -573,6 +651,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme } } + //申请贴标 public synchronized void applyLabeling() { Date date = new Date(); if (date.getTime() - this.require_apply_labeling_time.getTime() < (long) this.instruction_require_time_out) { @@ -580,6 +659,20 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme return; } else { this.require_apply_labeling_time = date; + String vehicle_code = ""; + if(task >0 ){ + Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task)); + vehicle_code = instruction.getVehicle_code(); + } else { + logServer.deviceExecuteLog(device_code, "", "", "申请贴标电气设备任务号:"+task+"异常"); + message = "申请贴标电气设备任务号:"+task+"异常"; + throw new RuntimeException("任务号为空!"); + } + if(StrUtil.isEmpty(vehicle_code)){ + logServer.deviceExecuteLog(device_code, "", "", "申请贴标电气设备任务号:"+task+"未找到载具号"); + message = "申请贴标电气设备任务号:"+task+"未找到载具号"; + throw new RuntimeException("载具号为空!"); + } ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest = new ApplyLabelingAndBindingRequest(); JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("storage_code ='" + this.device_code + "'").uniqueResult(0); @@ -589,11 +682,28 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme } applyLabelingAndBindingRequest.setDevice_code(start_point_code); applyLabelingAndBindingRequest.setType("1"); - acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest); + applyLabelingAndBindingRequest.setVehicle_code(vehicle_code); + ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest); + if(ObjectUtil.isNotEmpty( applyLabelingAndBindingResponse.getData())){ + Map datas = applyLabelingAndBindingResponse.getData(); + String length = datas.get("box_length").toString(); + String width = datas.get("box_width").toString(); + String box_high = datas.get("box_high").toString(); + String bundle_times = datas.get("bundle_times").toString(); + + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code","to_command"); + map.put("value","5"); + list.add(map); + this.writing(list); + + } requireApplyLabelingSuccess = true; } } + //申请捆扎 public synchronized void applyLaStrangulation() { Date date = new Date(); if (date.getTime() - this.require_apply_strangulation_time.getTime() < (long) this.instruction_require_time_out) { @@ -601,6 +711,20 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme return; } else { this.require_apply_strangulation_time = date; + String vehicle_code = ""; + if(task >0 ){ + Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task)); + vehicle_code = instruction.getVehicle_code(); + } else { + logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:"+task+"异常"); + message = "申请捆扎电气设备任务号:"+task+"异常"; + throw new RuntimeException("任务号为空!"); + } + if(StrUtil.isEmpty(vehicle_code)){ + logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:"+task+"未找到载具号"); + message = "申请捆扎电气设备任务号:"+task+"未找到载具号"; + throw new RuntimeException("载具号为空!"); + } ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest = new ApplyLabelingAndBindingRequest(); JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("storage_code ='" + this.device_code + "'").uniqueResult(0); @@ -610,7 +734,40 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme } applyLabelingAndBindingRequest.setDevice_code(start_point_code); applyLabelingAndBindingRequest.setType("2"); - acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest); + applyLabelingAndBindingRequest.setVehicle_code(vehicle_code); + ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest); + if(ObjectUtil.isNotEmpty( applyLabelingAndBindingResponse.getData())){ + Map datas = applyLabelingAndBindingResponse.getData(); + String length = datas.get("box_length").toString(); + String width = datas.get("box_width").toString(); + String box_high = datas.get("box_high").toString(); + String bundle_times = datas.get("bundle_times").toString(); + + List list = new ArrayList(); + Map map = new HashMap(); + map.put("code","to_length"); + map.put("value",length); + list.add(map); + Map map2 = new HashMap(); + map2.put("code","to_weight"); + map2.put("value",width); + list.add(map2); + Map map3 = new HashMap(); + map3.put("code","to_height"); + map3.put("value",box_high); + list.add(map3); + Map map4 = new HashMap(); + map4.put("code","to_strap_times"); + map4.put("value",bundle_times); + list.add(map4); + Map map5 = new HashMap(); + map5.put("code","to_command"); + map5.put("value","4"); + list.add(map5); + this.writing(list); + + } + requireApplyLaStrangulationSuccess = true; } } @@ -622,6 +779,26 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme return; } else { this.require_empty_in_time = date; + + if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { + message = "申请任务中..."; + JSONObject apply = new JSONObject(); + apply.put("device_code", device_code); + apply.put("type","2"); + String str = acsToWmsService.applyTaskToWms(apply); + JSONObject jo = JSON.parseObject(str); + if (ObjectUtil.isEmpty(jo)) { + message = "接口不通"; + } else { + if (jo.getInteger("status") == 200) { + requireEmptyInSuccess = true; + } else { + requireEmptyInSuccess = false; + message = jo.get("message").toString(); + } + } + + } } } @@ -632,6 +809,25 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme return; } else { this.require_empty_out_time = date; + if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { + message = "申请任务中..."; + JSONObject apply = new JSONObject(); + apply.put("device_code", device_code); + apply.put("type","2"); + String str = acsToWmsService.applyTaskToWms(apply); + JSONObject jo = JSON.parseObject(str); + if (ObjectUtil.isEmpty(jo)) { + message = "接口不通"; + } else { + if (jo.getInteger("status") == 200) { + requireEmptyOutSuccess = true; + } else { + requireEmptyOutSuccess = false; + message = jo.get("message").toString(); + } + } + + } } } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyLabelingAndBindingResponse.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyLabelingAndBindingResponse.java index e60e5cd1e..cf20c9c1d 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyLabelingAndBindingResponse.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/ApplyLabelingAndBindingResponse.java @@ -1,9 +1,14 @@ package org.nl.acs.ext.wms.data; +import com.alibaba.fastjson.JSONObject; import lombok.Data; +import java.util.HashMap; +import java.util.Map; + @Data public class ApplyLabelingAndBindingResponse extends BaseResponse { + private Map data = new HashMap(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusData.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusData.java index 07a680691..a2b5c3471 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusData.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusData.java @@ -1,5 +1,8 @@ package org.nl.acs.ext.wms.liKuData; +import lombok.Data; + +@Data public class DeviceStatusData { String deviceId; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusRequest.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusRequest.java index fca8e50df..006bbaa7e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusRequest.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/DeviceStatusRequest.java @@ -1,5 +1,8 @@ package org.nl.acs.ext.wms.liKuData; +import lombok.Data; + +@Data public class DeviceStatusRequest { String deviceId; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/putEmptyPalletRequest.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/putEmptyPalletRequest.java new file mode 100644 index 000000000..2d921b867 --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/liKuData/putEmptyPalletRequest.java @@ -0,0 +1,14 @@ +package org.nl.acs.ext.wms.liKuData; + +import lombok.Data; + +@Data +public class putEmptyPalletRequest { + + String deviceId; + + String orderId; + + String type; + +} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/LiKuToACSController.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/LiKuToACSController.java index 24faaf6a8..acf3a41b0 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/LiKuToACSController.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/LiKuToACSController.java @@ -55,5 +55,13 @@ public class LiKuToACSController { return new ResponseEntity<>(liKuToAcsService.moveStoreReport(requestParam), HttpStatus.OK); } + @SaIgnore + @PostMapping("/putEmptyPallet") + @Log("请求放空盘") + @ApiOperation("请求放空盘") + public ResponseEntity putEmptyPallet(@RequestBody putEmptyPalletRequest requestParam) throws Exception { + return new ResponseEntity<>(liKuToAcsService.putEmptyPallet(requestParam), HttpStatus.OK); + } + } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java index ec7c36f5d..b880f9cad 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java @@ -93,7 +93,7 @@ public interface AcsToWmsService { HttpResponse applyOutCacheLineTask(JSONObject param); /** - * ACS系统申请出库任务 + * 申请捆扎、贴标 * * @param param * @return diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/LiKuToAcsService.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/LiKuToAcsService.java index 12c4d0a14..b7394808b 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/LiKuToAcsService.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/LiKuToAcsService.java @@ -29,4 +29,12 @@ public interface LiKuToAcsService { */ public Resp moveStoreReport(MoveStoreReportRequest requestParam) throws Exception; + + /** + * 移库任务上报 + * @param requestParam + * @return + */ + public Resp putEmptyPallet(putEmptyPalletRequest requestParam) throws Exception; + } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToLiKuServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToLiKuServiceImpl.java index f13788d16..f0f0ce6cd 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToLiKuServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToLiKuServiceImpl.java @@ -182,10 +182,10 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService { public Resp querySsxDeviceStatus(DeviceStatusRequest requestParam) { try { MDC.put(log_file_type, log_type); - log.info("queryTsjDeviceStatus-----输入参数{}", requestParam); + log.info("querySsxDeviceStatus-----输入参数{}", requestParam); String api = addressService.findByCode("querySsxDeviceStatus").getMethods_url(); String result = AcsUtil.notifyAcs(api, requestParam); - log.info("queryTsjDeviceStatus-----输出参数{}", result); + log.info("querySsxDeviceStatus-----输出参数{}", result); return RespUtil.getResp(result, new DeviceStatusRequest()); } finally { MDC.remove(log_file_type); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 23fdfccb5..eaae2ff27 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -411,6 +411,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { String url = wmsUrl + methods_url; log.info("ApplyLabelingAndBindingRequest----请求参数{}", param); try { +// String result = ""; String result = HttpRequest.post(url) .body(JSON.toJSONString(param)) .execute().body(); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/LiKuToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/LiKuToAcsServiceImpl.java index 0dcd36e65..7de777270 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/LiKuToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/LiKuToAcsServiceImpl.java @@ -5,6 +5,9 @@ import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.device.address.service.AddressService; +import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver; +import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver; +import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; import org.nl.acs.ext.wms.AcsUtil; import org.nl.acs.ext.wms.RespUtil; import org.nl.acs.ext.wms.data.UpdateLKTaskRequest; @@ -15,8 +18,12 @@ import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.LiKuToAcsService; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; +import org.nl.acs.opc.Device; +import org.nl.acs.opc.DeviceAppService; +import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; +import org.nl.modules.wql.util.SpringContextHolder; import org.slf4j.MDC; import org.springframework.stereotype.Service; @@ -260,4 +267,42 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService { + //请求放空盘 + @Override + public Resp putEmptyPallet(putEmptyPalletRequest requestParam) throws Exception { + try { + MDC.put(log_file_type, log_type); + log.info("请求放空盘-----输入参数{}", requestParam.toString()); + String device_code = requestParam.getDeviceId(); + String type = requestParam.getType(); + DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); + Device device = appService.findDeviceByCode(device_code); + SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; + JSONObject result = new JSONObject(); + result.put("code", "0"); + if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) { + siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver(); + if(StrUtil.equals(type,"1")){ + if(siemensConveyorDeviceDriver.getMode() ==2 && siemensConveyorDeviceDriver.getMove() ==0){ + result.put("result", "true"); + result.put("comment", ""); + } else { + result.put("result", "false"); + result.put("comment", "当前设备光电信号:"+siemensConveyorDeviceDriver.getMove()+",工作模式:"+siemensConveyorDeviceDriver.getMode()); + } + } else if(StrUtil.equals(type,"2")){ + siemensConveyorDeviceDriver.writing("to_command","3"); + result.put("result", "true"); + result.put("comment", ""); + } + + } + log.info("请求放空盘-----输出参数{}", result); + return RespUtil.getResp(result.toString(), new DeviceStatusResponse()); + } finally { + MDC.remove(log_file_type); + } + + } + } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 05a9ca88b..7f7f9a737 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -95,7 +95,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { } response.setMessage("success"); response.setErrArr(errArr); - log.info("createFromWms--------------:输出参数:" + response); + log.info("cancelFromWms--------------:输出参数:" + response); return response; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java index 4a3900925..d29e71f9a 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java @@ -91,7 +91,7 @@ public class DeviceOpcProtocolRunable implements Runnable { } if (is_error) { - log.info("设备OPC数据同步配置异常"); + log.info("设备OPC数据同步配置异常," + err_message); } if (!OpcStartTag.is_run) { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskFeedbackServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskFeedbackServiceImpl.java index dd4d38aa1..e034bc87d 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskFeedbackServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskFeedbackServiceImpl.java @@ -180,7 +180,6 @@ public class TaskFeedbackServiceImpl implements TaskFeedbackService { e.printStackTrace(); } int status = body.getStatus(); - JSONObject jo = (JSONObject) JSONObject.toJSON(body.body()); dto.setTask_status(entity.getTask_status()); if (status == 200) { diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryLKDeviceStatus.java b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryLKDeviceStatus.java new file mode 100644 index 000000000..98b5a5f8b --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryLKDeviceStatus.java @@ -0,0 +1,44 @@ +package org.nl.modules.quartz.task; + +import cn.hutool.core.map.MapUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpResponse; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.agv.server.AgvService; +import org.nl.acs.agv.server.ZheDaAgvService; +import org.nl.acs.ext.wms.liKuData.DeviceStatusRequest; +import org.nl.acs.ext.wms.liKuData.DeviceStatusResponse; +import org.nl.acs.ext.wms.liKuData.Resp; +import org.nl.acs.ext.wms.service.AcsToLiKuService; +import org.nl.acs.instruction.service.InstructionService; +import org.nl.acs.instruction.service.dto.Instruction; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 查询立库设备状态 + */ +@Slf4j +@Component +public class QueryLKDeviceStatus { + + @Autowired + AcsToLiKuService acsToLiKuService; + + + public void run() throws Exception { + DeviceStatusRequest deviceStatusRequest = new DeviceStatusRequest(); + deviceStatusRequest.setDeviceId("0"); + Resp carResp = acsToLiKuService.queryCarDeviceStatus(deviceStatusRequest); + Resp ssxResp = acsToLiKuService.querySsxDeviceStatus(deviceStatusRequest); + Resp tsjResp = acsToLiKuService.queryTsjDeviceStatus(deviceStatusRequest); + + + + } +} diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryZDAgvTaskStatus.java b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryZDAgvTaskStatus.java deleted file mode 100644 index 668a57c5a..000000000 --- a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryZDAgvTaskStatus.java +++ /dev/null @@ -1,164 +0,0 @@ -package org.nl.modules.quartz.task; - -import cn.hutool.core.map.MapUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpResponse; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.agv.server.AgvService; -import org.nl.acs.agv.server.ZheDaAgvService; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * 查询AGV任务状态 - */ -@Slf4j -@Component -public class QueryZDAgvTaskStatus { - - @Autowired - InstructionService instructionService; - - @Autowired - ZheDaAgvService agvService; - - - public void run() throws Exception { - HttpResponse response = agvService.queryAgvInstStatus("1"); - //查询AGV指令列表 - JSONArray inst_rows = JSONArray.parseArray(response.body()); - for (int i = 0; i < inst_rows.size(); i++) { - JSONObject inst_jo = inst_rows.getJSONObject(i); - String inst_code = inst_jo.getString("task_code"); - Instruction inst = instructionService.findByCodeFromCache(inst_code); - if (ObjectUtil.isEmpty(inst)){ - continue; - } - //反馈结果状态 - log.info("instcode:" + inst_code + "," + inst_jo.toString()); - - String state = inst_jo.getString("state"); - String vehicle = ""; - //正在执行指令agv车号 - if (!StrUtil.isEmpty(inst_jo.getString("vehicle"))) { - vehicle = inst_jo.getString("vehicle"); - inst.setCarno(vehicle); - } -// RAW:初始状态 -// ACTIVE:业务订单已激活 -// DISPATCHABLE:业务订单已通过系统验证,等待被调度执行 -// BEING_PROCESSED:业务订单正在被执行 -// WITHDRAWN:业务订单已被撤销 -// FINISHED:业务订单已完成 -// FAILED:业务订单已失败 -// UNROUTABLE:无法规划该业务订单的执行路线 - - //执行中 - if ("BEING_PROCESSED".equals(state)) { - if (inst != null) { - inst.setInstruction_status("1"); - instructionService.update(inst); - } - } else if ("FINISHED".equals(state)) { - if (inst != null) { - inst.setInstruction_status("2"); - instructionService.finish(inst); - } - } else if ("WITHDRAWN".equals(state) || "FAILED".equals(state)) { - if (inst != null) { - inst.setInstruction_status("3"); - instructionService.update(inst); - instructionService.removeByCodeFromCache(inst_jo.getString("task_code")); - } - } - JSONArray ja = inst_jo.getJSONArray("destinations"); - for (int j = 0; j < ja.size(); j++) { - JSONObject jo = ja.getJSONObject(j); - JSONArray pro_rows = jo.getJSONArray("properties"); - //Load 取货动作 Unload放货动作 Wait等待 - String operation = jo.getString("operation"); - String device = jo.getString("locationName"); - for (int k = 0; k < pro_rows.size(); k++) { - JSONObject item = pro_rows.getJSONObject(k); - if ("True".equals(item.get("value"))) { - String param = item.get("key").toString(); - //EntryRequired是否进入前等待 PauseOnStation是否离开等待 Wait在该点进行等待 - agvService.process(inst_code, param, device, operation, vehicle); - } - } - } - } - - HttpResponse response2 = agvService.queryAgvInstStatus("2"); - //查询AGV指令列表 - JSONArray inst_rows2 = JSONArray.parseArray(response2.body()); - for (int i = 0; i < inst_rows2.size(); i++) { - JSONObject inst_jo = inst_rows2.getJSONObject(i); - String inst_code = inst_jo.getString("task_code"); - Instruction inst = instructionService.findByCodeFromCache(inst_code); - if (ObjectUtil.isEmpty(inst)){ - continue; - } - //反馈结果状态 - log.info("instcode:" + inst_code + "," + inst_jo.toString()); - - String state = inst_jo.getString("state"); - String vehicle = ""; - //正在执行指令agv车号 - if (!StrUtil.isEmpty(inst_jo.getString("vehicle"))) { - vehicle = inst_jo.getString("vehicle"); - inst.setCarno(vehicle); - } -// RAW:初始状态 -// ACTIVE:业务订单已激活 -// DISPATCHABLE:业务订单已通过系统验证,等待被调度执行 -// BEING_PROCESSED:业务订单正在被执行 -// WITHDRAWN:业务订单已被撤销 -// FINISHED:业务订单已完成 -// FAILED:业务订单已失败 -// UNROUTABLE:无法规划该业务订单的执行路线 - - //执行中 - if ("BEING_PROCESSED".equals(state)) { - if (inst != null) { - inst.setInstruction_status("1"); - instructionService.update(inst); - } - } else if ("FINISHED".equals(state)) { - if (inst != null) { - inst.setInstruction_status("2"); - instructionService.finish(inst); - } - } else if ("WITHDRAWN".equals(state) || "FAILED".equals(state)) { - if (inst != null) { - inst.setInstruction_status("3"); - instructionService.update(inst); - instructionService.removeByCodeFromCache(inst_jo.getString("task_code")); - } - } - JSONArray ja = inst_jo.getJSONArray("destinations"); - for (int j = 0; j < ja.size(); j++) { - JSONObject jo = ja.getJSONObject(j); - JSONArray pro_rows = jo.getJSONArray("properties"); - //Load 取货动作 Unload放货动作 Wait等待 - String operation = jo.getString("operation"); - String device = jo.getString("locationName"); - for (int k = 0; k < pro_rows.size(); k++) { - JSONObject item = pro_rows.getJSONObject(k); - if ("True".equals(item.get("value"))) { - String param = item.get("key").toString(); - //EntryRequired是否进入前等待 PauseOnStation是否离开等待 Wait在该点进行等待 - agvService.process(inst_code, param, device, operation, vehicle); - } - } - } - } - } -} diff --git a/acs/nladmin-system/src/main/resources/config/application-dev.yml b/acs/nladmin-system/src/main/resources/config/application-dev.yml index d8075a6ea..9fd265c16 100644 --- a/acs/nladmin-system/src/main/resources/config/application-dev.yml +++ b/acs/nladmin-system/src/main/resources/config/application-dev.yml @@ -6,11 +6,14 @@ spring: druid: db-type: com.alibaba.druid.pool.DruidDataSource driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy -# url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:lzhl_one_wcs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true - url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true +# url: jdbc:log4jdbc:mysql://${DB_HOST:10.1.3.91}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true +# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true + url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true username: ${DB_USER:root} -# password: ${DB_PWD:P@ssw0rd} - password: ${DB_PWD:Root.123456} + # password: ${DB_PWD:P@ssw0rd} + # password: ${DB_PWD:Root.123456} + password: ${DB_PWD:123456} + # 初始连接数 initial-size: 5 # 最小连接数 diff --git a/acs/nladmin-system/src/main/resources/config/application-prod.yml b/acs/nladmin-system/src/main/resources/config/application-prod.yml index 47dada236..dd2359363 100644 --- a/acs/nladmin-system/src/main/resources/config/application-prod.yml +++ b/acs/nladmin-system/src/main/resources/config/application-prod.yml @@ -6,7 +6,7 @@ spring: druid: db-type: com.alibaba.druid.pool.DruidDataSource driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy - url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true + url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true username: ${DB_USER:root} password: ${DB_PWD:123456} # 初始连接数 diff --git a/acs/nladmin-system/src/main/resources/config/application.yml b/acs/nladmin-system/src/main/resources/config/application.yml index 8e1be364d..7e3fbea7d 100644 --- a/acs/nladmin-system/src/main/resources/config/application.yml +++ b/acs/nladmin-system/src/main/resources/config/application.yml @@ -2,13 +2,14 @@ spring: freemarker: check-template-location: false profiles: - active: prod + active: dev jackson: time-zone: GMT+8 data: redis: repositories: enabled: false + #配置 Jpa jpa: hibernate: @@ -17,7 +18,7 @@ spring: properties: hibernate: dialect: org.hibernate.dialect.MySQL5InnoDBDialect - + enable_lazy_load_no_trans: true task: pool: # 核心线程池大小 @@ -43,13 +44,37 @@ rsa: private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A== logging: file: - path: C:\logs\nlacs\ -demo: - monitor: - server-url: https://www.demo-monitor.com - username: MessiLoveRidingBike - password: 123456 - -acsTowms: - token: Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI2ZjI2OGMxZjAyOTE0MTNiOWU3YThmMTM2ZTc2MWJkYSIsImF1dGgiOiJhZG1pbiIsInN1YiI6ImFkbWluIn0.lKxY3Wc_efzmBXXAS_dDC_Sfh32kZInxYmaxBzg83e5gviSJPPKolNt4IlCCaGM8HOc_yKByiIu8YFlgQif01Q - + path: C:\log\wms + config: classpath:logback-spring.xml +# sa-token白名单配置 +security: + # 排除路径 + excludes: + # 认证 + - /auth/login + - /auth/code + - /auth/logout + # swagger + - /swagger-ui.html + - /swagger-resources/** + - /webjars/** + - /file/** + - /webSocket/** + # 静态资源 + - /*.html + - /**/*.html + - /**/*.css + - /**/*.js + # swagger 文档配置 + - /favicon.ico + - /*/api-docs + - /*/api-docs/** + # druid 监控配置 + - /druid/** + # actuator 监控配置 + - /actuator + - /actuator/** + # 上传 + - /api/localStorage/pictures + # 参数 + - /api/param/getValueByCode diff --git a/acs/nladmin-system/src/main/resources/log/AcsToWms.xml b/acs/nladmin-system/src/main/resources/log/AcsToWms.xml new file mode 100644 index 000000000..94a118025 --- /dev/null +++ b/acs/nladmin-system/src/main/resources/log/AcsToWms.xml @@ -0,0 +1,32 @@ + + + + + + + + + ${LOG_HOME}/ACS请求WMS/%d{yyyy-MM-dd}.%i.log + + 15 + + 200MB + + 2GB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + + + + + + + + + + + diff --git a/acs/nladmin-system/src/main/resources/log/AutoCreateInst.xml b/acs/nladmin-system/src/main/resources/log/AutoCreateInst.xml new file mode 100644 index 000000000..f79a8116c --- /dev/null +++ b/acs/nladmin-system/src/main/resources/log/AutoCreateInst.xml @@ -0,0 +1,31 @@ + + + + + + + + + ${LOG_HOME}/自动创建指令/%d{yyyy-MM-dd}.%i.log + + 15 + + 200MB + + 2GB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + + + + + + + + + + diff --git a/acs/nladmin-system/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml b/acs/nladmin-system/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml new file mode 100644 index 000000000..5c558e6bc --- /dev/null +++ b/acs/nladmin-system/src/main/resources/log/OneNDCSocketConnectionAutoRun.xml @@ -0,0 +1,32 @@ + + + + + + + + + ${LOG_HOME}/一楼NDC系统/%d{yyyy-MM-dd}.%i.log + + 15 + + 200MB + + 2GB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + + + + + + + + + + + diff --git a/acs/nladmin-system/src/main/resources/log/ScannerBarcode.xml b/acs/nladmin-system/src/main/resources/log/ScannerBarcode.xml new file mode 100644 index 000000000..07dc0b623 --- /dev/null +++ b/acs/nladmin-system/src/main/resources/log/ScannerBarcode.xml @@ -0,0 +1,32 @@ + + + + + + + + + ${LOG_HOME}/扫码记录/%d{yyyy-MM-dd}.%i.log + + 15 + + 200MB + + 2GB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + + + + + + + + + + + diff --git a/acs/nladmin-system/src/main/resources/log/WmsToAcs.xml b/acs/nladmin-system/src/main/resources/log/WmsToAcs.xml new file mode 100644 index 000000000..630446d51 --- /dev/null +++ b/acs/nladmin-system/src/main/resources/log/WmsToAcs.xml @@ -0,0 +1,32 @@ + + + + + + + + + ${LOG_HOME}/WMS下发ACS/%d{yyyy-MM-dd}.%i.log + + 15 + + 200MB + + 2GB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + + + + + + + + + + + diff --git a/acs/nladmin-system/src/main/resources/logback-spring.xml b/acs/nladmin-system/src/main/resources/logback-spring.xml index 4edd8e564..9b5fa1a19 100644 --- a/acs/nladmin-system/src/main/resources/logback-spring.xml +++ b/acs/nladmin-system/src/main/resources/logback-spring.xml @@ -29,8 +29,9 @@ https://juejin.cn/post/6844903775631572999 - --> + --> + @@ -87,6 +88,7 @@ https://juejin.cn/post/6844903775631572999 + diff --git a/acs/nladmin-ui/src/App.vue b/acs/nladmin-ui/src/App.vue index 2f82bccfe..bd570a9fc 100644 --- a/acs/nladmin-ui/src/App.vue +++ b/acs/nladmin-ui/src/App.vue @@ -24,7 +24,7 @@ export default { this.timmer = setTimeout(() => { sessionStorage.clear() this.logout() - }, 1000 * 60 * 15) // 15分钟 https://blog.csdn.net/qq_42345108/article/details/103496456 + }, 1000 * 60 * 60) // 15分钟 https://blog.csdn.net/qq_42345108/article/details/103496456 }, logout() { this.$store.dispatch('LogOut').then(() => { From 4f68ed9dfed16509a1ec5df0b17a1a2ecc8b2b56 Mon Sep 17 00:00:00 2001 From: liuxy Date: Mon, 9 Jan 2023 09:57:55 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java index 7d36263f5..ce4bcf8dd 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java @@ -25,6 +25,7 @@ import org.nl.wms.basedata.st.service.dto.StorattrDto; import org.nl.wms.basedata.st.service.dto.StructattrDto; import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl; import org.nl.wms.sch.manage.AbstractAcsTask; +import org.nl.wms.sch.manage.TaskStatusEnum; import org.nl.wms.sch.service.PointService; import org.nl.wms.sch.service.TaskService; import org.nl.wms.sch.service.dto.PointDto; @@ -1119,7 +1120,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService { }*/ AbstractAcsTask task = new InTask(); - task.updateTaskStatus(task_jo, "2"); + task.updateTaskStatus(task_jo, TaskStatusEnum.FINISHED.getCode()); } @Override