From 4d86df5389fb939e5a7a04af89afd8ca34b62fb5 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期一, 13 十一月 2023 13:34:20 +0800
Subject: [PATCH] #
---
src/main/resources/mapper/LocDetlMapper.xml | 2 +-
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 31 ++++++++++++++++---------------
2 files changed, 17 insertions(+), 16 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 2b49f04..6b2dda5 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -899,6 +899,15 @@
OrderDetl orderDetl = orderDetlService.selectOne(orderDetlWrapper);
if (Cools.isEmpty(orderDetl)){
return R.error("璁㈠崟涓湭鏌ヨ鍒颁笅鏋舵暟鎹�");
+
+ }
+ EntityWrapper<ManLocDetl> manLocDetlWrapper = new EntityWrapper<>();
+ manLocDetlWrapper.eq("zpallet",jsonBarcode);
+ manLocDetlWrapper.eq("matnr",jsonManLocDetl.getMatnr());
+ ManLocDetl manLocDetl = manLocDetlService.selectOne(manLocDetlWrapper);
+ if (Cools.isEmpty(manLocDetl)){
+ return R.error("鎵樼洏鐮佹湭鏌ヨ鍒板簱瀛樹俊鎭�");
+
}
BigDecimal orderQty = new BigDecimal(orderDetl.getQty());
BigDecimal orderWorkQty = new BigDecimal(orderDetl.getWorkQty());
@@ -911,15 +920,6 @@
if (diffWorkQty.doubleValue() > orderDetl.getAnfme()){
return R.error("宸ヤ綔鏁伴噺澶т簬璁㈠崟鏁伴噺");
}
- orderDetl.setQty(diffQty.doubleValue());
- orderDetl.setWorkQty(diffWorkQty.doubleValue());
- if (!orderDetlService.updateById(orderDetl)){
- return R.error("璁㈠崟鏄庣粏鏇存柊澶辫触");
- }
- EntityWrapper<ManLocDetl> manLocDetlWrapper = new EntityWrapper<>();
- manLocDetlWrapper.eq("zpallet",jsonBarcode);
- manLocDetlWrapper.eq("matnr",jsonManLocDetl.getMatnr());
- ManLocDetl manLocDetl = manLocDetlService.selectOne(manLocDetlWrapper);
BigDecimal locDetlAnfme = new BigDecimal(manLocDetl.getAnfme());
BigDecimal diffAnfme = locDetlAnfme.subtract(anfme);
@@ -928,16 +928,18 @@
}
if (diffAnfme.doubleValue() == 0){
if (!manLocDetlService.delete(manLocDetlWrapper)){
- return R.error("鍒犻櫎搴撳瓨鏄庣粏澶辫触");
+ throw new RuntimeException("鍒犻櫎搴撳瓨鏄庣粏澶辫触");
}
-
} else if (diffAnfme.doubleValue() > 0) {
manLocDetl.setAnfme(diffAnfme.doubleValue());
if (!manLocDetlService.update(manLocDetl,manLocDetlWrapper)){
- return R.error("鏇存柊搴撳瓨鏄庣粏澶辫触");
+ throw new RuntimeException("鏇存柊搴撳瓨鏄庣粏澶辫触");
}
-
-
+ }
+ orderDetl.setQty(diffQty.doubleValue());
+ orderDetl.setWorkQty(diffWorkQty.doubleValue());
+ if (!orderDetlService.updateById(orderDetl)){
+ return R.error("璁㈠崟鏄庣粏鏇存柊澶辫触");
}
Order order = orderService.selectByNo(jsonOrderNo);
if (IsOrderStatus(jsonOrderNo)){
@@ -949,7 +951,6 @@
throw new RuntimeException("鏇存柊璁㈠崟鐘舵�佸け璐�");
}
}
-
return R.ok();
}
diff --git a/src/main/resources/mapper/LocDetlMapper.xml b/src/main/resources/mapper/LocDetlMapper.xml
index 495b65f..aaba2f7 100644
--- a/src/main/resources/mapper/LocDetlMapper.xml
+++ b/src/main/resources/mapper/LocDetlMapper.xml
@@ -396,7 +396,7 @@
and a.zpallet = #{zpallet}
</if>
<if test="matnr != null and matnr !='' and matnr !='null'">
- and a.matnr = #{matnr}
+ and a.matnr like '%'+#{matnr}+'%'
</if>
</select>
<select id="queryStockViewMergeCount" resultType="java.lang.Integer">
--
Gitblit v1.9.1