From e72f4946b1696a570022d6ae715fa07656ab89f7 Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期三, 27 九月 2023 13:07:43 +0800
Subject: [PATCH] Merge branch 'tzskasrs' of http://47.97.1.152:5880/r/zy-asrs into tzskasrs
---
src/main/java/com/zy/common/web/WcsController.java | 46 ++++++++++++++++++++++++++--------------------
1 files changed, 26 insertions(+), 20 deletions(-)
diff --git a/src/main/java/com/zy/common/web/WcsController.java b/src/main/java/com/zy/common/web/WcsController.java
index 668c5b6..c14495a 100644
--- a/src/main/java/com/zy/common/web/WcsController.java
+++ b/src/main/java/com/zy/common/web/WcsController.java
@@ -18,6 +18,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@@ -60,7 +61,7 @@
return R.error("婧愮珯缂栧彿涓嶈兘涓虹┖");
}
List<WaitPakin> waitPakins = null;
- Mat mat = null;
+ ArrayList<Mat> mats = new ArrayList<>();
if (param.getIoType() == 1) {
if (Cools.isEmpty(param.getBarcode())) {
return R.error("鏉$爜涓嶈兘涓虹┖");
@@ -77,15 +78,20 @@
// }
waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()));
- if (Cools.isEmpty(waitPakins) || waitPakins.size()!=1) {
+ if (Cools.isEmpty(waitPakins)) {
WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode());
if (wrkMast != null && (wrkMast.getIoType() == 103 || wrkMast.getIoType() == 104 || wrkMast.getIoType() == 107)) {
return R.parse(CodeRes.PICK_600);
}
return R.parse(CodeRes.NO_COMB_700);
}
- mat = matService.selectByMatnr(waitPakins.get(0).getMatnr());
- mat.setWeight(waitPakins.get(0).getAnfme());
+
+ for (WaitPakin waitPakin : waitPakins) {
+ Mat mat = matService.selectByMatnr(waitPakin.getMatnr());
+ mat.setWeight(waitPakin.getAnfme());
+ mats.add(mat);
+ }
+
int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode()));
int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode()));
if (countLoc > 0 || countWrk > 0) {
@@ -103,8 +109,7 @@
StartupDto dto = null;
switch (param.getIoType()) {
case 1://婊℃墭鐩樺叆搴�
- assert mat != null;
- dto = startupFullPutStore(param.getSourceStaNo(), param.getBarcode(), locTypeDto, mat);
+ dto = startupFullPutStore(param.getSourceStaNo(), param.getBarcode(), locTypeDto, mats);
break;
case 10://绌烘墭鐩樺叆搴�
dto = emptyPlateIn(param.getSourceStaNo(), locTypeDto, null);
@@ -126,11 +131,10 @@
* 鍏ㄦ澘鍏ュ簱
*/
@Transactional
- public StartupDto startupFullPutStore(Integer devpNo, String barcode, LocTypeDto locTypeDto, Mat mat) {
+ public StartupDto startupFullPutStore(Integer devpNo, String barcode, LocTypeDto locTypeDto, List<Mat> mats) {
// 婧愮珯鐐圭姸鎬佹娴�
BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true);
// 妫�绱㈠簱浣�
- List<Mat> mats = Collections.singletonList(mat);
List<String> matnrList = mats.stream().map(Mat::getMatnr).distinct().collect(Collectors.toList());
StartupDto dto = commonService.getLocNo(1, 1, devpNo, matnrList, locTypeDto,0);
int workNo = dto.getWorkNo();
@@ -162,19 +166,21 @@
if (!res) {
throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐�");
}
- // 鐢熸垚宸ヤ綔妗f槑缁�
- WrkDetl wrkDetl = new WrkDetl();
- wrkDetl.sync(mat);
- wrkDetl.setAnfme(mat.getWeight());
- wrkDetl.setBatch(barcode);
-// wrkDetl.setAnfme(1.0D);
- wrkDetl.setWrkNo(wrkMast.getWrkNo());
- wrkDetl.setIoTime(wrkMast.getIoTime());
- wrkDetl.setAppeTime(now);
- wrkDetl.setModiTime(now);
- if (!wrkDetlService.insert(wrkDetl)) {
- throw new CoolException("淇濆瓨宸ヤ綔鏄庣粏澶辫触");
+ for (Mat mat : mats) {
+ // 鐢熸垚宸ヤ綔妗f槑缁�
+ WrkDetl wrkDetl = new WrkDetl();
+ wrkDetl.sync(mat);
+ wrkDetl.setAnfme(mat.getWeight());
+ wrkDetl.setZpallet(barcode);
+ wrkDetl.setWrkNo(wrkMast.getWrkNo());
+ wrkDetl.setIoTime(wrkMast.getIoTime());
+ wrkDetl.setAppeTime(now);
+ wrkDetl.setModiTime(now);
+ if (!wrkDetlService.insert(wrkDetl)) {
+ throw new CoolException("淇濆瓨宸ヤ綔鏄庣粏澶辫触");
+ }
}
+
// // 鏇存柊鍏ュ簱閫氱煡妗� ioStatus ===>> Y
// Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>()
// .eq("zpallet", barcode);
--
Gitblit v1.9.1