From 979f2505861b77b8702604739486b62f1e339e76 Mon Sep 17 00:00:00 2001 From: dubin <bindu_bean@163.com> Date: 星期二, 07 十月 2025 08:44:11 +0800 Subject: [PATCH] 联调 --- src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 94 +++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 82 insertions(+), 12 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 59f0af9..af100de 100644 --- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java @@ -134,14 +134,19 @@ //鏍¢獙褰撳墠鐗╂枡涓庢墭鐩樼粦瀹氫俊鎭槸鍚︽纭� MatBarcode matBarcode = new MatBarcode(); MatBarcode mb = matBarcodeService.selectbyMatnr(detlDto.getMatnr()); - if (mb != null && !mb.getZpallet().equals(param.getBarcode())) { - throw new CoolException(detlDto.getMatnr() + "璇ョ墿鏂欎笌鍏朵粬鎵樼洏缁戝畾锛岃鍏堣В缁�"); - } else { + if (mb != null){ + if (!mb.getZpallet().equals(param.getBarcode())){ + throw new CoolException(detlDto.getMatnr() + "璇ョ墿鏂欎笌鍏朵粬鎵樼洏缁戝畾锛岃鍏堣В缁�"); + } + }else { matBarcode.setZpallet(param.getBarcode());//鎵樼洏鐮� matBarcode.setMatnr(mat.getMatnr());//鐗╂枡鍙� matBarcode.setMaktx(mat.getMaktx());//鐗╂枡鍚嶇О matBarcode.setSpecs(mat.getSpecs());//瑙勬牸 matBarcode.setModel(mat.getModel());//鍨嬪彿 + if (!matBarcodeService.insert(matBarcode)) { + throw new CoolException("鐗╂枡涓庢墭鐩樼粦瀹氬け璐�"); + } } WaitPakin waitPakin = new WaitPakin(); waitPakin.sync(mat); @@ -160,9 +165,6 @@ waitPakin.setMemo(detlDto.getMemo()); if (!waitPakinService.insert(waitPakin)) { throw new CoolException("淇濆瓨鍏ュ簱閫氱煡妗eけ璐�"); - } - if (!matBarcodeService.insert(matBarcode)) { - throw new CoolException("鐗╂枡涓庢墭鐩樼粦瀹氬け璐�"); } } // 鍏宠仈缁勬墭 @@ -194,14 +196,19 @@ //鏍¢獙褰撳墠鐗╂枡涓庢墭鐩樼粦瀹氫俊鎭槸鍚︽纭� MatBarcode matBarcode = new MatBarcode(); MatBarcode mb = matBarcodeService.selectbyMatnr(orderDetl.getMatnr()); - if (mb != null && !mb.getZpallet().equals(param.getBarcode())) { - throw new CoolException(orderDetl.getMatnr() + "璇ョ墿鏂欎笌鍏朵粬鎵樼洏缁戝畾锛岃鍏堣В缁�"); - } else { + if (mb != null){ + if (!mb.getZpallet().equals(param.getBarcode())){ + throw new CoolException(orderDetl.getMatnr() + "璇ョ墿鏂欎笌鍏朵粬鎵樼洏缁戝畾锛岃鍏堣В缁�"); + } + }else { matBarcode.setZpallet(param.getBarcode());//鎵樼洏鐮� matBarcode.setMatnr(mat.getMatnr());//鐗╂枡鍙� matBarcode.setMaktx(mat.getMaktx());//鐗╂枡鍚嶇О matBarcode.setSpecs(mat.getSpecs());//瑙勬牸 matBarcode.setModel(mat.getModel());//鍨嬪彿 + if (!matBarcodeService.insert(matBarcode)) { + throw new CoolException("鐗╂枡涓庢墭鐩樼粦瀹氬け璐�"); + } } WaitPakin waitPakin = new WaitPakin(); waitPakin.sync(mat); @@ -224,9 +231,6 @@ waitPakin.setPacking(orderDetl.getPacking()); if (!waitPakinService.insert(waitPakin)) { throw new CoolException("淇濆瓨鍏ュ簱閫氱煡妗eけ璐�"); - } - if (!matBarcodeService.insert(matBarcode)) { - throw new CoolException("鐗╂枡涓庢墭鐩樼粦瀹氬け璐�"); } }); @@ -726,4 +730,70 @@ } log.info(recordRecordLog); } + + @Override + public void combToWms(WaitPakin waitPakin) { + // 鍒ゆ柇鏄惁鏈夌浉鍚屾潯鐮佺殑鏁版嵁 +// if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). +// eq("zpallet", waitPakin.getBarcode()).eq("io_status", "N")) > 0) { +// throw new CoolException(waitPakin.getBarcode() + "鏁版嵁姝e湪杩涜鍏ュ簱"); +// } + + if (waitPakin.getBarcode().length() != 8) { + throw new CoolException("鏉$爜闀垮害涓嶆槸8浣�===>>" + waitPakin.getBarcode()); + } + int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", waitPakin.getBarcode())); + int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", waitPakin.getBarcode())); + int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", waitPakin.getBarcode())); + if (countLoc > 0 || countWrk > 0) { + throw new CoolException("缁勬墭妗�/宸ヤ綔妗�/搴撳瓨鏉$爜鏁版嵁宸插瓨鍦�===>>" + waitPakin.getBarcode()); + } + + Date now = new Date(); + // 鐢熸垚鍏ュ簱閫氱煡妗� + List<DetlDto> detlDtos = new ArrayList<>(); + Mat byId = matService.selectById(waitPakin.getModiUser()); + DetlDto detlDto = new DetlDto(byId.getMatnr(), waitPakin.getBatch(), waitPakin.getAnfme(), waitPakin.getProType(), waitPakin.getTemp2(), waitPakin.getOutOrderNo()); + detlDto.setMemo(detlDto.getMemo()); + if (DetlDto.has(detlDtos, detlDto)) { + DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); + assert one != null; + one.setAnfme(one.getAnfme() + detlDto.getAnfme()); + } else { + detlDtos.add(detlDto); + } + + + for (DetlDto dto : detlDtos) { + Mat mat = matService.selectByMatnr(dto.getMatnr()); + if (Cools.isEmpty(mat)) { + throw new CoolException(dto.getMatnr() + "鍟嗗搧妗f涓嶅瓨鍦�"); + } + //鏍¢獙褰撳墠鐗╂枡涓庢墭鐩樼粦瀹氫俊鎭槸鍚︽纭� + MatBarcode mb = matBarcodeService.selectbyMatnr(dto.getMatnr()); + if (mb != null){ + if (!mb.getZpallet().equals(waitPakin.getBarcode())){ + throw new CoolException(detlDto.getMatnr() + "璇ョ墿鏂欎笌鍏朵粬鎵樼洏缁戝畾锛岃鍏堣В缁�"); + } + } + WaitPakin waitPakin1 = new WaitPakin(); + waitPakin1.sync(mat); + waitPakin1.setProType(dto.getProType()); + waitPakin1.setTemp2(dto.getTemp2()); + waitPakin1.setOutOrderNo(dto.getOutOrderNo()); + waitPakin1.setBatch(dto.getBatch()); + waitPakin1.setZpallet(waitPakin.getBarcode()); // 鎵樼洏鐮� + waitPakin1.setIoStatus("N"); // 鍏ュ嚭鐘舵�� + waitPakin1.setAnfme(dto.getAnfme()); // 鏁伴噺 + waitPakin1.setStatus("Y"); // 鐘舵�� + waitPakin1.setAppeUser(waitPakin.getAppeUser()); + waitPakin1.setAppeTime(now); + waitPakin1.setModiUser(waitPakin.getAppeUser()); + waitPakin1.setModiTime(now); + waitPakin1.setMemo(detlDto.getMemo()); + if (!waitPakinService.insert(waitPakin1)) { + throw new CoolException("淇濆瓨鍏ュ簱閫氱煡妗eけ璐�"); + } + } + } } -- Gitblit v1.9.1