吴学文 6 роки тому
батько
коміт
78a08b81c0

+ 2 - 1
Api/src/main/java/com/java110/api/bmo/owner/impl/OwnerBMOImpl.java

@@ -68,7 +68,7 @@ public class OwnerBMOImpl extends ApiBaseBMO implements IOwnerBMO {
         JSONObject businessOwnerAppUser = new JSONObject();
         JSONObject businessOwnerAppUser = new JSONObject();
         businessOwnerAppUser.putAll(paramInJson);
         businessOwnerAppUser.putAll(paramInJson);
         //状态类型,10000 审核中,12000 审核成功,13000 审核失败
         //状态类型,10000 审核中,12000 审核成功,13000 审核失败
-        businessOwnerAppUser.put("state", "10000");
+        businessOwnerAppUser.put("state", "12000");
         businessOwnerAppUser.put("appTypeCd", "10010");
         businessOwnerAppUser.put("appTypeCd", "10010");
         businessOwnerAppUser.put("appUserId", "-1");
         businessOwnerAppUser.put("appUserId", "-1");
         businessOwnerAppUser.put("memberId", ownerDto.getMemberId());
         businessOwnerAppUser.put("memberId", ownerDto.getMemberId());
@@ -77,6 +77,7 @@ public class OwnerBMOImpl extends ApiBaseBMO implements IOwnerBMO {
         businessOwnerAppUser.put("appUserName", ownerDto.getName());
         businessOwnerAppUser.put("appUserName", ownerDto.getName());
         businessOwnerAppUser.put("idCard", ownerDto.getIdCard());
         businessOwnerAppUser.put("idCard", ownerDto.getIdCard());
         businessOwnerAppUser.put("link", ownerDto.getLink());
         businessOwnerAppUser.put("link", ownerDto.getLink());
+        businessOwnerAppUser.put("userId", paramInJson.getString("userId"));
         business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessOwnerAppUser", businessOwnerAppUser);
         business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessOwnerAppUser", businessOwnerAppUser);
         return business;
         return business;
     }
     }

+ 17 - 0
Api/src/main/java/com/java110/api/bmo/user/IUserBMO.java

@@ -14,28 +14,45 @@ import com.java110.core.context.DataFlowContext;
  **/
  **/
 public interface IUserBMO extends IApiBaseBMO {
 public interface IUserBMO extends IApiBaseBMO {
     public JSONObject addStaffOrg(JSONObject paramInJson);
     public JSONObject addStaffOrg(JSONObject paramInJson);
+
     /**
     /**
      * 添加员工
      * 添加员工
+     *
      * @param paramInJson
      * @param paramInJson
      * @return
      * @return
      */
      */
     public JSONObject addStaff(JSONObject paramInJson);
     public JSONObject addStaff(JSONObject paramInJson);
+
     /**
     /**
      * 添加用户
      * 添加用户
+     *
      * @param paramObj
      * @param paramObj
      */
      */
     public JSONObject addUser(JSONObject paramObj, DataFlowContext dataFlowContext);
     public JSONObject addUser(JSONObject paramObj, DataFlowContext dataFlowContext);
+
     public JSONObject modifyStaff(JSONObject paramObj, DataFlowContext dataFlowContext);
     public JSONObject modifyStaff(JSONObject paramObj, DataFlowContext dataFlowContext);
+
     /**
     /**
      * 删除商户
      * 删除商户
+     *
      * @param paramInJson
      * @param paramInJson
      * @return
      * @return
      */
      */
     public JSONObject deleteStaff(JSONObject paramInJson);
     public JSONObject deleteStaff(JSONObject paramInJson);
+
     /**
     /**
      * 删除商户
      * 删除商户
+     *
      * @param paramInJson
      * @param paramInJson
      * @return
      * @return
      */
      */
     public JSONObject deleteUser(JSONObject paramInJson);
     public JSONObject deleteUser(JSONObject paramInJson);
+
+
+    /**
+     * 注册用户
+     *
+     * @param paramObj
+     */
+    public JSONObject registerUser(JSONObject paramObj, DataFlowContext dataFlowContext);
 }
 }

+ 78 - 38
Api/src/main/java/com/java110/api/bmo/user/impl/UserBMOImpl.java

@@ -38,58 +38,60 @@ public class UserBMOImpl extends ApiBaseBMO implements IUserBMO {
 
 
         JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
         JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
         business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ORG_STAFF_REL);
         business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ORG_STAFF_REL);
