xyh
2021-06-29 83479607bc5ffea9ad5e9be36088c7f742ba00d9
实有人口导入,走访导出
11个文件已修改
146 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/enums/PopulIsOkEnum.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationServeExcelVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/grid/GridService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/EventVisitingTasksApi.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationDO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/api/EventVisitingTasksApi.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/EventVisitingTasksService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventVisitingTasksServiceImpl.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/enums/PopulIsOkEnum.java
@@ -27,7 +27,7 @@
                return item.getCode();
            }
        }
        return -1;
        return 0;
    }
    public static String getCnDescByName(Integer code) {
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java
@@ -332,7 +332,12 @@
                if(StringUtils.isNotEmpty(oneData.get(27))){
                    vo.setHouseHold(oneData.get(27).trim());
                }
                for (int i = 28; i < headSize; i++) {
                if(StringUtils.isEmpty(oneData.get(28))){
                    vo.setHouseHold(oneData.get(28).trim());
                }else{
                    vo.setIsResidence(PopulIsOkEnum.getCodeByName(oneData.get(28).trim()));
                }
                for (int i = 29; i < headSize; i++) {
                    if (oneData.get(i) != null && oneData.get(i).equals("是")) {
                        vo.getUserTagStr().add(headData.get(i).substring(0,headData.get(i).indexOf("(")));
                    }
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationServeExcelVO.java
@@ -157,5 +157,7 @@
     */
    private List<String> userTagStr = Lists.newArrayList();
    private Long houseId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/grid/GridService.java
@@ -1128,12 +1128,12 @@
    /**
     * 删除走访任务
     *
     * @param ids
     * @param idDTO
     * @param communityId
     * @return
     */
    @PostMapping("/eventvisitingtasks/delete")
    R delete(@RequestParam("ids") String ids, @RequestParam("communityId") Long communityId);
    R delete(@RequestBody IdDTO idDTO, @RequestParam("communityId") Long communityId);
    /**
     * 被走访人员列表
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java
@@ -145,10 +145,8 @@
    @ApiOperation(value = "实有人口-下载模板")
    @GetMapping("/export")
    public R exportPopulation() {
        //获取登陆用户
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        //获取登陆用户绑定社区id
        Long communityId = loginUserInfo.getCommunityId();
        Long communityId = 2L;//this.getCommunityId();
        //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址
        String ftpUrl = "/mnt/data/web/excel/";
        String name = "实有人口导入模板.xlsx";
@@ -221,47 +219,58 @@
        List<String> head2 = new ArrayList<String>();
        head2.add("民族");
        List<String> head3 = new ArrayList<String>();
        head3.add("政治面貌(群众/中共党员/共青团员)");
        head3.add("政治面貌(中共党员/中共预备党员/共青团员/民革党员/台盟盟员/群众)");
        List<String> head4 = new ArrayList<String>();
        head4.add("是否租住(是/否)");
        List<String> head5 = new ArrayList<String>();
        head5.add("与户主关系(户主/配偶/子女/孙女/父母/其他)");
        head5.add("与户主关系(户主/本人/配偶/夫/妻/子/女/孙女/孙子/兄弟姐妹/父母/其他)");
        List<String> head6 = new ArrayList<String>();
        head6.add("*街/路/巷(必填)");
        List<String> head7 = new ArrayList<String>();
        head7.add("*小区号(必填,政府对于每个小区都有特定编号)");
        List<String> head8 = new ArrayList<String>();
        head8.add("*楼排号(必填)");
        List<String> head9 = new ArrayList<String>();
        head9.add("*单元号(必填)");
        List<String> head10 = new ArrayList<String>();
        head10.add("*单元号(必填)");
        head10.add("*户室(必填,四位数表示。前两位楼层,后两位户号)");
        List<String> head11 = new ArrayList<String>();
        head11.add("*户室(必填,四位数表示。前两位楼层,后两位户号)");
        head11.add("建筑用途");
        List<String> head12 = new ArrayList<String>();
        head12.add("联系方式");
        head12.add("房屋面积");
        List<String> head13 = new ArrayList<String>();
        head13.add("籍贯");
        head13.add("房屋状态(自住/租住/其他)");
        List<String> head14 = new ArrayList<String>();
        head14.add("文化程度(小学/初中/高中/中专/大专/本科/硕士/博士/其他)");
        head14.add("房屋用途(住宅/公寓/宿舍/仓库/其他)");
        List<String> head15 = new ArrayList<String>();
        head15.add("婚姻状况(未婚/已婚/离异/丧偶/分居/其他)");
        head15.add("管控状态(常规/关注/管控)");
        List<String> head16 = new ArrayList<String>();
        head16.add("健康状况");
        head16.add("联系方式");
        List<String> head17 = new ArrayList<String>();
        head17.add("工作单位");
        head17.add("籍贯");
        List<String> head18 = new ArrayList<String>();
        head18.add("备注");
        head18.add("文化程度(小学/初中/高中/中专/大专/本科/硕士/博士/其他)");
        List<String> head19 = new ArrayList<String>();
        head19.add("户口所在地");
        head19.add("婚姻状况(未婚/已婚/初婚/再婚/复婚/丧偶/离婚/分居/其他)");
        List<String> head20 = new ArrayList<String>();
        head20.add("本地外地(本地/外地)");
        head20.add("健康状况");
        List<String> head21 = new ArrayList<String>();
        head21.add("房屋状态(自住/租住/其他)");
        head21.add("工作单位");
        List<String> head22 = new ArrayList<String>();
        head22.add("房屋用途(住宅/公寓/宿舍/仓库/其他)");
        head22.add("本地外地(本地/外地)");
        List<String> head23 = new ArrayList<String>();
        head23.add("管控状态(常规/关注/管控)");
        head23.add("户口所在地");
        List<String> head24 = new ArrayList<String>();
        head24.add("是否为居住地(是/否)");
        head24.add("备注");
        List<String> head25 = new ArrayList<String>();
        head25.add("证件照(人面像)照片");
        List<String> head26 = new ArrayList<String>();
        head26.add("证件照(国徽面)照片");
        List<String> head27 = new ArrayList<String>();
        head27.add("户口本照片");
        List<String> head28 = new ArrayList<String>();
        head28.add("是否为居住地(是/否)");
        list.add(head0);
@@ -273,6 +282,7 @@
        list.add(head6);
        list.add(head7);
        list.add(head8);
        list.add(head9);
        list.add(head10);
        list.add(head11);
        list.add(head12);
@@ -288,6 +298,10 @@
        list.add(head22);
        list.add(head23);
        list.add(head24);
        list.add(head25);
        list.add(head26);
        list.add(head27);
        list.add(head28);
        return list;
    }
@@ -298,25 +312,30 @@
        data.add("汉族");
        data.add("群众");
        data.add("是");
        data.add("户主");
        data.add("本人");
        data.add("樱花街");
        data.add("115");
        data.add("15栋");
        data.add("1单元");
        data.add("1");
        data.add("1001");
        data.add("");
        data.add("");
        data.add("");
        data.add("");
        data.add("");
        data.add("13768548521");
        data.add("中国");
        data.add("硕士");
        data.add("未婚");
        data.add("");
        data.add("阿里巴巴");
        data.add("");
        data.add("四川成都");
        data.add("本地");
        data.add("自住");
        data.add("公寓");
        data.add("常规");
        data.add("否");
        data.add("四川成都");
        data.add("");
        data.add("");
        data.add("");
        data.add("");
        data.add("是");
        return data;
    }
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/EventVisitingTasksApi.java
@@ -78,15 +78,15 @@
     */
    @PostMapping("/delete")
    @ApiOperation(value = "删除走访任务")
    public R delete(@RequestParam("ids") String ids){
        return gridService.delete(ids,this.getCommunityId());
    public R delete(@RequestBody IdDTO idDTO){
        return gridService.delete(idDTO,this.getCommunityId());
    }
    /**
     * 走访任务导出
     * @return
     */
    @GetMapping("/export")
    @GetMapping("/noToken/export")
    @ApiOperation(value = "导出走访任务")
    public void export(HttpServletResponse response,EventTasksQuery query){
//        query.setCommunityId(this.getCommunityId());
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationDO.java
@@ -170,7 +170,7 @@
    /**
     * 居住地房屋id
     */
//    private Long houseId;
    private Long houseId;
    /**
     * 性别(1.男 2.女 3.未知)
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -358,6 +358,7 @@
                    + vo.getFloor() + vo.getUnitNo() + vo.getHouseNo();
            vo.setAddress(address);
            //todo 后期优化改为批量
            //先判断房屋是否存在
            ComMngPopulationHouseDO populationHouseDO = comMngPopulationHouseDAO.selectOne(new QueryWrapper<ComMngPopulationHouseDO>().lambda()
                    .eq(ComMngPopulationHouseDO::getCommunityId, communityId).eq(ComMngPopulationHouseDO::getVillageId, comMngVillageDO.getVillageId())
@@ -366,6 +367,7 @@
            if (populationHouseDO == null) {
                //房屋信息不存在建立房屋信息
                populationHouseDO = savePopulationHouse(vo, comMngVillageDO, communityId, address, areaPath, comActDO.getName());
                vo.setHouseId(populationHouseDO.getId());
            }
            if (StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())) {
@@ -382,7 +384,7 @@
            } else {
                //如果存在人口信息,且是自用房,则更新人口默认的房屋信息
                if (vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) {
                    populationDO = updatePopulationHouseUse(vo, populationDO);
                    populationDO = updatePopulationDO(vo, populationDO);
                }
            }
@@ -415,7 +417,7 @@
        return R.ok();
    }
    private ComMngPopulationDO updatePopulationHouseUse(ComMngPopulationServeExcelVO vo, ComMngPopulationDO populationDO) throws Exception {
    private ComMngPopulationDO updatePopulationDO(ComMngPopulationServeExcelVO vo, ComMngPopulationDO populationDO) throws Exception {
        populationDO.setRoad(vo.getRoad());
        populationDO.setDoorNo(vo.getDoorNo());
        populationDO.setFloor(vo.getFloor());
@@ -423,8 +425,10 @@
        populationDO.setHouseNo(vo.getHouseNo());
        populationDO.setCardNo(vo.getCardNo());
        populationDO.setCardNoStr(vo.getCardNo());
        if(vo.getIsResidence().intValue() == 1){
            populationDO.setHouseId(vo.getHouseId());
        }
        if (StringUtils.isNotEmpty(populationDO.getPhone())) {
//            populationDO.setPhone(AESUtil.encrypt128(populationDO.getPhone(), aesKey));
            populationDO.setPhone(populationDO.getPhone());
        }
        this.baseMapper.updateById(populationDO);
@@ -444,6 +448,9 @@
        populationDO.setCardNo(vo.getCardNo());
        populationDO.setCardNoStr(vo.getCardNo());
        populationDO.setUpdateAt(new Date());
        if(vo.getIsResidence().intValue() == 1){
            populationDO.setHouseId(vo.getHouseId());
        }
        this.baseMapper.insert(populationDO);
        return populationDO;
    }
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/api/EventVisitingTasksApi.java
@@ -76,13 +76,13 @@
    }
    /**
     * 删除走访任务
     * @param ids
     * @param idDTO
     * @param communityId
     * @return
     */
    @PostMapping("/delete")
    R delete(@RequestParam("ids") String ids, @RequestParam("communityId") Long communityId){
        return eventVisitingTasksService.delete(ids,communityId);
    R delete(@RequestBody IdDTO idDTO, @RequestParam("communityId") Long communityId){
        return eventVisitingTasksService.delete(idDTO,communityId);
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/EventVisitingTasksService.java
@@ -91,11 +91,11 @@
    /**
     * 删除走访任务
     *
     * @param ids
     * @param idDTO
     * @param communityId
     * @return
     */
    R delete(String ids, Long communityId);
    R delete(IdDTO idDTO, Long communityId);
    /**
     * 需走访人员列表
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventVisitingTasksServiceImpl.java
@@ -176,21 +176,36 @@
    @Transactional
    @Override
    public R delete(String ids, Long communityId) {
        String[] idarr = ids.split(",");
    public R delete(IdDTO idDTO, Long communityId) {
        StringBuilder rt = new StringBuilder();
        String[] idarr = idDTO.getId().split(",");
        for(String id:idarr){
            if(StringUtils.isEmpty(id)){
                continue;
            }
            EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectOne(new QueryWrapper<EventVisitingTasksDO>().eq("id",Long.valueOf(id)).eq("grid_member_community",communityId));
            if(eventVisitingTasksDO == null){
                throw new RuntimeException("无权限");
            String error = toDelete(Long.valueOf(id));
            if(!StringUtils.isEmpty(error)){
                rt.append(rt);
            }
            eventVisitingTasksMapper.deleteById(Long.valueOf(id));
        }
        if(!StringUtils.isEmpty(rt)){
            return R.fail("部分删除失败:"+rt.toString());
        }
        return R.ok();
    }
    private String toDelete(Long id) {
        EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(id);
        if(eventVisitingTasksDO == null){
            return "["+id+"]数据不存在;";
        }
        if(!Objects.equals(eventVisitingTasksDO.getEventStatus(),EventTasksStatusEnum.DZF.getCode())){
            return "["+eventVisitingTasksDO.getVisiterName()+"]状态不可删除;";
        }
        return null;
    }
    @Override
    public R visitorList(EventVisitListQuery query) {
        IPage<EventVisitListVO> page = eventVisitingTasksMapper.visitorList(new Page(query.getPageNum(),query.getPageSize()),query);