From e739add1e75473eae6a6067d1a1f5f7267ad4462 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期一, 10 十月 2022 18:15:15 +0800
Subject: [PATCH] 优化预约代码

---
 service-store/src/main/java/com/java110/store/cmd/resourceStore/SaveAllocationStorehouseCmd.java |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/service-store/src/main/java/com/java110/store/cmd/resourceStore/SaveAllocationStorehouseCmd.java b/service-store/src/main/java/com/java110/store/cmd/resourceStore/SaveAllocationStorehouseCmd.java
index a06ad58..c7acc5f 100644
--- a/service-store/src/main/java/com/java110/store/cmd/resourceStore/SaveAllocationStorehouseCmd.java
+++ b/service-store/src/main/java/com/java110/store/cmd/resourceStore/SaveAllocationStorehouseCmd.java
@@ -5,15 +5,17 @@
 import com.java110.core.annotation.Java110Cmd;
 import com.java110.core.annotation.Java110Transactional;
 import com.java110.core.context.ICmdDataFlowContext;
-import com.java110.core.event.cmd.AbstractServiceCmdListener;
+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.user.UserDto;
 import com.java110.dto.userStorehouse.UserStorehouseDto;
 import com.java110.intf.common.IAllocationStorehouseUserInnerServiceSMO;
 import com.java110.intf.store.*;
+import com.java110.intf.user.IUserV1InnerServiceSMO;
 import com.java110.po.allocationStorehouse.AllocationStorehousePo;
 import com.java110.po.allocationStorehouseApply.AllocationStorehouseApplyPo;
 import com.java110.po.purchase.ResourceStorePo;
@@ -36,7 +38,7 @@
  *
  */
 @Java110Cmd(serviceCode = "resourceStore.saveAllocationStorehouse")
-public class SaveAllocationStorehouseCmd extends AbstractServiceCmdListener {
+public class SaveAllocationStorehouseCmd extends Cmd {
 
     @Autowired
     private IResourceStoreInnerServiceSMO resourceStoreInnerServiceSMOImpl;
@@ -58,6 +60,9 @@
 
     @Autowired
     private IUserStorehouseV1InnerServiceSMO userStorehouseV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl;
 
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
@@ -135,6 +140,16 @@
         int flag = 0;
         //鑾峰彇璋冩嫧杩旇繕鐘舵�佹爣璇�
         String applyType = reqJson.getString("apply_type");
+
+        // 鏌ヨ鐢ㄦ埛鍚嶇О
+        UserDto userDto = new UserDto();
+        userDto.setUserId(reqJson.getString("userId"));
+        List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto);
+
+        Assert.listOnlyOne(userDtos, "鐢ㄦ埛涓嶅瓨鍦�");
+        reqJson.put("userName", userDtos.get(0).getName());
+
+
         //灏佽璋冩嫧瀵硅薄
         AllocationStorehouseApplyPo allocationStorehouseApplyPo = covertAllocationStorehouseApply(reqJson);
         JSONArray resourceStores = reqJson.getJSONArray("resourceStores");

--
Gitblit v1.8.0