-        business.put(CommonConstant.HTTP_SEQ,1);
-        business.put(CommonConstant.HTTP_INVOKE_MODEL,CommonConstant.HTTP_INVOKE_MODEL_S);
+        business.put(CommonConstant.HTTP_SEQ, 1);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
         JSONArray businessOrgStaffRels = new JSONArray();
         JSONArray businessOrgStaffRels = new JSONArray();
         JSONObject businessOrgStaffRel = new JSONObject();
         JSONObject businessOrgStaffRel = new JSONObject();
-        businessOrgStaffRel.put("relId","-1");
-        businessOrgStaffRel.put("storeId",paramInJson.getString("storeId"));
-        businessOrgStaffRel.put("staffId",paramInJson.getString("userId"));
-        businessOrgStaffRel.put("orgId",paramInJson.getString("orgId"));
-        businessOrgStaffRel.put("relCd",paramInJson.getString("relCd"));
+        businessOrgStaffRel.put("relId", "-1");
+        businessOrgStaffRel.put("storeId", paramInJson.getString("storeId"));
+        businessOrgStaffRel.put("staffId", paramInJson.getString("userId"));
+        businessOrgStaffRel.put("orgId", paramInJson.getString("orgId"));
+        businessOrgStaffRel.put("relCd", paramInJson.getString("relCd"));
         businessOrgStaffRels.add(businessOrgStaffRel);
         businessOrgStaffRels.add(businessOrgStaffRel);
-        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessOrgStaffRel",businessOrgStaffRels);
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessOrgStaffRel", businessOrgStaffRels);
 
 
         return business;
         return business;
     }
     }
 
 
     /**
     /**
      * 添加员工
      * 添加员工
+     *
      * @param paramInJson
      * @param paramInJson
      * @return
      * @return
      */
      */
-    public JSONObject addStaff(JSONObject paramInJson){
+    public JSONObject addStaff(JSONObject paramInJson) {
 
 
         JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
         JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
         business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_STORE_USER);
         business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_STORE_USER);
-        business.put(CommonConstant.HTTP_SEQ,1);
-        business.put(CommonConstant.HTTP_INVOKE_MODEL,CommonConstant.HTTP_INVOKE_MODEL_S);
+        business.put(CommonConstant.HTTP_SEQ, 1);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
         JSONArray businessStoreUsers = new JSONArray();
         JSONArray businessStoreUsers = new JSONArray();
         JSONObject businessStoreUser = new JSONObject();
         JSONObject businessStoreUser = new JSONObject();
-        businessStoreUser.put("storeId",paramInJson.getString("storeId"));
-        businessStoreUser.put("storeUserId","-1");
-        businessStoreUser.put("userId",paramInJson.getString("userId"));
-        businessStoreUser.put("relCd",paramInJson.getString("relCd"));
+        businessStoreUser.put("storeId", paramInJson.getString("storeId"));
+        businessStoreUser.put("storeUserId", "-1");
+        businessStoreUser.put("userId", paramInJson.getString("userId"));
+        businessStoreUser.put("relCd", paramInJson.getString("relCd"));
         businessStoreUsers.add(businessStoreUser);
         businessStoreUsers.add(businessStoreUser);
-        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessStoreUser",businessStoreUsers);
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessStoreUser", businessStoreUsers);
 
 
         return business;
         return business;
     }
     }
 
 
     /**
     /**
      * 添加用户
      * 添加用户
+     *
      * @param paramObj
      * @param paramObj
      */
      */
