From 82f5a3c1fdcfcde25c20805feea64e5a3c315201 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期四, 21 十一月 2024 14:12:14 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 62 +++++++++++++++++++++++++-----
1 files changed, 51 insertions(+), 11 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
index 78041df..b8f8d62 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -8,6 +8,7 @@
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
import com.zy.asrs.entity.param.*;
+import com.zy.asrs.mapper.BasDevpMapper;
import com.zy.asrs.mapper.ManLocDetlMapper;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.MatUtils;
@@ -24,6 +25,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import javax.annotation.Resource;
import java.util.*;
/**
@@ -73,13 +75,25 @@
@Autowired
private ManLocDetlMapper manLocDetlMapper;
+ @Resource
+ private BasDevpMapper basDevpMapper;
@Override
public R inLocCallAgv(String sta, String inSta) {
- // 鍒ゆ柇鍏ュ簱绔欑偣鏈夋棤鍑哄簱浠诲姟杩囨护鐩樼偣鎹℃枡
- int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("sta_no", inSta).ne("wrk_sts",15).notIn("io_type",103,107));
- if (count > 0) {
- return R.parse(inSta + "绔欑偣瀛樺湪鍑哄簱浠诲姟");
+
+ BasDevp basDevp = basDevpMapper.selectById(inSta);
+ // 0.鍑哄簱妯″紡锛�1.agv鍏ュ簱涓紝2.鐢熸垚鍏ュ簱浠诲姟
+ if (basDevp.getDevMk().equals("0")) { // 鏄嚭搴�
+ // 鍒ゆ柇鏄惁鏈夊嚭搴撲换鍔�
+ int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>()
+ .eq("sta_no", inSta).lt("wrk_sts",14).in("io_type",101,103,107,110));
+ if (count == 0) {
+ // 娌℃湁鍑哄簱浠诲姟锛屾洿鏀逛负鍏ュ簱妯″紡
+ basDevp.setDevMk("1");
+ basDevpMapper.updateById(basDevp);
+ } else {
+ return R.parse(inSta + "绔欑偣瀛樺湪鍑哄簱浠诲姟");
+ }
}
// 鍏堢粦瀹�
@@ -249,10 +263,10 @@
throw new CoolException("璇锋彁鍙栦竴涓晢鍝侊紝鎴栬�呭埛鏂伴噸鏂扮粍鎵橈紒");
}
// 鍒ゆ柇鏄惁鏈夌浉鍚屾潯鐮佺殑鏁版嵁
- if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
- eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) {
- throw new CoolException(param.getBarcode() + "鏁版嵁姝e湪杩涜鍏ュ簱");
- }
+// if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
+// eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) {
+// throw new CoolException(param.getBarcode() + "鏁版嵁姝e湪杩涜鍏ュ簱");
+// }
if(param.getBarcode().length()!=9){
throw new CoolException("鏉$爜闀垮害涓嶆槸9浣�===>>" + param.getBarcode());
@@ -260,9 +274,9 @@
int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode()));
int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode()));
- int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",param.getBarcode()));
- if (countLoc > 0 || countWrk > 0 || countwait > 0) {
- throw new CoolException("缁勬墭妗�/宸ヤ綔妗�/搴撳瓨鏉$爜鏁版嵁宸插瓨鍦�===>>" + param.getBarcode());
+// int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",param.getBarcode()));
+ if (countLoc > 0 || countWrk > 0) {
+ throw new CoolException("宸ヤ綔妗�/搴撳瓨鏉$爜鏁版嵁宸插瓨鍦�===>>" + param.getBarcode());
}
Date now = new Date();
@@ -378,6 +392,11 @@
if(param.getCombMats().stream().anyMatch(obj -> obj.getAnfme() == null)){
throw new CoolException("鍏ュ簱鐗╂枡鏁伴噺涓嶈兘涓虹┖");
}
+ Order order = orderService.selectByNo(param.getOrderNo());
+ if (Cools.isEmpty(order) || order.getSettle() > 2) {
+ throw new CoolException("鍗曟嵁缂栧彿宸茶繃鏈�");
+ }
+
// 鍒ゆ柇鏄惁鏈夌浉鍚屾潯鐮佺殑鏁版嵁
if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) {
@@ -399,6 +418,19 @@
Date now = new Date();
for (CombParam.CombMat combMat : param.getCombMats()) {
+ // 璁㈠崟鏄庣粏鏁伴噺鏍¢獙
+ OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), combMat.getMatnr(), combMat.getBatch());
+ if (Cools.isEmpty(orderDetl)) {
+ throw new CoolException("璇ュ崟鎹腑鏈壘鍒板搴旂墿鏂欐槑缁�");
+ }
+ if (combMat.getAnfme() > orderDetl.getEnableQty()) {
+ throw new CoolException(orderDetl.getMatnr() + "鍏ュ簱鏁伴噺涓嶅悎娉�");
+ }
+ // 淇敼璁㈠崟浣滀笟鏁伴噺
+ if (!orderDetlService.increaseWorkQty(order.getId(), combMat.getMatnr(), combMat.getBatch(), combMat.getAnfme())) {
+ throw new CoolException("淇敼鍗曟嵁浣滀笟鏁伴噺澶辫触");
+ }
+
Mat mat = matService.selectByMatnr(combMat.getMatnr());
WrkDetl wrkDetl = new WrkDetl();
wrkDetl.sync(mat);
@@ -411,6 +443,7 @@
wrkDetl.setAppeUser(userId);
wrkDetl.setModiTime(now);
wrkDetl.setModiUser(userId);
+ wrkDetl.setManu(orderDetl.getManu());
wrkDetlService.insert(wrkDetl);
}
@@ -783,6 +816,13 @@
public void leftoversOut(Map<String, Object> map,Long userId) {
String barcode = map.get("barcode").toString();
String barcode2 = map.get("barcode2").toString();
+
+ int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",barcode2));
+ int countWrk = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("barcode",barcode2).ne("io_type",200));
+ int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",barcode2));
+ if (countLoc > 0 || countWrk > 0 || countwait > 0) {
+ throw new CoolException("璇ユ潯鐮佸凡琚娇鐢�===>>" + barcode2);
+ }
WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", barcode).eq("io_type", 103));
if (Cools.isEmpty(wrkMast)) {
throw new CoolException("鏈煡璇㈠埌鎷f枡浠诲姟");
--
Gitblit v1.9.1