From f5e8c627a7082b142c8f4b0fe5bbc17c68680361 Mon Sep 17 00:00:00 2001
From: 野心家 <1051256694@qq.com>
Date: 星期一, 28 八月 2023 15:50:52 +0800
Subject: [PATCH] 消防报警移库改出库
---
src/main/java/com/zy/common/web/WcsController.java | 99 +++++++++++++++++++++++++++++++------------------
1 files changed, 63 insertions(+), 36 deletions(-)
diff --git a/src/main/java/com/zy/common/web/WcsController.java b/src/main/java/com/zy/common/web/WcsController.java
index 41456b6..55d8621 100644
--- a/src/main/java/com/zy/common/web/WcsController.java
+++ b/src/main/java/com/zy/common/web/WcsController.java
@@ -79,6 +79,15 @@
.eq("user_id",param.getBarcode())//鏌ユ墭鐩樼爜
.eq("status",4)); //瀹屾垚娴嬭瘯
logs=false;
+ }else{
+ LocDetl locDetl=locDetlService.selectOne(new EntityWrapper<LocDetl>()
+ .eq("matnr",param.getPackNo())
+ .or()
+ .eq("zpallet",param.getBarcode()));
+ if(!Cools.isEmpty(locDetl)){
+ return R.error("PACK鐮佸湪搴擄紒锛侊紒锛�");
+ }
+
}
Date now = new Date();
if (true){
@@ -166,7 +175,7 @@
}
/**
- * 鍏ㄦ澘鍏ュ簱
+ * 鍏ㄦ澘鍏ュ簱
*/
@Transactional
public StartupDto startupFullPutStore(Integer devpNo, String barcode, LocTypeDto locTypeDto, List<WaitPakin> waitPakins) {
@@ -206,7 +215,7 @@
LocMast locMast = locMastService.selectById(dto.getLocNo());
// 鐢熸垚宸ヤ綔妗f槑缁�
- waitPakins.forEach(waitPakin -> {
+ for (WaitPakin waitPakin: waitPakins) {
WrkDetl wrkDetl = new WrkDetl();
wrkDetl.sync(waitPakin);
wrkDetl.setWrkNo(wrkMast.getWrkNo());
@@ -217,31 +226,49 @@
if (!wrkDetlService.insert(wrkDetl)) {
throw new CoolException("淇濆瓨宸ヤ綔鏄庣粏澶辫触");
}
- TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>()
- .eq("barcode", wrkDetl.getMatnr()));//pack鐮�
- if (Cools.isEmpty(testMast)){
- //鐢熸垚娴嬭瘯妗�
- testMast=new TestMast();
- testMast.setChannel(locMast.getChannel());
- testMast.setUserId(wrkMast.getBarcode());//鎵樼洏鐮�
- testMast.setStatus(1);
- testMast.setBarcode(wrkDetl.getMatnr());
- testMast.setLocNo(locMast.getLocNo());
- testMast.setModiTime(now);
- testMast.setAppeTime(now);
- if (!testMastService.insert(testMast)){
- throw new CoolException(wrkDetl.getMatnr()+"鐢熸垚娴嬭瘯妗eけ璐�");
+
+ TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>()
+ .eq("barcode", wrkDetl.getMatnr()));//pack鐮�
+ if (Cools.isEmpty(testMast)){
+ //鐢熸垚娴嬭瘯妗�
+ testMast=new TestMast();
+ //鍏ュ緟娴嬪簱浣嶉�氶亾璁句负0
+ if(locMast.getChannel()==null) {
+ testMast.setChannel(0);//閫氶亾璁句负0
+ }else{
+ testMast.setChannel(locMast.getChannel());
+ }
+ testMast.setUserId(wrkMast.getBarcode());//鎵樼洏鐮�
+ testMast.setStatus(1);
+ testMast.setBarcode(wrkDetl.getMatnr());
+ testMast.setLocNo(locMast.getLocNo());
+ testMast.setModiTime(now);
+ testMast.setAppeTime(now);
+ if (!testMastService.insert(testMast)){
+ throw new CoolException(wrkDetl.getMatnr()+"鐢熸垚娴嬭瘯妗eけ璐�");
+ }
+ }else if(wrkMast.getStaNo()==209){
+ testMast.setBarcode(wrkDetl.getMatnr());
+ testMast.setLocNo(locMast.getLocNo());
+ testMast.setUserId(wrkMast.getBarcode());//鎵樼洏鐮�
+ testMast.setAppeTime(now);
+ if(!testMastService.update(testMast,new EntityWrapper<TestMast>().eq("barcode", wrkDetl.getMatnr()))){
+ throw new CoolException(wrkDetl.getMatnr()+"鏇存柊娴嬭瘯妗eけ璐�");
+ }
+ }else {
+ testMast.setBarcode(wrkDetl.getMatnr());
+ testMast.setChannel(locMast.getChannel());
+ testMast.setLocNo(locMast.getLocNo());
+ testMast.setStatus(1);
+ testMast.setUserId(wrkMast.getBarcode());//鎵樼洏鐮�
+ testMast.setAppeTime(now);
+ if(!testMastService.update(testMast,new EntityWrapper<TestMast>().eq("barcode", wrkDetl.getMatnr()))){
+ throw new CoolException(wrkDetl.getMatnr()+"鏇存柊娴嬭瘯妗eけ璐�");
+ }
}
- }else {
- testMast.setBarcode(wrkDetl.getMatnr());
- testMast.setChannel(locMast.getChannel());
- testMast.setLocNo(locMast.getLocNo());
- testMast.setAppeTime(now);
- if(!testMastService.update(testMast,new EntityWrapper<TestMast>().eq("barcode", wrkDetl.getMatnr()))){
- throw new CoolException(wrkDetl.getMatnr()+"鏇存柊娴嬭瘯妗eけ璐�");
- }
- }
- });
+
+
+ }
// 鏇存柊鍏ュ簱閫氱煡妗� ioStatus ===>> Y
Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>()
.eq("zpallet", barcode);
@@ -265,16 +292,16 @@
if (!locMastService.updateById(locMast)){
throw new CoolException("鏀瑰彉搴撲綅鐘舵�佸け璐�");
}else{
- if (locMast.getRow1()<3){
- //1.鎵爜涓婃姤
- CombParam combParam = new CombParam();
- combParam.setPackNo(wrkMast.getBarcode());
- combParam.setLocNo(wrkMast.getLocNo());
- combParam.setPackSts(0);
- combParam.setStepSts(1);
- combParam.setRequestTime(DateUtils.convert(now));
- new PostMesDataUtils().postMesData("MES绯荤粺",mesUrl,inpath,combParam);
- }
+// if (locMast.getRow1()<3){
+// //1.鎵爜涓婃姤
+// CombParam combParam = new CombParam();
+// combParam.setPackNo(wrkMast.getBarcode());
+// combParam.setLocNo(wrkMast.getLocNo());
+// combParam.setPackSts(0);
+// combParam.setStepSts(1);
+// combParam.setRequestTime(DateUtils.convert(now));
+// new PostMesDataUtils().postMesData("MES绯荤粺",mesUrl,inpath,combParam);
+// }
}
} else {
throw new CoolException(dto.getLocNo()+"鐩爣搴撲綅宸茶鍗犵敤");
--
Gitblit v1.9.1