-    public JSONObject addUser(JSONObject paramObj, DataFlowContext dataFlowContext){
+    public JSONObject addUser(JSONObject paramObj, DataFlowContext dataFlowContext) {
 
 
         //校验json 格式中是否包含 name,email,levelCd,tel
         //校验json 格式中是否包含 name,email,levelCd,tel
-        Assert.jsonObjectHaveKey(paramObj,"name","请求参数中未包含name 节点,请确认");
+        Assert.jsonObjectHaveKey(paramObj, "name", "请求参数中未包含name 节点,请确认");
         //Assert.jsonObjectHaveKey(paramObj,"email","请求参数中未包含email 节点,请确认");
         //Assert.jsonObjectHaveKey(paramObj,"email","请求参数中未包含email 节点,请确认");
-        Assert.jsonObjectHaveKey(paramObj,"tel","请求参数中未包含tel 节点,请确认");
-        Assert.jsonObjectHaveKey(paramObj,"orgId", "请求报文格式错误或未包含部门信息");
-        Assert.jsonObjectHaveKey(paramObj,"address", "请求报文格式错误或未包含地址信息");
-        Assert.jsonObjectHaveKey(paramObj,"sex", "请求报文格式错误或未包含性别信息");
-        Assert.jsonObjectHaveKey(paramObj,"relCd", "请求报文格式错误或未包含员工角色");
+        Assert.jsonObjectHaveKey(paramObj, "tel", "请求参数中未包含tel 节点,请确认");
+        Assert.jsonObjectHaveKey(paramObj, "orgId", "请求报文格式错误或未包含部门信息");
+        Assert.jsonObjectHaveKey(paramObj, "address", "请求报文格式错误或未包含地址信息");
+        Assert.jsonObjectHaveKey(paramObj, "sex", "请求报文格式错误或未包含性别信息");
+        Assert.jsonObjectHaveKey(paramObj, "relCd", "请求报文格式错误或未包含员工角色");
 
 
 
 
         if (paramObj.containsKey("email") && !StringUtil.isEmpty(paramObj.getString("email"))) {
         if (paramObj.containsKey("email") && !StringUtil.isEmpty(paramObj.getString("email"))) {
@@ -99,29 +101,65 @@ public class UserBMOImpl extends ApiBaseBMO implements IUserBMO {
 
 
         JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
         JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
         business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_USER_INFO);
         business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_USER_INFO);
-        business.put(CommonConstant.HTTP_SEQ,1);
-        business.put(CommonConstant.HTTP_INVOKE_MODEL,CommonConstant.HTTP_INVOKE_MODEL_S);
+        business.put(CommonConstant.HTTP_SEQ, 1);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
 
 
-        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessUser",refreshParamIn(paramObj));
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessUser", refreshParamIn(paramObj));
 
 
         return business;
         return business;
     }
     }
 
 
+    /**
+     * 注册用户
+     *
+     * @param paramObj
+     */
+    public JSONObject registerUser(JSONObject paramObj, DataFlowContext dataFlowContext) {
+
+        //校验json 格式中是否包含 name,email,levelCd,tel
+        Assert.jsonObjectHaveKey(paramObj, "name", "请求参数中未包含name 节点,请确认");
+        //Assert.jsonObjectHaveKey(paramObj,"email","请求参数中未包含email 节点,请确认");
+        Assert.jsonObjectHaveKey(paramObj, "tel", "请求参数中未包含tel 节点,请确认");
+        Assert.jsonObjectHaveKey(paramObj, "password", "请求参数中未包含password 节点,请确认");
+
+
+        if (paramObj.containsKey("email") && !StringUtil.isEmpty(paramObj.getString("email"))) {
+            Assert.isEmail(paramObj, "email", "不是有效的邮箱格式");
+        }
+
+
+        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
+        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_USER_INFO);
+        business.put(CommonConstant.HTTP_SEQ, 1);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
+
+        //paramObj.put("userId","-1");
+        paramObj.put("levelCd", UserLevelConstant.USER_LEVEL_ORDINARY);
+        //设置默认密码
+        String userPassword = paramObj.getString("password");
+        userPassword = AuthenticationFactory.passwdMd5(userPassword);
+        paramObj.put("password", userPassword);
+
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessUser", paramObj);
+
+        return business;
+    }
 
 
 
 
     /**
     /**
      * 对请求报文处理
      * 对请求报文处理
+     *
      * @param paramObj
      * @param paramObj
      * @return
      * @return
      */
      */
-    private JSONObject refreshParamIn(JSONObject paramObj){
+    private JSONObject refreshParamIn(JSONObject paramObj) {
         //paramObj.put("userId","-1");
         //paramObj.put("userId","-1");
         paramObj.put("levelCd", UserLevelConstant.USER_LEVEL_STAFF);
         paramObj.put("levelCd", UserLevelConstant.USER_LEVEL_STAFF);
         //设置默认密码
         //设置默认密码
         String staffDefaultPassword = MappingCache.getValue(MappingConstant.KEY_STAFF_DEFAULT_PASSWORD);
         String staffDefaultPassword = MappingCache.getValue(MappingConstant.KEY_STAFF_DEFAULT_PASSWORD);
-        Assert.hasLength(staffDefaultPassword,"映射表中未设置员工默认密码,请检查"+MappingConstant.KEY_STAFF_DEFAULT_PASSWORD);
+        Assert.hasLength(staffDefaultPassword, "映射表中未设置员工默认密码,请检查" + MappingConstant.KEY_STAFF_DEFAULT_PASSWORD);
         staffDefaultPassword = AuthenticationFactory.passwdMd5(staffDefaultPassword);
         staffDefaultPassword = AuthenticationFactory.passwdMd5(staffDefaultPassword);
-        paramObj.put("password",staffDefaultPassword);
+        paramObj.put("password", staffDefaultPassword);
         return paramObj;
         return paramObj;
     }
     }
 
 
