From 3f30983db5b3cd2b25cb215579501a2ef134883c Mon Sep 17 00:00:00 2001 From: zyx <zyx123456> Date: 星期五, 04 八月 2023 17:00:11 +0800 Subject: [PATCH] agv 订单出库功能完善 --- src/main/java/com/zy/asrs/service/impl/OrderServiceImpl.java | 57 +++++++++++++++++++++++++++++++++------------------------ 1 files changed, 33 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/OrderServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/OrderServiceImpl.java index 0bf3dcb..2c6449c 100644 --- a/src/main/java/com/zy/asrs/service/impl/OrderServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/OrderServiceImpl.java @@ -40,6 +40,8 @@ @Autowired private WrkDetlService wrkDetlService; @Autowired + private AgvWrkDetlService agvWrkDetlService; + @Autowired private MatService matService; @Autowired private ErpService erpService; @@ -66,10 +68,14 @@ @Override public void checkComplete(String orderNo) { Order order = this.selectByNo(orderNo); + if(Cools.isEmpty(order)){ + return; + } if (order.getSettle() >= 4L) { return; } List<OrderDetl> orderDetls = orderDetlMapper.selectList(new EntityWrapper<OrderDetl>().eq("order_id", order.getId())); + // 浣滀笟鏁伴噺鏄惁绛変簬鏁伴噺 boolean complete = true; for (OrderDetl orderDetl : orderDetls) { if (orderDetl.getAnfme() > orderDetl.getQty()) { @@ -77,31 +83,34 @@ break; } } - if (complete && wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().like("order_no", orderNo)) == 0) { + // 濡傛灉 浣滀笟鏁伴噺绛変簬鍗曟嵁鎬绘暟閲� && 宸ヤ綔鏄庣粏妗d腑鏃犺鍗曟嵁鐨勬暟鎹� && AGV宸ヤ綔鏄庣粏妗d腑鏃犺鍗曟嵁鐨勬暟鎹� + if (complete + && wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().like("order_no", orderNo)) < 1 + && agvWrkDetlService.selectCount(new EntityWrapper<AgvWrkDetl>().like("order_no",orderNo)) < 1) { // 鍑哄簱璁㈠崟閲嶆柊鏁寸悊鏄庣粏 - DocType docType = docTypeService.selectById(order.getDocType()); - if (null != docType && docType.getPakout() == 1) { - // 閲嶇粍鏄庣粏 - if (!orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", order.getId()))) { - throw new CoolException("閲嶆暣鍑哄簱璁㈠崟銆恛rderNo = " + order.getOrderNo() + "銆戞槑缁嗗け璐�"); - } - List<WrkDetl> wrkDetls = wrkDetlService.selectAndLogByOrderNo(orderNo); - for (WrkDetl wrkDetl : wrkDetls) { - OrderDetl orderDetl = new OrderDetl(); - orderDetl.sync(wrkDetl); - orderDetl.setQty(orderDetl.getAnfme()); - orderDetl.setOrderId(order.getId()); - orderDetl.setOrderNo(orderNo); - orderDetl.setStatus(1); - orderDetl.setCreateTime(order.getCreateTime()); - orderDetl.setCreateBy(order.getCreateBy()); - orderDetl.setUpdateTime(order.getUpdateTime()); - orderDetl.setUpdateBy(order.getUpdateBy()); - if (!orderDetlService.insert(orderDetl)) { - throw new CoolException("閲嶆暣鍑哄簱璁㈠崟銆恛rderNo = " + order.getOrderNo() + "銆戞槑缁嗗け璐�"); - } - } - } +// DocType docType = docTypeService.selectById(order.getDocType()); +// if (null != docType && docType.getPakout() == 1) { +// // 閲嶇粍鏄庣粏 +// if (!orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", order.getId()))) { +// throw new CoolException("閲嶆暣鍑哄簱璁㈠崟銆恛rderNo = " + order.getOrderNo() + "銆戞槑缁嗗け璐�"); +// } +// List<WrkDetl> wrkDetls = wrkDetlService.selectAndLogByOrderNo(orderNo); +// for (WrkDetl wrkDetl : wrkDetls) { +// OrderDetl orderDetl = new OrderDetl(); +// orderDetl.sync(wrkDetl); +// orderDetl.setQty(orderDetl.getAnfme()); +// orderDetl.setOrderId(order.getId()); +// orderDetl.setOrderNo(orderNo); +// orderDetl.setStatus(1); +// orderDetl.setCreateTime(order.getCreateTime()); +// orderDetl.setCreateBy(order.getCreateBy()); +// orderDetl.setUpdateTime(order.getUpdateTime()); +// orderDetl.setUpdateBy(order.getUpdateBy()); +// if (!orderDetlService.insert(orderDetl)) { +// throw new CoolException("閲嶆暣鍑哄簱璁㈠崟銆恛rderNo = " + order.getOrderNo() + "銆戞槑缁嗗け璐�"); +// } +// } +// } if (!this.updateSettle(order.getId(), 4L, null)) { throw new CoolException("淇敼璁㈠崟銆恛rderNo = " + order.getOrderNo() + "銆戠姸鎬佷负宸插畬鎴愬け璐�"); -- Gitblit v1.9.1