LIVE_YE 3 rokov pred
rodič
commit
b7be1b082d

+ 29 - 22
boman-api/boman-domain/src/main/java/com/boman/domain/Czrk.java

@@ -1,6 +1,7 @@
 package com.boman.domain;
 
 import com.boman.domain.annotation.Excel;
+import com.boman.domain.annotation.Excels;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.*;
 
@@ -51,14 +52,14 @@ public class Czrk extends BaseEntity{
     /**
      * 年龄
      */
-    @Excel(name = "年龄")
+    //@Excel(name = "年龄")
     private Integer age;
 
     /**
      * 出生日期
      */
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd")
+    //@Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd")
     private String birthday;
 
     /**
@@ -94,7 +95,7 @@ public class Czrk extends BaseEntity{
     /**
      * 认领人
      */
-    @Excel(name = "认领人")
+    //@Excel(name = "认领人")
     private String rlr;
     /**
      * 认领人姓名
@@ -105,7 +106,7 @@ public class Czrk extends BaseEntity{
      * 认领时间
      */
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "认领时间", width = 30, dateFormat = "yyyy-MM-dd")
+    //@Excel(name = "认领时间", width = 30, dateFormat = "yyyy-MM-dd")
     private java.sql.Date rlTime;
 
     /**
@@ -120,98 +121,98 @@ public class Czrk extends BaseEntity{
     /**
      * 当前人所在的最后一级的部门id
      */
-    @Excel(name = "当前人所在的最后一级的部门id")
+    //@Excel(name = "当前人所在的最后一级的部门id")
     private Long deptId;
 
 
     /**
      * 工作单位
      */
-    @Excel(name = "工作单位")
+    //@Excel(name = "工作单位")
     private String workUnit;
 
     /**
      * 户籍地的省份
      */
-    @Excel(name = "户籍地的省份")
+    //@Excel(name = "户籍地的省份")
     private Long provinceId;
 
     /**
      * 户籍地的省份
      */
-    @Excel(name = "户籍地的省份")
+    //@Excel(name = "户籍地的省份")
     private String province;
 
     /**
      * 户籍地的城市
      */
-    @Excel(name = "户籍地的城市")
+    //@Excel(name = "户籍地的城市")
     private Long cityId;
 
     /**
      * 户籍地的城市
      */
-    @Excel(name = "户籍地的城市")
+    //@Excel(name = "户籍地的城市")
     private String city;
 
     /**
      * 户籍地的区
      */
-    @Excel(name = "户籍地的区")
+    //@Excel(name = "户籍地的区")
     private Long regionId;
 
     /**
      * 户籍地的区
      */
-    @Excel(name = "户籍地的区")
+    //@Excel(name = "户籍地的区")
     private String region;
 
     /**
      * 户籍地的镇
      */
-    @Excel(name = "户籍地的镇")
+    //@Excel(name = "户籍地的镇")
     private Long villageTownsId;
 
     /**
      * 户籍地的镇
      */
-    @Excel(name = "户籍地的镇")
+    //@Excel(name = "户籍地的镇")
     private String villageTowns;
 
     /**
      * 户籍地的村
      */
-    @Excel(name = "户籍地的村")
+    //@Excel(name = "户籍地的村")
     private Long villageId;
 
     /**
      * 户籍地的村
      */
-    @Excel(name = "户籍地的村")
+    //@Excel(name = "户籍地的村")
     private String village;
 
     /**
      * 户籍地的组
      */
-    @Excel(name = "户籍地的组")
+    //@Excel(name = "户籍地的组")
     private Long villagerGroupId;
 
     /**
      * 户籍地的组
      */
-    @Excel(name = "户籍地的组")
+    //@Excel(name = "户籍地的组")
     private String villagerGroup;
 
     /**
      * 户籍地的详细地址
      */
-    @Excel(name = "户籍地的详细地址")
+    @Excel(name = "户籍详细地址")
     private String nowIn;
 
     /**
      * 状态
      */
-    @Excel(name = "状态")
+    //@Excel(name = "状态")
     private String status;
     /**
      * 变更人手机号
@@ -255,13 +256,13 @@ public class Czrk extends BaseEntity{
     /**
      * 是否删除 默认为 "N"
      */