@@ -167,20 +205,21 @@ public class UserBMOImpl extends ApiBaseBMO implements IUserBMO {
 
 
     /**
     /**
      * 删除商户
      * 删除商户
+     *
      * @param paramInJson
      * @param paramInJson
      * @return
      * @return
      */
      */
     public JSONObject deleteStaff(JSONObject paramInJson) {
     public JSONObject deleteStaff(JSONObject paramInJson) {
         JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
         JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
         business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_STORE_USER);
         business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_STORE_USER);
-        business.put(CommonConstant.HTTP_SEQ,1);
-        business.put(CommonConstant.HTTP_INVOKE_MODEL,CommonConstant.HTTP_INVOKE_MODEL_S);
+        business.put(CommonConstant.HTTP_SEQ, 1);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
         JSONArray businessStoreUsers = new JSONArray();
         JSONArray businessStoreUsers = new JSONArray();
         JSONObject businessStoreUser = new JSONObject();
         JSONObject businessStoreUser = new JSONObject();
-        businessStoreUser.put("storeId",paramInJson.getString("storeId"));
-        businessStoreUser.put("userId",paramInJson.getString("userId"));
+        businessStoreUser.put("storeId", paramInJson.getString("storeId"));
+        businessStoreUser.put("userId", paramInJson.getString("userId"));
         businessStoreUsers.add(businessStoreUser);
         businessStoreUsers.add(businessStoreUser);
-        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessStoreUser",businessStoreUsers);
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessStoreUser", businessStoreUsers);
 
 
         return business;
         return business;
 
 
@@ -188,6 +227,7 @@ public class UserBMOImpl extends ApiBaseBMO implements IUserBMO {
 
 
     /**
     /**
      * 删除商户
      * 删除商户
+     *
      * @param paramInJson
      * @param paramInJson
      * @return
      * @return
      */
      */
@@ -197,11 +237,11 @@ public class UserBMOImpl extends ApiBaseBMO implements IUserBMO {
 
 
         JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
         JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
         business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_REMOVE_USER_INFO);
         business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_REMOVE_USER_INFO);
-        business.put(CommonConstant.HTTP_SEQ,1);
-        business.put(CommonConstant.HTTP_INVOKE_MODEL,CommonConstant.HTTP_INVOKE_MODEL_S);
+        business.put(CommonConstant.HTTP_SEQ, 1);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
         JSONObject businessStoreUser = new JSONObject();
         JSONObject businessStoreUser = new JSONObject();
-        businessStoreUser.put("userId",paramInJson.getString("userId"));
-        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessUser",businessStoreUser);
+        businessStoreUser.put("userId", paramInJson.getString("userId"));
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessUser", businessStoreUser);
 
 
         return business;
         return business;
 
 

+ 1 - 0
Api/src/main/java/com/java110/api/listener/owner/AppUserBindingOwnerListener.java

@@ -159,6 +159,7 @@ public class AppUserBindingOwnerListener extends AbstractServiceApiListener {
         String paramIn = dataFlowContext.getReqData();
         String paramIn = dataFlowContext.getReqData();
         JSONObject paramObj = JSONObject.parseObject(paramIn);
         JSONObject paramObj = JSONObject.parseObject(paramIn);
         paramObj.put("openId", openId);
         paramObj.put("openId", openId);
+        paramObj.put("userId", userId);
         HttpHeaders header = new HttpHeaders();
         HttpHeaders header = new HttpHeaders();
         dataFlowContext.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
         dataFlowContext.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
         JSONArray businesses = new JSONArray();
         JSONArray businesses = new JSONArray();

+ 222 - 0
Api/src/main/java/com/java110/api/listener/owner/OwnerRegisterListener.java

@@ -0,0 +1,222 @@
+package com.java110.api.listener.owner;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.owner.IOwnerBMO;
+import com.java110.api.bmo.user.IUserBMO;
+import com.java110.api.listener.AbstractServiceApiListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.core.smo.common.ISmsInnerServiceSMO;
+import com.java110.core.smo.community.ICommunityInnerServiceSMO;
+import com.java110.core.smo.file.IFileInnerServiceSMO;
+import com.java110.core.smo.owner.IOwnerAppUserInnerServiceSMO;
+import com.java110.core.smo.owner.IOwnerInnerServiceSMO;
+import com.java110.core.smo.user.IUserInnerServiceSMO;
+import com.java110.dto.community.CommunityDto;
+import com.java110.dto.msg.SmsDto;
+import com.java110.dto.owner.OwnerAppUserDto;
+import com.java110.dto.owner.OwnerDto;
+import com.java110.dto.user.UserDto;
+import com.java110.entity.center.AppService;
+import com.java110.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.cache.MappingCache;
+import com.java110.utils.constant.CommonConstant;
+import com.java110.utils.constant.ServiceCodeConstant;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName AppUserBindingOwnerListener
+ * @Description 业主注册小程序
+ * @Author wuxw
+ * @Date 2019/4/26 14:51
+ * @Version 1.0
+ * add by wuxw 2019/4/26
+ **/
+
+@Java110Listener("ownerRegisterListener")
+public class OwnerRegisterListener extends AbstractServiceApiListener {
+
+
+    private static final int DEFAULT_SEQ_COMMUNITY_MEMBER = 2;
+
+    @Autowired
+    private IOwnerBMO ownerBMOImpl;
+
+    @Autowired
+    private IUserBMO userBMOImpl;
+
+    @Autowired
+    private IFileInnerServiceSMO fileInnerServiceSMOImpl;
+
+    @Autowired
+    private ISmsInnerServiceSMO smsInnerServiceSMOImpl;
+
+    @Autowired
+    private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
+
+    @Autowired
+    private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl;
+
+    @Autowired
+    private IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMOImpl;
+
+    @Autowired
+    private IUserInnerServiceSMO userInnerServiceSMOImpl;
+
+    private static Logger logger = LoggerFactory.getLogger(OwnerRegisterListener.class);
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeConstant.SERVICE_CODE_OWNER_REGISTER;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "communityName", "未包含小区名称");
+        Assert.hasKeyAndValue(reqJson, "areaCode", "未包含小区地区");
+        Assert.hasKeyAndValue(reqJson, "appUserName", "未包含用户名称");
+        Assert.hasKeyAndValue(reqJson, "idCard", "未包含身份证号");
+        Assert.hasKeyAndValue(reqJson, "link", "未包含联系电话");
+        Assert.hasKeyAndValue(reqJson, "msgCode", "未包含联系电话验证码");
+        Assert.hasKeyAndValue(reqJson, "password", "未包含密码");
+
+        //判断是否有用户ID
+        Map<String, String> headers = event.getDataFlowContext().getRequestCurrentHeaders();
+
+        SmsDto smsDto = new SmsDto();
+        smsDto.setTel(reqJson.getString("link"));
+        smsDto.setCode(reqJson.getString("msgCode"));
+        smsDto = smsInnerServiceSMOImpl.validateCode(smsDto);
+
+        if (!smsDto.isSuccess() && "ON".equals(MappingCache.getValue("APP_USER_BINDING_OWNER_SMS"))) {
+            throw new IllegalArgumentException(smsDto.getMsg());
+        }
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        logger.debug("ServiceDataFlowEvent : {}", event);
+        //判断是否有用户ID
+        Map<String, String> headers = event.getDataFlowContext().getRequestCurrentHeaders();
+
+
+        OwnerAppUserDto ownerAppUserDto = BeanConvertUtil.covertBean(reqJson, OwnerAppUserDto.class);
+        ownerAppUserDto.setStates(new String[]{"10000", "12000"});
+
+        List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
+
+        //Assert.listOnlyOne(ownerAppUserDtos, "已经申请过入驻小区");
+        if (ownerAppUserDtos != null && ownerAppUserDtos.size() > 0) {
+            throw new IllegalArgumentException("已经申请过绑定业主");
+        }
+
+        //查询小区是否存在
+        CommunityDto communityDto = new CommunityDto();
+        communityDto.setCityCode(reqJson.getString("areaCode"));
+        communityDto.setName(reqJson.getString("communityName"));
+        communityDto.setState("1100");
+        List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
+
+        Assert.listOnlyOne(communityDtos, "填写小区信息错误");
+
+        CommunityDto tmpCommunityDto = communityDtos.get(0);
+
+        OwnerDto ownerDto = new OwnerDto();
+        ownerDto.setCommunityId(tmpCommunityDto.getCommunityId());
+        ownerDto.setIdCard(reqJson.getString("idCard"));
+        ownerDto.setName(reqJson.getString("appUserName"));
+        ownerDto.setLink(reqJson.getString("link"));
+        List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto);
+
+        Assert.listOnlyOne(ownerDtos, "填写业主信息错误");
+
+        OwnerDto tmpOwnerDto = ownerDtos.get(0);
+
+        DataFlowContext dataFlowContext = event.getDataFlowContext();
+        AppService service = event.getAppService();
+        String paramIn = dataFlowContext.getReqData();
+        JSONObject paramObj = JSONObject.parseObject(paramIn);
+        paramObj.put("userId", GenerateCodeFactory.getUserId());
+        paramObj.put("openId", "-1");
+        HttpHeaders header = new HttpHeaders();
+        dataFlowContext.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
+        JSONArray businesses = new JSONArray();
+        //添加小区楼
+        businesses.add(ownerBMOImpl.addOwnerAppUser(paramObj, tmpCommunityDto, tmpOwnerDto));
+        businesses.add(userBMOImpl.registerUser(paramObj, dataFlowContext));
+
+
+
+        ResponseEntity<String> responseEntity = ownerBMOImpl.callService(dataFlowContext, service.getServiceCode(), businesses);
+
+        dataFlowContext.setResponseEntity(responseEntity);
+
+    }
+
+
+    @Override
+    public int getOrder() {
+        return 0;
+    }
+
+
+    public IFileInnerServiceSMO getFileInnerServiceSMOImpl() {
+        return fileInnerServiceSMOImpl;
+    }
+
+    public void setFileInnerServiceSMOImpl(IFileInnerServiceSMO fileInnerServiceSMOImpl) {
+        this.fileInnerServiceSMOImpl = fileInnerServiceSMOImpl;
+    }
+
+
+    public ICommunityInnerServiceSMO getCommunityInnerServiceSMOImpl() {
+        return communityInnerServiceSMOImpl;
+    }
+
+    public void setCommunityInnerServiceSMOImpl(ICommunityInnerServiceSMO communityInnerServiceSMOImpl) {
+        this.communityInnerServiceSMOImpl = communityInnerServiceSMOImpl;
+    }
+
+
+    public IOwnerInnerServiceSMO getOwnerInnerServiceSMOImpl() {
+        return ownerInnerServiceSMOImpl;
+    }
+
+    public void setOwnerInnerServiceSMOImpl(IOwnerInnerServiceSMO ownerInnerServiceSMOImpl) {
+        this.ownerInnerServiceSMOImpl = ownerInnerServiceSMOImpl;
+    }
+
+    public IOwnerAppUserInnerServiceSMO getOwnerAppUserInnerServiceSMOImpl() {
+        return ownerAppUserInnerServiceSMOImpl;
+    }
+
+    public void setOwnerAppUserInnerServiceSMOImpl(IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMOImpl) {
+        this.ownerAppUserInnerServiceSMOImpl = ownerAppUserInnerServiceSMOImpl;
+    }
+
+    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
+        return userInnerServiceSMOImpl;
+    }
+
+    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
+        this.userInnerServiceSMOImpl = userInnerServiceSMOImpl;
+    }
+}

