From 97e70fa264df2d3d0ed004137a8c55d9035b10f9 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期六, 20 九月 2025 15:42:37 +0800 Subject: [PATCH] 缓冲区库存调整 --- src/main/java/com/zy/asrs/entity/OrderDetl.java | 6 +++++- src/main/java/com/zy/asrs/entity/WaitPakin.java | 6 +++--- src/main/java/com/zy/asrs/entity/OrderDetlPakin.java | 4 +--- src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 35 ++++++++++++++++++----------------- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/zy/asrs/entity/OrderDetl.java b/src/main/java/com/zy/asrs/entity/OrderDetl.java index aa96844..006c610 100644 --- a/src/main/java/com/zy/asrs/entity/OrderDetl.java +++ b/src/main/java/com/zy/asrs/entity/OrderDetl.java @@ -15,12 +15,14 @@ import com.zy.system.service.UserService; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springframework.beans.BeanUtils; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; +import java.util.Objects; @Data @TableName("man_order_detl") @@ -628,7 +630,9 @@ } public void sync(Object source) { - Synchro.Copy(source, this); + if (!Objects.isNull(source)) { + BeanUtils.copyProperties(source, this); + } } } \ No newline at end of file diff --git a/src/main/java/com/zy/asrs/entity/OrderDetlPakin.java b/src/main/java/com/zy/asrs/entity/OrderDetlPakin.java index fe7d5de..935e58b 100644 --- a/src/main/java/com/zy/asrs/entity/OrderDetlPakin.java +++ b/src/main/java/com/zy/asrs/entity/OrderDetlPakin.java @@ -469,6 +469,7 @@ } } + public String getStatus$(){ if (null == this.status){ return null; } switch (this.status){ @@ -517,9 +518,6 @@ if (null != this.anfme && this.workQty != null) { return this.anfme - this.workQty; } -// if (null != this.anfme && this.qty != null) { -// return this.anfme - this.qty; -// } return null; } diff --git a/src/main/java/com/zy/asrs/entity/WaitPakin.java b/src/main/java/com/zy/asrs/entity/WaitPakin.java index e1bfb4c..90e0164 100644 --- a/src/main/java/com/zy/asrs/entity/WaitPakin.java +++ b/src/main/java/com/zy/asrs/entity/WaitPakin.java @@ -277,7 +277,7 @@ return this.boxType1; } - public void sync(Object source) { - Synchro.Copy(source, this); - } +// public void sync(Object source) { +// Synchro.Copy(source, this); +// } } diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java index 09fcff6..12c145f 100644 --- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java @@ -21,6 +21,7 @@ import com.zy.common.service.CommonService; import com.zy.common.utils.HttpHandler; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -544,7 +545,7 @@ if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) { throw new CoolException(BaseRes.PARAM); } - if (param.getCombMats().size() > 1) { + if (param.getCombMats().size() < 1) { throw new CoolException("璇锋彁鍙栦竴涓晢鍝侊紝鎴栬�呭埛鏂伴噸鏂扮粍鎵橈紒"); } // 鍒ゆ柇鏄惁鏈夌浉鍚屾潯鐮佺殑鏁版嵁 @@ -555,9 +556,6 @@ if (param.getBarcode().length() != 8) { throw new CoolException("鏉$爜闀垮害涓嶆槸8浣�===>>" + param.getBarcode()); - } - if (param.getCombMats().size() > 1) { - throw new CoolException("涓嶅厑璁告贩鏂�===>>" + param.getBarcode()); } int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode())); @@ -593,7 +591,7 @@ throw new CoolException(detlDto.getMatnr() + "鍟嗗搧妗f涓嶅瓨鍦�"); } WaitPakin waitPakin = new WaitPakin(); - waitPakin.sync(mat); + BeanUtils.copyProperties(mat, waitPakin); waitPakin.setBatch(detlDto.getBatch()); waitPakin.setZpallet(param.getBarcode()); // 鎵樼洏鐮� waitPakin.setIoStatus("N"); // 鍏ュ嚭鐘舵�� @@ -617,18 +615,20 @@ // 鐢熸垚鍏ュ簱閫氱煡妗� List<DetlDto> detlDtos = new ArrayList<>(); param.getCombMats().forEach(elem -> { - // 璁㈠崟鏄庣粏鏁伴噺鏍¢獙 -// OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), elem.getMatnr(), elem.getBatch()); - OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), - elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3()); - if (elem.getAnfme() > orderDetl.getEnableQty()) { - throw new CoolException(orderDetl.getMatnr() + "鍏ュ簱鏁伴噺涓嶅悎娉�"); +// OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), +// elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3()); + OrderDetlPakin detls = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>() + .eq("order_id", order.getId()) + .eq("matnr", elem.getMatnr())); + + if (Objects.isNull(detls)) { + throw new CoolException("鏁版嵁閿欒锛氬崟鎹槑缁嗕笉瀛樺湪锛侊紒"); } - // 淇敼璁㈠崟浣滀笟鏁伴噺 -// if (!orderDetlService.increaseWorkQty(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme())) { -// throw new CoolException("淇敼鍗曟嵁浣滀笟鏁伴噺澶辫触"); -// } + + if (elem.getAnfme() > detls.getEnableQty()) { + throw new CoolException(detls.getMatnr() + "鍏ュ簱鏁伴噺涓嶅悎娉�"); + } OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), @@ -647,7 +647,8 @@ throw new CoolException(detlDto.getMatnr() + "鍟嗗搧妗f涓嶅瓨鍦�"); } WaitPakin waitPakin = new WaitPakin(); - waitPakin.sync(mat); + BeanUtils.copyProperties(mat, waitPakin); +// waitPakin.sync(mat); waitPakin.setOrderNo(order.getOrderNo()); // 鍗曟嵁缂栧彿 waitPakin.setBatch(detlDto.getBatch()); // 搴忓垪鐮� waitPakin.setZpallet(param.getBarcode()); // 鎵樼洏鐮� @@ -945,7 +946,7 @@ throw new CoolException(detlDto.getMatnr() + "鍟嗗搧妗f涓嶅瓨鍦�"); } WaitPakin waitPakin = new WaitPakin(); - waitPakin.sync(mat); + BeanUtils.copyProperties(mat, waitPakin); waitPakin.setOrderNo(orderNo); waitPakin.setBatch(detlDto.getBatch()); waitPakin.setZpallet(param.getBarcode()); // 鎵樼洏鐮� -- Gitblit v1.9.1