From 1b72fc0dd1d7004de54ab0886e0323cb1b96198d Mon Sep 17 00:00:00 2001
From: 懒羊羊 <15939171744@163.com>
Date: 星期三, 10 一月 2024 16:38:53 +0800
Subject: [PATCH] 批次上料

---
 guns-vip-main/src/main/java/cn/stylefeng/guns/modular/om/productionOrderBatchInfo/controller/ProductionOrderBatchInfoController.java |   26 +++++++++++++++++++++++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/guns-vip-main/src/main/java/cn/stylefeng/guns/modular/om/productionOrderBatchInfo/controller/ProductionOrderBatchInfoController.java b/guns-vip-main/src/main/java/cn/stylefeng/guns/modular/om/productionOrderBatchInfo/controller/ProductionOrderBatchInfoController.java
index 5d20245..0db2488 100644
--- a/guns-vip-main/src/main/java/cn/stylefeng/guns/modular/om/productionOrderBatchInfo/controller/ProductionOrderBatchInfoController.java
+++ b/guns-vip-main/src/main/java/cn/stylefeng/guns/modular/om/productionOrderBatchInfo/controller/ProductionOrderBatchInfoController.java
@@ -168,11 +168,31 @@
     @ResponseBody
     @RequestMapping("/updateOrderBatchInfo")
     public ResponseData updateOrderBatchInfo(ProductionOrderBatchInfoParam productionOrderBatchInfoParam) {
-        Long id = getCheckLocationCodeList(productionOrderBatchInfoParam).get(0).getId();
-        ProductionOrderBatchInfo byId = productionOrderBatchInfoService.getById(id);
+        List<ProductionOrderBatchInfo> checkLocationCodeList = getCheckLocationCodeList(productionOrderBatchInfoParam);
+        ProductionOrderBatchInfo batchInfo = checkLocationCodeList.get(0);
+        ProductionOrderBatchInfo byId = productionOrderBatchInfoService.getById(batchInfo.getId());
+        byId.setSpareField1(productionOrderBatchInfoParam.getSpareField1());
+        if(batchInfo.getState().equals("鏄�")){
+            if(!productionOrderBatchInfoParam.getLoadingCode().equals(batchInfo.getLoadingCode())){
+                return  ResponseData.success("0");
+            }else {
+                Integer count1 = Integer.parseInt(productionOrderBatchInfoParam.getSpareField1())+Integer.parseInt(batchInfo.getSpareField1());
+                byId.setSpareField1(count1.toString());
+            }
+        }
         byId.setState("鏄�");
         byId.setLoadingCode(productionOrderBatchInfoParam.getLoadingCode());
-        byId.setSpareField1(productionOrderBatchInfoParam.getSpareField1());
+        productionOrderBatchInfoService.saveOrUpdate(byId);
+        return ResponseData.success("1");
+    }
+
+    @ResponseBody
+    @RequestMapping("/resetting")
+    public ResponseData resetting(ProductionOrderBatchInfoParam productionOrderBatchInfoParam) {
+        ProductionOrderBatchInfo byId = productionOrderBatchInfoService.getById(productionOrderBatchInfoParam.getId());
+        byId.setState("鍚�");
+        byId.setSpareField1("0");
+        byId.setLoadingCode("");
         productionOrderBatchInfoService.saveOrUpdate(byId);
         return ResponseData.success();
     }

--
Gitblit v1.9.3