| | |
| | | package com.java110.user.smo.impl; |
| | | |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.CommunityMemberDto; |
| | | import com.java110.dto.community.CommunityMemberDto; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.dto.owner.OwnerAttrDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.common.IFileRelInnerServiceSMO; |
| | | import com.java110.intf.community.ICommunityInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerAttrInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerInnerServiceSMO; |
| | | import com.java110.intf.user.IUserInnerServiceSMO; |
| | | import com.java110.po.owner.OwnerPo; |
| | | import com.java110.user.dao.IOwnerServiceDao; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.MappingConstant; |
| | | import com.java110.utils.constant.OwnerTypeConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | @Autowired |
| | | private ICommunityInnerServiceSMO communityInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFileRelInnerServiceSMO fileRelInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<OwnerDto> queryOwners(@RequestBody OwnerDto ownerDto) { |
| | | |
| | |
| | | } |
| | | |
| | | Map ownerInfo = BeanConvertUtil.beanCovertMap(ownerDto); |
| | | ownerInfo.put("communityId", ownerDto.getCommunityId()); |
| | | ownerInfo.put("ownerTypeCd", OwnerTypeConstant.OWNER); |
| | | // 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) { |
| | | if (ListUtil.isNull(owners)) { |
| | | return owners; |
| | | } |
| | | |
| | |
| | | for (OwnerDto owner : owners) { |
| | | refreshOwner(owner, users, ownerAttrDtos); |
| | | } |
| | | |
| | | return owners; |
| | | } |
| | | |
| | | @Override |
| | | public List<OwnerDto> queryOwnerMembers(@RequestBody OwnerDto ownerDto) { |
| | | |
| | | int page = ownerDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | ownerDto.setPage((page - 1) * ownerDto.getRow()); |
| | | } |
| | | |
| | | List<OwnerDto> owners = BeanConvertUtil.covertBeanList(ownerServiceDaoImpl.getOwnerInfo(BeanConvertUtil.beanCovertMap(ownerDto)), OwnerDto.class); |
| | | if (owners == null || owners.size() == 0) { |
| | | if (ListUtil.isNull(owners)) { |
| | | return owners; |
| | | } |
| | | |
| | |
| | | for (OwnerDto owner : owners) { |
| | | refreshOwner(owner, users, ownerAttrDtos); |
| | | } |
| | | |
| | | return owners; |
| | | } |
| | | |
| | | @Override |
| | | public int queryOwnersMemberCount(@RequestBody OwnerDto ownerDto) { |
| | | return ownerServiceDaoImpl.getOwnerInfoCount(BeanConvertUtil.beanCovertMap(ownerDto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | owner.setOwnerAttrDtos(tmpOwnerAttrDtos); |
| | | } |
| | | |
| | | /** |
| | | * 获取批量userId |
| | | * |
| | | * @param communityMemberDtos 小区楼信息 |
| | | * @return 批量userIds 信息 |
| | | */ |
| | | private String[] getOwnerIds(List<CommunityMemberDto> communityMemberDtos) { |
| | | List<String> ownerIds = new ArrayList<String>(); |
| | | for (CommunityMemberDto communityMemberDto : communityMemberDtos) { |
| | | ownerIds.add(communityMemberDto.getMemberId()); |
| | | } |
| | | |
| | | return ownerIds.toArray(new String[ownerIds.size()]); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public int queryOwnersCount(@RequestBody OwnerDto ownerDto) { |
| | | |
| | | //调用 小区服务查询 小区成员业主信息 |
| | | /*CommunityMemberDto communityMemberDto = new CommunityMemberDto(); |
| | | communityMemberDto.setCommunityId(ownerDto.getCommunityId()); |
| | | communityMemberDto.setMemberTypeCd(CommunityMemberTypeConstant.OWNER); |
| | | return communityInnerServiceSMOImpl.getCommunityMemberCount(communityMemberDto);*/ |
| | | int page = ownerDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | ownerDto.setPage((page - 1) * ownerDto.getRow()); |
| | | } |
| | | |
| | | Map ownerInfo = BeanConvertUtil.beanCovertMap(ownerDto); |
| | | ownerInfo.put("communityId", ownerDto.getCommunityId()); |
| | | ownerInfo.put("ownerTypeCd", OwnerTypeConstant.OWNER); |
| | | // ownerInfo.put("ownerIds", getOwnerIds(communityMemberDtos)); |
| | | //ownerInfo.put("ownerTypeCd", ownerDto.getOwnerTypeCd()); |
| | | ownerInfo.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | |
| | | return ownerServiceDaoImpl.getOwnerInfoCount(ownerInfo); |
| | | |
| | |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = ownerDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | ownerDto.setPage((page - 1) * ownerDto.getRow()); |
| | | } |
| | | // int page = ownerDto.getPage(); |
| | | // |
| | | // if (page != PageDto.DEFAULT_PAGE) { |
| | | // ownerDto.setPage((page - 1) * ownerDto.getRow()); |
| | | // } |
| | | return ownerServiceDaoImpl.queryOwnersCount(BeanConvertUtil.beanCovertMap(ownerDto)); |
| | | } |
| | | |