From 5677bbf8ba92c286d59b90321c863c14255c734e Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 29 七月 2024 09:23:49 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java | 42 +++++++++++++++++++++++++++++++++++-------
1 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
index f5fb2df..1dc9867 100644
--- a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -116,10 +116,13 @@
// 鏇存柊璁㈠崟瀹屾垚鏁伴噺
OrderDetl orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
+ if (orderDetl==null){
+ orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
+ }
try {
if(!Cools.isEmpty(orderDetl)){
if(!orderDetlService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(),
- wrkDetl.getBatch(),wrkDetl.getAnfme())){
+ orderDetl.getBatch(),wrkDetl.getAnfme())){
// exceptionHandle("鍏ㄦ澘鍏ュ簱 ===>> 鏇存柊璁㈠崟瀹屾垚鏁伴噺澶辫触锛沎workNo={0}],[locNo={1}]",
// wrkMast.getWrkNo(), wrkMast.getLocNo());
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -133,6 +136,7 @@
if (locMast.getLocSts().equals("S")) {
locMast.setLocSts("F");
locMast.setBarcode(wrkMast.getBarcode());
+ locMast.setSheetNo("0");
locMast.setIoTime(now);
locMast.setModiTime(now);
if (!locMastService.updateById(locMast)) {
@@ -153,9 +157,14 @@
}
for (WrkDetl wrkDetl : wrkDetls53) {
- LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
+// LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
+ // 绠卞彿+鍗峰彿
+ LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("batch",wrkDetl.getBatch())
+ .eq("model",wrkDetl.getModel()));
if (null != locDetl) {
- if (!locDetlService.updateAnfme(locDetl.getAnfme() - wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch())) {
+
+// if (!locDetlService.updateAnfme(locDetl.getAnfme() - wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch())) {
+ if (!locDetlService.updateAnfme2(locDetl.getAnfme() - wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getModel(), wrkDetl.getBatch())) {
// exceptionHandle("鎷f枡鍏ュ簱 ===>> 淇敼搴撳瓨鏄庣粏鏁伴噺澶辫触锛沎workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return FAIL.setMsg("鎷f枡鍏ュ簱 ===>> 淇敼搴撳瓨鏄庣粏鏁伴噺澶辫触; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]");
@@ -164,10 +173,13 @@
// 鏇存柊璁㈠崟瀹屾垚鏁伴噺
OrderDetl orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
+ if (orderDetl==null){
+ orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
+ }
try {
if(!Cools.isEmpty(orderDetl)){
if(!orderDetlService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(),
- wrkDetl.getBatch(),wrkDetl.getAnfme())){
+ orderDetl.getBatch(),wrkDetl.getAnfme())){
// exceptionHandle("鎷f枡鍏ュ簱 ===>> 鏇存柊璁㈠崟瀹屾垚鏁伴噺澶辫触锛沎workNo={0}],[locNo={1}]",
// wrkMast.getWrkNo(), wrkMast.getLocNo());
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -181,6 +193,7 @@
if (locMast.getLocSts().equals("Q")) {
locMast.setLocSts("F");
locMast.setBarcode(wrkMast.getBarcode());
+ locMast.setSheetNo("0");
locMast.setIoTime(now);
locMast.setModiTime(now);
if (!locMastService.updateById(locMast)) {
@@ -228,6 +241,7 @@
if (locMast.getLocSts().equals("Q")) {
locMast.setLocSts("F");
locMast.setBarcode(wrkMast.getBarcode());
+ locMast.setSheetNo("0");
locMast.setIoTime(now);
locMast.setModiTime(now);
if (!locMastService.updateById(locMast)) {
@@ -250,6 +264,7 @@
if (locMast.getLocSts().equals("Q")) {
locMast.setLocSts(wrkMast.getFullPlt().equals("Y")?"F":"D");
locMast.setBarcode(wrkMast.getBarcode());
+ locMast.setSheetNo("0");
locMast.setIoTime(now);
locMast.setModiTime(now);
if (!locMastService.updateById(locMast)) {
@@ -278,6 +293,7 @@
if (null != sourceLoc) {
sourceLoc.setBarcode("");
sourceLoc.setLocSts("O");
+ sourceLoc.setSheetNo("0");
sourceLoc.setModiTime(now);
sourceLoc.setIoTime(now);
if (!locMastService.updateById(sourceLoc)) {
@@ -289,6 +305,7 @@
// 淇敼鐩爣搴撲綅鐘舵�� ==> .locSts
locMast.setLocSts(locSts);
locMast.setBarcode(wrkMast.getBarcode());
+ locMast.setSheetNo("0");
locMast.setIoTime(now);
locMast.setModiTime(now);
if (!locMastService.updateById(locMast)) {
@@ -343,11 +360,21 @@
}
for (WrkDetl wrkDetl : wrkDetls101) {
// 鏇存柊璁㈠崟瀹屾垚鏁伴噺
- OrderDetl orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
+// OrderDetl orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
+// if (orderDetl==null){
+// orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), null);
+// }
+ // 绠卞彿+鍗峰彿
+ OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>().eq("batch",wrkDetl.getBatch())
+ .eq("model",wrkDetl.getModel()));
+
try {
if(!Cools.isEmpty(orderDetl)){
- if(!orderDetlService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(),
- wrkDetl.getBatch(),wrkDetl.getAnfme())){
+ // 鏇存柊璁㈠崟瀹屾垚鏁伴噺
+// orderDetlService.update(null,new EntityWrapper<OrderDetl>().eq("order_no",orderDetl.getOrderNo())
+// .eq("batch",orderDetl.getBatch()).eq("model", orderDetl.getModel()));
+ if(!orderDetlService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), orderDetl.getModel(),
+ orderDetl.getBatch(),wrkDetl.getAnfme())){
// exceptionHandle("鍏ㄦ澘鍑哄簱 ===>> 鏇存柊璁㈠崟瀹屾垚鏁伴噺澶辫触锛沎workNo={0}],[locNo={1}]",
// wrkMast.getWrkNo(), wrkMast.getLocNo());
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -366,6 +393,7 @@
if (locMast.getLocSts().equals("R")) {
locMast.setLocSts("O");
locMast.setBarcode("");
+ locMast.setSheetNo("0");
locMast.setModiTime(now);
locMast.setIoTime(now);
if (!locMastService.updateById(locMast)) {
--
Gitblit v1.9.1