From d907a822a940c7ec0fb7de0ca845472bda52229b Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期二, 03 二月 2026 14:33:12 +0800
Subject: [PATCH] #pda料箱组托和换码
---
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 103 insertions(+), 4 deletions(-)
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 52ba404..64a5fbf 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -7,10 +7,7 @@
import com.core.common.*;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
-import com.zy.asrs.entity.param.CombParam;
-import com.zy.asrs.entity.param.MobileAdjustParam;
-import com.zy.asrs.entity.param.OffSaleParam;
-import com.zy.asrs.entity.param.OpenOrderPakinParam;
+import com.zy.asrs.entity.param.*;
import com.zy.asrs.mapper.ManLocDetlMapper;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.MatUtils;
@@ -202,6 +199,108 @@
}
+ @Override
+ @Transactional
+ public void cartonComb(List<CombCartonParam> params, Long userId) {
+ for (CombCartonParam param : params) {
+ if (Cools.isEmpty(param.getBarcode(), param.getCartons())) {
+ throw new CoolException(BaseRes.PARAM);
+ }
+ // 鍒ゆ柇鏄惁鏈夌浉鍚屾潯鐮佺殑鏁版嵁
+ if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
+ eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) {
+ throw new CoolException("response.data_processing_inbound");
+ }
+
+ if(param.getBarcode().length()!=8){
+ throw new CoolException("response.barcode_length_invalid");
+ }
+ int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode()));
+ int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode()));
+ int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",param.getBarcode()));
+ if (countLoc > 0 || countWrk > 0 || countwait > 0) {
+ throw new CoolException("response.pallet_data_exists");
+ }
+
+ Date now = new Date();
+
+ Order order = orderService.selectByNo(param.getOrderNo());
+ if (Cools.isEmpty(order) || order.getSettle() > 2) {
+ throw new CoolException("response.order_expired");
+ }
+ // 鐢熸垚鍏ュ簱閫氱煡妗�
+ List<DetlDto> detlDtos = new ArrayList<>();
+ param.getCartons().forEach(elem -> {
+
+ // 璁㈠崟鏄庣粏鏁伴噺鏍¢獙
+ OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), elem.getMatnr(), elem.getBatch(),elem.getCartonLabel());
+ if (elem.getAnfme() > orderDetl.getEnableQty()) {
+ throw new CoolException("response.inbound_qty_invalid");
+ }
+ // 淇敼璁㈠崟浣滀笟鏁伴噺
+ if (!orderDetlService.increaseWorkQty(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme(),elem.getCartonLabel())) {
+ throw new CoolException("response.update_doc_qty_failed");
+ }
+
+ DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(),elem.getCartonLabel());
+ if (DetlDto.has(detlDtos, detlDto)) {
+ DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch(), detlDto.getCartonLabel());
+ assert one != null;
+ one.setAreaId(param.getZoneId());
+ one.setAnfme(one.getAnfme() + detlDto.getAnfme());
+ } else {
+ detlDtos.add(detlDto);
+ }
+ });
+ for (DetlDto detlDto : detlDtos) {
+ Mat mat = matService.selectByMatnr(detlDto.getMatnr());
+ if (Cools.isEmpty(mat)) {
+ throw new CoolException("response.material_not_exist");
+ }
+ OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>()
+ .eq("order_no",order.getOrderNo())
+ .eq("matnr",mat.getMatnr())
+ .eq("barcode",detlDto.getCartonLabel()));
+ WaitPakin waitPakin = new WaitPakin();
+ waitPakin.sync(mat);
+ waitPakin.sync(orderDetl);
+ waitPakin.setOrderNo(order.getOrderNo()); // 鍗曟嵁缂栧彿
+ waitPakin.setBatch(detlDto.getBatch()); // 搴忓垪鐮�
+ waitPakin.setZpallet(param.getBarcode()); // 鎵樼洏鐮�
+ waitPakin.setAreaId(param.getZoneId()); //鍖哄煙
+ waitPakin.setIoStatus("N"); // 鍏ュ嚭鐘舵��
+ waitPakin.setAnfme(detlDto.getAnfme()); // 鏁伴噺
+ waitPakin.setStatus("Y"); // 鐘舵��
+ waitPakin.setAppeUser(userId);
+ waitPakin.setAppeTime(now);
+ waitPakin.setModiUser(userId);
+ waitPakin.setModiTime(now);
+ if (!waitPakinService.insert(waitPakin)) {
+ throw new CoolException("response.save_wait_pakin_failed");
+ }
+ }
+ orderService.updateSettle(order.getId(), 2L, userId);
+ }
+
+ }
+
+ @Override
+ public OrderDetl cartonScan(ScanParam scanParam , Long userId) {
+ String cartonLabel = scanParam.getCartonLabel();
+ if(cartonLabel == null){
+ throw new CoolException("Label can not be null");
+ }
+ List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("barcode",cartonLabel));
+ if(waitPakins.size() > 0){
+ throw new CoolException("Label has already been in system");
+ }
+ OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>().eq("barcode",cartonLabel));
+ if(orderDetl == null){
+ throw new CoolException("OrderDetl can not be found");
+ }
+ return orderDetl;
+ }
+
// 鍟嗗搧涓婃灦
@Override
public void onSale(CombParam param) {
--
Gitblit v1.9.1