From b4ffbe0d45e17bd4a4f79c6201e92cc9d3091cb8 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期五, 17 十一月 2023 10:10:13 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java | 70 +++++++++++++++++++++++++++++-----
1 files changed, 59 insertions(+), 11 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
index 998769d..6d43269 100644
--- a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -125,7 +125,7 @@
// 鐢熸垚宸ヤ綔妗f槑缁�
List<MatCodeCountDto> matDtos = new ArrayList<>();
param.getList().forEach(elem -> {
- matDtos.add(new MatCodeCountDto(elem.getMatNo(), elem.getSupplier(), elem.getCount(),elem.getMemo()));
+ matDtos.add(new MatCodeCountDto(elem.getMatNo(), elem.getSupplier(), elem.getCount(),elem.getMemo(),elem.getSource(),elem.getVendor()));
});
wrkDetlService.createWorkDetail(workNo, matDtos, param.getBarcode(), userId);
// 鏇存柊婧愮珯鐐逛俊鎭�
@@ -264,6 +264,10 @@
}
// 鐢熸垚宸ヤ綔妗f槑缁�
for (LocDetlDto detlDto : dto.getLocDetlDtos()) {
+ MatCode matCode = matCodeService.selectById(detlDto.getLocDetl().getMatNo());
+ if(Cools.isEmpty(matCode)){
+ throw new CoolException("浜у搧缂栫爜鍦ㄥ熀纭�鏁版嵁涓笉瀛樺湪锛岃纭");
+ }
// 鍑哄簱鏃讹紝鏁伴噺涓�0鐨勭洿鎺ュ拷鐣�
if (detlDto.getCount()==null || detlDto.getCount() <= 0.0D) {continue;}
WrkDetl wrkDetl = new WrkDetl();
@@ -277,6 +281,16 @@
wrkDetl.setModiTime(new Date());
wrkDetl.setModiUser(userId);
wrkDetl.setMemo(detlDto.getLocDetl().getMemo());
+ wrkDetl.setQtyBox(matCode.getStr6()!=null ? matCode.getStr6() : 0);
+ wrkDetl.setWeight(matCode.getWeight()!=null ? matCode.getWeight() : 0);
+ wrkDetl.setAllWeight(matCode.getWeight()!=null ? qty*matCode.getWeight()+30 : 0);
+ wrkDetl.setAllQty(matCode.getStr6()!=null ? qty*matCode.getStr6() : 0);
+ wrkDetl.setVendor(detlDto.getLocDetl().getVendor());
+ wrkDetl.setSource(detlDto.getLocDetl().getSource());
+ wrkDetl.setSupplier(detlDto.getLocDetl().getSupplier());
+ wrkDetl.setStr5(matCode.getStr5());
+ wrkDetl.setStr4(matCode.getStr4());
+ wrkDetl.setStr3(matCode.getStr3());
if (!wrkDetlService.insert(wrkDetl)) {
throw new CoolException("淇濆瓨宸ヤ綔妗f槑缁嗗け璐�");
}
@@ -409,6 +423,15 @@
// 鑾峰彇宸ヤ綔鍙�
int workNo = commonService.getWorkNo(1);
+ //2022-06-16 ADD, 鍑哄簱搴撲綅濡傛灉鏄繁搴撲綅1鍙疯揣鏋讹紝涓斿搴旀祬搴撲綅涔熶负D鏃讹紝鍏堝嚭娴呭簱浣�
+ if(Utils.isDeepLoc(slaveProperties, locNo)){
+ String shallow = Utils.getShallowLoc(slaveProperties,locNo);
+ LocMast shallowLoc = locMastService.selectById(shallow);
+ if(!Cools.isEmpty(shallowLoc) && shallowLoc.getLocSts().equals("D")){
+ locNo = shallowLoc.getLocNo();
+ }
+ }
+
// 鑾峰彇搴撲綅
LocMast locMast = locMastService.selectById(locNo);
if (Cools.isEmpty(locMast)) {
@@ -491,6 +514,7 @@
LocDetl sqlParam = new LocDetl();
sqlParam.setLocNo(paramLocDetl.getLocNo());
sqlParam.setMatNo(paramLocDetl.getMatNo());
+ sqlParam.setSupplier(paramLocDetl.getSupplier());
LocDetl one = locDetlService.selectOne(new EntityWrapper<>(sqlParam));
if (null != one) locDetlDtos.add(new LocDetlDto(one, one.getQty()));
}
@@ -532,10 +556,11 @@
}
}
+ Date now = new Date();
// 淇濆瓨宸ヤ綔妗�
WrkMast wrkMast = new WrkMast();
wrkMast.setWrkNo(workNo);
- wrkMast.setIoTime(new Date());
+ wrkMast.setIoTime(now);
wrkMast.setWrkSts(11L); // 宸ヤ綔鐘舵�侊細11.鐢熸垚鍑哄簱ID
wrkMast.setIoType(11); // 鍏ュ嚭搴撶姸鎬侊細 11.搴撴牸绉昏浇
wrkMast.setIoPri(10D);
@@ -549,9 +574,9 @@
wrkMast.setBarcode(sourceLoc.getBarcode()); // 鎵樼洏鐮�
wrkMast.setLinkMis("N");
wrkMast.setAppeUser(userId);
- wrkMast.setAppeTime(new Date());
+ wrkMast.setAppeTime(now);
wrkMast.setModiUser(userId);
- wrkMast.setModiTime(new Date());
+ wrkMast.setModiTime(now);
boolean res = wrkMastService.insert(wrkMast);
if (!res) {
throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐�");
@@ -561,12 +586,12 @@
for (LocDetl locDetl : locDetls) {
WrkDetl wrkDetl = new WrkDetl();
wrkDetl.setWrkNo(workNo);
- wrkDetl.setIoTime(new Date());
+ wrkDetl.setIoTime(now);
wrkDetl.setQty(locDetl.getQty());
VersionUtils.setWrkDetl(wrkDetl, locDetl); // 鐗堟湰鎺у埗
- wrkDetl.setAppeTime(new Date());
+ wrkDetl.setAppeTime(now);
wrkDetl.setAppeUser(userId);
- wrkDetl.setModiTime(new Date());
+ wrkDetl.setModiTime(now);
wrkDetl.setModiUser(userId);
if (!wrkDetlService.insert(wrkDetl)) {
throw new CoolException("淇濆瓨宸ヤ綔妗f槑缁嗗け璐�");
@@ -576,7 +601,7 @@
if (sourceLoc.getLocSts().equals("D") || sourceLoc.getLocSts().equals("F")) {
sourceLoc.setLocSts("R"); // R.鍑哄簱棰勭害
sourceLoc.setModiUser(userId);
- sourceLoc.setModiTime(new Date());
+ sourceLoc.setModiTime(now);
if (!locMastService.updateById(sourceLoc)){
throw new CoolException("鏇存柊婧愬簱浣嶇姸鎬佸け璐�");
}
@@ -586,7 +611,7 @@
// 淇敼鐩爣搴撲綅鐘舵��
if (loc.getLocSts().equals("O")) {
loc.setLocSts("S"); // S.鍏ュ簱棰勭害
- loc.setModiTime(new Date());
+ loc.setModiTime(now);
loc.setModiUser(userId);
if (!locMastService.updateById(loc)) {
throw new CoolException("鏇存柊鐩爣搴撲綅鐘舵�佸け璐�");
@@ -678,6 +703,15 @@
locDetl.setAppeUser(userId);
locDetl.setAppeTime(new Date());
locDetl.setZpallet(param.getZpallet());//鎵樼洏鍙�
+ locDetl.setVendor(adjust.getVendor());
+ locDetl.setSource(adjust.getSource());
+ locDetl.setSupplier(adjust.getSupplier());
+ locDetl.setQtyBox(matCode.getStr6());
+ locDetl.setAllQty(matCode.getStr6()*adjust.getCount());
+ locDetl.setAllWeight(matCode.getWeight()*adjust.getCount()+30);
+ locDetl.setStr3(matCode.getStr3());
+ locDetl.setStr4(matCode.getStr4());
+ locDetl.setStr5(matCode.getStr5());
if (!locDetlService.insert(locDetl)) {
throw new CoolException("淇濆瓨搴撳瓨鏄庣粏澶辫触");
}
@@ -698,11 +732,21 @@
throw new CoolException("娓呴櫎搴撳瓨鏄庣粏澶辫触");
}
} else {
+ MatCode matCode = matCodeService.selectById(adjust.getMatNo());
LocDetl sqlParam1 = new LocDetl();
sqlParam1.setQty(adjust.getCount());
sqlParam1.setSupplier(adjust.getSupplier());
sqlParam1.setModiTime(new Date());
sqlParam1.setModiUser(userId);
+ sqlParam1.setVendor(adjust.getVendor());
+ sqlParam1.setSource(adjust.getSource());
+ sqlParam1.setSupplier(adjust.getSupplier());
+ sqlParam1.setQtyBox(matCode.getStr6());
+ sqlParam1.setAllQty(matCode.getStr6()*adjust.getCount());
+ sqlParam1.setAllWeight(matCode.getWeight()*adjust.getCount()+30);
+ sqlParam1.setStr5(matCode.getStr5());
+ sqlParam1.setStr4(matCode.getStr4());
+ sqlParam1.setStr3(matCode.getStr3());
if (!locDetlService.update(sqlParam1, new EntityWrapper<LocDetl>()
.eq("loc_no", locMast.getLocNo())
.eq("mat_no", adjust.getMatNo())
@@ -771,7 +815,11 @@
locSts = "D";
// 搴撲綅杞Щ ===>> D.绌烘《/绌烘爤鏉�
} else if (wrkMast.getIoType() == 11) {
- locSts = "F";
+ if(wrkMast.getEmptyMk().equals("Y")){
+ locSts = "D";
+ }else {
+ locSts = "F";
+ }
// 搴撲綅杞Щ锛氱洰鏍囧簱浣�
LocMast locMast = locMastService.selectById(wrkMast.getLocNo());
if (Cools.isEmpty(locMast)) {
@@ -801,7 +849,7 @@
if (wrkMast.getIoType() != 10 && wrkMast.getIoType() != 110) {
// 淇濆瓨宸ヤ綔鏄庣粏妗e巻鍙叉。
- if (!wrkDetlLogService.save(wrkMast.getWrkNo())) {
+ if (!wrkMast.getEmptyMk().equals("Y") && !wrkDetlLogService.save(wrkMast.getWrkNo())) {
throw new CoolException("淇濆瓨宸ヤ綔鏄庣粏鍘嗗彶妗eけ璐�, workNo = " + wrkMast.getWrkNo());
}
// 鍒犻櫎宸ヤ綔妗f槑缁�
--
Gitblit v1.9.1