+ 2 - 0
UserService/src/main/java/com/java110/user/listener/ownerAppUser/AbstractOwnerAppUserBusinessServiceDataFlowListener.java

@@ -49,6 +49,7 @@ public abstract class AbstractOwnerAppUserBusinessServiceDataFlowListener extend
         businessOwnerAppUserInfo.put("communityId", businessOwnerAppUserInfo.get("community_id"));
         businessOwnerAppUserInfo.put("communityId", businessOwnerAppUserInfo.get("community_id"));
         businessOwnerAppUserInfo.put("appTypeCd", businessOwnerAppUserInfo.get("app_type_cd"));
         businessOwnerAppUserInfo.put("appTypeCd", businessOwnerAppUserInfo.get("app_type_cd"));
         businessOwnerAppUserInfo.put("memberId", businessOwnerAppUserInfo.get("member_id"));
         businessOwnerAppUserInfo.put("memberId", businessOwnerAppUserInfo.get("member_id"));
+        businessOwnerAppUserInfo.put("userId", businessOwnerAppUserInfo.get("user_id"));
         businessOwnerAppUserInfo.remove("bId");
         businessOwnerAppUserInfo.remove("bId");
         businessOwnerAppUserInfo.put("statusCd", statusCd);
         businessOwnerAppUserInfo.put("statusCd", statusCd);
     }
     }
