From cab3425bb92d01f3494eb25c1f299038dc634c65 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: 星期三, 15 三月 2023 23:43:48 +0800
Subject: [PATCH] 优化保养转单功能

---
 service-user/src/main/java/com/java110/user/cmd/owner/OwnerRegisterCmd.java |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/service-user/src/main/java/com/java110/user/cmd/owner/OwnerRegisterCmd.java b/service-user/src/main/java/com/java110/user/cmd/owner/OwnerRegisterCmd.java
index f4e516a..4c28448 100644
--- a/service-user/src/main/java/com/java110/user/cmd/owner/OwnerRegisterCmd.java
+++ b/service-user/src/main/java/com/java110/user/cmd/owner/OwnerRegisterCmd.java
@@ -4,7 +4,7 @@
 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.AuthenticationFactory;
 import com.java110.core.factory.GenerateCodeFactory;
@@ -22,6 +22,7 @@
 import com.java110.po.user.UserPo;
 import com.java110.po.userAttr.UserAttrPo;
 import com.java110.utils.cache.MappingCache;
+import com.java110.utils.constant.MappingConstant;
 import com.java110.utils.constant.UserLevelConstant;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
@@ -29,7 +30,7 @@
 import com.java110.utils.util.StringUtil;
 import com.java110.vo.ResultVo;
 import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import com.java110.core.log.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.util.List;
@@ -38,7 +39,7 @@
  * 鏈嶅姟娉ㄥ唽鍔熻兘杩佺Щ
  */
 @Java110Cmd(serviceCode = "owner.ownerRegister")
-public class OwnerRegisterCmd extends AbstractServiceCmdListener {
+public class OwnerRegisterCmd extends Cmd {
     private final static Logger logger = LoggerFactory.getLogger(OwnerRegisterCmd.class);
     @Autowired
     private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl;
@@ -76,7 +77,7 @@
         smsDto.setCode(reqJson.getString("msgCode"));
         smsDto = smsInnerServiceSMOImpl.validateCode(smsDto);
 
-        if (!smsDto.isSuccess() && "ON".equals(MappingCache.getValue(SendSmsFactory.SMS_SEND_SWITCH))) {
+        if (!smsDto.isSuccess() && "ON".equals(MappingCache.getValue(MappingConstant.SMS_DOMAIN,SendSmsFactory.SMS_SEND_SWITCH))) {
             throw new IllegalArgumentException(smsDto.getMsg());
         }
     }
@@ -122,15 +123,28 @@
     }
 
     private void addOwnerAppUser(JSONObject paramInJson, List<OwnerDto> ownerDtos) {
+        List<CommunityDto> communityDtos = null;
+        CommunityDto tmpCommunityDto = null;
+        String communityName = "鏃�";
+
         if (ownerDtos == null || ownerDtos.size() < 1) {
+            CommunityDto communityDto = new CommunityDto();
+            communityDto.setState("1100");
+            communityDto.setCommunityId(paramInJson.getString("defaultCommunityId"));
+            communityDto.setPage(1);
+            communityDto.setRow(1);
+            communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
+            if (communityDtos != null && communityDtos.size() > 0) {
+                communityName = communityDtos.get(0).getName();
+            }
             OwnerAppUserPo ownerAppUserPo = BeanConvertUtil.covertBean(paramInJson, OwnerAppUserPo.class);
             //鐘舵�佺被鍨嬶紝10000 瀹℃牳涓紝12000 瀹℃牳鎴愬姛锛�13000 瀹℃牳澶辫触
             ownerAppUserPo.setState("12000");
             ownerAppUserPo.setAppTypeCd("10010");
             ownerAppUserPo.setAppUserId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_appUserId));
             ownerAppUserPo.setMemberId("-1");
-            ownerAppUserPo.setCommunityName("-1");
-            ownerAppUserPo.setCommunityId("鏃�");
+            ownerAppUserPo.setCommunityName(communityName);
+            ownerAppUserPo.setCommunityId(paramInJson.getString("defaultCommunityId"));
             ownerAppUserPo.setAppUserName("娓稿");
             ownerAppUserPo.setIdCard("鏃�");
 
@@ -140,8 +154,7 @@
             }
             return;
         }
-        List<CommunityDto> communityDtos = null;
-        CommunityDto tmpCommunityDto = null;
+
         OwnerAppUserPo ownerAppUserPo = null;
         for (OwnerDto ownerDto : ownerDtos) {
             CommunityDto communityDto = new CommunityDto();

--
Gitblit v1.8.0