From fc45de2fc49363738d5854446ad2ad33b58b1949 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期五, 15 十二月 2023 16:33:38 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 30 +++++++++++++++++-------------
1 files changed, 17 insertions(+), 13 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 2c7e32a..edda824 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -89,6 +89,9 @@
@Autowired
private OriginRuleService originRuleService;
+ @Autowired
+ private LocInPrintMatService locInPrintMatService;
+
@Override
@@ -957,6 +960,7 @@
@Override
public R manDetlOrigin(JSONObject json, User user) {
+ Date now = new Date();
String jsonLocNo = (String) json.get("locNo"); //鑾峰彇搴撲綅鐮�
String jsonCode = (String) json.get("code"); //鑾峰彇鏉$爜
String jsonOrigin = (String) json.get("origin"); //鑾峰彇鏉ユ簮鍦�
@@ -992,6 +996,9 @@
if (Cools.isEmpty(mat)){
return R.error("鏈煡璇㈠埌鍟嗗搧淇℃伅");
}
+ //澧炲姞鎵撳嵃妗f
+ LocInPrintMat locInPrintMat = new LocInPrintMat(now,user.getId(), mat.getMatnr(),jsonOriginDetl.getBatch(),jsonOriginDetl.getAnfme(),jsonLocNo,mat.getMaktx());
+ locInPrintMatService.insert(locInPrintMat);
Wrapper<ManLocDetl> manLocDetlWrapper = new EntityWrapper<ManLocDetl>().eq("loc_no", jsonLocNo).eq("matnr", jsonOriginDetl.getMatnr()).eq("batch",date);
ManLocDetl manLocDetl1 = manLocDetlService.selectOne(manLocDetlWrapper);
@@ -1006,7 +1013,6 @@
}
}else {
- Date now = new Date();
ManLocDetl manLocDetl = new ManLocDetl(); //鍒濆鍖栧簱瀛樺疄浣撶被
manLocDetl.sync(mat);
manLocDetl.setLocNo(node.getUuid());
@@ -1037,6 +1043,7 @@
@Override
public R manDetlOrigInNo(JSONObject json, User user) {
+ Date now = new Date();
String jsonLocNo = (String) json.get("locNo"); //鑾峰彇搴撲綅鐮�
Node node = nodeService.selectOne(new EntityWrapper<Node>().eq("name", jsonLocNo)); //鑾峰彇瀵瑰簲搴撲綅淇℃伅
@@ -1052,6 +1059,9 @@
if (Cools.isEmpty(mat)){
return R.error("鏈煡璇㈠埌鍟嗗搧淇℃伅");
}
+ //澧炲姞鎵撳嵃妗f
+ LocInPrintMat locInPrintMat = new LocInPrintMat(now,user.getId(), mat.getMatnr(),jsonOriginDetl.getBatch(),jsonOriginDetl.getAnfme(),jsonLocNo,mat.getMaktx());
+ locInPrintMatService.insert(locInPrintMat);
Wrapper<ManLocDetl> manLocDetlWrapper = new EntityWrapper<ManLocDetl>().eq("loc_no", jsonLocNo).eq("matnr", jsonOriginDetl.getMatnr()).eq("batch",jsonOriginDetl.getBatch());
ManLocDetl manLocDetl1 = manLocDetlService.selectOne(manLocDetlWrapper);
@@ -1066,7 +1076,6 @@
}
}else {
- Date now = new Date();
ManLocDetl manLocDetl = new ManLocDetl(); //鍒濆鍖栧簱瀛樺疄浣撶被
manLocDetl.sync(mat);
manLocDetl.setLocNo(node.getUuid());
@@ -1097,24 +1106,21 @@
@Override
public R manDetlOriginOut(JSONObject json, User user) {
- String jsonLocNo = (String) json.get("locNo"); //鑾峰彇搴撲綅鐮�
-
JSONArray combMats = json.getJSONArray("combMats");
for (int i = 0; i < combMats.size(); i++) {
- OrderDetl jsonOriginDetl = combMats.getObject(i, OrderDetl.class);
- Wrapper<ManLocDetl> manLocDetlWrapper = new EntityWrapper<ManLocDetl>().eq("loc_no", jsonLocNo).eq("matnr", jsonOriginDetl.getMatnr()).eq("batch", jsonOriginDetl.getBatch());
+ MatPrint jsonOriginDetl = combMats.getObject(i, MatPrint.class);
+ Double parseLong = jsonOriginDetl.getAnfme();
+ Wrapper<ManLocDetl> manLocDetlWrapper = new EntityWrapper<ManLocDetl>().eq("loc_no", jsonOriginDetl.getLocNo()).eq("matnr", jsonOriginDetl.getMatnr()).eq("batch", jsonOriginDetl.getBatch());
ManLocDetl manLocDetl = manLocDetlService.selectOne(manLocDetlWrapper);
if (Cools.isEmpty(manLocDetl)){
- return R.error("鏈晢鍝佹槑缁嗕俊鎭�!搴撲綅鍙凤細"+jsonLocNo+";鍟嗗搧缂栧彿锛�"+jsonOriginDetl.getMatnr()+"鎵规锛�"+jsonOriginDetl.getBatch());
+ return R.error("鏈晢鍝佹槑缁嗕俊鎭�!搴撲綅鍙凤細"+jsonOriginDetl.getLocNo()+";鍟嗗搧缂栧彿锛�"+jsonOriginDetl.getMatnr()+"鎵规锛�"+jsonOriginDetl.getBatch());
}
- BigDecimal outAnfme = BigDecimal.valueOf(jsonOriginDetl.getAnfme());
+ BigDecimal outAnfme = BigDecimal.valueOf(parseLong);
BigDecimal anfme = BigDecimal.valueOf(manLocDetl.getAnfme());
- if (manLocDetl.getAnfme() > jsonOriginDetl.getAnfme()){
+ if (manLocDetl.getAnfme() > parseLong){
BigDecimal num = anfme.subtract(outAnfme);
manLocDetl.setAnfme(num.doubleValue());
-
-
if (!manLocDetlService.update(manLocDetl,manLocDetlWrapper)) {
return R.error("鐗╂枡淇℃伅涓嬫灦澶辫触");
}
@@ -1124,8 +1130,6 @@
return R.error("鐗╂枡淇℃伅鍒犻櫎澶辫触");
}
}
-
-
}
return R.ok();
}
--
Gitblit v1.9.1