@@ -85,6 +86,7 @@ public abstract class AbstractOwnerAppUserBusinessServiceDataFlowListener extend
         currentOwnerAppUserInfo.put("communityId", currentOwnerAppUserInfo.get("community_id"));
         currentOwnerAppUserInfo.put("communityId", currentOwnerAppUserInfo.get("community_id"));
         currentOwnerAppUserInfo.put("appTypeCd", currentOwnerAppUserInfo.get("app_type_cd"));
         currentOwnerAppUserInfo.put("appTypeCd", currentOwnerAppUserInfo.get("app_type_cd"));
         currentOwnerAppUserInfo.put("memberId", currentOwnerAppUserInfo.get("member_id"));
         currentOwnerAppUserInfo.put("memberId", currentOwnerAppUserInfo.get("member_id"));
+        currentOwnerAppUserInfo.put("userId", currentOwnerAppUserInfo.get("user_id"));
 
 
 
 
         currentOwnerAppUserInfo.put("operate", StatusConstant.OPERATE_DEL);
         currentOwnerAppUserInfo.put("operate", StatusConstant.OPERATE_DEL);

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/owner/OwnerAppUserDto.java

@@ -27,6 +27,7 @@ public class OwnerAppUserDto extends PageDto implements Serializable {
     private String communityId;
     private String communityId;
     private String appTypeCd;
     private String appTypeCd;
     private String memberId;
     private String memberId;
+    private String userId;
 
 
     private String[] states;
     private String[] states;
 
 
@@ -156,4 +157,12 @@ public class OwnerAppUserDto extends PageDto implements Serializable {
     public void setStateName(String stateName) {
     public void setStateName(String stateName) {
         this.stateName = stateName;
         this.stateName = stateName;
     }
     }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
 }
 }

