From a13573d5ef8d16f4bc2535a3c89c2891e6f5b56c Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期二, 30 五月 2023 15:33:30 +0800
Subject: [PATCH] optimize
---
service-store/src/main/java/com/java110/store/cmd/resourceStore/AuditAllocationStoreOrderCmd.java | 50 ++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 48 insertions(+), 2 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 fddf7ca..41f1544 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
@@ -8,8 +8,9 @@
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.allocationStorehouse.AllocationStorehouseApplyDto;
import com.java110.dto.resourceStore.ResourceStoreDto;
+import com.java110.dto.resourceStoreTimes.ResourceStoreTimesDto;
import com.java110.intf.common.IAllocationStorehouseUserInnerServiceSMO;
import com.java110.intf.store.*;
import com.java110.po.allocationStorehouseApply.AllocationStorehouseApplyPo;
@@ -49,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", "璁㈠崟鍙蜂笉鑳戒负绌�");
@@ -57,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 {
@@ -216,6 +228,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);
@@ -246,7 +274,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"));
@@ -281,6 +310,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