| | |
| | | import com.java110.dto.app.AppDto; |
| | | 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.UserAttrDto; |
| | | import com.java110.dto.user.UserDto; |
| | |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | tmpUserDto.setPassword(""); |
| | | tmpUserDto.setToken(token); |
| | | tmpUserDto.setKey(newKey); |
| | | //查询认证关系 |
| | | OwnerAppUserDto dto = new OwnerAppUserDto(); |
| | | dto.setUserId(userDtos.get(0).getUserId()); |
| | | dto.setLink(userDtos.get(0).getTel()); |
| | | List<OwnerAppUserDto> dtos = ownerAppUserV1InnerServiceSMOImpl.queryOwnerAppUsers(dto); |
| | | if(!CollectionUtils.isEmpty(dtos)){ |
| | | tmpUserDto.setAuditState(dtos.get(0).getState()); |
| | | } |
| | | context.setResponseEntity(ResultVo.createResponseEntity(tmpUserDto)); |
| | | } catch (Exception e) { |
| | | logger.error("登录异常:", e); |
| | |
| | | if (flag < 1) { |
| | | throw new CmdException("注册失败"); |
| | | } |
| | | |
| | | OwnerAppUserPo ownerAppUserPo = new OwnerAppUserPo(); |
| | | //状态类型,10000 审核中,12000 审核成功,13000 审核失败 |
| | | ownerAppUserPo.setState("12000"); |
| | | ownerAppUserPo.setAppTypeCd("10010"); |
| | | ownerAppUserPo.setAppUserId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_appUserId)); |
| | | ownerAppUserPo.setMemberId(ownerDtos.get(0).getMemberId()); |
| | | ownerAppUserPo.setCommunityName(tmpCommunityDto.getName()); |
| | | ownerAppUserPo.setCommunityId(ownerDtos.get(0).getCommunityId()); |
| | | ownerAppUserPo.setAppUserName(ownerDtos.get(0).getName()); |
| | | ownerAppUserPo.setIdCard(ownerDtos.get(0).getIdCard()); |
| | | ownerAppUserPo.setAppType("WECHAT"); |
| | | ownerAppUserPo.setLink(ownerDtos.get(0).getLink()); |
| | | ownerAppUserPo.setUserId(userPo.getUserId()); |
| | | ownerAppUserPo.setOpenId("-1"); |
| | | |
| | | flag = ownerAppUserV1InnerServiceSMOImpl.saveOwnerAppUser(ownerAppUserPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("添加用户业主关系失败"); |
| | | } |
| | | |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userPo.getUserId()); |
| | | List<UserDto> userDtos = userInnerServiceSMOImpl.getUsers(userDto); |
| | | //用userId和手机号查询绑定关系,没有则新增 |
| | | OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto(); |
| | | ownerAppUserDto.setLink(userPo.getTel()); |
| | | ownerAppUserDto.setUserId(userPo.getUserId()); |
| | | List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserV1InnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto); |
| | | if(CollectionUtils.isEmpty(ownerAppUserDtos)){ |
| | | OwnerAppUserPo ownerAppUserPo = new OwnerAppUserPo(); |
| | | //状态类型,10000 审核中, 11000 待认证 ,12000 审核成功,13000 审核失败 |
| | | ownerAppUserPo.setState(OwnerAppUserDto.STATE_NOT_AUDIT); |
| | | ownerAppUserPo.setAppTypeCd("10010"); |
| | | ownerAppUserPo.setAppUserId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_appUserId)); |
| | | ownerAppUserPo.setMemberId(ownerDtos.get(0).getMemberId()); |
| | | ownerAppUserPo.setCommunityName(tmpCommunityDto.getName()); |
| | | ownerAppUserPo.setCommunityId(ownerDtos.get(0).getCommunityId()); |
| | | ownerAppUserPo.setAppUserName(ownerDtos.get(0).getName()); |
| | | ownerAppUserPo.setIdCard(ownerDtos.get(0).getIdCard()); |
| | | ownerAppUserPo.setAppType("WECHAT"); |
| | | ownerAppUserPo.setLink(ownerDtos.get(0).getLink()); |
| | | ownerAppUserPo.setUserId(userPo.getUserId()); |
| | | ownerAppUserPo.setOpenId("-1"); |
| | | flag = ownerAppUserV1InnerServiceSMOImpl.saveOwnerAppUser(ownerAppUserPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("添加用户业主关系失败"); |
| | | } |
| | | } |
| | | return userDtos; |
| | | } |
| | | |