+ 18 - 6
java110-db/src/main/resources/mapper/user/OwnerAppUserServiceDaoImplMapper.xml

@@ -7,9 +7,9 @@
     <!-- 保存绑定业主信息 add by wuxw 2018-07-03 -->
     <!-- 保存绑定业主信息 add by wuxw 2018-07-03 -->
     <insert id="saveBusinessOwnerAppUserInfo" parameterType="Map">
     <insert id="saveBusinessOwnerAppUserInfo" parameterType="Map">
         insert into business_owner_app_user(
         insert into business_owner_app_user(
-        id_card,open_id,link,remark,operate,app_user_name,community_name,state,app_user_id,community_id,app_type_cd,b_id,member_id
+        id_card,open_id,link,remark,operate,app_user_name,community_name,state,app_user_id,community_id,app_type_cd,b_id,member_id,user_id
         ) values (
         ) values (
-        #{idCard},#{openId},#{link},#{remark},#{operate},#{appUserName},#{communityName},#{state},#{appUserId},#{communityId},#{appTypeCd},#{bId},#{memberId}
+        #{idCard},#{openId},#{link},#{remark},#{operate},#{appUserName},#{communityName},#{state},#{appUserId},#{communityId},#{appTypeCd},#{bId},#{memberId},#{userId}
         )
         )
     </insert>
     </insert>
 
 
@@ -19,7 +19,7 @@
         select t.id_card,t.id_card idCard,t.open_id,t.open_id
         select t.id_card,t.id_card idCard,t.open_id,t.open_id
         openId,t.link,t.remark,t.operate,t.app_user_name,t.app_user_name appUserName,t.community_name,t.community_name
         openId,t.link,t.remark,t.operate,t.app_user_name,t.app_user_name appUserName,t.community_name,t.community_name
         communityName,t.state,t.app_user_id,t.app_user_id appUserId,t.community_id,t.community_id
         communityName,t.state,t.app_user_id,t.app_user_id appUserId,t.community_id,t.community_id
-        communityId,t.app_type_cd,t.app_type_cd appTypeCd,t.b_id,t.b_id bId,t.member_id,t.member_id memberId
+        communityId,t.app_type_cd,t.app_type_cd appTypeCd,t.b_id,t.b_id bId,t.member_id,t.member_id memberId,t.user_id,t.user_id userId
         from business_owner_app_user t
         from business_owner_app_user t
         where 1 =1
         where 1 =1
         <if test="idCard !=null and idCard != ''">
         <if test="idCard !=null and idCard != ''">
@@ -61,6 +61,9 @@
         <if test="memberId !=null and memberId != ''">
         <if test="memberId !=null and memberId != ''">
             and t.member_id= #{memberId}
             and t.member_id= #{memberId}
         </if>
         </if>
+        <if test="userId !=null and userId != ''">
+            and t.user_id= #{userId}
+        </if>
 
 
     </select>
     </select>
 
 
