|
@ -32,9 +32,11 @@ import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
|
|
|
import java.text.Collator; |
|
|
import java.util.Collections; |
|
|
import java.util.Collections; |
|
|
import java.util.Date; |
|
|
import java.util.Date; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Locale; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -242,25 +244,23 @@ public class MyHomeServiceImpl implements MyHomeService { |
|
|
* @Date 2022/7/19 16:48 |
|
|
* @Date 2022/7/19 16:48 |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public List<HomeInfoResultDTO> getOwnerHouseList(TokenDto tokenDto) { |
|
|
public List<HomeInfoResultDTO> getOwnerHouseList(TokenDto tokenDto, IcHouseDTO formDTO) { |
|
|
//通过用户ID获取居民端用户信息
|
|
|
//通过用户ID获取居民端用户信息
|
|
|
ResiUserBaseInfoResultDTO baseInfo = userBaseInfoDao.selecUserBaseInfoByUserId(tokenDto.getUserId()); |
|
|
ResiUserBaseInfoResultDTO baseInfo = userBaseInfoDao.selecUserBaseInfoByUserId(tokenDto.getUserId()); |
|
|
if (null == baseInfo) { |
|
|
if (null == baseInfo) { |
|
|
return Collections.emptyList(); |
|
|
return Collections.emptyList(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
IcHouseDTO dto = new IcHouseDTO(); |
|
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|
|
dto.setCustomerId(tokenDto.getCustomerId()); |
|
|
formDTO.setOwnerIdCard(baseInfo.getIdNum()); |
|
|
dto.setOwnerIdCard(baseInfo.getIdNum()); |
|
|
Result<List<HouseInfoDTO>> houseResult = govOrgOpenFeignClient.getOwnerHouseList(formDTO); |
|
|
Result<List<HouseInfoDTO>> houseResult = govOrgOpenFeignClient.getOwnerHouseList(dto); |
|
|
|
|
|
if (!houseResult.success()) { |
|
|
if (!houseResult.success()) { |
|
|
throw new EpmetException(houseResult.getCode(), houseResult.getMsg()); |
|
|
throw new EpmetException(houseResult.getCode(), houseResult.getMsg()); |
|
|
} |
|
|
} |
|
|
if (CollectionUtils.isEmpty(houseResult.getData())) { |
|
|
if (CollectionUtils.isEmpty(houseResult.getData())) { |
|
|
return Collections.emptyList(); |
|
|
return Collections.emptyList(); |
|
|
} |
|
|
} |
|
|
|
|
|
List<HomeInfoResultDTO> list = houseResult.getData().stream().map(item -> { |
|
|
return houseResult.getData().stream().map(item -> { |
|
|
|
|
|
HomeInfoResultDTO result = new HomeInfoResultDTO(); |
|
|
HomeInfoResultDTO result = new HomeInfoResultDTO(); |
|
|
result.setHouseId(item.getHomeId()); |
|
|
result.setHouseId(item.getHomeId()); |
|
|
result.setHouseName(item.getAllName()); |
|
|
result.setHouseName(item.getAllName()); |
|
@ -268,6 +268,9 @@ public class MyHomeServiceImpl implements MyHomeService { |
|
|
result.setQrCodeUrl(item.getHouseQrcodeUrl()); |
|
|
result.setQrCodeUrl(item.getHouseQrcodeUrl()); |
|
|
return result; |
|
|
return result; |
|
|
}).collect(Collectors.toList()); |
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
return list.stream().sorted((o1, o2) -> |
|
|
|
|
|
Collator.getInstance(Locale.SIMPLIFIED_CHINESE) |
|
|
|
|
|
.compare(o1.getHouseName(),o2.getHouseName())).collect(Collectors.toList()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|