yanghb
1 天以前 7bd7ad452e6a7a3fc60acfd1d6898c70e933773e
feat: 修复安置库信息
3个文件已修改
57 ■■■■■ 已修改文件
cz-admin/src/main/java/com/ruoyi/web/controller/bussiness/PlacementBatchController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cz-bussiness/src/main/java/com/ruoyi/bussiness/service/PlacementBatchService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cz-bussiness/src/main/java/com/ruoyi/bussiness/service/impl/PlacementBatchServiceImpl.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cz-admin/src/main/java/com/ruoyi/web/controller/bussiness/PlacementBatchController.java
@@ -198,4 +198,11 @@
        placementBatchService.problemExport(request,response);
    }
    @ApiOperation(value = "修复安置库信息")
    @GetMapping(value = "/fix-settle")
    public BaseResult<Object> fixSettle(){
        placementBatchService.fixSettle();
        return ResponseUtils.successResponse();
    }
}
cz-bussiness/src/main/java/com/ruoyi/bussiness/service/PlacementBatchService.java
@@ -75,6 +75,12 @@
     */
    void problemExport(ProblemExportRequest request, HttpServletResponse response);
    /**
     * 修复安置
     */
    void fixSettle();
    /**
     * 获取上一批次号
     * @return
cz-bussiness/src/main/java/com/ruoyi/bussiness/service/impl/PlacementBatchServiceImpl.java
@@ -821,6 +821,50 @@
        }
    }
    @Override
    public void fixSettle() {
        //修改安置状态为0
        LambdaUpdateWrapper<Placement> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.set(Placement::getStatus, 0);
        placementService.update(updateWrapper);
        LambdaQueryWrapper<PlacementBatch> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(PlacementBatch::getStatus, 1);
        List<PlacementBatch> list = this.baseMapper.selectList(queryWrapper);
        List<Long> batchIds = list.stream().map(PlacementBatch::getId).collect(Collectors.toList());
        //查询房产表
        LambdaQueryWrapper<PlacementBatchHousehold> householdWrapper = new LambdaQueryWrapper<>();
        householdWrapper.in(PlacementBatchHousehold::getPlacementBatchId, batchIds);
        List<PlacementBatchHousehold> households = this.placementBatchHouseholdService.list(householdWrapper);
        if (ObjectUtil.isEmpty(households)) {
            return;
        }
        //修改户主安置状态
        List<String> houseHead = households.stream().map(PlacementBatchHousehold::getHouseholdHead).collect(Collectors.toList());
        if (ObjUtil.isNotEmpty(houseHead)) {
            LambdaUpdateWrapper<Placement> placementHouseHeadUpdateWrapper = new LambdaUpdateWrapper<>();
            placementHouseHeadUpdateWrapper.set(Placement::getStatus, 1);
            placementHouseHeadUpdateWrapper.and(query -> query.in(Placement::getHouseholdHead, houseHead));
            placementService.update(placementHouseHeadUpdateWrapper);
        }
        //修改家庭成员安置状态
        for (PlacementBatchHousehold household : households) {
            if (ObjUtil.isEmpty(household.getWaitFamilyNames())) {
                continue;
            }
            //购房表家庭成员姓名
            List<String> names = Arrays.asList(household.getWaitFamilyNames().split("、"));
            //购房表户主身份证
            String headIdCard = household.getIdCard();
            LambdaUpdateWrapper<Placement> placementLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
            placementLambdaUpdateWrapper.set(Placement::getStatus, 1);
            placementLambdaUpdateWrapper.eq(Placement::getIdCard, headIdCard);
            placementLambdaUpdateWrapper.and(query -> query.in(Placement::getFamilyName, names));
            placementService.update(placementLambdaUpdateWrapper);
        }
    }
    /**
     * 获取最近批次号
     *