| | |
| | | import org.springframework.util.StopWatch; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 住户 服务实现类 |
| | |
| | | public IPage<HouseholdVO> selectHouseholdPage(IPage<HouseholdVO> page, HouseholdVO household) { |
| | | StopWatch stopWatch = new StopWatch(); |
| | | stopWatch.start(); |
| | | // doInsert(); |
| | | // 执行业务等 |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | if (null!=dept){ |
| | | household.setRegionCode(dept.getRegionCode()); |
| | | } |
| | | List<HouseholdVO> householdVOS = baseMapper.selectHouseholdPage(page, household); |
| | | // 遍历 |
| | | // for (HouseholdVO householdVO : householdVOS) { |
| | | // // 设置对应的网格名称 |
| | | // GridVO gridVO = gridService.getGridDetailByHouseCode(householdVO.getHouseCode()); |
| | | // if (null!= gridVO){ |
| | | // householdVO.setGridName(gridVO.getGridName()); |
| | | // } |
| | | // } |
| | | // 返回 |
| | | stopWatch.stop(); |
| | | System.out.println("selectHouseholdPage:" + stopWatch.getTotalTimeMillis()); |
| | | return page.setRecords(householdVOS); |
| | |
| | | userHouseLabelService.remove(wrapper); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<HouseholdVO> getAllHouseHold(HouseholdVO household) { |
| | | return baseMapper.getAllHouseHold(household); |
| | | } |
| | | |
| | | /** |
| | | * 住户列表查询 |
| | | * @param household |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<HouseholdVO> selectHouseholdList(HouseholdVO household) { |
| | | List<HouseholdVO> householdVOS = baseMapper.selectHouseholdList(household); |
| | | // 遍历 |
| | | for (HouseholdVO householdVO : householdVOS) { |
| | | if (householdVO.getHouseholdLabelList().size()>0){ |
| | | List<String> labelNameList = householdVO.getHouseholdLabelList().stream().map(householdLabelVO -> householdLabelVO.getLabelName()) |
| | | .collect(Collectors.toList()); |
| | | householdVO.setLabelName(String.join(",",labelNameList)); |
| | | } |
| | | } |
| | | // 返回 |
| | | return householdVOS; |
| | | } |
| | | } |