From 608fb6f9529ce51291ef682638a5efc7dd51ac63 Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期二, 18 十一月 2025 08:21:08 +0800
Subject: [PATCH] 1.完善找库位 2.新增erp订单删除后,wms订单跟着删除功能 3.新增订单完成后,上报erp,erp报错后显现在出货单中 4.新增一键查询到异常完成订单 5.对销售单据和其他单据进行区分出库 6.对中间表订单状态进行完善 7.新增锁单功能 8.新增任务查询维护加上订单号
---
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 95 ++++++++++++++++++++++++++++++++++-------------
1 files changed, 69 insertions(+), 26 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 00eb38c..f31590c 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -23,6 +23,15 @@
import com.zy.common.model.MesCombParam;
import com.zy.common.service.CommonService;
import com.zy.common.utils.HttpHandler;
+import com.zy.third.entity.ExdInstockSource;
+import com.zy.third.entity.ExdStock;
+import com.zy.third.entity.ExdvYanbu;
+import com.zy.third.mapper.ExdMaterialMapper;
+import com.zy.third.mapper.ExdStockMapper;
+import com.zy.third.service.ExdInstockSourceService;
+import com.zy.third.service.ExdMaterialService;
+import com.zy.third.service.ExdStockService;
+import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -46,6 +55,8 @@
private OrderService orderService;
@Autowired
private OrderDetlService orderDetlService;
+ @Autowired
+ private OrderDetl1Service orderDetl1Service;
@Autowired
private BasDevpService basDevpService;
@Autowired
@@ -76,6 +87,14 @@
private ManLocDetlService manLocDetlService;
@Autowired
private ManLocDetlMapper manLocDetlMapper;
+ @Autowired
+ private ExdMaterialMapper exdMaterialMapper;
+ @Autowired
+ private ExdStockMapper exdStockMapper;
+ @Autowired
+ private ExdStockService exdStockService;
+ @Autowired
+ private ExdInstockSourceService exdInstockSourceService;
@Override
@@ -109,26 +128,27 @@
Date now = new Date();
//杩涜鎵瑰彿绛涢�夛紝鎵瑰彿鍙兘鍞竴
-// Set<String> batchs = new HashSet<>();
-// List<String> strings = new ArrayList<>();
-
-
-// for (CombParam.CombMat mat : param.getCombMats()) {
-// if (Cools.isEmpty(mat.getBatch())) {
-// continue;
-// }
-// batchs.add(mat.getBatch());
-// strings.add(mat.getBatch());
-// WaitPakin waitPakin = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("batch", mat.getBatch()));
-// WrkDetl batch = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("batch", mat.getBatch()));
-// LocDetl batch1 = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("batch", mat.getBatch()));
-// if (!Cools.isEmpty(batch) || !Cools.isEmpty(batch1) || !Cools.isEmpty(waitPakin)) {
-// throw new CoolException("璇ョ墿鏂欐壒鍙�" + mat.getBatch() + "宸插湪鍏ュ簱閫氱煡妗c�佷换鍔℃槑缁嗗拰搴撳瓨涓瓨鍦�");
-// }
-// }
-// if (batchs.size() < strings.size()) {
-// throw new CoolException("鏈夐噸澶嶇殑鐗╂枡鎵瑰彿");
-// }
+ Set<String> batchs = new HashSet<>();
+ List<String> strings = new ArrayList<>();
+ long time = new Date().getTime();
+ //鐢熶骇鍏ュ簱瀵逛竴鍧ㄧ墿鏂欒繘琛岀粦瀹氥�傚敮涓�鍊�
+ String fbillno = param.getBarcode()+"--"+time;
+ for (CombParam.CombMat mat : param.getCombMats()) {
+ if (Cools.isEmpty(mat.getBatch())) {
+ continue;
+ }
+ batchs.add(mat.getBatch());
+ strings.add(mat.getBatch());
+ WaitPakin waitPakin = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("batch", mat.getBatch()));
+ WrkDetl batch = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("batch", mat.getBatch()));
+ LocDetl batch1 = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("batch", mat.getBatch()));
+ if (!Cools.isEmpty(batch) || !Cools.isEmpty(batch1) || !Cools.isEmpty(waitPakin)) {
+ throw new CoolException("璇ョ墿鏂欐壒鍙�" + mat.getBatch() + "宸插湪鍏ュ簱閫氱煡妗c�佷换鍔℃槑缁嗗拰搴撳瓨涓瓨鍦�");
+ }
+ }
+ if (batchs.size() < strings.size()) {
+ throw new CoolException("鏈夐噸澶嶇殑鐗╂枡鎵瑰彿");
+ }
int i = 1;
// 鏃犲崟缁勬墭
if (Cools.isEmpty(param.getOrderNo())) {
@@ -166,7 +186,7 @@
}
WaitPakin waitPakin = new WaitPakin();
waitPakin.sync(mat);
- waitPakin.setBatch(detlDto.getBatch());
+ waitPakin.setBatch(detlDto.getBc());
waitPakin.setThreeCode(detlDto.getBc());
waitPakin.setZpallet(param.getBarcode()); // 鎵樼洏鐮�
waitPakin.setIoStatus("N"); // 鍏ュ嚭鐘舵��
@@ -177,7 +197,15 @@
waitPakin.setModiUser(userId);
waitPakin.setColor(userId+"");
waitPakin.setModiTime(now);
- waitPakin.setBrand(param.getCk());//浠撳簱
+ //鐢熶骇鍏ュ簱瀵逛竴鍧ㄧ墿鏂欒繘琛岀粦瀹氥�傚敮涓�鍊�
+ waitPakin.setOrigin(fbillno);
+ ExdvYanbu barcode1 = exdMaterialMapper.getBacode(detlDto.getBc());
+ String pid="03.98";
+ if(!Cools.isEmpty(barcode1)&&!Cools.isEmpty(barcode1.getProdinkind())){
+ pid=barcode1.getProdinkind();
+ }
+ ExdStock id = exdStockService.selectOne(new EntityWrapper<ExdStock>().eq("Fnumber", pid));
+ waitPakin.setBrand(id.getFname());//浠撳簱
waitPakin.setInspect(param.isType() ? 1 : 0);
if (i == 1) {
// 0锛氫笉闇�瑕佽ˉ绌烘墭鐩�
@@ -193,7 +221,7 @@
* 3锛欰GV浠诲姟瀹屾垚
* 4锛氱粰杈撻�佺嚎涓嬪彂鍏ュ簱鎸囦护
*/
- waitPakin.setBeBatch(param.getBeBatch());
+ waitPakin.setBeBatch(Cools.isEmpty(param.getRsta())?0:1);
waitPakin.setSuppCode(param.getBarcode());
}
i++;
@@ -217,7 +245,11 @@
throw new CoolException(orderDetl.getMatnr() + "鍏ュ簱鏁伴噺涓嶅悎娉�");
}
// 淇敼璁㈠崟浣滀笟鏁伴噺
- if (!orderDetlService.increaseWorkQty2(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme(), fxId)) {
+ if (!orderDetlService.increaseWorkQty2(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme(), userId)) {
+ throw new CoolException("淇敼鍗曟嵁浣滀笟鏁伴噺澶辫触");
+ }
+ // 淇敼瀛愬崟璁㈠崟浣滀笟鏁伴噺
+ if (!orderDetl1Service.increaseWorkQty2(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme(), userId)) {
throw new CoolException("淇敼鍗曟嵁浣滀笟鏁伴噺澶辫触");
}
@@ -238,7 +270,7 @@
WaitPakin waitPakin = new WaitPakin();
waitPakin.sync(mat);
waitPakin.setOrderNo(order.getOrderNo()); // 鍗曟嵁缂栧彿
- waitPakin.setBatch(detlDto.getBatch()); // 搴忓垪鐮�
+ waitPakin.setBatch(detlDto.getBatch()); // 鎵瑰彿
waitPakin.setZpallet(param.getBarcode()); // 鎵樼洏鐮�
waitPakin.setIoStatus("N"); // 鍏ュ嚭鐘舵��
waitPakin.setAnfme(detlDto.getAnfme()); // 鏁伴噺
@@ -248,7 +280,11 @@
waitPakin.setModiUser(userId);
waitPakin.setModiTime(now);
waitPakin.setColor(userId+"");
- waitPakin.setBrand(param.getCk());//浠撳簱
+
+ OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>()
+ .eq("matnr", detlDto.getMatnr()).eq("order_no", order.getOrderNo())
+ .eq("batch", detlDto.getBatch()));
+ waitPakin.setBrand(orderDetl.getBrand());//浠撳簱
waitPakin.setInspect(param.isType() ? 1 : 0);
if (i == 1) {
// 0锛氫笉闇�瑕佽ˉ绌烘墭鐩�
@@ -273,6 +309,13 @@
}
}
orderService.updateSettle(order.getId(), 2L, userId);
+ List<ExdInstockSource> fBillNo = exdInstockSourceService.selectList(new EntityWrapper<ExdInstockSource>().eq("FBillNo", order.getOrderNo()));
+ if(fBillNo != null){
+ for(ExdInstockSource exdInstockSource : fBillNo){
+ exdInstockSource.setStatus(10);
+ exdInstockSourceService.updateById(exdInstockSource);
+ }
+ }
}
}
--
Gitblit v1.9.1