From 18d1f4bc4f4f77c8883702a00896dd99469db648 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期五, 25 八月 2023 16:06:37 +0800
Subject: [PATCH] Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

---
 service-store/src/main/java/com/java110/store/cmd/resourceStore/AuditAllocationStoreOrderCmd.java |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 53 insertions(+), 5 deletions(-)

diff --git a/service-store/src/main/java/com/java110/store/cmd/resourceStore/AuditAllocationStoreOrderCmd.java b/service-store/src/main/java/com/java110/store/cmd/resourceStore/AuditAllocationStoreOrderCmd.java
index 3a3ddb8..6dc9dba 100644
--- a/service-store/src/main/java/com/java110/store/cmd/resourceStore/AuditAllocationStoreOrderCmd.java
+++ b/service-store/src/main/java/com/java110/store/cmd/resourceStore/AuditAllocationStoreOrderCmd.java
@@ -7,13 +7,15 @@
 import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.dto.allocationStorehouse.AllocationStorehouseDto;
-import com.java110.dto.allocationStorehouseApply.AllocationStorehouseApplyDto;
-import com.java110.dto.resourceStore.ResourceStoreDto;
+import com.java110.dto.purchase.AllocationStorehouseDto;
+import com.java110.dto.purchase.AllocationStorehouseApplyDto;
+import com.java110.dto.resource.ResourceStoreDto;
+import com.java110.dto.resource.ResourceStoreTimesDto;
 import com.java110.intf.common.IAllocationStorehouseUserInnerServiceSMO;
 import com.java110.intf.store.*;
-import com.java110.po.allocationStorehouseApply.AllocationStorehouseApplyPo;
+import com.java110.po.purchase.AllocationStorehouseApplyPo;
 import com.java110.po.purchase.ResourceStorePo;
+import com.java110.po.resource.ResourceStoreTimesPo;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
@@ -48,6 +50,9 @@
     @Autowired
     private IAllocationStorehouseApplyV1InnerServiceSMO allocationStorehouseApplyV1InnerServiceSMOImpl;
 
+    @Autowired
+    private IResourceStoreTimesV1InnerServiceSMO resourceStoreTimesV1InnerServiceSMOImpl;
+
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         Assert.hasKeyAndValue(reqJson, "applyId", "璁㈠崟鍙蜂笉鑳戒负绌�");
@@ -56,6 +61,14 @@
         Assert.hasKeyAndValue(reqJson, "remark", "蹇呭~锛岃濉啓鎵规敞");
     }
 
+    /**
+     * 璋冩嫧鐢宠-鐗╁搧璋冩嫧瀹℃牳
+     * @param event              浜嬩欢瀵硅薄
+     * @param context 鏁版嵁涓婃枃瀵硅薄
+     * @param reqJson            璇锋眰鎶ユ枃
+     * @throws CmdException
+     * @throws ParseException
+     */
     @Override
     @Java110Transactional
     public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
@@ -69,6 +82,7 @@
         allocationStorehouseDto.setAuditMessage(reqJson.getString("remark"));
         allocationStorehouseDto.setCurrentUserId(reqJson.getString("userId"));
         allocationStorehouseDto.setNoticeState(reqJson.getString("noticeState"));
+        allocationStorehouseDto.setNextUserId(reqJson.getString("nextUserId"));
         AllocationStorehouseApplyDto tmpAllocationStorehouseDto = new AllocationStorehouseApplyDto();
         tmpAllocationStorehouseDto.setApplyId(reqJson.getString("applyId"));
         tmpAllocationStorehouseDto.setStoreId(reqJson.getString("storeId"));
@@ -215,6 +229,22 @@
                         throw new CmdException("娣诲姞澶辫触");
                     }
                 }
