| | |
| | | |
| | | @Override |
| | | public IPage<HouseholdVO> selectHouseholdPage(IPage<HouseholdVO> page, HouseholdVO household) { |
| | | StopWatch stopWatch = new StopWatch(); |
| | | stopWatch.start(); |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(HouseholdVO.class, household); |
| | | |
| | | // List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | |
| | | if (Objects.nonNull(household.getLabelType())) { |
| | | extracted(household); |
| | | } |
| | | StopWatch stopWatch = new StopWatch(); |
| | | stopWatch.start(); |
| | | List<HouseholdVO> householdVOS = baseMapper.selectHouseholdPage(page, household, commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getRegionChildCodesList(), commonParamSet.getGridCodeList()); |
| | | stopWatch.stop(); |
| | | // System.out.println("selectHouseholdPage:" + stopWatch.getTotalTimeMillis()); |
| | | if (household.getRelationship() == 18) { |
| | | householdVOS.forEach(item -> { |
| | | HouseholdEntity householdEntity = getOne(Wrappers.<HouseholdEntity>lambdaQuery() |
| | | .eq(HouseholdEntity::getHouseCode, item.getHouseCode()) |
| | | .eq(HouseholdEntity::getRelationship, 1) |
| | | .eq(HouseholdEntity::getIsDeleted, 0) |
| | | .last("limit 1")); |
| | | if (householdEntity != null) { |
| | | item.setHouseName(householdEntity.getName()); |
| | | item.setHousePhone(householdEntity.getPhoneNumber()); |
| | | item.setHouseIdCard(householdEntity.getIdCard()); |
| | | } |
| | | }); |
| | | } |
| | | System.out.println("selectHouseholdPage:" + stopWatch.getTotalTimeMillis()); |
| | | return page.setRecords(householdVOS); |
| | | } |
| | | |
| | |
| | | * @param isCovered |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String importUserHouseHold(List<ImportHouseholdExcel> data, Boolean isCovered, String isTenant) { |
| | | IHouseService houseService = SpringUtils.getBean(IHouseService.class); |
| | | int totalNum = data.size(); |
| | |
| | | for (Future<Map<String, String>> future : futures) { |
| | | try { |
| | | Map<String, String> stringStringMap = future.get(); |
| | | logger.info("结果:{}", stringStringMap); |
| | | // logger.info("结果:{}", stringStringMap); |
| | | String result = stringStringMap.get("restult"); |
| | | switch (result) { |
| | | case "1": |
| | |
| | | break; |
| | | } |
| | | // 获取并打印每个任务的结果 |
| | | } catch (InterruptedException | ExecutionException e) { |
| | | } catch (Exception e) { |
| | | errorNum++; |
| | | logger.error("获取异常-----》", e); |
| | | } |
| | |
| | | return builder.toString(); |
| | | } |
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Map<String, String> importHouseHold(ImportHouseholdExcel houseHoldExcel, IHouseService houseService, Boolean isCovered, String isTenant) { |
| | | Map<String, String> objectObjectHashMap = new HashMap<>(); |
| | | try { |
| | | HouseholdEntity householdEntity = Objects.requireNonNull(BeanUtil.copy(houseHoldExcel, HouseholdEntity.class)); |
| | | HouseholdEntity householdEntity = Objects.requireNonNull(BeanUtil.copy(houseHoldExcel, HouseholdEntity.class)); |
| | | // 判断姓名,手机号 |
| | | if (Strings.isBlank(householdEntity.getName()) || Strings.isBlank(householdEntity.getHouseCode())) { |
| | | objectObjectHashMap.put("row", householdEntity.getName() + ":" + householdEntity.getPhoneNumber()); |
| | |
| | | objectObjectHashMap.put("restult", "2"); |
| | | return objectObjectHashMap; |
| | | } |
| | | } catch (Exception e) { |
| | | logger.error("异常导入------------》", e); |
| | | // return "3"; |
| | | // objectObjectHashMap.put("row", householdEntity.getName() + ":" + householdEntity.getPhoneNumber()); |
| | | objectObjectHashMap.put("restult", "3"); |
| | | return objectObjectHashMap; |
| | | } |
| | | } |
| | | |
| | | /** |