-    @Excel(name = "是否删除")
+    //@Excel(name = "是否删除")
     private String isDel = IS_DEL_N;
 
     /**
      * 删除原因
      */
-    @Excel(name = "删除原因")
+    //@Excel(name = "删除原因")
     private String deleteReason;
     private String remark;
 
@@ -274,6 +275,10 @@ public class Czrk extends BaseEntity{
 
     /*************************************************************** Transient ***************************************************************/
     private List<CzrkJzdz> czrkJzdzList;
+
+    @Excels({
+            @Excel(name = "居住详细地址", targetAttr = "nowIn")
+    })
     private CzrkJzdz czrkJzdz;
 
     /** 部门id集合 */
@@ -281,8 +286,10 @@ public class Czrk extends BaseEntity{
     private List<String> idCardList;
 
     /** 现居地列表展示 安徽省安庆市潜山市xx乡xx村xx组 */
+    @Excel(name = "居住地址")
     private String nowInSelect;
     /** 户籍地列表展示 安徽省安庆市潜山市xx乡xx村xx组 */
+    @Excel(name = "户籍地址")
     private String domicileSelect;
     /*** 现居地的详细地址,只留作连表映射用 **/
     private String domicile;

+ 17 - 17
boman-api/boman-domain/src/main/java/com/boman/domain/CzrkJzdz.java

@@ -31,103 +31,103 @@ public class CzrkJzdz {
     /**
      * czrk表的id
      */
-    @Excel(name = "czrk表的id")
+    //@Excel(name = "czrk表的id")
     private Long czrkId;
 
     /**
      * 身份证号码
      */
-    @Excel(name = "身份证号码")
+    //@Excel(name = "身份证号码")
     private String idCard;
 
     /**
      * 姓名
      */
-    @Excel(name = "姓名")
+    //@Excel(name = "姓名")
     private String userName;
 
     /**
      * 居住地址的排序
      */
-    @Excel(name = "居住地址的排序")
+    //@Excel(name = "居住地址的排序")
     private Integer sort;
 
     /**
      * $column.columnComment
      */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    //@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
     private Long deptId;
 
     /**
      * 户籍地的省份
      */
-    @Excel(name = "户籍地的省份")
+    //@Excel(name = "户籍地的省份")
     private String provinceId;
 
     /**
      * 户籍地的省份
      */
-    @Excel(name = "户籍地的省份")
+    //@Excel(name = "户籍地的省份")
     private String province;
 
     /**
      * 户籍地的城市
      */
-    @Excel(name = "户籍地的城市")
+    //@Excel(name = "户籍地的城市")
     private String cityId;
 
     /**
      * 户籍地的城市
      */
-    @Excel(name = "户籍地的城市")
+    //@Excel(name = "户籍地的城市")
     private String city;
 
     /**
      * 户籍地的区
      */
-    @Excel(name = "户籍地的区")
+    //@Excel(name = "户籍地的区")
     private String regionId;
 
     /**
      * 户籍地的区
      */
-    @Excel(name = "户籍地的区")
+    //@Excel(name = "户籍地的区")
     private String region;
 
     /**
      * 居住地的镇
      */
-    @Excel(name = "居住地的镇")
+    //@Excel(name = "居住地的镇")
     private String townId;
 
     /**
      * 居住地的镇
      */
-    @Excel(name = "居住地的镇")
+    //@Excel(name = "居住地的镇")
     private String town;
 
     /**
      * 居住地的村
      */
-    @Excel(name = "居住地的村")
+    //@Excel(name = "居住地的村")
     private String villageId;
 
     /**
      * 居住地的村
      */
-    @Excel(name = "居住地的村")
+    //@Excel(name = "居住地的村")
     private String village;
 
     /**
      * 居住地的详细地址
      */
-    @Excel(name = "居住地的详细地址")
+    @Excel(name = "居住详细地址")
     private String nowIn;
 
     /**
      * Y有效地址,N无效地址
      */
-    @Excel(name = "Y有效地址,N无效地址")
+    //@Excel(name = "Y有效地址,N无效地址")
     private String status = "Y";
 
     private java.sql.Timestamp createTime;

+ 19 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/CzrkController.java

@@ -3,10 +3,13 @@ package com.boman.web.core.controller;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.boman.common.core.utils.DateUtils;
+import com.boman.common.core.utils.poi.ExcelUtil;
 import com.boman.common.core.web.controller.BaseController;
 import com.boman.common.log.annotation.Log;
 import com.boman.common.log.enums.BusinessType;
+import com.boman.common.security.annotation.PreAuthorize;
 import com.boman.domain.Czrk;
+import com.boman.domain.SysRole;
 import com.boman.domain.TableDataInfo;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.web.core.domain.JsonRequest;
@@ -16,6 +19,9 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
 
@@ -210,4 +216,17 @@ public class CzrkController extends BaseController {
         return czrkService.getInfoJson(jsonRequest);
     }
 
+    /**
+     * 人员数据到处
+     *
+     */
+    @Log(title = "人员信息", businessType = BusinessType.EXPORT)
+    @PreAuthorize(hasPermi = "system:czrk:export")
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, Czrk czrk) throws IOException
+    {
+        List<Czrk> czrkList = czrkService.getAllCzrk(czrk);
+        ExcelUtil<Czrk> util = new ExcelUtil<Czrk>(Czrk.class);
+        util.exportExcel(response, czrkList, "梅城镇人员数据");
+    }
 }

+ 2 - 0
boman-web-core/src/main/java/com/boman/web/core/mapper/CzrkMapper.java

@@ -181,4 +181,6 @@ public interface CzrkMapper {
      * @return
      */
     List<Czrk> unusualList(Czrk czrk);
+
+    List<Czrk> getAllCzrk(Czrk czrk);
 }

+ 281 - 11
boman-web-core/src/main/java/com/boman/web/core/service/czrk/CzrkServiceImpl.java

@@ -666,6 +666,19 @@ public class CzrkServiceImpl implements ICzrkService {
         return AjaxResult.error("变更失败");
     }
 
+    @Override
+    public List<Czrk> getAllCzrkRegionId(String s) {
+        return czrkMapper.getAllCzrkRegionId(s);
+    }
+
+    @Override
+    public List<Czrk> getAllCzrk(Czrk czrk) {
+        setAgeScope(czrk);
+        List<Czrk> czrkList = czrkMapper.getAllCzrk(czrk);
+        packAddr(czrkList);
+        return czrkList;
+    }
+
     @Override
     public Czrk getById(Long id) {
         if (isEmpty(id)) {
@@ -1065,6 +1078,9 @@ public class CzrkServiceImpl implements ICzrkService {
 
         String startTime = DateUtils.getTodayStartStr();
         String endTime = DateUtils.getTodayEndStr();
+
+        Timestamp s = Timestamp.valueOf(startTime);
+        Timestamp e = Timestamp.valueOf(endTime);
         Long deptId = sysUser.getDeptId();
 
         // 市领导 todo 此处不应该写死
@@ -1098,7 +1114,78 @@ public class CzrkServiceImpl implements ICzrkService {
                 }
                 result.put("cun", isEmpty(cunDepts) ? 0 : cunDepts.size());
 
-                List<Long> deptIdList = null;
+                //查找潜山市户籍人口总数
+                List<Czrk> czrkList = czrkMapper.getAllCzrkRegionId("340882000000");
+                if(czrkList==null){
+                    czrkList = new ArrayList<>();
+                }
+                //潜山市户籍人口总数
+                int hjzrs = czrkList.size();
+
+                //潜山市 户籍人口今日新增
+                int hjxz = 0;
+                //潜山市 户籍人口今日减少
+                int hjjs = 0;
+
+                //循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
+                for (Czrk czrk : czrkList) {
+                    if("Y".equals(czrk.getIsDel())){
+                        hjzrs--;
+                    }
+                    //判断是否是在今天操作的人员信息
+                    if(s.before(czrk.getCreateTime()) && czrk.getCreateTime().before(e)){
+                        if("Y".equals(czrk.getIsDel())){
+                            hjjs++;
+                        }else{
+                            hjxz++;
+                        }
+                    }
+                }
+                //潜山市总人数
+                result.put("hjzrs", hjzrs);
+                //潜山市新增
+                result.put("hjxz", hjxz);
+                //潜山市减少
+                result.put("hjjs", hjjs);
+                result.put("hjbfb", NumberUtils.percent(hjzrs, hjzrs));
+
+
+                //查找潜山市常驻人口信息
+                List<CzrkJzdz> czrkJzdzList = czrkJzdzService.selectCzrkJzdzListByRegionId("340882000000");
+                if(czrkJzdzList==null){
+                    czrkJzdzList = new ArrayList<>();
+                }
+                //潜山市居住人口总数
+                int czzrs = czrkJzdzList.size();
+
+                //潜山市居住人口今日新增
+                int czxz = 0;
+                //潜山市居住人口今日减少
+                int czjs = 0;
+
+                //循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
+                for (CzrkJzdz czrkJzdz : czrkJzdzList) {
+                    if("N".equals(czrkJzdz.getStatus())){
+                        czzrs--;
+                    }
+                    //判断是否是在今天操作的人员信息
+                    if(s.before(czrkJzdz.getCreateTime()) && czrkJzdz.getCreateTime().before(e)){
+                        if("N".equals(czrkJzdz.getStatus())){
+                            czjs++;
+                        }else{
+                            czxz++;
+                        }
+                    }
+                }
+                //潜山市总人数
+                result.put("czzrs", czzrs);
+                //潜山市新增
+                result.put("czxz", czxz);
+                //潜山市减少
+                result.put("czjs", czjs);
+                result.put("czbfb", NumberUtils.percent(czzrs, czzrs));
+
+                /*List<Long> deptIdList = null;
                 int zrs = czrkMapper.countAll(); // 总人数
                 int hjzrs = czrkMapper.countHj1(deptIdList); // 该镇户籍人口总数
                 result.put("hjzrs", hjzrs);
@@ -1114,13 +1201,14 @@ public class CzrkServiceImpl implements ICzrkService {
                 int czjs = czrkMapper.countByCzJs1(startTime, endTime, deptIdList); // 该镇 常住人口今日减少
                 result.put("czxz", czxz);
                 result.put("czjs", czjs);
-                result.put("czbfb", NumberUtils.percent(czzrs, zrs));
+                result.put("czbfb", NumberUtils.percent(czzrs, zrs));*/
 
                 // 以各个镇为单位单独处理 townsDepts
                 ArrayList<JSONObject> towsDataList = new ArrayList<>(20);
                 for (SysDept townsDept : townsDepts) {
                     JSONObject townsResult = new JSONObject(16);
-                    townSts(townsResult, townsDept.getId(), townsDept.getDeptName(), false);
+                    ///townSts(townsResult, townsDept.getId(), townsDept.getDeptName(), false);
+                    townSts(townsResult, townsDept, czrkList, czrkJzdzList,hjzrs, czzrs);
                     towsDataList.add(townsResult);
                 }
 
@@ -1139,7 +1227,36 @@ public class CzrkServiceImpl implements ICzrkService {
             }
 
             ThreadPoolService.execute(() -> {
-                townSts(result, deptId, deptName, true);
+
+                //查找潜山市户籍人口总数
+                List<Czrk> czrkList = czrkMapper.getAllCzrkRegionId("340882000000");
+                if(czrkList==null){
+                    czrkList = new ArrayList<>();
+                }
+                //潜山市户籍人口总数
+                int hjzrs = czrkList.size();
+                //循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
+                for (Czrk czrk : czrkList) {
+                    if("Y".equals(czrk.getIsDel())){
+                        hjzrs--;
+                    }
+                }
+                //查找潜山市常驻人口信息
+                List<CzrkJzdz> czrkJzdzList = czrkJzdzService.selectCzrkJzdzListByRegionId("340882000000");
+                if(czrkJzdzList==null){
+                    czrkJzdzList = new ArrayList<>();
+                }
+                //潜山市居住人口总数
+                int czzrs = czrkJzdzList.size();
+                //循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
+                for (CzrkJzdz czrkJzdz : czrkJzdzList) {
+                    if("N".equals(czrkJzdz.getStatus())){
+                        czzrs--;
+                    }
+                }
+
+
+                townSts(result, sysUser.getDept(), czrkList, czrkJzdzList,hjzrs, czzrs);
 //                redisService.setCacheObject(packRedisKey("town:" + deptId), result, 1L, TimeUnit.DAYS);
                 setIntoRedis(packRedisKey("town:" + deptId), result);
             });
@@ -1153,6 +1270,9 @@ public class CzrkServiceImpl implements ICzrkService {
             }
 
             ThreadPoolService.execute(() -> {
+                String areaId = sysUser.getDept().getAreaId();
+
+
                 List<SysDept> depts = remoteDeptService.listChildrenDepts(deptId);
                 result.put("dqdw", deptName);
 
@@ -1182,11 +1302,14 @@ public class CzrkServiceImpl implements ICzrkService {
         return result;
     }
 
-    private void townSts(JSONObject result, Long deptId, String deptName, boolean percent) {
+    private void townSts(JSONObject result, SysDept sysDept, List<Czrk> czrkList, List<CzrkJzdz> czrkJzdzList ,int shjzrs, int sczzrs) {
         String startTime = DateUtils.getTodayStartStr();
         String endTime = DateUtils.getTodayEndStr();
         Timestamp s = Timestamp.valueOf(startTime);
         Timestamp e = Timestamp.valueOf(endTime);
+        Long deptId = sysDept.getId();
+        String deptName = sysDept.getDeptName();
+        String areaId = sysDept.getAreaId();
         // 乡镇以下的所有部门
         List<SysDept> depts = remoteDeptService.listChildrenDepts(deptId);
         List<SysDept> cunDepts = new ArrayList<>(16);
@@ -1210,6 +1333,153 @@ public class CzrkServiceImpl implements ICzrkService {
         result.put("zu", isEmpty(zuDept) ? 0 : zuDept.size());
 
         /** **/
+        /*int zrs = 0; // 总人数
+        if (BooleanUtils.isTrue(percent)) {
+            zrs = czrkMapper.countAll();
+        }*/
+
+        if(czrkList==null){
+            czrkList = new ArrayList<>();
+        }
+        //该镇户籍人口总数
+        int hjzrs = 0;
+
+        //该镇 户籍人口今日新增
+        int hjxz = 0;
+        //该镇 户籍人口今日减少
+        int hjjs = 0;
+
+        //循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
+        for (Czrk czrk : czrkList) {
+            if(!(czrk.getVillageTownsId() == null) && !(czrk.getVillageTownsId().longValue() == 0)  && String.valueOf(czrk.getVillageTownsId()).equals(areaId)){
+                if("N".equals(czrk.getIsDel())){
+                    hjzrs++;
+                }
+                //判断是否是在今天操作的人员信息
+                if(s.before(czrk.getCreateTime()) && czrk.getCreateTime().before(e)){
+                    if("Y".equals(czrk.getIsDel())){
+                        hjjs++;
+                    }else{
+                        hjxz++;
+                    }
+                }
+            }
+        }
+        result.put("hjzrs", hjzrs);
+        result.put("hjxz", hjxz);
+        result.put("hjjs", hjjs);
+        result.put("hjbfb", NumberUtils.percent(hjzrs, shjzrs));
+
+
+        if(czrkJzdzList==null){
+            czrkJzdzList = new ArrayList<>();
+        }
+        //该镇户籍人口总数
+        int czzrs = 0;
+
+        //该镇 户籍人口今日新增
+        int czxz = 0;
+        //该镇 户籍人口今日减少
+        int czjs = 0;
+
+        //循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
+        for (CzrkJzdz czrkJzdz : czrkJzdzList) {
+            if(StringUtils.isNotEmpty(czrkJzdz.getTownId()) && czrkJzdz.getTownId().equals(areaId)){
+                if("Y".equals(czrkJzdz.getStatus())){
+                    czzrs++;
+                }
+                //判断是否是在今天操作的人员信息
+                if(s.before(czrkJzdz.getCreateTime()) && czrkJzdz.getCreateTime().before(e)){
+                    if("N".equals(czrkJzdz.getStatus())){
+                        czjs++;
+                    }else{
+                        czxz++;
+                    }
+                }
+            }
+
+        }
+        result.put("czzrs", czzrs);
+        result.put("czxz", czxz);
+        result.put("czjs", czjs);
+        result.put("czbfb", NumberUtils.percent(czzrs, sczzrs));
+
+        /*int czzrs = czrkMapper.countCz1(deptIdList);  // 该镇常住人口总数
+        result.put("czzrs", czzrs);
+        int czxz = czrkMapper.countByCzXz1(startTime, endTime, deptIdList); // 该镇 常住人口今日新增
+        int czjs = czrkMapper.countByCzJs1(startTime, endTime, deptIdList); // 该镇 常住人口今日减少
+        result.put("czxz", czxz);
+        result.put("czjs", czjs);
+        result.put("czbfb", NumberUtils.percent(czzrs, zrs));*/
+
+        result.put("zhen", deptName);
+        /** **/
+
+
+        // 常住人口信息
+//        int type = 4; // 乡镇
+//        int czzrs = czrkMapper.countCzrk(type, areaId); // 常住人口
+//        result.put("czzrs", czzrs);
+//
+//        int zrs = 0;
+//        // 常住人口占总人口的百分比
+//        if (BooleanUtils.isTrue(percent)) {
+//             // 查全部
+//            zrs = czrkMapper.countCzrk(type, areaId);
+//            String czbfb = NumberUtils.percent(czzrs, zrs);
+//            result.put("czbfb", czbfb);
+//        }
+//
+////        type = 4;
+//        int czxz = czrkMapper.countByCzXz(startTime, endTime, type, areaId);
+//        int czjs = czrkMapper.countByCzJs(startTime, endTime, type, areaId);
+//        result.put("czxz", czxz);
+//        result.put("czjs", czjs);
+//
+//        result.put("zhen", deptName);
+//
+//        // 户籍人口信息
+//        int hjxz = czrkMapper.countByHjXz(startTime, endTime, type, areaId); // 新增
+//        int hjjs = czrkMapper.countByHjJs(startTime, endTime, type, areaId);// 减少
+//        result.put("hjxz", hjxz);
+//        result.put("hjjs", hjjs);
+//
+//        // 户籍总人数
+//        int hjzrs = czrkMapper.countHj(startTime, endTime, type, areaId);
+////                int hjzrs= isEmpty(hjzrsList) ? 0 : hjzrsList.size();
+//        result.put("hjzrs", hjzrs);
+//        String hjbfb = NumberUtils.percent(hjzrs, zrs);
+//        result.put("hjbfb", hjbfb);
+    }
+
+    /*private void townSts(JSONObject result, Long deptId, String deptName, boolean percent) {
+        String startTime = DateUtils.getTodayStartStr();
+        String endTime = DateUtils.getTodayEndStr();
+        Timestamp s = Timestamp.valueOf(startTime);
+        Timestamp e = Timestamp.valueOf(endTime);
+        // 乡镇以下的所有部门
+        List<SysDept> depts = remoteDeptService.listChildrenDepts(deptId);
+        List<SysDept> cunDepts = new ArrayList<>(16);
+        for (SysDept dept : depts) {
+            if (isEmpty(dept.getParentId())) continue;
+            if (deptId.equals(dept.getParentId())) {
+                cunDepts.add(dept);
+            }
+        }
+        result.put("cun", isEmpty(cunDepts) ? 0 : cunDepts.size());
+
+        List<SysDept> zuDept = new ArrayList<>(16);
+        for (SysDept cunDept : cunDepts) {
+            for (SysDept dept : depts) {
+                if (cunDept.getId().equals(dept.getParentId())) {
+                    zuDept.add(dept);
+                }
+            }
+        }
+
+        result.put("zu", isEmpty(zuDept) ? 0 : zuDept.size());
+
+        *//** **//*
         int zrs = 0; // 总人数
         if (BooleanUtils.isTrue(percent)) {
             zrs = czrkMapper.countAll();
@@ -1248,14 +1518,14 @@ public class CzrkServiceImpl implements ICzrkService {
         result.put("hjjs", hjjs);
         result.put("hjbfb", NumberUtils.percent(hjzrs, zrs));
 
-        /*List<Long> deptIdList = map(depts, SysDept::getId);
+        *//*List<Long> deptIdList = map(depts, SysDept::getId);
         int hjzrs = czrkMapper.countHj1(deptIdList); // 该镇户籍人口总数
         result.put("hjzrs", hjzrs);
         int hjxz = czrkMapper.countByHjXz1(startTime, endTime, deptIdList); // 该镇 户籍人口今日新增
         result.put("hjxz", hjxz);
         int hjjs = czrkMapper.countByHjJs1(startTime, endTime, deptIdList); // 该镇 户籍人口今日减少
         result.put("hjjs", hjjs);
-        result.put("hjbfb", NumberUtils.percent(hjzrs, zrs));*/
+        result.put("hjbfb", NumberUtils.percent(hjzrs, zrs));*//*
 
 
         List<CzrkJzdz> czrkJzdzList = czrkJzdzService.selectCzrkJzdzListByDeptId(deptIdList);
@@ -1289,16 +1559,16 @@ public class CzrkServiceImpl implements ICzrkService {
         result.put("czjs", czjs);
         result.put("czbfb", NumberUtils.percent(czzrs, zrs));
 
-        /*int czzrs = czrkMapper.countCz1(deptIdList);  // 该镇常住人口总数
+        *//*int czzrs = czrkMapper.countCz1(deptIdList);  // 该镇常住人口总数
         result.put("czzrs", czzrs);
         int czxz = czrkMapper.countByCzXz1(startTime, endTime, deptIdList); // 该镇 常住人口今日新增
         int czjs = czrkMapper.countByCzJs1(startTime, endTime, deptIdList); // 该镇 常住人口今日减少
         result.put("czxz", czxz);
         result.put("czjs", czjs);
-        result.put("czbfb", NumberUtils.percent(czzrs, zrs));*/
+        result.put("czbfb", NumberUtils.percent(czzrs, zrs));*//*
 
         result.put("zhen", deptName);
-        /** **/
+        *//** **//*
 
 
         // 常住人口信息
@@ -1335,7 +1605,7 @@ public class CzrkServiceImpl implements ICzrkService {
 //        result.put("hjzrs", hjzrs);
 //        String hjbfb = NumberUtils.percent(hjzrs, zrs);
 //        result.put("hjbfb", hjbfb);
-    }
+    }*/
 
     @Override
     public JSONObject hjczLine() {

+ 4 - 0
boman-web-core/src/main/java/com/boman/web/core/service/czrk/ICzrkService.java

@@ -131,4 +131,8 @@ public interface ICzrkService {
      * @return
      */
     AjaxResult changeCzrk(Czrk czrk);
+
+    List<Czrk> getAllCzrkRegionId(String s);
+
+    List<Czrk> getAllCzrk(Czrk czrk);
 }

+ 1 - 1
boman-web-core/src/main/resources/mapper/CzrkJzdzMapper.xml

@@ -305,7 +305,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
     </select>
     <select id="selectCzrkJzdzListByRegionId" resultMap="CzrkJzdzResult">
-        elect id, dept_id, region_id, region, town_id, town, village_id, village create_time, status
+        select id, dept_id, region_id, region, town_id, town, village_id, village, create_time, status
         from czrk_jzdz
         where region_id = #{regionId};
     </select>

+ 65 - 1
boman-web-core/src/main/resources/mapper/CzrkMapper.xml

@@ -1236,7 +1236,71 @@
     </select>
     <select id="getAllCzrkRegionId" resultMap="CzrkResult">
         select id, dept_id, region_id, region, village_towns_id, village_towns
-                 , village_id, village create_time, is_del, area_id from czrk
+                 , village_id, village, create_time, is_del from czrk
         where region_id = #{regionId};
     </select>
+    <select id="getAllCzrk" resultMap="CzrkResult">
+        select  c.user_name, STUFF(c.id_card,1,14,'*********') as id_card,  c.province, c.city, c.region,
+        c.village_towns, c.village, c.villager_group,c.now_in,c.key_industries,
+        cj.province as province_jzdz,cj.city as city_jzdz,
+        cj.region as region_jzdz,cj.town as town_jzdz,
+        cj.village as village_jzdz,cj.now_in as now_in_jzdz
+        from czrk c left join czrk_jzdz cj on c.id =cj.czrk_id
+        <where>
+            <!-- 已认领 -->
+            <if test="isRl != null and isRl != ''">and c.is_rl = #{isRl}</if>
+
+            <if test="userName != null  and userName != ''">
+                and c.user_name like concat(#{userName}, '%')
+            </if>
+            <if test="params.startAge != null  and params.startAge != ''">and c.age &gt;= #{params.startAge}</if>
+            <if test="params.endAge != null  and params.endAge != ''">and c.age &lt;= #{params.endAge}</if>
+            <if test="gender != null  and gender != ''">and c.gender = #{gender}</if>
+            <if test="birthday != null ">and c.birthday = #{birthday}</if>
+            <if test="idCard != null  and idCard != ''">and c.id_card = #{idCard}</if>
+            <if test="phoneNum != null  and phoneNum != ''">and c.phone_num = #{phoneNum}</if>
+            <if test="code != null  and code != ''">and c.code = #{code}</if>
+            <if test="houseType != null  and houseType != ''">and c.house_type = #{houseType}</if>
+            <if test="rlr != null  and rlr != ''">and c.rlr = #{rlr}</if>
+            <if test="rlTime != null ">and c.rl_time = #{rlTime}</if>
+            <if test="yhzgx != null  and yhzgx != ''">and c.yhzgx = #{yhzgx}</if>
+            <if test="workUnit != null  and workUnit != ''">and c.work_unit = #{workUnit}</if>
+            <if test="provinceId != null  and provinceId != ''">and c.province_id = #{provinceId}</if>
+            <if test="province != null  and province != ''">and c.province = #{province}</if>
+            <if test="cityId != null  and cityId != ''">and c.city_id = #{cityId}</if>
+            <if test="city != null  and city != ''">and c.city = #{city}</if>
+            <if test="regionId != null  and regionId != ''">and c.region_id = #{regionId}</if>
+            <if test="region != null  and region != ''">and c.region = #{region}</if>
+            <if test="villageTownsId != null  and villageTownsId != ''">and c.village_towns_id = #{villageTownsId}</if>
+            <if test="villageTowns != null  and villageTowns != ''">and c.village_towns = #{villageTowns}</if>
+            <if test="villageId != null  and villageId != ''">and c.village_id = #{villageId}</if>
+            <if test="village != null  and village != ''">and c.village = #{village}</if>
+            <!--    <if test="villagerGroupId != null  and villagerGroupId != ''"> and villager_group_id = #{villagerGroupId}</if>
+                <if test="villagerGroup != null  and villagerGroup != ''"> and villager_group = #{villagerGroup}</if>-->
+            <if test="nowIn != null  and nowIn != ''">and c.now_in = #{nowIn}</if>
+            <if test="status != null  and status != ''">and c.status = #{status}</if>
+            <if test="isConfirm != null  and isConfirm != ''">and c.is_confirm = #{isConfirm}</if>
+            <if test="isDel != null  and isDel != ''">and c.is_del = #{isDel}</if>
+            <if test="deleteReason != null  and deleteReason != ''">and c.delete_reason = #{deleteReason}</if>
+            <if test="gridId != null  and gridId != ''">and c.grid_id = #{gridId}</if>
+            <if test="deptIdList != null and deptIdList.size() > 0">
+                and c.dept_id in
+                <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
+                    #{deptId}
+                </foreach>
+            </if>
+            <if test="idCardList != null and idCardList.size() > 0">
+                and c.id_card in
+                <foreach item="idCard" collection="idCardList" open="(" separator="," close=")">
+                    #{idCard}
+                </foreach>
+            </if>
+            <if test="czrkJzdz.provinceId != null">and z.province_id = #{czrkJzdz.provinceId}</if>
+            <if test="czrkJzdz.cityId != null">and z.city_id = #{czrkJzdz.cityId}</if>
+            <if test="czrkJzdz.regionId != null">and z.region_id = #{czrkJzdz.regionId}</if>
+            <if test="czrkJzdz.townId != null">and z.town_id = #{czrkJzdz.townId}</if>
+            <if test="czrkJzdz.villageId != null">and z.village_id = #{czrkJzdz.villageId}</if>
+        </where>
+        order by c.create_time DESC
+    </select>
 </mapper>