From f1bf27a91f0e6a0943912161070557b304ebcac9 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 25 八月 2022 09:43:01 +0800
Subject: [PATCH] 优化代码

---
 service-common/src/main/java/com/java110/common/cmd/machine/GetCarMachineQrCodeUrl.java |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 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 754f2b4..cae727e 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,7 @@
 import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.log.LoggerFactory;
 import com.java110.dto.parkingBoxArea.ParkingBoxAreaDto;
 import com.java110.dto.smallWeChat.SmallWeChatDto;
 import com.java110.intf.community.IParkingBoxAreaV1InnerServiceSMO;
@@ -31,7 +32,6 @@
 import com.java110.utils.util.StringUtil;
 import com.java110.vo.ResultVo;
 import org.slf4j.Logger;
-import com.java110.core.log.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.util.List;
@@ -60,6 +60,7 @@
     private ISmallWeChatInnerServiceSMO smallWeChatInnerServiceSMOImpl;
     @Autowired
     private IParkingBoxAreaV1InnerServiceSMO parkingBoxAreaV1InnerServiceSMOImpl;
+
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         Assert.hasKeyAndValue(reqJson, "communityId", "璇锋眰鎶ユ枃涓湭鍖呭惈灏忓尯淇℃伅");
@@ -75,11 +76,15 @@
         smallWeChatDto.setWeChatType(SmallWeChatDto.WECHAT_TYPE_PUBLIC);
         List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto);
         String ownerUrl = MappingCache.getValue("OWNER_WECHAT_URL");
-        ownerUrl += ("/#/pages/tempParkingFee/tempParkingFee?paId="+ getPaIds(reqJson));
-        if(smallWeChatDtos != null && smallWeChatDtos.size()> 0){
-            ownerUrl += ("&appId="+smallWeChatDtos.get(0).getAppId());
+        ownerUrl += ("/#/pages/tempParkingFee/tempParkingFee?paId=" + getPaIds(reqJson));
+        if (smallWeChatDtos != null && smallWeChatDtos.size() > 0) {
+            ownerUrl += ("&appId=" + smallWeChatDtos.get(0).getAppId());
         }
-        reqJson.put("url",ownerUrl);
+
+        if (reqJson.containsKey("machineId") && !"-1".equals(reqJson.getString("machineId"))) {
+            ownerUrl += ("&machineId=" + reqJson.getString("machineId"));
+        }
+        reqJson.put("url", ownerUrl);
         cmdDataFlowContext.setResponseEntity(ResultVo.createResponseEntity(reqJson));
     }
 

--
Gitblit v1.8.0