| | |
| | | import com.java110.dto.msg.SmsDto; |
| | | import com.java110.dto.owner.OwnerAppUserDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.owner.OwnerRoomRelDto; |
| | | import com.java110.dto.room.RoomDto; |
| | | import com.java110.dto.system.SystemInfoDto; |
| | | import com.java110.dto.user.LoginOwnerResDto; |
| | | import com.java110.dto.user.UserAttrDto; |
| | |
| | | import com.java110.intf.common.ISmsInnerServiceSMO; |
| | | import com.java110.intf.common.ISystemInfoV1InnerServiceSMO; |
| | | import com.java110.intf.community.ICommunityInnerServiceSMO; |
| | | import com.java110.intf.community.IRoomInnerServiceSMO; |
| | | import com.java110.intf.job.IIotInnerServiceSMO; |
| | | import com.java110.intf.job.IMallInnerServiceSMO; |
| | | import com.java110.intf.user.*; |
| | | import com.java110.po.owner.OwnerAppUserPo; |
| | | import com.java110.po.user.UserAttrPo; |
| | |
| | | @Autowired |
| | | private ISystemInfoV1InnerServiceSMO systemInfoV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerRoomRelV1InnerServiceSMO ownerRoomRelV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IMallInnerServiceSMO mallInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IIotInnerServiceSMO iotInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRoomInnerServiceSMO roomInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | Assert.hasKeyAndValue(reqJson, "username", "请求报文中未包含用户名"); |
| | |
| | | userDtos = ifOwnerLoginByPhone(reqJson, context); |
| | | } |
| | | if (ListUtil.isNull(userDtos)) { |
| | | throw new CmdException("用户不存在,请先注册"); |
| | | throw new CmdException("密码错误或者用户不存在"); |
| | | } |
| | | |
| | | //todo 1.2 同步物业用户资料给商城 |
| | | mallInnerServiceSMOImpl.sendUserInfo(userDtos.get(0)); |
| | | |
| | | //todo 1.3 同步物业用户资料给物联网 |
| | | iotInnerServiceSMOImpl.sendUserInfo(userDtos.get(0)); |
| | | |
| | | // todo 2.0 校验 业主用户绑定表是否存在记录 |
| | | OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto(); |
| | |
| | | if (!ListUtil.isNull(ownerAppUserDtos)) { |
| | | // todo 4.0 查询小区是否存在 |
| | | communityId = ownerAppUserDtos.get(0).getCommunityId(); |
| | | }else{ |
| | | } else { |
| | | SystemInfoDto systemInfoDto = new SystemInfoDto(); |
| | | List<SystemInfoDto> systemInfoDtos = systemInfoV1InnerServiceSMOImpl.querySystemInfos(systemInfoDto); |
| | | communityId = systemInfoDtos.get(0).getDefaultCommunityId(); |
| | |
| | | CommunityDto communityDto = new CommunityDto(); |
| | | communityDto.setCommunityId(communityId); |
| | | List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto); |
| | | Assert.listOnlyOne(communityDtos, "小区不存在,确保开发者账户配置默认小区" + ownerAppUserDtos.get(0).getCommunityId()); |
| | | Assert.listOnlyOne(communityDtos, "小区不存在,确保开发者账户配置默认小区" + communityId); |
| | | |
| | | //todo 生成 app 永久登录key |
| | | UserDto tmpUserDto = userDtos.get(0); |
| | |
| | | loginOwnerResDto.setCommunityId(communityDtos.get(0).getCommunityId()); |
| | | loginOwnerResDto.setCommunityName(communityDtos.get(0).getName()); |
| | | loginOwnerResDto.setCommunityTel(communityDtos.get(0).getTel()); |
| | | loginOwnerResDto.setCommunityQrCode(communityDtos.get(0).getQrCode()); |
| | | loginOwnerResDto.setUserId(tmpUserDto.getUserId()); |
| | | loginOwnerResDto.setUserName(tmpUserDto.getName()); |
| | | loginOwnerResDto.setOwnerTel(tmpUserDto.getTel()); |
| | |
| | | } |
| | | |
| | | OwnerAppUserPo ownerAppUserPo = new OwnerAppUserPo(); |
| | | //状态类型,10000 审核中,12000 审核成功,13000 审核失败 |
| | | ownerAppUserPo.setState("12000"); |
| | | //状态类型,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.setLink(ownerDtos.get(0).getLink()); |
| | | ownerAppUserPo.setUserId(userPo.getUserId()); |
| | | ownerAppUserPo.setOpenId("-1"); |
| | | ownerAppUserPo.setOwnerTypeCd(ownerDtos.get(0).getOwnerTypeCd()); |
| | | |
| | | queryOwnerRoom(ownerDtos.get(0), ownerAppUserPo); |
| | | |
| | | |
| | | flag = ownerAppUserV1InnerServiceSMOImpl.saveOwnerAppUser(ownerAppUserPo); |
| | | if (flag < 1) { |
| | |
| | | return userDtos; |
| | | } |
| | | |
| | | private void queryOwnerRoom(OwnerDto ownerDto, OwnerAppUserPo ownerAppUserPo) { |
| | | |
| | | |
| | | OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto(); |
| | | ownerRoomRelDto.setOwnerId(ownerDto.getOwnerId()); |
| | | |
| | | List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelV1InnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto); |
| | | |
| | | if (ListUtil.isNull(ownerRoomRelDtos)) { |
| | | return; |
| | | } |
| | | |
| | | RoomDto roomDto = new RoomDto(); |
| | | roomDto.setRoomId(ownerRoomRelDtos.get(0).getRoomId()); |
| | | List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto); |
| | | if (ListUtil.isNull(roomDtos)) { |
| | | return; |
| | | } |
| | | |
| | | ownerAppUserPo.setRoomId(roomDtos.get(0).getRoomId()); |
| | | ownerAppUserPo.setRoomName(roomDtos.get(0).getFloorNum() + "-" + roomDtos.get(0).getUnitNum() + "-" + roomDtos.get(0).getRoomNum()); |
| | | } |
| | | |
| | | private UserAttrDto getCurrentUserAttrDto(List<UserAttrDto> userAttrDtos, String specCd) { |
| | | if (userAttrDtos == null) { |
| | | return null; |