From 8482d4e5969a324fd30406fb488eea265e78a49a Mon Sep 17 00:00:00 2001
From: skyouc <958836976@qq.com>
Date: 星期一, 09 三月 2026 19:33:33 +0800
Subject: [PATCH] no message
---
src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java | 105 ++++++++++++++++++++++++++++++++++------------------
1 files changed, 69 insertions(+), 36 deletions(-)
diff --git a/src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java b/src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
index 5b28ddd..3286885 100644
--- a/src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
@@ -21,6 +21,7 @@
import com.zy.asrs.service.*;
import com.zy.asrs.service.impl.TaskDetlLogServiceImpl;
import com.zy.asrs.service.impl.TaskDetlServiceImpl;
+import com.zy.asrs.service.impl.WrkDetlLogServiceImpl;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.utils.OrderInAndOutUtil;
@@ -73,6 +74,8 @@
CheckOrderDetlService checkOrderDetlService;
@Autowired
private TaskDetlLogService taskDetlLogService;
+ @Autowired
+ private WrkDetlLogServiceImpl wrkDetlLogService;
@Transactional
@@ -144,6 +147,7 @@
orderDetlList.add(detail);
}
}
+
for (OrderDetl orderDetl : orderDetlList) {
orderDetl.setWorkQty(0D);
OrderInAndOutUtil.insertOrderDetl(order.getPakinPakoutStatus$(), order, orderDetl);
@@ -165,17 +169,22 @@
@Transactional(rollbackFor = Exception.class)
public void ifTransfetInsertStockIn(Order order, OrderDetl orderDetl) {
- OrderPakin orderPakin = new OrderPakin();
- BeanUtils.copyProperties(order, orderPakin);
- orderPakin.setDocType(OrderTypeEnum.STOCK_IN.type.longValue());
-
- if (!orderPakinService.insert(orderPakin)) {
- throw new CoolException("鎻掑叆澶囪揣鍏ュ簱鍗曞け璐�");
+ OrderPakin pakin = orderPakinService.selectOne(new EntityWrapper<OrderPakin>()
+ .eq("order_no", order.getOrderNo())
+ .eq("doc_type", OrderTypeEnum.STOCK_IN.type.longValue()));
+ if (Objects.isNull(pakin)) {
+ OrderPakin orderPakin = new OrderPakin();
+ BeanUtils.copyProperties(order, orderPakin);
+ orderPakin.setDocType(OrderTypeEnum.STOCK_IN.type.longValue());
+ if (!orderPakinService.insert(orderPakin)) {
+ throw new CoolException("鎻掑叆澶囪揣鍏ュ簱鍗曞け璐�");
+ }
+ pakin = orderPakin;
}
+
OrderDetlPakin orderDetlPakin = new OrderDetlPakin();
BeanUtils.copyProperties(orderDetl, orderDetlPakin);
- orderDetlPakin.setOrderId(orderPakin.getId());
-
+ orderDetlPakin.setOrderId(pakin.getId());
if (!orderDetlPakinService.insert(orderDetlPakin)) {
throw new CoolException("鎻掑叆澶囪揣鍏ュ簱鍗曞け璐�");
}
@@ -270,7 +279,7 @@
orderDetls.forEach(detl -> {
Mat material = matService.selectByMatnr(detl.getMatnr());
if (Objects.isNull(material)) {
- throw new CoolException("鐗╂枡涓嶅瓨鍦�");
+ throw new CoolException(material.getMatnr() + "鐗╂枡涓嶅瓨鍦�");
}
ReportOrderParams itemParam = new ReportOrderParams();
@@ -279,29 +288,46 @@
.eq("supp_code", detl.getSuppCode())
.eq("order_no", detl.getOrderNo()));
if (Objects.isNull(locDetl)) {
- throw new CoolException("搴撳瓨鏄庣粏涓嶅瓨鍦� 锛岃妫�鏌ュ崟鎹槸鍚﹀畬鎴愶紒锛�");
+ // BS Code
+ itemParam.setTotal_serial(detl.getThreeCode())
+ // 涓婃姤鏃讹紝榛樿浜у搧绫诲瀷鏄痭ull
+ .setPro_type(material.getProType())
+ // 涓婃姤鏃讹紝榛樿浜у搧缂栫爜
+ .setPro_komcode(detl.getMatnr())
+ // 涓婃姤鏃讹紝榛樿浜у搧id鏄緵搴斿晢缂栫爜
+ .setPro_id(detl.getSuppCode())
+ .setLocation_no("LX000000000")
+ .setSj_emp("9527")
+ .setLocation_type(MatLocType.getMatTag(material.getTagId() + ""))
+ // 涓婃姤鏃讹紝榛樿涓婃姤鏃堕棿鏄洿鏂版椂闂�
+ .setSj_date(Utils.dateToStr(order.getUpdateTime(), "yyyy-MM-dd HH:mm:ss"))
+ // 涓婃姤鏃讹紝濡傛灉涓虹┖榛樿涓婃姤 0
+ .setPick_qty(0)
+ // 涓婃姤鏃讹紝榛樿鎹熷潖鏁伴噺鏄�0
+ .setDamage_qty(0)
+ // 涓婃姤鏃讹紝榛樿宸紓鏁伴噺鏄�0
+ .setDiff_qty(0);
+ } else {
+ // BS Code
+ itemParam.setTotal_serial(detl.getThreeCode())
+ // 涓婃姤鏃讹紝榛樿浜у搧绫诲瀷鏄痭ull
+ .setPro_type(material.getProType())
+ // 涓婃姤鏃讹紝榛樿浜у搧缂栫爜
+ .setPro_komcode(detl.getMatnr())
+ // 涓婃姤鏃讹紝榛樿浜у搧id鏄緵搴斿晢缂栫爜
+ .setPro_id(detl.getSuppCode())
+ .setLocation_no(locDetl.getZpallet())
+ .setSj_emp(locDetl.getModiUser$())
+ .setLocation_type(MatLocType.getMatTag(material.getTagId() + ""))
+ // 涓婃姤鏃讹紝榛樿涓婃姤鏃堕棿鏄洿鏂版椂闂�
+ .setSj_date(Utils.dateToStr(order.getUpdateTime(), "yyyy-MM-dd HH:mm:ss"))
+ // 涓婃姤鏃讹紝榛樿涓婃姤鏁伴噺鏄鍗曟暟閲�
+ .setPick_qty(locDetl.getAnfme().intValue())
+ // 涓婃姤鏃讹紝榛樿鎹熷潖鏁伴噺鏄�0
+ .setDamage_qty(0)
+ // 涓婃姤鏃讹紝榛樿宸紓鏁伴噺鏄�0
+ .setDiff_qty(0);
}
-
- // BS Code
- itemParam.setTotal_serial(detl.getThreeCode())
- // 涓婃姤鏃讹紝榛樿浜у搧绫诲瀷鏄痭ull
- .setPro_type(material.getProType())
- // 涓婃姤鏃讹紝榛樿浜у搧缂栫爜
- .setPro_komcode(detl.getMatnr())
- // 涓婃姤鏃讹紝榛樿浜у搧id鏄緵搴斿晢缂栫爜
- .setPro_id(detl.getSuppCode())
- .setLocation_no(locDetl.getZpallet())
- .setSj_emp(locDetl.getModiUser$())
- .setLocation_type(MatLocType.getMatTag(material.getTagId() + ""))
- // 涓婃姤鏃讹紝榛樿涓婃姤鏃堕棿鏄洿鏂版椂闂�
- .setSj_date(Utils.dateToStr(order.getUpdateTime(), "yyyy-MM-dd HH:mm:ss"))
- // 涓婃姤鏃讹紝榛樿涓婃姤鏁伴噺鏄鍗曟暟閲�
- .setPick_qty(detl.getQty().intValue())
- // 涓婃姤鏃讹紝榛樿鎹熷潖鏁伴噺鏄�0
- .setDamage_qty(0)
- // 涓婃姤鏃讹紝榛樿宸紓鏁伴噺鏄�0
- .setDiff_qty(0);
-
reportOrderParams.add(itemParam);
});
@@ -363,7 +389,7 @@
orderDetls.forEach(detl -> {
Mat material = matService.selectByMatnr(detl.getMatnr());
if (Objects.isNull(material)) {
- throw new CoolException("鐗╂枡涓嶅瓨鍦�");
+ throw new CoolException(material.getMatnr() + "鐗╂枡涓嶅瓨鍦�");
}
TaskDetlLog detlLog = taskDetlLogService.selectOne(new EntityWrapper<TaskDetlLog>()
.eq("matnr", detl.getMatnr())
@@ -372,7 +398,15 @@
if (Objects.isNull(detlLog)) {
throw new CoolException("鏁版嵁閿欒 锛岃妫�鏌GV浠诲姟妗f槸鍚﹀凡瀹屾垚锛侊紒");
}
+/* WrkDetlLog detlLog = wrkDetlLogService.selectOne(new EntityWrapper<WrkDetlLog>()
+ .eq("matnr", detl.getMatnr())
+ .eq("supp_code", detl.getStandby1())
+ .eq("order_no", detl.getOrderNo()));
+ if (Objects.isNull(detlLog)) {
+ throw new CoolException("鐗╂枡缂栫爜锛�" + detl.getMatnr() + "鏁版嵁閿欒 锛岃妫�鏌ュ爢鍨涙満浠诲姟妗f槸鍚﹀凡瀹屾垚锛侊紒");
+ }*/
//鐩爣搴撳尯
+// orderParam.setTarget_location("2");
orderParam.setTarget_location(detlLog.getAreaType());
OrderItemsParam itemParam = new OrderItemsParam();
// BS Code
@@ -386,7 +420,7 @@
// // 涓婃姤鏃讹紝榛樿鏉ユ簮浣嶇疆鏄痭ull
.setLocation_no(detlLog.getZpallet())
// 涓婃姤鏃讹紝榛樿涓婃姤鏁伴噺鏄鍗曟暟閲�
- .setPick_qty(detl.getQty().intValue());
+ .setPick_qty(Objects.isNull(detl.getQty()) ? 0 : detl.getQty().intValue());
reportOrderParams.add(itemParam);
});
@@ -456,9 +490,8 @@
orderDetls.forEach(detl -> {
Mat material = matService.selectByMatnr(detl.getMatnr());
if (Objects.isNull(material)) {
- throw new CoolException("鐗╂枡涓嶅瓨鍦�");
+ throw new CoolException(material.getMatnr() + "鐗╂枡涓嶅瓨鍦�");
}
-
TaskDetlLog detlLog = taskDetlLogService.selectOne(new EntityWrapper<TaskDetlLog>()
.eq("matnr", detl.getMatnr())
.eq("supp_code", detl.getStandby1())
@@ -573,7 +606,7 @@
detls.forEach(detl -> {
Mat material = matService.selectByMatnr(detl.getMatnr());
if (Objects.isNull(material)) {
- throw new CoolException("鐗╂枡涓嶅瓨鍦�");
+ throw new CoolException(material.getMatnr() + "鐗╂枡涓嶅瓨鍦�");
}
OrderItemsParam itemParam = new OrderItemsParam();
itemParam.setLocation_no(detl.getZpallet())
--
Gitblit v1.9.1