From e44239cb6516389b4dd4a63747df7bc82681660b Mon Sep 17 00:00:00 2001
From: lsh <1>
Date: 星期四, 11 一月 2024 13:18:05 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java | 105 ++++++++++++++++++++++++++++------------------------
1 files changed, 56 insertions(+), 49 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
index 2d9de8d..d4a7590 100644
--- a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -63,6 +63,8 @@
private CommonService commonService;
@Autowired
private LocDetlRullUpDetailService locDetlRullUpDetailService;
+ @Autowired
+ private WrkDetlSingleService wrkDetlSingleService;
@Override
@Transactional
@@ -742,8 +744,8 @@
Date now = new Date();
- long rollUp = now.getTime();
for (PalletizingCompleteParam.MatList matList:param.getMatLists()){
+ long rollUp = new Date().getTime();
Mat mat = matService.selectByMatnr(matList.getMatnr());
if (Cools.isEmpty(mat)) {
throw new CoolException(matList.getMatnr() + "鍟嗗搧妗f涓嶅瓨鍦�");
@@ -770,6 +772,7 @@
locDetlRullUpDetail.setUuid(rollUp);
locDetlRullUpDetail.setRollNo(matDetlList.getBoxNoDetl());
locDetlRullUpDetail.setRollWeight(matDetlList.getWeightDetl().toString());
+ locDetlRullUpDetailService.insert(locDetlRullUpDetail);
}
}
if (!waitPakinService.insert(waitPakin)) {
@@ -805,20 +808,14 @@
public void singleUnstackingComplete(SingleUnstackingCompleteParam param) {
Long userId = 8888L;//妗佹灦涓婁綅杞欢
//鍒ゆ柇param鍙傛暟
- if (Cools.isEmpty(param.getBarcode())){
- throw new CoolException("鍙傛暟锛氭墭鐩樼爜 barcode涓虹┖");
- }else if (Cools.isEmpty(param.getPalletizingNo())){
+ if (Cools.isEmpty(param.getPalletizingNo())){
throw new CoolException("鍙傛暟锛氱爜鍨涗綅缂栧彿 palletizingNo涓虹┖");
}else if (Cools.isEmpty(param.getMatLists()) || param.getMatLists().size()==0){
throw new CoolException("鍙傛暟锛氱墿鏂欐槑缁� matLists涓虹┖");
}
- WrkMast wrkMastMatrix = wrkMastService.selectByBarcode(param.getBarcode());
- if (Cools.isEmpty(wrkMastMatrix)){
- throw new CoolException("鍙傛暟锛氭墭鐩樼爜鏌ヨ宸ヤ綔妗eけ璐ワ細"+param.getBarcode());
- }
- List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNoUnstacking(wrkMastMatrix.getWrkNo());
ArrayList<WrkDetl> wrkDetlsNew = new ArrayList<>();
+ ArrayList<WrkDetlSingle> wrkDetlsOld = new ArrayList<>();
//鍒ゆ柇matLists鍙傛暟
for (SingleUnstackingCompleteParam.MatList matList:param.getMatLists()){
if (Cools.isEmpty(matList.getPosition())){
@@ -826,12 +823,14 @@
}else if (Cools.isEmpty(matList.getBoxNo())){
throw new CoolException("鍙傛暟锛氭湪绠辩紪鍙� boxNo涓虹┖");
}
+ List<WrkDetlSingle> wrkDetlSingles = wrkDetlSingleService.selectList(new EntityWrapper<WrkDetlSingle>().eq("batch", matList.getBoxNo()));
boolean sign=true;
- for (WrkDetl wrkDetl:wrkDetls){
- if (wrkDetl.getBatch().equals(matList.getBoxNo())){//鏈ㄧ缂栫爜
- wrkDetl.setInspect(1);
- wrkDetlService.update(wrkDetl,new EntityWrapper<WrkDetl>().eq("batch",wrkDetl.getBatch()));
+ for (WrkDetlSingle wrkDetlSingle:wrkDetlSingles){
+ if (wrkDetlSingle.getBatch().equals(matList.getBoxNo())){//鏈ㄧ缂栫爜
+ WrkDetl wrkDetl = new WrkDetl();
+ wrkDetl.sync(wrkDetlSingle);
wrkDetlsNew.add(wrkDetl);
+ wrkDetlsOld.add(wrkDetlSingle);
sign=false;
break;
}
@@ -873,6 +872,13 @@
}
}
+ for (WrkDetlSingle wrkDetlSingle : wrkDetlsOld) {
+ wrkDetlSingleService.delete(new EntityWrapper<WrkDetlSingle>()
+ .eq("batch",wrkDetlSingle.getBatch())
+ .eq("wrk_no",wrkDetlSingle.getWrkNo())
+ .eq("io_time",wrkDetlSingle.getIoTime()));
+ }
+
}
/*
@@ -885,49 +891,50 @@
//鍒ゆ柇param鍙傛暟
if (Cools.isEmpty(param.getBarcode())){
throw new CoolException("鍙傛暟锛氭墭鐩樼爜 barcode涓虹┖");
- }else if (Cools.isEmpty(param.getPalletizingNo())){
- throw new CoolException("鍙傛暟锛氱爜鍨涗綅缂栧彿 palletizingNo涓虹┖");
}
+// else if (Cools.isEmpty(param.getPalletizingNo())){
+// throw new CoolException("鍙傛暟锛氱爜鍨涗綅缂栧彿 palletizingNo涓虹┖");
+// }
WrkMast wrkMastMatrix = wrkMastService.selectByBarcode(param.getBarcode());
if (Cools.isEmpty(wrkMastMatrix)){
throw new CoolException("鍙傛暟锛氭墭鐩樼爜鏌ヨ宸ヤ綔妗eけ璐ワ細"+param.getBarcode());
}else {
- if (!wrkMastMatrix.getIoType().equals(101)){
- List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNoUnstacking(wrkMastMatrix.getWrkNo());
- if (Cools.isEmpty(param.getMatLists()) || param.getMatLists().size()==0 || param.getMatLists().size()!=wrkDetls.size()){
- throw new CoolException("杩斿洖鐗╂枡鏄庣粏鏁颁负"+param.getMatLists().size()+",鎵樼洏鐮侊細"+param.getBarcode()+"搴斿墿浣欑墿鏂欐暟锛�"+wrkDetls.size());
- }
-
- ArrayList<String> orgin = new ArrayList<>();
- //鍒ゆ柇matLists鍙傛暟
- for (SingleMountUnstackingCompleteParam.MatList matList : param.getMatLists()){
- if (Cools.isEmpty(matList.getPosition())){
- throw new CoolException("鍙傛暟锛氱爜鍨涗綅缃� position涓虹┖");
- }else if (Cools.isEmpty(matList.getBoxNo())){
- throw new CoolException("鍙傛暟锛氭湪绠辩紪鍙� boxNo涓虹┖");
- }
- if (!orgin.contains(matList.getPosition())){
- orgin.add(matList.getPosition());
- }else {
- throw new CoolException("鍙傛暟锛氭湪绠辩紪鍙� boxNo:"+matList.getBoxNo()+",鏈ㄧ浣嶇疆瀛樺湪閲嶅");
- }
- boolean sign=true;
- for (WrkDetl wrkDetl:wrkDetls){
- if (wrkDetl.getBatch().equals(matList.getBoxNo())){//鏈ㄧ缂栫爜
- wrkDetl.setOrigin(matList.getPosition());
- wrkDetlService.update(wrkDetl,new EntityWrapper<WrkDetl>().eq("batch",wrkDetl.getBatch()));
- sign=false;
- break;
- }
- }
- if (sign){
- throw new CoolException("鍙傛暟锛氭湪绠辩紪鍙� boxNo:"+matList.getBoxNo()+"鏈煡璇㈠埌瀵瑰簲鐨勫伐浣滄槑缁嗭紒");
- }
- }
- }
+// if (wrkMastMatrix.getIoType().equals(103)){
+// List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNoUnstacking(wrkMastMatrix.getWrkNo());
+// if (Cools.isEmpty(param.getMatLists()) || param.getMatLists().size()==0 || param.getMatLists().size()!=wrkDetls.size()){
+// throw new CoolException("杩斿洖鐗╂枡鏄庣粏鏁颁负"+param.getMatLists().size()+",鎵樼洏鐮侊細"+param.getBarcode()+"搴斿墿浣欑墿鏂欐暟锛�"+wrkDetls.size());
+// }
+//
+// ArrayList<String> orgin = new ArrayList<>();
+// //鍒ゆ柇matLists鍙傛暟
+// for (SingleMountUnstackingCompleteParam.MatList matList : param.getMatLists()){
+// if (Cools.isEmpty(matList.getPosition())){
+// throw new CoolException("鍙傛暟锛氱爜鍨涗綅缃� position涓虹┖");
+// }else if (Cools.isEmpty(matList.getBoxNo())){
+// throw new CoolException("鍙傛暟锛氭湪绠辩紪鍙� boxNo涓虹┖");
+// }
+// if (!orgin.contains(matList.getPosition())){
+// orgin.add(matList.getPosition());
+// }else {
+// throw new CoolException("鍙傛暟锛氭湪绠辩紪鍙� boxNo:"+matList.getBoxNo()+",鏈ㄧ浣嶇疆瀛樺湪閲嶅");
+// }
+// boolean sign=true;
+// for (WrkDetl wrkDetl:wrkDetls){
+// if (wrkDetl.getBatch().equals(matList.getBoxNo())){//鏈ㄧ缂栫爜
+// wrkDetl.setOrigin(matList.getPosition());
+// wrkDetlService.update(wrkDetl,new EntityWrapper<WrkDetl>().eq("batch",wrkDetl.getBatch()));
+// sign=false;
+// break;
+// }
+// }
+// if (sign){
+// throw new CoolException("鍙傛暟锛氭湪绠辩紪鍙� boxNo:"+matList.getBoxNo()+"鏈煡璇㈠埌瀵瑰簲鐨勫伐浣滄槑缁嗭紒");
+// }
+// }
+// }
}
- wrkMastMatrix.setSheetNo("1");
+ wrkMastMatrix.setSheetNo("2");
if (!wrkMastService.updateById(wrkMastMatrix)){
throw new CoolException("鏇存柊宸ヤ綔妗eけ璐�==銆嬫鏋朵笂浣嶈蒋浠讹細鍗曟墭鎷嗗灈瀹屾垚閫氱煡");
}
--
Gitblit v1.9.1