+                // 淇濆瓨鑷� 鐗╁搧 times琛�
+                //鏌ヨ璋冩嫧鎵规浠锋牸
+                ResourceStoreTimesDto resourceStoreTimesDto = new ResourceStoreTimesDto();
+                resourceStoreTimesDto.setTimesId(allocationStorehouseDto.getTimesId());
+                List<ResourceStoreTimesDto> resourceStoreTimesDtos = resourceStoreTimesV1InnerServiceSMOImpl.queryResourceStoreTimess(resourceStoreTimesDto);
+
+                ResourceStoreTimesPo resourceStoreTimesPo = new ResourceStoreTimesPo();
+                resourceStoreTimesPo.setApplyOrderId(tmpAllocationStorehouseDto.getApplyId());
+                resourceStoreTimesPo.setPrice(resourceStoreTimesDtos.get(0).getPrice());
+                resourceStoreTimesPo.setStock(allocationStorehouseDto.getStock());
+                resourceStoreTimesPo.setResCode(allocationStorehouseDto.getResCode());
+                resourceStoreTimesPo.setStoreId(allocationStorehouseDto.getStoreId());
+                resourceStoreTimesPo.setTimesId(GenerateCodeFactory.getGeneratorId("10"));
+                resourceStoreTimesPo.setShId(allocationStorehouseDto.getShIdz());
+                resourceStoreTimesV1InnerServiceSMOImpl.saveOrUpdateResourceStoreTimes(resourceStoreTimesPo);
+
             }
         } else if (allocationStorehouseApplyDtos.get(0).getState().equals("1203")) {
             allocationStorehouseApplyPo.setState(AllocationStorehouseDto.STATE_FAIL);
@@ -245,7 +275,8 @@
         int flag = allocationStorehouseApplyV1InnerServiceSMOImpl.updateAllocationStorehouseApply(allocationStorehouseApplyPo);
         if (flag < 1) {
             throw new CmdException("淇敼澶辫触");
-        }        //璋冩嫧璇︽儏鏁版嵁
+        }
+        //璋冩嫧璇︽儏鏁版嵁
         AllocationStorehouseDto tmpAllocationStorehouseDto = new AllocationStorehouseDto();
         tmpAllocationStorehouseDto.setApplyId(paramInJson.getString("applyId"));
         tmpAllocationStorehouseDto.setStoreId(paramInJson.getString("storeId"));
@@ -280,6 +311,23 @@
             BigDecimal newMiniStock = miniStock.add(nowMiniStock);
             resourceStorePo.setMiniStock(String.valueOf(newMiniStock));
             flag = resourceStoreV1InnerServiceSMOImpl.updateResourceStore(resourceStorePo);
+
+            // 淇濆瓨鑷� 鐗╁搧 times琛�
+            //鏌ヨ璋冩嫧鎵规浠锋牸
+            ResourceStoreTimesDto resourceStoreTimesDto = new ResourceStoreTimesDto();
+            resourceStoreTimesDto.setTimesId(allocationStorehouseDto.getTimesId());
+            List<ResourceStoreTimesDto> resourceStoreTimesDtos = resourceStoreTimesV1InnerServiceSMOImpl.queryResourceStoreTimess(resourceStoreTimesDto);
+
+            ResourceStoreTimesPo resourceStoreTimesPo = new ResourceStoreTimesPo();
+            resourceStoreTimesPo.setApplyOrderId(tmpAllocationStorehouseDto.getApplyId());
+            resourceStoreTimesPo.setPrice(resourceStoreTimesDtos.get(0).getPrice());
+            resourceStoreTimesPo.setStock(allocationStorehouseDto.getStock());
+            resourceStoreTimesPo.setResCode(allocationStorehouseDto.getResCode());
+            resourceStoreTimesPo.setStoreId(allocationStorehouseDto.getStoreId());
+            resourceStoreTimesPo.setTimesId(GenerateCodeFactory.getGeneratorId("10"));
+            resourceStoreTimesPo.setShId(allocationStorehouseDto.getShIda());
+            resourceStoreTimesV1InnerServiceSMOImpl.saveOrUpdateResourceStoreTimes(resourceStoreTimesPo);
+
             if (flag < 1) {
                 throw new CmdException("淇敼澶辫触");
             }

--
Gitblit v1.8.0