From be1b426b7d765a546f4a26b60e80aa49a57079b9 Mon Sep 17 00:00:00 2001
From: xiaogang <905166056@qq.com>
Date: 星期六, 13 一月 2024 16:25:11 +0800
Subject: [PATCH] 1、优化采购模块数量不能为小数点问题2、新增客服巡查巡楼记录功能模块3、新增页面导出功能4、优化记录查询条件新增时间段查询条件5、其他界面性调整

---
 service-store/src/main/java/com/java110/store/cmd/resourceStore/AllocationStoreEnterCmd.java |   52 +++++++++++++---------------------------------------
 1 files changed, 13 insertions(+), 39 deletions(-)

diff --git a/service-store/src/main/java/com/java110/store/cmd/resourceStore/AllocationStoreEnterCmd.java b/service-store/src/main/java/com/java110/store/cmd/resourceStore/AllocationStoreEnterCmd.java
index 6810420..c2bc6d8 100644
--- a/service-store/src/main/java/com/java110/store/cmd/resourceStore/AllocationStoreEnterCmd.java
+++ b/service-store/src/main/java/com/java110/store/cmd/resourceStore/AllocationStoreEnterCmd.java
@@ -7,24 +7,16 @@
 import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
-import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.dto.purchase.AllocationStorehouseApplyDto;
 import com.java110.dto.purchase.AllocationStorehouseDto;
-import com.java110.dto.purchase.PurchaseApplyDto;
-import com.java110.dto.resource.ResourceStoreDto;
 import com.java110.dto.resource.ResourceStoreTimesDto;
-import com.java110.dto.store.StorehouseDto;
-import com.java110.intf.common.IAllocationStorehouseUserInnerServiceSMO;
 import com.java110.intf.common.IOaWorkflowActivitiInnerServiceSMO;
 import com.java110.intf.store.*;
 import com.java110.po.purchase.AllocationStorehouseApplyPo;
-import com.java110.po.purchase.PurchaseApplyPo;
-import com.java110.po.purchase.ResourceStorePo;
-import com.java110.po.resource.ResourceStoreTimesPo;
+import com.java110.po.purchase.AllocationStorehousePo;
 import com.java110.store.bmo.allocation.IAllocationBMO;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
-import com.java110.utils.util.BeanConvertUtil;
 import com.java110.vo.ResultVo;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -40,27 +32,14 @@
     @Autowired
     private IAllocationStorehouseApplyInnerServiceSMO allocationStorehouseApplyInnerServiceSMOImpl;
 
-
     @Autowired
     private IResourceStoreTimesV1InnerServiceSMO resourceStoreTimesV1InnerServiceSMOImpl;
-
-    @Autowired
-    private IResourceStoreInnerServiceSMO resourceStoreInnerServiceSMOImpl;
-
-    @Autowired
-    private IAllocationStorehouseUserInnerServiceSMO allocationStorehouseUserInnerServiceSMOImpl;
-
-    @Autowired
-    private IUserStorehouseInnerServiceSMO userStorehouseInnerServiceSMOImpl;
 
     @Autowired
     private IAllocationStorehouseApplyV1InnerServiceSMO allocationStorehouseApplyV1InnerServiceSMOImpl;
 
     @Autowired
     private IAllocationStorehouseV1InnerServiceSMO allocationStorehouseV1InnerServiceSMOImpl;
-
-    @Autowired
-    private IResourceStoreV1InnerServiceSMO resourceStoreV1InnerServiceSMOImpl;
 
     @Autowired
     private IAllocationBMO allocationBMOImpl;
@@ -71,7 +50,6 @@
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
         Assert.hasKeyAndValue(reqJson, "applyId", "璁㈠崟ID涓虹┖");
-
         AllocationStorehouseApplyDto allocationStorehouseApplyDto = new AllocationStorehouseApplyDto();
         allocationStorehouseApplyDto.setApplyId(reqJson.getString("applyId"));
         List<AllocationStorehouseApplyDto> allocationStorehouseDtos
@@ -89,7 +67,7 @@
         JSONObject resourceStore = null;
         ResourceStoreTimesDto resourceStoreTimesDto = null;
         List<ResourceStoreTimesDto> resourceStoreTimesDtos = null;