@@ -68,9 +71,9 @@
     <!-- 保存绑定业主信息至 instance表中 add by wuxw 2018-07-03 -->
     <!-- 保存绑定业主信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveOwnerAppUserInfoInstance" parameterType="Map">
     <insert id="saveOwnerAppUserInfoInstance" parameterType="Map">
         insert into owner_app_user(
         insert into owner_app_user(
-        id_card,open_id,link,remark,status_cd,app_user_name,community_name,state,app_user_id,community_id,app_type_cd,b_id,member_id
+        id_card,open_id,link,remark,status_cd,app_user_name,community_name,state,app_user_id,community_id,app_type_cd,b_id,member_id,user_id
         ) select
         ) select
-        t.id_card,t.open_id,t.link,t.remark,'0',t.app_user_name,t.community_name,t.state,t.app_user_id,t.community_id,t.app_type_cd,t.b_id,t.member_id
+        t.id_card,t.open_id,t.link,t.remark,'0',t.app_user_name,t.community_name,t.state,t.app_user_id,t.community_id,t.app_type_cd,t.b_id,t.member_id,t.user_id
         from business_owner_app_user t where 1=1
         from business_owner_app_user t where 1=1
         <if test="idCard !=null and idCard != ''">
         <if test="idCard !=null and idCard != ''">
             and t.id_card= #{idCard}
             and t.id_card= #{idCard}
@@ -109,6 +112,9 @@
         <if test="memberId !=null and memberId != ''">
         <if test="memberId !=null and memberId != ''">
             and t.member_id= #{memberId}
             and t.member_id= #{memberId}
         </if>
         </if>
+        <if test="userId !=null and userId != ''">
+            and t.user_id= #{userId}
+        </if>
 
 
     </insert>
     </insert>
 
 
@@ -118,7 +124,7 @@
         select t.id_card,t.id_card idCard,t.open_id,t.open_id openId,t.link,t.remark,t.status_cd,t.status_cd
         select t.id_card,t.id_card idCard,t.open_id,t.open_id openId,t.link,t.remark,t.status_cd,t.status_cd
         statusCd,t.app_user_name,t.app_user_name appUserName,t.community_name,t.community_name
         statusCd,t.app_user_name,t.app_user_name appUserName,t.community_name,t.community_name
         communityName,t.state,t.app_user_id,t.app_user_id appUserId,t.community_id,t.community_id
         communityName,t.state,t.app_user_id,t.app_user_id appUserId,t.community_id,t.community_id
-        communityId,t.app_type_cd,t.app_type_cd appTypeCd,t.b_id,t.b_id bId,t.member_id,t.member_id memberId,td1.name stateName
+        communityId,t.app_type_cd,t.app_type_cd appTypeCd,t.b_id,t.b_id bId,t.member_id,t.member_id memberId,td1.name stateName,t.user_id,t.user_id userId
         from owner_app_user t,t_dict td1
         from owner_app_user t,t_dict td1
         where 1 =1
         where 1 =1
         and t.state = td1.status_cd
         and t.state = td1.status_cd
@@ -170,6 +176,9 @@
         <if test="memberId !=null and memberId != ''">
         <if test="memberId !=null and memberId != ''">
             and t.member_id= #{memberId}
             and t.member_id= #{memberId}
         </if>
         </if>
+        <if test="userId !=null and userId != ''">
+            and t.user_id = #{userId}
+        </if>
         <if test="page != -1 and page != null ">
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
             limit #{page}, #{row}
         </if>
         </if>
@@ -213,6 +222,9 @@
         <if test="memberId !=null and memberId != ''">
         <if test="memberId !=null and memberId != ''">
             , t.member_id= #{memberId}
             , t.member_id= #{memberId}
         </if>
         </if>
+        <if test="userId !=null and userId != ''">
+            , t.user_id= #{userId}
+        </if>
         where 1=1
         where 1=1
         <if test="appUserId !=null and appUserId != ''">
         <if test="appUserId !=null and appUserId != ''">
             and t.app_user_id= #{appUserId}
             and t.app_user_id= #{appUserId}

+ 2 - 0
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeConstant.java

@@ -455,6 +455,8 @@ public class ServiceCodeConstant {
 
 
     // App 用户绑定业主接口
     // App 用户绑定业主接口
     public static final String SERVICE_CODE_APP_USER_BINDING_OWNER = "owner.appUserBindingOwner";
     public static final String SERVICE_CODE_APP_USER_BINDING_OWNER = "owner.appUserBindingOwner";
+    // App 业主注册接口
+    public static final String SERVICE_CODE_OWNER_REGISTER = "owner.ownerRegister";
 
 
 
 
     /**
     /**