From 10d7b3239e4baec952b9ee8a3e948399916d336c Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期一, 20 十月 2025 08:23:58 +0800
Subject: [PATCH] 13
---
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java | 154 +++++++++++++++++++++++++-------------------------
1 files changed, 77 insertions(+), 77 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 237d191..54693d4 100644
--- a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -80,8 +80,6 @@
private SlaveProperties slaveProperties;
@Autowired
private WaitPakinService waitPakinService;
- @Autowired
- private InventoryCheckOrderDetlService inventoryCheckOrderDetlService;
@Override
@Transactional
@@ -174,7 +172,7 @@
List<LocDetlDto> locDetlDtos = new ArrayList<>();
for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) {
if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) {
- LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch());
+ LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getSku());
if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount()));
}
}
@@ -184,8 +182,12 @@
if (staNo.getDevNo() == 1135 && locMast.getLocType1() == 2) {
throw new CoolException("鎵�閫夊簱浣嶄笉鏄綆搴撲綅鏃犳硶璋冩嫧锛屽簱浣嶅彿锛歿}" + locMast.getLocNo());
}
- // 鍚姩鍑哄簱寮�濮� 101.鍑哄簱
- stockOut(staNo, locDetlDtos, null, userId);
+ if(staNo.getDevNo()>=1100){
+ // 鍚姩鍑哄簱寮�濮� 101.鍑哄簱
+ stockOut(staNo, locDetlDtos, null, userId);
+ }else {
+ stockOutSXK(staNo, locDetlDtos, null, userId);
+ }
} else {
throw new CoolException("鎵�閫夊簱浣嶅瓨鍦ㄧ姸鎬佷笉涓篎銆丏鐨勫簱浣嶏紝搴撲綅鍙凤細" + locMast.getLocNo() + " 銆佸綋鍓嶇姸鎬侊細" + locMast.getLocSts() + "-" + locMast.getLocSts$());
}
@@ -382,19 +384,7 @@
// 鐢熸垚宸ヤ綔妗f槑缁�
for (LocDetlDto detlDto : dto.getLocDetlDtos()) {
- InventoryCheckOrderDetl inventoryCheckOrderDetl = new InventoryCheckOrderDetl();
- inventoryCheckOrderDetl.setOrderNo(param.getOrderNo());
- inventoryCheckOrderDetl.setMatnr(detlDto.getLocDetl().getMatnr());
- inventoryCheckOrderDetl.setMaktx(detlDto.getLocDetl().getMaktx());
- inventoryCheckOrderDetl.setBatch(detlDto.getLocDetl().getBatch());
- inventoryCheckOrderDetl.setLocNo(detlDto.getLocDetl().getLocNo());
- inventoryCheckOrderDetl.setArea(detlDto.getLocDetl().getOrigin());
- inventoryCheckOrderDetl.setAnfme(detlDto.getLocDetl().getAnfme());
- inventoryCheckOrderDetl.setIoTime(now);
- inventoryCheckOrderDetl.setStatus("1");
- if (!inventoryCheckOrderDetlService.insert(inventoryCheckOrderDetl)) {
- throw new CoolException("淇濆瓨鐩樼偣鏄庣粏澶辫触");
- }
+
if (detlDto.getCount() == null || detlDto.getCount() <= 0.0D) {
continue;
@@ -501,7 +491,7 @@
throw new CoolException("淇濆瓨宸ヤ綔妗f槑缁嗗け璐�");
}
// 淇敼璁㈠崟鏄庣粏
- if (!orderDetlService.increaseWorkQty(orderDetl.getOrderId(), orderDetl.getMatnr(), orderDetl.getBatch(), locDto.getAnfme())) {
+ if (!orderDetlService.increaseWorkQtyById(orderDetl.getId(), locDto.getAnfme())) {
throw new CoolException("淇敼璁㈠崟鏄庣粏鏁伴噺澶辫触");
}
orderService.updateSettle(orderDetl.getOrderId(), 2L, userId);
@@ -534,30 +524,26 @@
LocMast locMast = locMastService.selectById(taskDto.getLocNo());
List<LocMast> locMasts = new ArrayList<>();
- if ((locMast.getBay1() >= 1 && locMast.getBay1() <= 2) || (locMast.getBay1() >= 6 && locMast.getBay1() <= 7 && locMast.getRow1() != 36 && locMast.getRow1() != 29) || (locMast.getBay1() >= 11 && locMast.getBay1() <= 12)) {
+ if ((locMast.getBay1() >= 3 && locMast.getBay1() <= 6) ) {
locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
- .eq("gro1", locMast.getGro1())
- .eq("crn_no", 7)
- .eq("loc_type1", locMast.getLocType1())
- .orderBy("bay1", false));
- } else {
- locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
- .eq("gro1", locMast.getGro1())
+ .eq("row1", locMast.getBay1())
+ .in("bay1", 3,4,5,6)
.eq("crn_no", 7)
.eq("loc_type1", locMast.getLocType1())
.orderBy("bay1", true));
- }
- for (LocMast locMast1 : locMasts) {
- if (locMast1.getLocNo().equals(taskDto.getLocNo())) {
- break;
- }
- if (locMast1.getLocSts().equals("X")) {
- throw new CoolException(taskDto.getLocNo() + "搴撲綅鍓嶆柟鏈夐攣瀹氬簱浣嶏紝绂佹鍑哄簱");
- }
- if (locMast1.getLocSts().equals("F")) {
- moveLocForDeepLoc(locMast1);
+ for (LocMast locMast1 : locMasts) {
+ if (locMast1.getLocNo().equals(taskDto.getLocNo())) {
+ break;
+ }
+ if (locMast1.getLocSts().equals("X")) {
+ throw new CoolException(taskDto.getLocNo() + "搴撲綅鍓嶆柟鏈夐攣瀹氬簱浣嶏紝绂佹鍑哄簱");
+ }
+ if (locMast1.getLocSts().equals("F")) {
+ locMast = locMast1;
+ }
}
}
+
// 鑾峰彇璺緞
int ioType = taskDto.isAll() ? 101 : 103;
@@ -912,7 +898,7 @@
List<LocDetlDto> locDetlDtos = new ArrayList<>();
for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) {
if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) {
- LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch());
+ LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getSku());
if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount()));
}
}
@@ -940,7 +926,7 @@
List<LocDetlDto> locDetlDtos = new ArrayList<>();
for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) {
if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) {
- LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch());
+ LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getSku());
if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount()));
}
}
@@ -1058,19 +1044,7 @@
// 鐢熸垚宸ヤ綔妗f槑缁�
for (LocDetlDto detlDto : dto.getLocDetlDtos()) {
- InventoryCheckOrderDetl inventoryCheckOrderDetl = new InventoryCheckOrderDetl();
- inventoryCheckOrderDetl.setOrderNo(param.getOrderNo());
- inventoryCheckOrderDetl.setMatnr(detlDto.getLocDetl().getMatnr());
- inventoryCheckOrderDetl.setMaktx(detlDto.getLocDetl().getMaktx());
- inventoryCheckOrderDetl.setBatch(detlDto.getLocDetl().getBatch());
- inventoryCheckOrderDetl.setLocNo(detlDto.getLocDetl().getLocNo());
- inventoryCheckOrderDetl.setArea(detlDto.getLocDetl().getOrigin());
- inventoryCheckOrderDetl.setAnfme(detlDto.getLocDetl().getAnfme());
- inventoryCheckOrderDetl.setIoTime(now);
- inventoryCheckOrderDetl.setStatus("1");
- if (!inventoryCheckOrderDetlService.insert(inventoryCheckOrderDetl)) {
- throw new CoolException("淇濆瓨鐩樼偣鏄庣粏澶辫触");
- }
+
if (detlDto.getCount() == null || detlDto.getCount() <= 0.0D) {
continue;
@@ -1196,7 +1170,7 @@
if (Cools.isEmpty(wrkMast)) {
throw new CoolException(workNo + "宸ヤ綔妗d笉瀛樺湪");
}
- if (wrkMast.getWrkSts() == 4 || wrkMast.getWrkSts() == 14) {
+ if (wrkMast.getWrkSts() == 4 || wrkMast.getWrkSts() == 5||wrkMast.getWrkSts() == 14 || wrkMast.getWrkSts() == 15) {
throw new CoolException("褰撳墠宸ヤ綔妗e凡瀹屾垚");
}
// 鍏ュ簱 + 搴撲綅杞Щ
@@ -1226,7 +1200,7 @@
if (Cools.isEmpty(locMast)) {
throw new CoolException("搴撲綅涓嶅瓨鍦�");
}
- if (!(locMast.getLocSts().equals("F") || locMast.getLocSts().equals("D") || locMast.getLocSts().equals("O"))) {
+ if (!(locMast.getLocSts().equals("P") ||locMast.getLocSts().equals("F") || locMast.getLocSts().equals("D") || locMast.getLocSts().equals("O"))) {
throw new CoolException("褰撳墠搴撲綅涓嶅彲璋冩暣锛佸簱浣嶇姸鎬侊細" + locMast.getLocSts$());
}
@@ -1250,7 +1224,7 @@
if (!locDetl.getAnfme().equals(adjust.getCount())) {
// todo 鐩樼偣璁板綍
// 淇敼搴撳瓨
- if (!locDetlService.updateAnfme(adjust.getCount(), locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch())) {
+ if (!locDetlService.updateAnfme(adjust.getCount(), locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getSku())) {
throw new CoolException(locDetl.getLocNo() + "搴撲綅锛�" + locDetl.getMatnr() + "鍟嗗搧锛�" + locDetl.getBatch() + "鎵瑰彿淇敼鏁伴噺澶辫触");
}
// 淇濆瓨璋冩暣璁板綍
@@ -1300,7 +1274,8 @@
Mat mat = matService.selectByMatnr(adjust.getMatnr());
LocDetl locDetl = new LocDetl();
locDetl.sync(mat);
- locDetl.setBatch(adjust.getBatch());
+ locDetl.setDanger(adjust.getDanger());
+ locDetl.setSku(adjust.getBatch());
locDetl.setLocNo(locMast.getLocNo());
locDetl.setAnfme(adjust.getCount()); // 鏁伴噺
locDetl.setModiUser(userId); // 鎿嶄綔浜哄憳淇℃伅
@@ -1337,6 +1312,9 @@
}
locMast.setModiUser(userId);
locMast.setModiTime(now);
+ if (locMast.getLocSts().equals("O")){
+ locMast.setBarcode("");
+ }
if (!locMastService.updateById(locMast)) {
throw new CoolException("鏇存柊搴撲綅鐘舵�佸け璐�");
}
@@ -1529,7 +1507,7 @@
// 鑾峰彇鐩爣绔�
Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
.eq("type_no", wrkMast.getIoType() - 50)
- .eq("stn_no", wrkMast.getStaNo()) // 浣滀笟绔欑偣 = 鎷f枡鍑哄簱鐨勭洰鏍囩珯
+ .eq("stn_no", wrkMast.getSourceStaNo()) // 浣滀笟绔欑偣 = 鎷f枡鍑哄簱鐨勭洰鏍囩珯
.eq("crn_no", wrkMast.getCrnNo()); // 鍫嗗灈鏈哄彿
StaDesc staDesc = staDescService.selectOne(wrapper);
if (Cools.isEmpty(staDesc)) {
@@ -1701,7 +1679,7 @@
List<LocDetlDto> locDetlDtos = new ArrayList<>();
for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) {
if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) {
- LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch());
+ LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getSku());
if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount()));
}
}
@@ -1722,7 +1700,7 @@
List<LocDetlDto> locDetlDtos = new ArrayList<>();
for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) {
if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) {
- LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch());
+ LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getSku());
if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount()));
}
}
@@ -1771,30 +1749,50 @@
LocMast locMast = locMastService.selectById(dto.getLocNo());
List<LocMast> locMasts = new ArrayList<>();
- if ((locMast.getBay1() >= 1 && locMast.getBay1() <= 2) || (locMast.getBay1() >= 6 && locMast.getBay1() <= 7 && locMast.getRow1() != 36 && locMast.getRow1() != 29) || (locMast.getBay1() >= 11 && locMast.getBay1() <= 12)) {
+// if ((locMast.getBay1() >= 1 && locMast.getBay1() <= 2) || (locMast.getBay1() >= 6 && locMast.getBay1() <= 7 && locMast.getRow1() != 36 && locMast.getRow1() != 29) || (locMast.getBay1() >= 11 && locMast.getBay1() <= 12)) {
+// locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
+// .eq("gro1", locMast.getGro1())
+// .eq("crn_no", 7)
+// .eq("loc_type1", locMast.getLocType1())
+// .orderBy("bay1", false));
+// } else {
+// locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
+// .eq("gro1", locMast.getGro1())
+// .eq("crn_no", 7)
+// .eq("loc_type1", locMast.getLocType1())
+// .orderBy("bay1", true));
+// }
+// for (LocMast locMast1 : locMasts) {
+// if (locMast1.getLocNo().equals(dto.getLocNo())) {
+// break;
+// }
+// if (locMast1.getLocSts().equals("X")) {
+// throw new CoolException(dto.getLocNo() + "搴撲綅鍓嶆柟鏈夐攣瀹氬簱浣嶏紝绂佹鍑哄簱");
+// }
+// if (locMast1.getLocSts().equals("F")) {
+// moveLocForDeepLoc(locMast1);
+// }
+// }
+ if ((locMast.getBay1() >= 3 && locMast.getBay1() <= 6) ) {
locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
- .eq("gro1", locMast.getGro1())
- .eq("crn_no", 7)
- .eq("loc_type1", locMast.getLocType1())
- .orderBy("bay1", false));
- } else {
- locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
- .eq("gro1", locMast.getGro1())
+ .eq("row1", locMast.getBay1())
+ .in("bay1", 3,4,5,6)
.eq("crn_no", 7)
.eq("loc_type1", locMast.getLocType1())
.orderBy("bay1", true));
- }
- for (LocMast locMast1 : locMasts) {
- if (locMast1.getLocNo().equals(dto.getLocNo())) {
- break;
- }
- if (locMast1.getLocSts().equals("X")) {
- throw new CoolException(dto.getLocNo() + "搴撲綅鍓嶆柟鏈夐攣瀹氬簱浣嶏紝绂佹鍑哄簱");
- }
- if (locMast1.getLocSts().equals("F")) {
- moveLocForDeepLoc(locMast1);
+ for (LocMast locMast1 : locMasts) {
+ if (locMast1.getLocNo().equals(locMast.getLocNo())) {
+ break;
+ }
+ if (locMast1.getLocSts().equals("X")) {
+ throw new CoolException(locMast.getLocNo() + "搴撲綅鍓嶆柟鏈夐攣瀹氬簱浣嶏紝绂佹鍑哄簱");
+ }
+ if (locMast1.getLocSts().equals("F")) {
+ locMast = locMast1;
+ }
}
}
+
Integer outSta = staNo.getDevNo();
// //2鍙峰爢鍨涙満鍏ㄦ澘鍑哄簱绔欐寚瀹氫负204绔欙紝鎷f枡绔欐寚瀹氫负202
@@ -1897,6 +1895,7 @@
wrkMast.setEmptyMk("Y"); // 绌烘澘
wrkMast.setBarcode(wrkMastold.getBarcode()); // 鎵樼洏鐮�
wrkMast.setLinkMis("N");
+ wrkMast.setPltType(wrkMastold.getWrkNo());
wrkMast.setAppeTime(new Date());
wrkMast.setModiTime(new Date());
boolean res = wrkMastService.insert(wrkMast);
@@ -1959,6 +1958,7 @@
wrkMast.setEmptyMk(wrkDetls != null ? "N" : "Y"); // 绌烘澘
wrkMast.setBarcode(wrkMastold.getBarcode()); // 鎵樼洏鐮�
wrkMast.setLinkMis("N");
+ wrkMast.setPltType(wrkMastold.getWrkNo());
wrkMast.setAppeTime(new Date());
wrkMast.setModiTime(new Date());
boolean res = wrkMastService.insert(wrkMast);
--
Gitblit v1.9.1