-        int originStock = 0;
+        double originStock = 0;
         for (int detailIndex = 0; detailIndex < resourceStores.size(); detailIndex++) {
             resourceStore = resourceStores.getJSONObject(detailIndex);
             Assert.hasKeyAndValue(resourceStore, "quantity", "璋冩嫧鏁伴噺鏈寘鍚�");
@@ -98,27 +76,24 @@
             Assert.hasKeyAndValue(resourceStore, "timesId", "鍗曚环鏈~鍐�");
             Assert.hasKeyAndValue(resourceStore, "resCode", "鐗╁搧缂栫爜鏈~鍐�");
             Assert.hasKeyAndValue(resourceStore, "asId", "璋冩嫧鏄庣粏鏈~鍐�");
-
-
             resourceStoreTimesDto = new ResourceStoreTimesDto();
             resourceStoreTimesDto.setTimesId(resourceStore.getString("timesId"));
             resourceStoreTimesDto.setShId(resourceStore.getString("shIda"));
             resourceStoreTimesDtos = resourceStoreTimesV1InnerServiceSMOImpl.queryResourceStoreTimess(resourceStoreTimesDto);
-
             Assert.listOnlyOne(resourceStoreTimesDtos, "鐗╁搧涓嶅瓨鍦�");
-            originStock = Integer.parseInt(resourceStoreTimesDtos.get(0).getStock());
-            if(originStock < resourceStore.getIntValue("quantity")){
-                throw new CmdException(reqJson.getString("resCode")+"搴撳瓨涓嶈冻");
+            originStock = Double.parseDouble(resourceStoreTimesDtos.get(0).getStock());
+            double quantity = Double.parseDouble(resourceStore.getString("quantity"));
+            if (originStock < quantity) {
+                throw new CmdException(reqJson.getString("resCode") + "搴撳瓨涓嶈冻");
             }
         }
     }
 
     @Override
     public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
-
         JSONArray resourceStores = reqJson.getJSONArray("resourceStores");
         JSONObject resourceStore = null;
-        int quantity = 0;
+        double quantity = 0;
         for (int detailIndex = 0; detailIndex < resourceStores.size(); detailIndex++) {
             resourceStore = resourceStores.getJSONObject(detailIndex);
             //todo 鏌ヨ璋冩嫧璁板綍
@@ -126,12 +101,15 @@
             allocationStorehouseDto.setApplyId(reqJson.getString("applyId"));
             allocationStorehouseDto.setAsId(resourceStore.getString("asId"));
             List<AllocationStorehouseDto> allocationStorehouseDtos = allocationStorehouseV1InnerServiceSMOImpl.queryAllocationStorehouses(allocationStorehouseDto);
-            quantity = resourceStore.getIntValue("quantity");
+            quantity = Double.parseDouble(resourceStore.getString("quantity"));
             //todo 姣忔潯璁板綍璋冩嫧
             allocationBMOImpl.doToAllocationStorehouse(allocationStorehouseDtos.get(0), quantity);
+            //鎶婅皟鎷ㄧ敵璇峰簱瀛樻洿鏂颁负瀹為檯璋冩嫧搴撳瓨
+            AllocationStorehousePo allocationStorehousePo = new AllocationStorehousePo();
+            allocationStorehousePo.setAsId(resourceStore.getString("asId"));
+            allocationStorehousePo.setStock(resourceStore.getString("quantity"));
+            allocationStorehouseV1InnerServiceSMOImpl.updateAllocationStorehouse(allocationStorehousePo);
         }
-
-        //
         String applyId = reqJson.getString("applyId");
         AllocationStorehouseApplyPo allocationStorehouseApplyPo = new AllocationStorehouseApplyPo();
         allocationStorehouseApplyPo.setApplyId(applyId);
@@ -153,10 +131,6 @@
         }
         allocationStorehouseApplyPo.setStatusCd("0");
         allocationStorehouseApplyV1InnerServiceSMOImpl.updateAllocationStorehouseApply(allocationStorehouseApplyPo);
-
-
-
         context.setResponseEntity(ResultVo.createResponseEntity(ResultVo.CODE_OK, "閲囪喘鐢宠鎴愬姛"));
     }
-
 }

--
Gitblit v1.8.0