| | |
| | | import com.java110.intf.community.IRoomV1InnerServiceSMO; |
| | | import com.java110.intf.user.*; |
| | | import com.java110.po.owner.OwnerAppUserPo; |
| | | import com.java110.po.owner.OwnerPo; |
| | | import com.java110.po.user.UserPo; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区"); |
| | | Assert.hasKeyAndValue(reqJson, "roomName", "未包含房屋"); |
| | | Assert.hasKeyAndValue(reqJson, "roomId", "未包含房屋"); |
| | | Assert.hasKeyAndValue(reqJson, "link", "未包含手机号"); |
| | | // Assert.hasKeyAndValue(reqJson, "link", "未包含手机号"); |
| | | Assert.hasKeyAndValue(reqJson, "ownerName", "未包含人员名称"); |
| | | Assert.hasKeyAndValue(reqJson, "ownerTypeCd", "未包含人员类型"); |
| | | |
| | |
| | | userDto.setUserId(userId); |
| | | List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); |
| | | Assert.listOnlyOne(userDtos, "用户未登录"); |
| | | if (!userDtos.get(0).getTel().equals(reqJson.getString("link"))) { |
| | | throw new CmdException("手机号错误,不是注册时的手机号"); |
| | | } |
| | | |
| | | // if(!StringUtils.isEmpty(userDtos.get(0).getTel())){ |
| | | // if (!userDtos.get(0).getTel().equals(reqJson.getString("link"))) { |
| | | // throw new CmdException("手机号错误,不是注册时的手机号"); |
| | | // } |
| | | // } |
| | | OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto(); |
| | | ownerAppUserDto.setLink(reqJson.getString("link")); |
| | | //由于手机号是非必填,所有有可能查出来大量用户,所以不能使用手机号查询,要用userId查询 |
| | | // ownerAppUserDto.setLink(reqJson.getString("link")); |
| | | ownerAppUserDto.setUserId(userId); |
| | | ownerAppUserDto.setCommunityId(reqJson.getString("communityId")); |
| | | ownerAppUserDto.setStates(new String[]{ |
| | | OwnerAppUserDto.STATE_AUDITING, |
| | |
| | | }else{ |
| | | for(OwnerAppUserDto ownerAppUser : ownerAppUserDtos){ |
| | | ownerAppUserPo.setAppUserId(ownerAppUser.getAppUserId()); |
| | | if(StringUtil.isEmpty(reqJson.getString("link"))){ |
| | | if(StringUtils.isEmpty(reqJson.getString("link"))){ |
| | | ownerAppUserPo.setState(OwnerAppUserDto.STATE_AUDITING); |
| | | }else{ |
| | | ownerAppUserPo.setState(OwnerAppUserDto.STATE_AUDIT_SUCCESS); |
| | | } |
| | | ownerAppUserPo.setLink(reqJson.getString("link")); |
| | | ownerAppUserV1InnerServiceSMOImpl.updateOwnerAppUser(ownerAppUserPo); |
| | | //更新building_owner表的link字段 |
| | | OwnerPo ownerPo = new OwnerPo(); |
| | | ownerPo.setMemberId(ownerAppUser.getMemberId()); |
| | | ownerPo.setLink(reqJson.getString("link")); |
| | | ownerV1InnerServiceSMOImpl.updateOwner(ownerPo); |
| | | //更新u_user的tel字段 |
| | | UserPo userPo = new UserPo(); |
| | | userPo.setUserId(ownerAppUser.getUserId()); |
| | | userPo.setTel(reqJson.getString("link")); |
| | | userV1InnerServiceSMOImpl.updateUser(userPo); |
| | | } |
| | | } |
| | | } |