| | |
| | | import com.java110.dto.UserDto; |
| | | import com.java110.user.dao.IOwnerServiceDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | @Autowired |
| | | private IOwnerServiceDao ownerServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | |
| | |
| | | //调用 小区服务查询 小区成员业主信息 |
| | | CommunityMemberDto communityMemberDto = BeanConvertUtil.covertBean(ownerDto, CommunityMemberDto.class); |
| | | communityMemberDto.setMemberTypeCd(CommunityMemberTypeConstant.OWNER); |
| | | if (StringUtils.isEmpty(communityMemberDto.getMemberId()) && !StringUtils.isEmpty(ownerDto.getOwnerId())) { |
| | | communityMemberDto.setMemberId(ownerDto.getOwnerId()); |
| | | } |
| | | List<CommunityMemberDto> communityMemberDtos = communityInnerServiceSMOImpl.getCommunityMembers(communityMemberDto); |
| | | |
| | | if (communityMemberDtos == null || communityMemberDtos.size() < 1) { |
| | |
| | | |
| | | Map ownerInfo = new HashMap(); |
| | | ownerInfo.put("ownerIds", getOwnerIds(communityMemberDtos)); |
| | | ownerInfo.put("ownerTypeCd", ownerDto.getOwnerTypeCd()); |
| | | ownerInfo.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | |
| | | List<OwnerDto> owners = BeanConvertUtil.covertBeanList(ownerServiceDaoImpl.getOwnerInfo(ownerInfo), OwnerDto.class); |
| | | |
| | | if (owners == null || owners.size() == 0) { |
| | | return owners; |
| | | } |
| | | |
| | | String[] userIds = getUserIds(owners); |
| | | //根据 userId 查询用户信息 |
| | | List<UserDto> users = userInnerServiceSMOImpl.getUserInfo(userIds); |
| | | |
| | | for (OwnerDto owner : owners) { |
| | | refreshOwner(owner, users); |
| | | } |
| | | return owners; |
| | | } |
| | | |
| | | @Override |
| | | public List<OwnerDto> queryOwnerMembers(@RequestBody OwnerDto ownerDto) { |
| | | List<OwnerDto> owners = BeanConvertUtil.covertBeanList(ownerServiceDaoImpl.getOwnerInfo(BeanConvertUtil.beanCovertMap(ownerDto)), OwnerDto.class); |
| | | if (owners == null || owners.size() == 0) { |
| | | return owners; |
| | | } |
| | |
| | | private void refreshOwner(OwnerDto owner, List<UserDto> users) { |
| | | for (UserDto user : users) { |
| | | if (owner.getUserId().equals(user.getUserId())) { |
| | | BeanConvertUtil.covertBean(user, owner); |
| | | //BeanConvertUtil.covertBean(user, owner); |
| | | owner.setUserName(user.getUserName()); |
| | | } |
| | | } |
| | | } |
| | |
| | | return owners; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryNoEnterRoomOwnerCount(@RequestBody OwnerDto ownerDto) { |
| | | return ownerServiceDaoImpl.queryNoEnterRoomOwnerCount(BeanConvertUtil.beanCovertMap(ownerDto)); |
| | | } |
| | | |
| | | @Override |
| | | public List<OwnerDto> queryOwnersByRoom(@RequestBody OwnerDto ownerDto) { |
| | | return BeanConvertUtil.covertBeanList(ownerServiceDaoImpl.queryOwnersByRoom(BeanConvertUtil.beanCovertMap(ownerDto)), OwnerDto.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<OwnerDto> queryOwnersByParkingSpace(@RequestBody OwnerDto ownerDto) { |
| | | return BeanConvertUtil.covertBeanList(ownerServiceDaoImpl.queryOwnersByParkingSpace(BeanConvertUtil.beanCovertMap(ownerDto)), OwnerDto.class); |
| | | } |
| | | |
| | | public IUserInnerServiceSMO getUserInnerServiceSMOImpl() { |
| | | return userInnerServiceSMOImpl; |
| | | } |