From 755ea91d2ffb2f5ffa5c5cc75a114c2910bdefa1 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期日, 17 十月 2021 13:07:19 +0800
Subject: [PATCH] 优化代码

---
 service-common/src/main/java/com/java110/common/cmd/machine/GetCarMachineQrCodeUrl.java |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/service-common/src/main/java/com/java110/common/cmd/machine/GetCarMachineQrCodeUrl.java b/service-common/src/main/java/com/java110/common/cmd/machine/GetCarMachineQrCodeUrl.java
index f8a6442..1fee33a 100644
--- a/service-common/src/main/java/com/java110/common/cmd/machine/GetCarMachineQrCodeUrl.java
+++ b/service-common/src/main/java/com/java110/common/cmd/machine/GetCarMachineQrCodeUrl.java
@@ -21,6 +21,8 @@
 import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.AbstractServiceCmdListener;
 import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.smallWeChat.SmallWeChatDto;
+import com.java110.intf.store.ISmallWeChatInnerServiceSMO;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
@@ -29,6 +31,8 @@
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
+
+import java.util.List;
 
 /**
  * 绫昏〃杩帮細淇濆瓨
@@ -50,6 +54,9 @@
     @Autowired
     private IMachineOpenDoorBMO machineOpenDoorBMOImpl;
 
+    @Autowired
+    private ISmallWeChatInnerServiceSMO smallWeChatInnerServiceSMOImpl;
+
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         Assert.hasKeyAndValue(reqJson, "communityId", "璇锋眰鎶ユ枃涓湭鍖呭惈灏忓尯淇℃伅");
@@ -60,8 +67,15 @@
     @Override
     public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
 
+        SmallWeChatDto smallWeChatDto = new SmallWeChatDto();
+        smallWeChatDto.setObjId(reqJson.getString("communityId"));
+        smallWeChatDto.setWeChatType(SmallWeChatDto.WECHAT_TYPE_PUBLIC);
+        List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto);
         String ownerUrl = MappingCache.getValue("OWNER_WECHAT_URL");
         ownerUrl += ("/#/pages/tempParkingFee/tempParkingFee?paId="+reqJson.getString("paId"));
+        if(smallWeChatDtos != null && smallWeChatDtos.size()> 0){
+            ownerUrl += ("&appId="+smallWeChatDtos.get(0).getAppId());
+        }
         reqJson.put("url",ownerUrl);
         cmdDataFlowContext.setResponseEntity(ResultVo.createResponseEntity(reqJson));
     }

--
Gitblit v1.8.0