| | |
| | | package com.java110.user.smo.impl; |
| | | |
| | | |
| | | import com.java110.common.constant.CommunityMemberTypeConstant; |
| | | import com.java110.common.constant.StatusConstant; |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.utils.constant.OwnerTypeConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.core.smo.community.ICommunityInnerServiceSMO; |
| | | import com.java110.core.smo.owner.IOwnerInnerServiceSMO; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.CommunityMemberDto; |
| | | import com.java110.dto.OwnerDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.UserDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.user.dao.IOwnerServiceDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Autowired |
| | | private IOwnerServiceDao ownerServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | |
| | |
| | | |
| | | //communityInnerServiceSMOImpl.getCommunityMembers() |
| | | //调用 小区服务查询 小区成员业主信息 |
| | | CommunityMemberDto communityMemberDto = BeanConvertUtil.covertBean(ownerDto, CommunityMemberDto.class); |
| | | /* 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) { |
| | | return null; |
| | | }*/ |
| | | |
| | | int page = ownerDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | ownerDto.setPage((page - 1) * ownerDto.getRow()); |
| | | } |
| | | |
| | | Map ownerInfo = new HashMap(); |
| | | ownerInfo.put("ownerIds", getOwnerIds(communityMemberDtos)); |
| | | 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) { |
| | | 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()); |
| | | } |
| | | } |
| | | } |
| | |
| | | public int queryOwnersCount(@RequestBody OwnerDto ownerDto) { |
| | | |
| | | //调用 小区服务查询 小区成员业主信息 |
| | | CommunityMemberDto communityMemberDto = new CommunityMemberDto(); |
| | | /*CommunityMemberDto communityMemberDto = new CommunityMemberDto(); |
| | | communityMemberDto.setCommunityId(ownerDto.getCommunityId()); |
| | | communityMemberDto.setMemberTypeCd(CommunityMemberTypeConstant.OWNER); |
| | | return communityInnerServiceSMOImpl.getCommunityMemberCount(communityMemberDto); |
| | | 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); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | ownerDto.setPage((page - 1) * ownerDto.getRow()); |
| | | ownerDto.setRow(page * ownerDto.getRow()); |
| | | } |
| | | return ownerServiceDaoImpl.queryOwnersCount(BeanConvertUtil.beanCovertMap(ownerDto)); |
| | | } |
| | |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | ownerDto.setPage((page - 1) * ownerDto.getRow()); |
| | | ownerDto.setRow(page * ownerDto.getRow()); |
| | | } |
| | | List<OwnerDto> owners = BeanConvertUtil.covertBeanList( |
| | | ownerServiceDaoImpl.getOwnerInfoByCondition(BeanConvertUtil.beanCovertMap(ownerDto)), OwnerDto.class); |
| | |
| | | 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; |
| | | } |