Эх сурвалжийг харах

Merge remote-tracking branch 'origin/master'

tjf 3 жил өмнө
parent
commit
23afa1f799
27 өөрчлөгдсөн 2380 нэмэгдсэн , 163 устгасан
  1. 2 0
      boman-api/boman-domain/src/main/java/com.boman.domain/BaseEntity.java
  2. 210 0
      boman-api/boman-domain/src/main/java/com/boman/domain/Czrk.java
  3. 136 0
      boman-api/boman-domain/src/main/java/com/boman/domain/CzrkJzdz.java
  4. 57 9
      boman-api/boman-domain/src/main/java/com/boman/domain/VaccineInfoOperation.java
  5. 5 0
      boman-common/boman-common-redis/src/main/java/com/boman/common/redis/RedisKey.java
  6. 5 1
      boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysDeptServiceImpl.java
  7. 104 0
      boman-web-core/src/main/java/com/boman/web/core/controller/Czrk1Controller.java
  8. 76 21
      boman-web-core/src/main/java/com/boman/web/core/controller/CzrkController.java
  9. 91 0
      boman-web-core/src/main/java/com/boman/web/core/controller/CzrkJzdzController.java
  10. 4 4
      boman-web-core/src/main/java/com/boman/web/core/controller/RyrlController.java
  11. 76 0
      boman-web-core/src/main/java/com/boman/web/core/controller/TestController.java
  12. 62 0
      boman-web-core/src/main/java/com/boman/web/core/mapper/CzrkJzdzMapper.java
  13. 62 0
      boman-web-core/src/main/java/com/boman/web/core/mapper/CzrkMapper.java
  14. 2 0
      boman-web-core/src/main/java/com/boman/web/core/mapper/FxryMapper.java
  15. 21 3
      boman-web-core/src/main/java/com/boman/web/core/mapper/VaccineInfoMapper.java
  16. 87 0
      boman-web-core/src/main/java/com/boman/web/core/service/czrk/CzrkJzdzServiceImpl.java
  17. 93 0
      boman-web-core/src/main/java/com/boman/web/core/service/czrk/CzrkServiceImpl.java
  18. 62 0
      boman-web-core/src/main/java/com/boman/web/core/service/czrk/ICzrkJzdzService.java
  19. 61 0
      boman-web-core/src/main/java/com/boman/web/core/service/czrk/ICzrkService.java
  20. 7 5
      boman-web-core/src/main/java/com/boman/web/core/service/fxry/FxryServiceImpl.java
  21. 16 1
      boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/IVaccineInfoService.java
  22. 479 96
      boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoServiceImpl.java
  23. 8 5
      boman-web-core/src/main/java/com/boman/web/core/utils/IdCardUtils.java
  24. 152 0
      boman-web-core/src/main/resources/mapper/CzrkJzdzMapper.xml
  25. 211 0
      boman-web-core/src/main/resources/mapper/CzrkMapper.xml
  26. 13 3
      boman-web-core/src/main/resources/mapper/FxryMapper.xml
  27. 278 15
      boman-web-core/src/main/resources/mapper/VaccineInfoMapper.xml

+ 2 - 0
boman-api/boman-domain/src/main/java/com.boman.domain/BaseEntity.java

@@ -1,6 +1,8 @@
 package com.boman.domain;
 package com.boman.domain;
 
 
 
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+
 import java.io.Serializable;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashMap;

+ 210 - 0
boman-api/boman-domain/src/main/java/com/boman/domain/Czrk.java

@@ -0,0 +1,210 @@
+package com.boman.domain;
+
+import java.util.Date;
+
+import com.boman.domain.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+/**
+ * 常住人口对象 czrk
+ *
+ * @author ruoyi
+ * @date 2022-01-14
+ */
+@Data
+@SuperBuilder
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString
+public class Czrk {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 姓名
+     */
+    @Excel(name = "姓名")
+    private String userName;
+
+    /**
+     * 性别
+     */
+    @Excel(name = "性别")
+    private String gender;
+
+    /**
+     * 年龄
+     */
+    @Excel(name = "年龄")
+    private Integer age;
+
+    /**
+     * 出生日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private java.sql.Date birthday;
+
+    /**
+     * 身份证号码
+     */
+    @Excel(name = "身份证号码")
+    private String idCard;
+
+    /**
+     * 联系号码
+     */
+    @Excel(name = "联系号码")
+    private String phoneNum;
+
+    /**
+     * 户籍号
+     */
+    @Excel(name = "户籍号")
+    private String code;
+
+    /**
+     * 是否是户主
+     */
+    @Excel(name = "是否是户主")
+    private String houseType;
+
+    /**
+     * 认领人
+     */
+    @Excel(name = "认领人")
+    private String rlr;
+
+    /**
+     * 认领时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "认领时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private java.sql.Date rlTime;
+
+    /**
+     * 与户主关系
+     */
+    @Excel(name = "与户主关系")
+    private String yhzgx;
+
+    /**
+     * 工作单位
+     */
+    @Excel(name = "工作单位")
+    private String workUnit;
+
+    /**
+     * 户籍地的省份
+     */
+    @Excel(name = "户籍地的省份")
+    private String provinceId;
+
+    /**
+     * 户籍地的省份
+     */
+    @Excel(name = "户籍地的省份")
+    private String province;
+
+    /**
+     * 户籍地的城市
+     */
+    @Excel(name = "户籍地的城市")
+    private String cityId;
+
+    /**
+     * 户籍地的城市
+     */
+    @Excel(name = "户籍地的城市")
+    private String city;
+
+    /**
+     * 户籍地的区
+     */
+    @Excel(name = "户籍地的区")
+    private String regionId;
+
+    /**
+     * 户籍地的区
+     */
+    @Excel(name = "户籍地的区")
+    private String region;
+
+    /**
+     * 户籍地的镇
+     */
+    @Excel(name = "户籍地的镇")
+    private String villageTownsId;
+
+    /**
+     * 户籍地的镇
+     */
+    @Excel(name = "户籍地的镇")
+    private String villageTowns;
+
+    /**
+     * 户籍地的村
+     */
+    @Excel(name = "户籍地的村")
+    private String villageId;
+
+    /**
+     * 户籍地的村
+     */
+    @Excel(name = "户籍地的村")
+    private String village;
+
+    /**
+     * 户籍地的组
+     */
+    @Excel(name = "户籍地的组")
+    private String villagerGroupId;
+
+    /**
+     * 户籍地的组
+     */
+    @Excel(name = "户籍地的组")
+    private String villagerGroup;
+
+    /**
+     * 户籍地的详细地址
+     */
+    @Excel(name = "户籍地的详细地址")
+    private String nowIn;
+
+    /**
+     * 状态
+     */
+    @Excel(name = "状态")
+    private String status;
+
+    /**
+     * 是否删除
+     */
+    @Excel(name = "是否删除")
+    private String isDel;
+
+    /**
+     * 删除原因
+     */
+    @Excel(name = "删除原因")
+    private String deleteReason;
+    private String remark;
+
+    private java.sql.Timestamp createTime;
+    private java.sql.Timestamp updateTime;
+    private String createBy;
+    private String updateBy;
+}

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

@@ -0,0 +1,136 @@
+package com.boman.domain;
+
+import com.boman.domain.annotation.Excel;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+/**
+ * 常住人口对应的居住地址对象 czrk_jzdz
+ *
+ * @author ruoyi
+ * @date 2022-01-14
+ */
+@Data
+@SuperBuilder
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString
+public class CzrkJzdz {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * czrk表的id
+     */
+    @Excel(name = "czrk表的id")
+    private Long czrkId;
+
+    /**
+     * 身份证号码
+     */
+    @Excel(name = "身份证号码")
+    private String idCard;
+
+    /**
+     * 姓名
+     */
+    @Excel(name = "姓名")
+    private String userName;
+
+    /**
+     * 居住地址的排序
+     */
+    @Excel(name = "居住地址的排序")
+    private Integer sort;
+
+    /**
+     * $column.columnComment
+     */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private Long deptId;
+
+    /**
+     * 户籍地的省份
+     */
+    @Excel(name = "户籍地的省份")
+    private String provinceId;
+
+    /**
+     * 户籍地的省份
+     */
+    @Excel(name = "户籍地的省份")
+    private String province;
+
+    /**
+     * 户籍地的城市
+     */
+    @Excel(name = "户籍地的城市")
+    private String cityId;
+
+    /**
+     * 户籍地的城市
+     */
+    @Excel(name = "户籍地的城市")
+    private String city;
+
+    /**
+     * 户籍地的区
+     */
+    @Excel(name = "户籍地的区")
+    private String regionId;
+
+    /**
+     * 户籍地的区
+     */
+    @Excel(name = "户籍地的区")
+    private String region;
+
+    /**
+     * 居住地的镇
+     */
+    @Excel(name = "居住地的镇")
+    private String townId;
+
+    /**
+     * 居住地的镇
+     */
+    @Excel(name = "居住地的镇")
+    private String town;
+
+    /**
+     * 居住地的村
+     */
+    @Excel(name = "居住地的村")
+    private String villageId;
+
+    /**
+     * 居住地的村
+     */
+    @Excel(name = "居住地的村")
+    private String village;
+
+    /**
+     * 居住地的详细地址
+     */
+    @Excel(name = "居住地的详细地址")
+    private String nowIn;
+
+    /**
+     * Y有效地址,N无效地址
+     */
+    @Excel(name = "Y有效地址,N无效地址")
+    private String status;
+
+    private java.sql.Timestamp createTime;
+    private java.sql.Timestamp updateTime;
+    private String createBy;
+    private String updateBy;
+
+}

+ 57 - 9
boman-api/boman-domain/src/main/java/com/boman/domain/VaccineInfoOperation.java

@@ -44,7 +44,7 @@ public class VaccineInfoOperation extends BaseEntity {
     private String villagerGroup;
     private String villagerGroup;
 
 
     /**
     /**
-     * 户别
+     * 户别 是否是户主 是, 否
      */
      */
     @Excel(name = "户别")
     @Excel(name = "户别")
     private String houseType;
     private String houseType;
@@ -205,6 +205,7 @@ public class VaccineInfoOperation extends BaseEntity {
      */
      */
     @Excel(name = "操作类型")
     @Excel(name = "操作类型")
     private String operationType;
     private String operationType;
+    private String yhzgx;
 
 
     /**
     /**
      * 疫苗信息
      * 疫苗信息
@@ -269,32 +270,59 @@ public class VaccineInfoOperation extends BaseEntity {
 
 
     private String deleteReason;
     private String deleteReason;
 
 
+    /** 户籍地的镇 **/
+    private String residenceTown;
+    /** 户籍地的村 **/
+    private String residenceVillage;
+
 
 
     /**
     /**
      * 检索开始时间
      * 检索开始时间
      */
      */
-    @JSONField(format = "yyyy-MM-dd HH:mm")
-    private Date startTime;
+//    @JSONField(format = "yyyy-MM-dd HH:mm")
+    private String startTime;
 
 
     /**
     /**
      * 检索结束时间
      * 检索结束时间
      */
      */
-    @JSONField(format = "yyyy-MM-dd HH:mm")
-    private Date endTime;
+//    @JSONField(format = "yyyy-MM-dd HH:mm")
+    private String endTime;
+
+    /** 认领人***/
+    private String rlr;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    public String getYhzgx() {
+        return yhzgx;
+    }
+
+    public void setYhzgx(String yhzgx) {
+        this.yhzgx = yhzgx;
+    }
+
+    public String getRlr() {
+        return rlr;
+    }
 
 
-    public Date getStartTime() {
+    public void setRlr(String rlr) {
+        this.rlr = rlr;
+    }
+
+    public String getStartTime() {
         return startTime;
         return startTime;
     }
     }
 
 
-    public void setStartTime(Date startTime) {
+    public void setStartTime(String startTime) {
         this.startTime = startTime;
         this.startTime = startTime;
     }
     }
 
 
-    public Date getEndTime() {
+    public String getEndTime() {
         return endTime;
         return endTime;
     }
     }
 
 
-    public void setEndTime(Date endTime) {
+    public void setEndTime(String endTime) {
         this.endTime = endTime;
         this.endTime = endTime;
     }
     }
 
 
@@ -691,7 +719,27 @@ public class VaccineInfoOperation extends BaseEntity {
         this.nowIn = nowIn;
         this.nowIn = nowIn;
     }
     }
 
 
+    public String getResidenceTown() {
+        return residenceTown;
+    }
+
+    public void setResidenceTown(String residenceTown) {
+        this.residenceTown = residenceTown;
+    }
+
+    public String getResidenceVillage() {
+        return residenceVillage;
+    }
 
 
+    public void setResidenceVillage(String residenceVillage) {
+        this.residenceVillage = residenceVillage;
+    }
 
 
+    public Date getUpdateTime() {
+        return updateTime;
+    }
 
 
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
 }
 }

+ 5 - 0
boman-common/boman-common-redis/src/main/java/com/boman/common/redis/RedisKey.java

@@ -37,4 +37,9 @@ public class RedisKey {
      * 异步下载时,判断是否下载完成
      * 异步下载时,判断是否下载完成
      */
      */
     public static final String ASYNC_DOWNLOAD_YMJZ = "download:ymjz:";
     public static final String ASYNC_DOWNLOAD_YMJZ = "download:ymjz:";
+
+    /** 常住人口统计 **/
+    public static final String STS_CZRK_ = "sts:czrk:";
+    /** 常住人口统计 **/
+    public static final String CHINA_AREA = "CHINA_AREA";
 }
 }

+ 5 - 1
boman-modules/boman-system/src/main/java/com/boman/system/service/impl/SysDeptServiceImpl.java

@@ -374,6 +374,10 @@ public class SysDeptServiceImpl implements ISysDeptService {
         List<SysDept> allDepts = selectDepts(new SysDept());
         List<SysDept> allDepts = selectDepts(new SysDept());
         SysDept sysDept = ObjectUtils.filterOne(allDepts, dept -> deptId.equals(dept.getId()));
         SysDept sysDept = ObjectUtils.filterOne(allDepts, dept -> deptId.equals(dept.getId()));
         List<SysDept> returnData = Lists.newArrayListWithCapacity(16);
         List<SysDept> returnData = Lists.newArrayListWithCapacity(16);
+        if (null == sysDept) {
+            return returnData;
+        }
+
         List<SysDept> sysDepts = recursionChildrenDepts(allDepts, sysDept, returnData);
         List<SysDept> sysDepts = recursionChildrenDepts(allDepts, sysDept, returnData);
         SysDept selfDept = new SysDept();
         SysDept selfDept = new SysDept();
         selfDept.setId(deptId);
         selfDept.setId(deptId);
@@ -549,7 +553,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
 
 
         List<SysDept> townsDepts = new ArrayList<>(16);
         List<SysDept> townsDepts = new ArrayList<>(16);
         List<SysDept> allDepts = selectDeptsList();
         List<SysDept> allDepts = selectDeptsList();
-        if (roleKeyList.contains("admin") || roleKeyList.contains("city")) {
+        if (roleKeyList.contains("admin") || roleKeyList.contains("city") || roleKeyList.contains("yanshi")) {
             Long deptId1;
             Long deptId1;
             if (null == deptId) deptId1 = 1L; // 查所有乡镇
             if (null == deptId) deptId1 = 1L; // 查所有乡镇
             else deptId1 = deptId; // 查乡镇下的村
             else deptId1 = deptId; // 查乡镇下的村

+ 104 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/Czrk1Controller.java

@@ -0,0 +1,104 @@
+package com.boman.web.core.controller;
+
+import com.boman.common.core.web.controller.BaseController;
+import com.boman.domain.TableDataInfo;
+import com.boman.domain.VaccineInfoOperation;
+import com.boman.domain.dto.AjaxResult;
+import com.boman.web.core.service.vaccineInfo.IVaccineInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @author shiqian
+ * @description 常驻人口
+ * @date 2022年01月05日 15:39
+ **/
+@RestController
+@RequestMapping("/core/czrk")
+public class Czrk1Controller extends BaseController {
+
+    @Autowired
+    private IVaccineInfoService vaccineInfoService;
+
+    /**
+     * 功能描述: 项目首页统计信息,
+     * 当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/stsByCzrkHomePage")
+    public AjaxResult stsByCzrkHomePage() {
+        return AjaxResult.success("成功", vaccineInfoService.stsByCzrkHomePage());
+    }
+
+    /**
+     * 功能描述: 当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/stsByCzrk")
+    public AjaxResult stsByCzrk() {
+        return AjaxResult.success("成功", vaccineInfoService.stsByCzrk());
+    }
+
+    /**
+     * 功能描述: ”当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人“ 中的新增人员列表
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/listByXz")
+    public TableDataInfo listByXz(VaccineInfoOperation condition) {
+        List<VaccineInfoOperation> list = vaccineInfoService.listByXz(condition);
+        return getDataTable(list);
+    }
+
+    /**
+     * 功能描述: ”当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人“ 中的减少人员列表
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/listByJs")
+    public TableDataInfo listByJs(VaccineInfoOperation condition) {
+        List<VaccineInfoOperation> list = vaccineInfoService.listByJs(condition);
+        return getDataTable(list);
+    }
+
+    /**
+     * 功能描述: 删除常住人口,人员认领中的删除也是这个接口
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/deleteCzrk")
+    public AjaxResult deleteCzrk(VaccineInfoOperation vaccineInfoOperation) {
+        return vaccineInfoService.deleteCzrk(vaccineInfoOperation);
+    }
+
+    /**
+     * 功能描述: 回收站的还原功能
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/reduction/{id}")
+    public AjaxResult reduction(@PathVariable("id") String id) {
+        int reduction = vaccineInfoService.reduction(id);
+        return reduction > 0 ? AjaxResult.success() : AjaxResult.error();
+    }
+
+    /**
+     * 功能描述: 根据户号查找家庭中所有人员
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/family/{code}")
+    public AjaxResult family(@PathVariable("code") String code) {
+        return AjaxResult.success(vaccineInfoService.family(code));
+    }
+
+
+
+}

+ 76 - 21
boman-web-core/src/main/java/com/boman/web/core/controller/CzrkController.java

@@ -1,44 +1,99 @@
 package com.boman.web.core.controller;
 package com.boman.web.core.controller;
 
 
-import com.boman.domain.VaccineInfoOperation;
+import java.io.IOException;
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+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.domain.Czrk;
+import com.boman.domain.TableDataInfo;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.domain.dto.AjaxResult;
-import com.boman.web.core.service.vaccineInfo.IVaccineInfoService;
+import com.boman.web.core.service.czrk.ICzrkService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 /**
 /**
- * @author shiqian
- * @description 常驻人口
- * @date 2022年01月05日 15:39
- **/
+ * 常住人口Controller
+ *
+ * @author ruoyi
+ * @date 2022-01-14
+ */
 @RestController
 @RestController
-@RequestMapping("/core/czrk")
-public class CzrkController {
+@RequestMapping("/czrk")
+public class CzrkController extends BaseController {
 
 
     @Autowired
     @Autowired
-    private IVaccineInfoService vaccineInfoService;
+    private ICzrkService czrkService;
+
+    /**
+     * 查询常住人口列表
+     */
+//    @PreAuthorize("@ss.hasPermi('system:czrk:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(Czrk czrk) {
+        startPage();
+        List<Czrk> list = czrkService.selectCzrkList(czrk);
+        return getDataTable(list);
+    }
 
 
     /**
     /**
-     * 功能描述: 当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人
-     *
-     * @return com.boman.domain.dto.AjaxResult
+     * 导出常住人口列表
      */
      */
-    @GetMapping("/stsByCzrk")
-    public AjaxResult stsByCzrk() {
-        return AjaxResult.success("成功", vaccineInfoService.stsByCzrk());
+//    @PreAuthorize("@ss.hasPermi('system:czrk:export')")
+    @Log(title = "常住人口", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, Czrk czrk) throws IOException {
+        List<Czrk> list = czrkService.selectCzrkList(czrk);
+        ExcelUtil<Czrk> util = new ExcelUtil<>(Czrk.class);
+        util.exportExcel(response, list, "常住人口数据");
     }
     }
 
 
     /**
     /**
-     * 功能描述: 删除常住人口
-     *
-     * @return com.boman.domain.dto.AjaxResult
+     * 获取常住人口详细信息
      */
      */
-    @GetMapping("/deleteCzrk")
-    public AjaxResult deleteCzrk(VaccineInfoOperation vaccineInfoOperation) {
-        return vaccineInfoService.deleteCzrk(vaccineInfoOperation);
+//    @PreAuthorize("@ss.hasPermi('system:czrk:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(czrkService.selectCzrkById(id));
     }
     }
 
 
+    /**
+     * 新增常住人口
+     */
+//    @PreAuthorize("@ss.hasPermi('system:czrk:add')")
+    @Log(title = "常住人口", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody Czrk czrk) {
+        return toAjax(czrkService.insertCzrk(czrk));
+    }
 
 
+    /**
+     * 修改常住人口
+     */
+//    @PreAuthorize("@ss.hasPermi('system:czrk:edit')")
+    @Log(title = "常住人口", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody Czrk czrk) {
+        return toAjax(czrkService.updateCzrk(czrk));
+    }
+
+    /**
+     * 删除常住人口
+     */
+//    @PreAuthorize("@ss.hasPermi('system:czrk:remove')")
+    @Log(title = "常住人口", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(czrkService.deleteCzrkByIds(ids));
+    }
 }
 }

+ 91 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/CzrkJzdzController.java

@@ -0,0 +1,91 @@
+package com.boman.web.core.controller;
+
+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.domain.CzrkJzdz;
+import com.boman.domain.TableDataInfo;
+import com.boman.domain.dto.AjaxResult;
+import com.boman.web.core.service.czrk.ICzrkJzdzService;
+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.List;
+
+/**
+ * 常住人口对应的居住地址Controller
+ *
+ * @author ruoyi
+ * @date 2022-01-14
+ */
+@RestController
+@RequestMapping("/system/jzdz")
+public class CzrkJzdzController extends BaseController {
+    @Autowired
+    private ICzrkJzdzService czrkJzdzService;
+
+    /**
+     * 查询常住人口对应的居住地址列表
+     */
+//    @PreAuthorize("@ss.hasPermi('system:jzdz:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CzrkJzdz czrkJzdz) {
+        startPage();
+        List<CzrkJzdz> list = czrkJzdzService.selectCzrkJzdzList(czrkJzdz);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出常住人口对应的居住地址列表
+     */
+//    @PreAuthorize("@ss.hasPermi('system:jzdz:export')")
+    @Log(title = "常住人口对应的居住地址", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, CzrkJzdz czrkJzdz) throws IOException {
+        List<CzrkJzdz> list = czrkJzdzService.selectCzrkJzdzList(czrkJzdz);
+        ExcelUtil<CzrkJzdz> util = new ExcelUtil<>(CzrkJzdz.class);
+        util.exportExcel(response, list, "常住人口对应的居住地址数据");
+    }
+
+    /**
+     * 获取常住人口对应的居住地址详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('system:jzdz:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(czrkJzdzService.selectCzrkJzdzById(id));
+    }
+
+    /**
+     * 新增常住人口对应的居住地址
+     */
+//    @PreAuthorize("@ss.hasPermi('system:jzdz:add')")
+    @Log(title = "常住人口对应的居住地址", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CzrkJzdz czrkJzdz) {
+        return toAjax(czrkJzdzService.insertCzrkJzdz(czrkJzdz));
+    }
+
+    /**
+     * 修改常住人口对应的居住地址
+     */
+//    @PreAuthorize("@ss.hasPermi('system:jzdz:edit')")
+    @Log(title = "常住人口对应的居住地址", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CzrkJzdz czrkJzdz) {
+        return toAjax(czrkJzdzService.updateCzrkJzdz(czrkJzdz));
+    }
+
+    /**
+     * 删除常住人口对应的居住地址
+     */
+//    @PreAuthorize("@ss.hasPermi('system:jzdz:remove')")
+    @Log(title = "常住人口对应的居住地址", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(czrkJzdzService.deleteCzrkJzdzByIds(ids));
+    }
+}

+ 4 - 4
boman-web-core/src/main/java/com/boman/web/core/controller/RyrlController.java

@@ -24,7 +24,7 @@ public class RyrlController extends BaseController {
     private IVaccineInfoService vaccineInfoService;
     private IVaccineInfoService vaccineInfoService;
 
 
     /**
     /**
-     * 功能描述: 认领人员list
+     * 功能描述: 认领人员list, 如果isDel="Y", 则为回收站的功能,默认是isDelr="N"
      *
      *
      * @param vaccineInfo vaccineInfo
      * @param vaccineInfo vaccineInfo
      * @return com.boman.domain.TableDataInfo
      * @return com.boman.domain.TableDataInfo
@@ -47,7 +47,7 @@ public class RyrlController extends BaseController {
     }
     }
 
 
     /**
     /**
-     * 功能描述: 修改
+     * 功能描述: 修改 也即 由未认领到认领
      *
      *
      * @param vaccineInfo vaccineInfo
      * @param vaccineInfo vaccineInfo
      * @return com.boman.domain.dto.AjaxResult
      * @return com.boman.domain.dto.AjaxResult
@@ -74,8 +74,8 @@ public class RyrlController extends BaseController {
      * @return com.boman.domain.dto.AjaxResult
      * @return com.boman.domain.dto.AjaxResult
      */
      */
     @GetMapping("/sts")
     @GetMapping("/sts")
-    public AjaxResult stsByApplet() {
-        return AjaxResult.success("成功", vaccineInfoService.stsByApplet());
+    public AjaxResult stsByApplet(Long townId, Long villageId, String userName) {
+        return AjaxResult.success("成功", vaccineInfoService.stsByApplet(townId, villageId, userName));
     }
     }
 
 
 
 

+ 76 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/TestController.java

@@ -0,0 +1,76 @@
+package com.boman.web.core.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.boman.common.core.utils.obj.ObjectUtils;
+import com.boman.domain.VaccineInfoOperation;
+import com.boman.domain.dto.AjaxResult;
+import com.boman.web.core.mapper.StandardlyMapper;
+import com.boman.web.core.mapper.VaccineInfoMapper;
+import com.boman.web.core.service.vaccineInfo.IVaccineInfoService;
+import com.boman.web.core.service.vaccineInfo.impl.VaccineInfoServiceImpl;
+import com.boman.web.core.utils.IdUtils;
+import com.google.common.base.Strings;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * @author shiqian
+ * @date 2021年09月08日 10:40
+ **/
+@RestController
+@RequestMapping("/test")
+public class TestController {
+    @Resource
+    private VaccineInfoMapper mapper;
+
+    @GetMapping("/handleData")
+    public AjaxResult handleData(){
+        List<VaccineInfoOperation> list = mapper.handleData();
+        for (VaccineInfoOperation vaccineInfoOperation : list) {
+            if (Objects.isNull(vaccineInfoOperation.getAge()) && ObjectUtils.isEmpty(vaccineInfoOperation.getBirthday())) {
+                continue;
+            }
+
+            mapper.updateAgeBirthday(vaccineInfoOperation);
+        }
+
+        return new AjaxResult();
+    }
+
+    @GetMapping("/setHouseType")
+    public AjaxResult setHouseType() {
+        List<JSONObject> list = mapper.getHouseType();
+        for (JSONObject json : list) {
+            String idCard = json.getString("idCard");
+            String yhzgx = json.getString("yhzgx");// 与户主关系
+            String code = json.getString("code"); // 户号
+
+            String houseType = "", yhzgx1 = "";
+            if (StringUtils.isNotEmpty(yhzgx)) {
+                yhzgx = yhzgx.trim();
+                if ("户主".equals(yhzgx)) {
+                    houseType = "是";
+                    yhzgx1 = "户主";
+                } else {
+                    houseType = "否";
+                    yhzgx1 = yhzgx;
+                }
+            }
+
+            mapper.setHouseType(idCard, code, yhzgx1, houseType);
+        }
+
+        return new AjaxResult();
+    }
+
+}

+ 62 - 0
boman-web-core/src/main/java/com/boman/web/core/mapper/CzrkJzdzMapper.java

@@ -0,0 +1,62 @@
+package com.boman.web.core.mapper;
+
+import com.boman.domain.CzrkJzdz;
+
+import java.util.List;
+
+/**
+ * 常住人口对应的居住地址Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-01-14
+ */
+ public interface CzrkJzdzMapper
+{
+    /**
+     * 查询常住人口对应的居住地址
+     * 
+     * @param id 常住人口对应的居住地址主键
+     * @return 常住人口对应的居住地址
+     */
+     CzrkJzdz selectCzrkJzdzById(Long id);
+
+    /**
+     * 查询常住人口对应的居住地址列表
+     * 
+     * @param czrkJzdz 常住人口对应的居住地址
+     * @return 常住人口对应的居住地址集合
+     */
+     List<CzrkJzdz> selectCzrkJzdzList(CzrkJzdz czrkJzdz);
+
+    /**
+     * 新增常住人口对应的居住地址
+     * 
+     * @param czrkJzdz 常住人口对应的居住地址
+     * @return 结果
+     */
+     int insertCzrkJzdz(CzrkJzdz czrkJzdz);
+
+    /**
+     * 修改常住人口对应的居住地址
+     * 
+     * @param czrkJzdz 常住人口对应的居住地址
+     * @return 结果
+     */
+     int updateCzrkJzdz(CzrkJzdz czrkJzdz);
+
+    /**
+     * 删除常住人口对应的居住地址
+     * 
+     * @param id 常住人口对应的居住地址主键
+     * @return 结果
+     */
+     int deleteCzrkJzdzById(Long id);
+
+    /**
+     * 批量删除常住人口对应的居住地址
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+     int deleteCzrkJzdzByIds(Long[] ids);
+}

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

@@ -0,0 +1,62 @@
+package com.boman.web.core.mapper;
+
+import com.boman.domain.Czrk;
+
+import java.util.List;
+
+
+/**
+ * 常住人口Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-01-14
+ */
+public interface CzrkMapper {
+    /**
+     * 查询常住人口
+     *
+     * @param id 常住人口主键
+     * @return 常住人口
+     */
+    Czrk selectCzrkById(Long id);
+
+    /**
+     * 查询常住人口列表
+     *
+     * @param czrk 常住人口
+     * @return 常住人口集合
+     */
+    List<Czrk> selectCzrkList(Czrk czrk);
+
+    /**
+     * 新增常住人口
+     *
+     * @param czrk 常住人口
+     * @return 结果
+     */
+    int insertCzrk(Czrk czrk);
+
+    /**
+     * 修改常住人口
+     *
+     * @param czrk 常住人口
+     * @return 结果
+     */
+    int updateCzrk(Czrk czrk);
+
+    /**
+     * 删除常住人口
+     *
+     * @param id 常住人口主键
+     * @return 结果
+     */
+    int deleteCzrkById(Long id);
+
+    /**
+     * 批量删除常住人口
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteCzrkByIds(Long[] ids);
+}

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

@@ -18,4 +18,6 @@ public interface FxryMapper{
     List<Fxry> list(Fxry fxry);
     List<Fxry> list(Fxry fxry);
 
 
     Fxry getById(String id);
     Fxry getById(String id);
+
+    int countByIdCard(String idCard);
 }
 }

+ 21 - 3
boman-web-core/src/main/java/com/boman/web/core/mapper/VaccineInfoMapper.java

@@ -1,5 +1,6 @@
 package com.boman.web.core.mapper;
 package com.boman.web.core.mapper;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.boman.domain.VaccineInfoOperation;
 import com.boman.domain.VaccineInfoOperation;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -59,6 +60,7 @@ public interface VaccineInfoMapper
      * @return 结果
      * @return 结果
      */
      */
     public int updateVaccineInfo(VaccineInfoOperation vaccineInfo);
     public int updateVaccineInfo(VaccineInfoOperation vaccineInfo);
+    public int updateAgeBirthday(VaccineInfoOperation vaccineInfo);
 
 
     int update(VaccineInfoOperation info);
     int update(VaccineInfoOperation info);
 
 
@@ -103,13 +105,17 @@ public interface VaccineInfoMapper
      */
      */
     VaccineInfoOperation getByIdCard(String idCard);
     VaccineInfoOperation getByIdCard(String idCard);
 
 
-    int stsByYrl(@Param("deptIdList") List<Long> deptIdList);
+    int stsByYrl(@Param("deptIdList") List<Long> deptIdList, @Param("userName") String userName);
 
 
-    int stsByWrl(@Param("deptIdList") List<Long> deptIdList);
+    int stsByWrl(@Param("deptIdList") List<Long> deptIdList, @Param("userName") String userName);
 
 
     int deleteCzrk(VaccineInfoOperation vaccineInfoOperation);
     int deleteCzrk(VaccineInfoOperation vaccineInfoOperation);
 
 
-    List<VaccineInfoOperation> listByXzAndJs(VaccineInfoOperation condition);
+    List<VaccineInfoOperation> listByJs(VaccineInfoOperation condition);
+    List<VaccineInfoOperation> listByXz(VaccineInfoOperation condition);
+    int countByJs(VaccineInfoOperation condition);
+    int countByXz(VaccineInfoOperation condition);
+
     /**
     /**
      * 功能描述: 根据deptIdList查找多少已经认领的(常住人口数量)
      * 功能描述: 根据deptIdList查找多少已经认领的(常住人口数量)
      *
      *
@@ -117,4 +123,16 @@ public interface VaccineInfoMapper
      * @return int
      * @return int
      */
      */
     int countCzrk(VaccineInfoOperation condition);
     int countCzrk(VaccineInfoOperation condition);
+    int countIdCard(String idCard);
+
+    List<VaccineInfoOperation> listByCode(String code);
+
+    int reduction(String id);
+
+    List<VaccineInfoOperation> handleData();
+
+    List<JSONObject> getHouseType();
+
+    int setHouseType(@Param("idCard") String idCard, @Param("code") String code
+    , @Param("yhzgx") String yhzgx, @Param("houseType") String houseType);
 }
 }

+ 87 - 0
boman-web-core/src/main/java/com/boman/web/core/service/czrk/CzrkJzdzServiceImpl.java

@@ -0,0 +1,87 @@
+package com.boman.web.core.service.czrk;
+
+import com.boman.domain.CzrkJzdz;
+import com.boman.web.core.mapper.CzrkJzdzMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 常住人口对应的居住地址Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-01-14
+ */
+@Service
+public class CzrkJzdzServiceImpl implements ICzrkJzdzService {
+
+    @Autowired
+    private CzrkJzdzMapper czrkJzdzMapper;
+
+    /**
+     * 查询常住人口对应的居住地址
+     *
+     * @param id 常住人口对应的居住地址主键
+     * @return 常住人口对应的居住地址
+     */
+    @Override
+    public CzrkJzdz selectCzrkJzdzById(Long id) {
+        return czrkJzdzMapper.selectCzrkJzdzById(id);
+    }
+
+    /**
+     * 查询常住人口对应的居住地址列表
+     *
+     * @param czrkJzdz 常住人口对应的居住地址
+     * @return 常住人口对应的居住地址
+     */
+    @Override
+    public List<CzrkJzdz> selectCzrkJzdzList(CzrkJzdz czrkJzdz) {
+        return czrkJzdzMapper.selectCzrkJzdzList(czrkJzdz);
+    }
+
+    /**
+     * 新增常住人口对应的居住地址
+     *
+     * @param czrkJzdz 常住人口对应的居住地址
+     * @return 结果
+     */
+    @Override
+    public int insertCzrkJzdz(CzrkJzdz czrkJzdz) {
+        return czrkJzdzMapper.insertCzrkJzdz(czrkJzdz);
+    }
+
+    /**
+     * 修改常住人口对应的居住地址
+     *
+     * @param czrkJzdz 常住人口对应的居住地址
+     * @return 结果
+     */
+    @Override
+    public int updateCzrkJzdz(CzrkJzdz czrkJzdz) {
+        return czrkJzdzMapper.updateCzrkJzdz(czrkJzdz);
+    }
+
+    /**
+     * 批量删除常住人口对应的居住地址
+     *
+     * @param ids 需要删除的常住人口对应的居住地址主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCzrkJzdzByIds(Long[] ids) {
+        return czrkJzdzMapper.deleteCzrkJzdzByIds(ids);
+    }
+
+    /**
+     * 删除常住人口对应的居住地址信息
+     *
+     * @param id 常住人口对应的居住地址主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCzrkJzdzById(Long id) {
+        return czrkJzdzMapper.deleteCzrkJzdzById(id);
+    }
+}

+ 93 - 0
boman-web-core/src/main/java/com/boman/web/core/service/czrk/CzrkServiceImpl.java

@@ -0,0 +1,93 @@
+package com.boman.web.core.service.czrk;
+
+import com.boman.domain.Czrk;
+import com.boman.web.core.mapper.CzrkMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 常住人口Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2022-01-14
+ */
+@Service
+public class CzrkServiceImpl implements ICzrkService 
+{
+    @Autowired
+    private CzrkMapper czrkMapper;
+
+    /**
+     * 查询常住人口
+     * 
+     * @param id 常住人口主键
+     * @return 常住人口
+     */
+    @Override
+    public Czrk selectCzrkById(Long id)
+    {
+        return czrkMapper.selectCzrkById(id);
+    }
+
+    /**
+     * 查询常住人口列表
+     * 
+     * @param czrk 常住人口
+     * @return 常住人口
+     */
+    @Override
+    public List<Czrk> selectCzrkList(Czrk czrk)
+    {
+        return czrkMapper.selectCzrkList(czrk);
+    }
+
+    /**
+     * 新增常住人口
+     * 
+     * @param czrk 常住人口
+     * @return 结果
+     */
+    @Override
+    public int insertCzrk(Czrk czrk)
+    {
+        return czrkMapper.insertCzrk(czrk);
+    }
+
+    /**
+     * 修改常住人口
+     * 
+     * @param czrk 常住人口
+     * @return 结果
+     */
+    @Override
+    public int updateCzrk(Czrk czrk)
+    {
+        return czrkMapper.updateCzrk(czrk);
+    }
+
+    /**
+     * 批量删除常住人口
+     * 
+     * @param ids 需要删除的常住人口主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCzrkByIds(Long[] ids)
+    {
+        return czrkMapper.deleteCzrkByIds(ids);
+    }
+
+    /**
+     * 删除常住人口信息
+     * 
+     * @param id 常住人口主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCzrkById(Long id)
+    {
+        return czrkMapper.deleteCzrkById(id);
+    }
+}

+ 62 - 0
boman-web-core/src/main/java/com/boman/web/core/service/czrk/ICzrkJzdzService.java

@@ -0,0 +1,62 @@
+package com.boman.web.core.service.czrk;
+
+
+import com.boman.domain.CzrkJzdz;
+
+import java.util.List;
+
+/**
+ * 常住人口对应的居住地址Service接口
+ *
+ * @author ruoyi
+ * @date 2022-01-14
+ */
+public interface ICzrkJzdzService {
+    /**
+     * 查询常住人口对应的居住地址
+     *
+     * @param id 常住人口对应的居住地址主键
+     * @return 常住人口对应的居住地址
+     */
+    CzrkJzdz selectCzrkJzdzById(Long id);
+
+    /**
+     * 查询常住人口对应的居住地址列表
+     *
+     * @param czrkJzdz 常住人口对应的居住地址
+     * @return 常住人口对应的居住地址集合
+     */
+    List<CzrkJzdz> selectCzrkJzdzList(CzrkJzdz czrkJzdz);
+
+    /**
+     * 新增常住人口对应的居住地址
+     *
+     * @param czrkJzdz 常住人口对应的居住地址
+     * @return 结果
+     */
+    int insertCzrkJzdz(CzrkJzdz czrkJzdz);
+
+    /**
+     * 修改常住人口对应的居住地址
+     *
+     * @param czrkJzdz 常住人口对应的居住地址
+     * @return 结果
+     */
+    int updateCzrkJzdz(CzrkJzdz czrkJzdz);
+
+    /**
+     * 批量删除常住人口对应的居住地址
+     *
+     * @param ids 需要删除的常住人口对应的居住地址主键集合
+     * @return 结果
+     */
+    int deleteCzrkJzdzByIds(Long[] ids);
+
+    /**
+     * 删除常住人口对应的居住地址信息
+     *
+     * @param id 常住人口对应的居住地址主键
+     * @return 结果
+     */
+    int deleteCzrkJzdzById(Long id);
+}

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

@@ -0,0 +1,61 @@
+package com.boman.web.core.service.czrk;
+
+import com.boman.domain.Czrk;
+
+import java.util.List;
+
+/**
+ * 常住人口Service接口
+ *
+ * @author ruoyi
+ * @date 2022-01-14
+ */
+public interface ICzrkService {
+    /**
+     * 查询常住人口
+     *
+     * @param id 常住人口主键
+     * @return 常住人口
+     */
+    Czrk selectCzrkById(Long id);
+
+    /**
+     * 查询常住人口列表
+     *
+     * @param czrk 常住人口
+     * @return 常住人口集合
+     */
+    List<Czrk> selectCzrkList(Czrk czrk);
+
+    /**
+     * 新增常住人口
+     *
+     * @param czrk 常住人口
+     * @return 结果
+     */
+    int insertCzrk(Czrk czrk);
+
+    /**
+     * 修改常住人口
+     *
+     * @param czrk 常住人口
+     * @return 结果
+     */
+    int updateCzrk(Czrk czrk);
+
+    /**
+     * 批量删除常住人口
+     *
+     * @param ids 需要删除的常住人口主键集合
+     * @return 结果
+     */
+    int deleteCzrkByIds(Long[] ids);
+
+    /**
+     * 删除常住人口信息
+     *
+     * @param id 常住人口主键
+     * @return 结果
+     */
+    int deleteCzrkById(Long id);
+}

+ 7 - 5
boman-web-core/src/main/java/com/boman/web/core/service/fxry/FxryServiceImpl.java

@@ -34,8 +34,12 @@ public class FxryServiceImpl implements FxryService {
     @Override
     @Override
     public AjaxResult add(Fxry fxry) {
     public AjaxResult add(Fxry fxry) {
         String idCard = fxry.getIdCard();
         String idCard = fxry.getIdCard();
-        String hideIdCard = IdCardUtils.hideIdCard(idCard);
-        fxry.setIdCardHide(hideIdCard);
+        int count = mapper.countByIdCard(idCard);
+        if (count > 0) {
+            return AjaxResult.error("此人已经存在,请勿重复添加");
+        }
+
+        fxry.setIdCardHide(IdCardUtils.hideIdCard(idCard));
         fxry.setCreateBy(AuthUtils.getLoginUser().getSysUser().getUserName());
         fxry.setCreateBy(AuthUtils.getLoginUser().getSysUser().getUserName());
         fxry.setUpdateBy(AuthUtils.getLoginUser().getSysUser().getUserName());
         fxry.setUpdateBy(AuthUtils.getLoginUser().getSysUser().getUserName());
         fxry.setAge(IdCardUtils.getAge(idCard));
         fxry.setAge(IdCardUtils.getAge(idCard));
@@ -48,8 +52,7 @@ public class FxryServiceImpl implements FxryService {
 
 
     @Override
     @Override
     public AjaxResult edit(Fxry fxry) {
     public AjaxResult edit(Fxry fxry) {
-        String hideIdCard = IdCardUtils.hideIdCard(fxry.getIdCard());
-        fxry.setIdCardHide(hideIdCard);
+        fxry.setIdCardHide(IdCardUtils.hideIdCard(fxry.getIdCard()));
         fxry.setUpdateBy(AuthUtils.getLoginUser().getSysUser().getUserName());
         fxry.setUpdateBy(AuthUtils.getLoginUser().getSysUser().getUserName());
         packWzhjdz(fxry);
         packWzhjdz(fxry);
 
 
@@ -83,7 +86,6 @@ public class FxryServiceImpl implements FxryService {
         }
         }
 
 
         List<Fxry> list = mapper.list(fxry);
         List<Fxry> list = mapper.list(fxry);
-
         return list;
         return list;
     }
     }
 
 

+ 16 - 1
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/IVaccineInfoService.java

@@ -94,9 +94,24 @@ public interface IVaccineInfoService
 
 
     VaccineInfoOperation getById(Long id);
     VaccineInfoOperation getById(Long id);
 
 
-    JSONObject stsByApplet();
+    JSONObject stsByApplet(Long townId, Long villageId, String userName);
 
 
     JSONObject stsByCzrk();
     JSONObject stsByCzrk();
+    JSONObject stsByCzrkHomePage();
+    int countByJs(VaccineInfoOperation condition);
+    int countByXz(VaccineInfoOperation condition);
+    List<VaccineInfoOperation> listByXz(VaccineInfoOperation condition);
+    List<VaccineInfoOperation> listByJs(VaccineInfoOperation condition);
 
 
     AjaxResult deleteCzrk(VaccineInfoOperation vaccineInfoOperation);
     AjaxResult deleteCzrk(VaccineInfoOperation vaccineInfoOperation);
+
+    List<VaccineInfoOperation> family(String code);
+
+    /**
+     * 功能描述: 回收站的还原功能
+     *
+     * @param id id
+     * @return int
+     */
+    int reduction(String id);
 }
 }

+ 479 - 96
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoServiceImpl.java

@@ -6,12 +6,13 @@ import com.boman.common.core.utils.DateUtils;
 import com.boman.common.core.utils.SecurityUtils;
 import com.boman.common.core.utils.SecurityUtils;
 import com.boman.common.core.utils.StringUtils;
 import com.boman.common.core.utils.StringUtils;
 import com.boman.common.core.utils.number.NumberUtils;
 import com.boman.common.core.utils.number.NumberUtils;
-import com.boman.common.core.utils.obj.ObjectUtils;
 import com.boman.common.core.utils.sql.SqlUtil;
 import com.boman.common.core.utils.sql.SqlUtil;
 import com.boman.common.core.web.page.PageDomain;
 import com.boman.common.core.web.page.PageDomain;
 import com.boman.common.core.web.page.TableSupport;
 import com.boman.common.core.web.page.TableSupport;
+import com.boman.common.redis.service.RedisService;
 import com.boman.domain.*;
 import com.boman.domain.*;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.domain.dto.AjaxResult;
+import com.boman.domain.utils.ThreadPoolService;
 import com.boman.system.api.RemoteDeptService;
 import com.boman.system.api.RemoteDeptService;
 import com.boman.system.api.RemoteDictDataService;
 import com.boman.system.api.RemoteDictDataService;
 import com.boman.web.core.mapper.StandardlyMapper;
 import com.boman.web.core.mapper.StandardlyMapper;
@@ -24,6 +25,7 @@ import com.boman.web.core.utils.AuthUtils;
 import com.boman.web.core.utils.IdUtils;
 import com.boman.web.core.utils.IdUtils;
 import com.boman.web.core.utils.VaccineUtils;
 import com.boman.web.core.utils.VaccineUtils;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
+import org.apache.commons.lang3.BooleanUtils;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -31,17 +33,19 @@ import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.Size;
 import java.sql.Timestamp;
 import java.sql.Timestamp;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.*;
+import java.util.concurrent.TimeUnit;
 import java.util.regex.Matcher;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.regex.Pattern;
+import java.util.stream.Collectors;
 
 
 import static com.boman.common.core.utils.StringUtils.isNotEmpty;
 import static com.boman.common.core.utils.StringUtils.isNotEmpty;
-import static com.boman.common.core.utils.obj.ObjectUtils.*;
+import static com.boman.common.core.utils.obj.ObjectUtils.isEmpty;
+import static com.boman.common.core.utils.obj.ObjectUtils.map;
+import static com.boman.common.redis.RedisKey.STS_CZRK_;
 
 
 /**
 /**
  * 疫苗信息Service业务层处理
  * 疫苗信息Service业务层处理
@@ -57,6 +61,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
     private static final String INSERT = "insert";
     private static final String INSERT = "insert";
     private static final String EDIT = "edit";
     private static final String EDIT = "edit";
     private static final String DELETE = "delete";
     private static final String DELETE = "delete";
+    private static JSONObject QIANSHANSHI = null, ZHEN = null, QIANSHANSHI_SINGEL = null;
 
 
     @Resource
     @Resource
     private VaccineInfoMapper vaccineInfoMapper;
     private VaccineInfoMapper vaccineInfoMapper;
@@ -72,6 +77,8 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
     private IBaseSaveService saveService;
     private IBaseSaveService saveService;
     @Resource
     @Resource
     private StandardlyMapper standardlyMapper;
     private StandardlyMapper standardlyMapper;
+    @Resource
+    private RedisService redisService;
 
 
     /**
     /**
      * 查询疫苗信息
      * 查询疫苗信息
@@ -1033,6 +1040,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
 
 
     @Override
     @Override
     public List<VaccineInfoOperation> listByRlry(VaccineInfoOperation vaccineInfoOperation) {
     public List<VaccineInfoOperation> listByRlry(VaccineInfoOperation vaccineInfoOperation) {
+        vaccineInfoOperation.setIsDel(isEmpty(vaccineInfoOperation.getIsDel()) ? "N" : "Y");
         Long deptId = vaccineInfoOperation.getDeptId();
         Long deptId = vaccineInfoOperation.getDeptId();
         if (deptId == null) {
         if (deptId == null) {
             deptId = AuthUtils.getLoginUser().getSysUser().getDeptId();
             deptId = AuthUtils.getLoginUser().getSysUser().getDeptId();
@@ -1061,6 +1069,17 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
             vaccineInfoOperation.setDeptIdList(deptIdList);
             vaccineInfoOperation.setDeptIdList(deptIdList);
         }
         }
 
 
+        Map<String, Object> params = vaccineInfoOperation.getParams();
+        String ageScope = (String) params.get("age");
+        if (isNotEmpty(ageScope)) {
+            ageScope = ageScope.trim();
+            String[] split = ageScope.split("-");
+            params.put("startAge", Integer.parseInt(split[0]));
+            if (split.length == 2) {
+                params.put("endAge", Integer.parseInt(split[1]));
+            }
+        }
+
         PageDomain pageDomain = TableSupport.buildPageRequest();
         PageDomain pageDomain = TableSupport.buildPageRequest();
         Integer pageNum = pageDomain.getPageNum();
         Integer pageNum = pageDomain.getPageNum();
         Integer pageSize = pageDomain.getPageSize();
         Integer pageSize = pageDomain.getPageSize();
@@ -1071,12 +1090,12 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
 
 
         List<VaccineInfoOperation> infoOperations = vaccineInfoMapper.listByRlry(vaccineInfoOperation);
         List<VaccineInfoOperation> infoOperations = vaccineInfoMapper.listByRlry(vaccineInfoOperation);
         for (VaccineInfoOperation infoOperation : infoOperations) {
         for (VaccineInfoOperation infoOperation : infoOperations) {
-            String province = infoOperation.getProvince(); //省
-            String city = infoOperation.getCity();  //市
-            String region = infoOperation.getRegion();   //区
-            String domicile = infoOperation.getDomicile(); //户籍地
-            StringBuilder sbDomicile = new StringBuilder();
-            StringBuilder sbNowIn = new StringBuilder();
+            String province = infoOperation.getProvince(); // 现居住地的
+            String city = infoOperation.getCity();  // 现居住地的城
+            String region = infoOperation.getRegion();   // 现居住地的
+            String domicile = infoOperation.getDomicile(); // 户籍地
+            StringBuilder sbDomicile = new StringBuilder(); // 户籍地前端展示用 安徽省安庆市潜山市xx乡xx村xx组
+            StringBuilder sbNowIn = new StringBuilder(); // 現在居住地址查询展示 安徽省安庆市潜山市xx乡xx村xx组
             if (StringUtils.isNotBlank(province)) {
             if (StringUtils.isNotBlank(province)) {
                 sbDomicile.append(province);
                 sbDomicile.append(province);
                 sbNowIn.append(province);
                 sbNowIn.append(province);
@@ -1089,7 +1108,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
                 sbDomicile.append(region);
                 sbDomicile.append(region);
                 sbNowIn.append(region);
                 sbNowIn.append(region);
             }
             }
-            if (StringUtils.isNotBlank(domicile)) {
+            if (StringUtils.isNotBlank(domicile)) { // 户籍地
                 sbDomicile.append(domicile);
                 sbDomicile.append(domicile);
             }
             }
 
 
@@ -1107,12 +1126,25 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
 
 
     @Override
     @Override
     public AjaxResult addRlry(VaccineInfoOperation vaccineInfo) {
     public AjaxResult addRlry(VaccineInfoOperation vaccineInfo) {
+        if (isNotEmpty(vaccineInfo.getVillageTowns())) {
+            vaccineInfo.setRlr(SecurityUtils.getUsername());
+        }
+
+        int count = vaccineInfoMapper.countIdCard(vaccineInfo.getIdCard());
+        if (count > 0) {
+            return  AjaxResult.error(String.format("该人员[身份证号为: %s]已存在,请勿重复添加", vaccineInfo.getIdCard()));
+        }
+
         int i = vaccineInfoMapper.insertVaccineInfo(vaccineInfo);
         int i = vaccineInfoMapper.insertVaccineInfo(vaccineInfo);
         return i > 0 ? AjaxResult.success() : AjaxResult.error();
         return i > 0 ? AjaxResult.success() : AjaxResult.error();
     }
     }
 
 
     @Override
     @Override
     public AjaxResult editRlry(VaccineInfoOperation vaccineInfo) {
     public AjaxResult editRlry(VaccineInfoOperation vaccineInfo) {
+        if (isNotEmpty(vaccineInfo.getVillageTowns())) {
+            vaccineInfo.setRlr(SecurityUtils.getUsername());
+        }
+
         int i = vaccineInfoMapper.updateVaccineInfo(vaccineInfo);
         int i = vaccineInfoMapper.updateVaccineInfo(vaccineInfo);
         return i > 0 ? AjaxResult.success() : AjaxResult.error();
         return i > 0 ? AjaxResult.success() : AjaxResult.error();
     }
     }
@@ -1123,33 +1155,46 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
     }
     }
 
 
     @Override
     @Override
-    public JSONObject stsByApplet() {
+    public JSONObject stsByApplet(Long townId, Long villageId, String userName) {
         Long deptId = AuthUtils.getLoginUser().getSysUser().getDeptId();
         Long deptId = AuthUtils.getLoginUser().getSysUser().getDeptId();
-        //判断是否是管理员
-        List<SysRole> roles = AuthUtils.getLoginUser().getSysUser().getRoles();
-        if (isNotEmpty(roles)) {
-            for (SysRole role : roles) {
-                String roleKey = role.getRoleKey();
-                if ("admin".equals(roleKey) || "city".equals(roleKey)) {
-                    deptId = null;
-                    break;
+        List<Long> deptIdList = new ArrayList<>(16);
+        // 未加搜索条件
+        if (isEmpty(townId) && isEmpty(villageId)) {
+            List<SysRole> roles = AuthUtils.getLoginUser().getSysUser().getRoles();
+            if (isNotEmpty(roles)) {
+                for (SysRole role : roles) {
+                    String roleKey = role.getRoleKey();
+                    //判断是否是管理员
+                    if ("admin".equals(roleKey) || "city".equals(roleKey)) {
+                        deptId = null;
+                        break;
+                    }
                 }
                 }
             }
             }
-        }
 
 
-        List<Long> deptIdList = new ArrayList<>(16);
-        if (deptId != null) {
-            List<SysDept> sysDepts = remoteDeptService.listChildrenDepts(deptId);
-            if (sysDepts != null && sysDepts.size() > 0) {
-                for (SysDept sysDept : sysDepts) {
-                    Long id = sysDept.getId();
-                    deptIdList.add(id);
+            if (deptId != null) {
+                List<SysDept> sysDepts = remoteDeptService.listChildrenDepts(deptId);
+                if (sysDepts != null && sysDepts.size() > 0) {
+                    for (SysDept sysDept : sysDepts) {
+                        Long id = sysDept.getId();
+                        deptIdList.add(id);
+                    }
                 }
                 }
             }
             }
+        } else {
+            // 查村
+            if (!isEmpty(townId) && !isEmpty(villageId)) {
+                List<SysDept> sysDepts = remoteDeptService.listChildrenDepts(villageId);
+                deptIdList = sysDepts.stream().map(SysDept::getId).collect(Collectors.toList());
+            } else if (!isEmpty(townId) && isEmpty(villageId)) {
+                // 查镇
+                List<SysDept> sysDepts = remoteDeptService.listChildrenDepts(townId);
+                deptIdList = sysDepts.stream().map(SysDept::getId).collect(Collectors.toList());
+            }
         }
         }
 
 
-        int yrl = vaccineInfoMapper.stsByYrl(deptIdList);
-        int wrl = vaccineInfoMapper.stsByWrl(deptIdList);
+        int yrl = vaccineInfoMapper.stsByYrl(deptIdList, userName);
+        int wrl = vaccineInfoMapper.stsByWrl(deptIdList, userName);
         JSONObject result = new JSONObject(3);
         JSONObject result = new JSONObject(3);
         result.put("yrl", yrl);
         result.put("yrl", yrl);
         result.put("wrl", wrl);
         result.put("wrl", wrl);
@@ -1164,106 +1209,381 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
      */
      */
     @Override
     @Override
     public JSONObject stsByCzrk() {
     public JSONObject stsByCzrk() {
-        JSONObject result = new JSONObject(6);
-        // 当前登陆人的deptId
+        JSONObject result = new JSONObject(16);
         SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
         SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
         String deptName = sysUser.getDept().getDeptName();
         String deptName = sysUser.getDept().getDeptName();
-        Long deptId = sysUser.getDeptId();
-        // 当前单位
-        result.put("dqdw", deptName);
+        Long deptId = sysUser.getDeptId(); // 当前登陆人的deptId
+        result.put("dqdw", deptName);  // 当前单位
 
 
         List<SysRole> roles = sysUser.getRoles();
         List<SysRole> roles = sysUser.getRoles();
         List<String> roleKeySets = map(roles, SysRole::getRoleKey);
         List<String> roleKeySets = map(roles, SysRole::getRoleKey);
-        Date todayStart = DateUtils.getTodayStart();
-        Date todayEnd = DateUtils.getTodayEnd();
+        String todayStart = DateUtils.getTodayStartStr();
+        String todayEnd = DateUtils.getTodayEndStr();
         VaccineInfoOperation condition = new VaccineInfoOperation();
         VaccineInfoOperation condition = new VaccineInfoOperation();
         condition.setStartTime(todayStart);
         condition.setStartTime(todayStart);
         condition.setEndTime(todayEnd);
         condition.setEndTime(todayEnd);
-        List<VaccineInfoOperation> list = null;
+        condition.setRyrl(true);
         // 市领导
         // 市领导
-        if (roleKeySets.contains("city") || roleKeySets.contains("admin")) {
-            List<SysDept> allDepts = remoteDeptService.listChildrenDepts(1L);
-            List<SysDept> townsDepts = new ArrayList<>(16);
-            for (SysDept allDept : allDepts) {
-                if (isEmpty(allDept.getParentId())) continue;
-                if (allDept.getParentId() == (1L)) {
-                    townsDepts.add(allDept);
-                }
+        if (roleKeySets.contains("city") || roleKeySets.contains("admin") || roleKeySets.contains("yanshi")) {
+            JSONObject jsonObject = redisService.getCacheObject(packRedisKey("single:" + deptId));
+            if (isNotEmpty(jsonObject)) {
+                QIANSHANSHI_SINGEL = jsonObject;
+                return jsonObject;
             }
             }
-            result.put("zhen", townsDepts.size()); // 镇
 
 
-            List<SysDept> cunDepts = new ArrayList<>(16);
-            for (SysDept townsDept : townsDepts) {
+            ThreadPoolService.execute(() -> {
+                List<SysDept> allDepts = remoteDeptService.listChildrenDepts(1L);
+                List<SysDept> townsDepts = new ArrayList<>(16);
                 for (SysDept allDept : allDepts) {
                 for (SysDept allDept : allDepts) {
                     if (isEmpty(allDept.getParentId())) continue;
                     if (isEmpty(allDept.getParentId())) continue;
-                    if (townsDept.getId().equals(allDept.getParentId())) {
-                        cunDepts.add(allDept);
+                    if (allDept.getParentId() == (1L)) {
+                        townsDepts.add(allDept);
                     }
                     }
                 }
                 }
+                result.put("zhen", townsDepts.size()); // 镇
+
+                List<SysDept> cunDepts = new ArrayList<>(16);
+                for (SysDept townsDept : townsDepts) {
+                    for (SysDept allDept : allDepts) {
+                        if (isEmpty(allDept.getParentId())) continue;
+                        if (townsDept.getId().equals(allDept.getParentId())) {
+                            cunDepts.add(allDept);
+                        }
+                    }
+                }
+                result.put("cun", isEmpty(cunDepts) ? 0 : cunDepts.size());
+
+                List<SysDept> zuDept = new ArrayList<>(16);
+                for (SysDept cunDept : cunDepts) {
+                    for (SysDept allDept : allDepts) {
+                        if (cunDept.getId().equals(allDept.getParentId())) {
+                            zuDept.add(allDept);
+                        }
+                    }
+                }
+
+                result.put("zu", isEmpty(zuDept) ? 0 : zuDept.size()); // 组
+                int czrk = vaccineInfoMapper.countCzrk(condition); // 常住人口
+                result.put("czrk", czrk);
+
+                int xz = vaccineInfoMapper.countByXz(condition); // 新增
+                int js = vaccineInfoMapper.countByJs(condition);// 减少
+                result.put("xz", xz);
+                result.put("js", js);
+
+                condition.setRyrl(null); // 查全部
+                int zrs = vaccineInfoMapper.countCzrk(condition);
+                String bfb = NumberUtils.percent(czrk, zrs);
+                result.put("bfb", bfb);
+                result.put("zrs", zrs);
+                setIntoRedis(packRedisKey("single:" + deptId), result);
+                QIANSHANSHI_SINGEL = result;
+            });
+
+            return QIANSHANSHI_SINGEL;
+        } else if (roleKeySets.contains("sys:town")) {
+            JSONObject jsonObject = redisService.getCacheObject(packRedisKey("town:" + deptId));
+            if (isNotEmpty(jsonObject)) {
+                return jsonObject;
+            }
+
+            townSts(result, condition, deptId, deptName, true);
+//            redisService.setCacheObject(packRedisKey("town:" + deptId), result, 1L, TimeUnit.DAYS);
+            setIntoRedis(packRedisKey("town:" + deptId), result);
+        }
+
+        return result;
+    }
+
+    /**
+     * 功能描述: 项目首页统计信息,
+     * 当前单位:镇,村:7个,组:300个,常住人口:5000人,新增 2人  减少 2人
+     *
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @Override
+    public JSONObject stsByCzrkHomePage() {
+        JSONObject result = new JSONObject(16);
+        // 当前登陆人的deptId
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        String deptName = sysUser.getDept().getDeptName();
+        result.put("dqdw", deptName); // 当前单位
+
+        List<String> roleKeySets = map(sysUser.getRoles(), SysRole::getRoleKey);
+
+        VaccineInfoOperation condition = new VaccineInfoOperation();
+        condition.setStartTime(DateUtils.getTodayStartStr());
+        condition.setEndTime(DateUtils.getTodayEndStr());
+        condition.setRyrl(true);
+        Long deptId = sysUser.getDeptId();
+
+        // 市领导 todo 此处不应该写死
+        if (roleKeySets.contains("city") || roleKeySets.contains("admin") || roleKeySets.contains("yanshi")) {
+            JSONObject jsonObject = redisService.getCacheObject(packRedisKey(deptId + ""));
+            if (isNotEmpty(jsonObject)) {
+                QIANSHANSHI = jsonObject;
+                return jsonObject;
             }
             }
-            result.put("cun", isEmpty(cunDepts) ? 0 : cunDepts.size());
 
 
-            List<SysDept> zuDept = new ArrayList<>(16);
-            for (SysDept cunDept : cunDepts) {
+            ThreadPoolService.execute(()->{
+                List<SysDept> allDepts = remoteDeptService.listChildrenDepts(1L);
+                List<SysDept> townsDepts = new ArrayList<>(16);
                 for (SysDept allDept : allDepts) {
                 for (SysDept allDept : allDepts) {
-                    if (cunDept.getId().equals(allDept.getParentId())) {
-                        zuDept.add(allDept);
+                    if (isEmpty(allDept.getParentId())) continue;
+                    if (allDept.getParentId() == (1L)) {
+                        townsDepts.add(allDept);
+                    }
+                }
+                result.put("zhen", townsDepts.size()); // 镇
+
+                List<SysDept> cunDepts = new ArrayList<>(16);
+                for (SysDept townsDept : townsDepts) {
+                    for (SysDept allDept : allDepts) {
+                        if (isEmpty(allDept.getParentId())) continue;
+                        if (townsDept.getId().equals(allDept.getParentId())) {
+                            cunDepts.add(allDept);
+                        }
+                    }
+                }
+                result.put("cun", isEmpty(cunDepts) ? 0 : cunDepts.size());
+
+                List<SysDept> zuDept = new ArrayList<>(16);
+                for (SysDept cunDept : cunDepts) {
+                    for (SysDept allDept : allDepts) {
+                        if (cunDept.getId().equals(allDept.getParentId())) {
+                            zuDept.add(allDept);
+                        }
                     }
                     }
                 }
                 }
-            }
-            result.put("zu", isEmpty(zuDept) ? 0 : zuDept.size());
 
 
-            list = vaccineInfoMapper.listByXzAndJs(condition);
+                result.put("zu", isEmpty(zuDept) ? 0 : zuDept.size()); // 组
+                int czrk = vaccineInfoMapper.countCzrk(condition); // 常住人口
+                result.put("czrk", czrk);
+
+                int xz = vaccineInfoMapper.countByXz(condition); // 新增
+                int js = vaccineInfoMapper.countByJs(condition);// 减少
+                result.put("xz", xz);
+                result.put("js", js);
+
+                condition.setRyrl(null); // 查全部
+                int zrs = vaccineInfoMapper.countCzrk(condition);
+                String bfb = NumberUtils.percent(czrk, zrs);
+                result.put("bfb", bfb);
+                result.put("zrs", zrs);
+
+                // 以各个镇为单位单独处理 townsDepts
+                ArrayList<JSONObject> towsDataList = new ArrayList<>(20);
+                for (SysDept townsDept : townsDepts) {
+                    JSONObject townsResult = new JSONObject(16);
+                    townSts(townsResult, condition, townsDept.getId(), townsDept.getDeptName(), false);
+                    towsDataList.add(townsResult);
+                }
+
+                result.put("townDatas", towsDataList);
+//                redisService.setCacheObject(packRedisKey(deptId + ""), result, 1L, TimeUnit.DAYS);
+                setIntoRedis(packRedisKey(deptId + ""), result);
+                QIANSHANSHI = result;
+            });
+
+            return QIANSHANSHI;
         } else if (roleKeySets.contains("sys:town")) {
         } else if (roleKeySets.contains("sys:town")) {
-            // 乡镇以下的所有部门
-            List<SysDept> depts = remoteDeptService.listChildrenDepts(deptId);
+            JSONObject jsonObject = redisService.getCacheObject(packRedisKey("town:" + deptId));
+            if (isNotEmpty(jsonObject)) {
+                ZHEN = jsonObject;
+                return jsonObject;
+            }
+
+            ThreadPoolService.execute(() -> {
+                townSts(result, condition, deptId, deptName, true);
+//                redisService.setCacheObject(packRedisKey("town:" + deptId), result, 1L, TimeUnit.DAYS);
+                setIntoRedis(packRedisKey("town:" + deptId), result);
+            });
+
+            return ZHEN;
+        }
 
 
-            List<SysDept> cunDepts = new ArrayList<>(16);
+        return result;
+    }
+
+    private void townSts(JSONObject result, VaccineInfoOperation condition, Long deptId, String deptName, boolean percent) {
+        // 乡镇以下的所有部门
+        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) {
             for (SysDept dept : depts) {
-                if (isEmpty(dept.getParentId())) continue;
-                if (deptId.equals(dept.getParentId())) {
-                    cunDepts.add(dept);
+                if (cunDept.getId().equals(dept.getParentId())) {
+                    zuDept.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());
+        condition.setDeptIdList(map(depts, SysDept::getId));
+        int czrk = vaccineInfoMapper.countCzrk(condition);
+        result.put("czrk", czrk);
+
+        // 常住人口占总人口的百分比
+        if (BooleanUtils.isTrue(percent)) {
+            condition.setRyrl(null); // 查全部
+            int zrs = vaccineInfoMapper.countCzrk(condition);
+            String bfb = NumberUtils.percent(czrk, zrs);
+            result.put("bfb", bfb);
+        }
+
+        int xz = vaccineInfoMapper.countByXz(condition);
+        int js = vaccineInfoMapper.countByJs(condition);
+        result.put("xz", xz);
+        result.put("js", js);
+        result.put("zhen", deptName);
+    }
+
+    @Override
+    public int countByJs(VaccineInfoOperation condition) {
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        Long deptId = sysUser.getDeptId();
+        List<SysRole> roles = sysUser.getRoles();
+        List<String> roleKeySets = map(roles, SysRole::getRoleKey);
+        String todayStart = DateUtils.getTodayStartStr();
+        String todayEnd = DateUtils.getTodayEndStr();
+        condition.setStartTime(todayStart);
+        condition.setEndTime(todayEnd);
+        if (roleKeySets.contains("sys:town")) {
+            // 乡镇以下的所有部门
+            List<SysDept> depts = remoteDeptService.listChildrenDepts(deptId);
+            condition.setDeptIdList(map(depts, SysDept::getId));
+        }
+
+        return vaccineInfoMapper.countByJs(condition);
+    }
+
+    @Override
+    public List<VaccineInfoOperation> listByJs(VaccineInfoOperation condition) {
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        Long deptId = sysUser.getDeptId();
+        List<SysRole> roles = sysUser.getRoles();
+        List<String> roleKeySets = map(roles, SysRole::getRoleKey);
+        String todayStart = DateUtils.getTodayStartStr();
+        String todayEnd = DateUtils.getTodayEndStr();
+        condition.setStartTime(todayStart);
+        condition.setEndTime(todayEnd);
+        if (roleKeySets.contains("sys:town")) {
+            // 乡镇以下的所有部门
+            List<SysDept> depts = remoteDeptService.listChildrenDepts(deptId);
+            condition.setDeptIdList(map(depts, SysDept::getId));
+        }
+        List<VaccineInfoOperation> infoOperations = vaccineInfoMapper.listByJs(condition);
+        for (VaccineInfoOperation infoOperation : infoOperations) {
+            String province = infoOperation.getProvince(); //省
+            String city = infoOperation.getCity();  //市
+            String region = infoOperation.getRegion();   //区
+            String domicile = infoOperation.getDomicile(); //户籍地
+            StringBuilder sbDomicile = new StringBuilder();
+            StringBuilder sbNowIn = new StringBuilder();
+            if (StringUtils.isNotBlank(province)) {
+                sbDomicile.append(province);
+                sbNowIn.append(province);
+            }
+            if (StringUtils.isNotBlank(city)) {
+                sbDomicile.append(city);
+                sbNowIn.append(city);
+            }
+            if (StringUtils.isNotBlank(region)) {
+                sbDomicile.append(region);
+                sbNowIn.append(region);
+            }
+            if (StringUtils.isNotBlank(domicile)) {
+                sbDomicile.append(domicile);
             }
             }
 
 
-            result.put("zu", isEmpty(zuDept) ? 0 : zuDept.size());
+            String nowIn = infoOperation.getNowIn(); //现居地
+            if (StringUtils.isNotBlank(nowIn)) {
+                sbNowIn.append(nowIn);
+            }
 
 
+            infoOperation.setDomicileSelect(sbDomicile.toString());
+            infoOperation.setNowInSelect(sbNowIn.toString());
+        }
+        return infoOperations;
+    }
+
+    @Override
+    public int countByXz(VaccineInfoOperation condition) {
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        Long deptId = sysUser.getDeptId();
+        List<SysRole> roles = sysUser.getRoles();
+        List<String> roleKeySets = map(roles, SysRole::getRoleKey);
+        String todayStart = DateUtils.getTodayStartStr();
+        String todayEnd = DateUtils.getTodayEndStr();
+        condition.setStartTime(todayStart);
+        condition.setEndTime(todayEnd);
+        if (roleKeySets.contains("sys:town")) {
+            // 乡镇以下的所有部门
+            List<SysDept> depts = remoteDeptService.listChildrenDepts(deptId);
             condition.setDeptIdList(map(depts, SysDept::getId));
             condition.setDeptIdList(map(depts, SysDept::getId));
-            list = vaccineInfoMapper.listByXzAndJs(condition);
         }
         }
 
 
-        // 增加、减少
-        if (isEmpty(list)) {
-            result.put("xz", 0);
-            result.put("js", 0);
-        } else {
-            int xz = 0, js = 0;
-            for (VaccineInfoOperation operation : list) {
-                Date createTime = operation.getCreateTime(), updateTime = operation.getUpdateTime();
-                String isDel = operation.getIsDel();
-                if ("N".equals(isDel) && createTime.after(todayStart) && createTime.before(todayEnd)) {
-                    xz++;
-                } else if ("Y".equals(isDel) && updateTime.after(todayStart) && updateTime.before(todayEnd)) {
-                    js++;
-                }
+        return vaccineInfoMapper.countByXz(condition);
+    }
+
+    @Override
+    public List<VaccineInfoOperation> listByXz(VaccineInfoOperation condition) {
+        SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
+        Long deptId = sysUser.getDeptId();
+        List<SysRole> roles = sysUser.getRoles();
+        List<String> roleKeySets = map(roles, SysRole::getRoleKey);
+        String todayStart = DateUtils.getTodayStartStr();
+        String todayEnd = DateUtils.getTodayEndStr();
+        condition.setStartTime(todayStart);
+        condition.setEndTime(todayEnd);
+        if (roleKeySets.contains("sys:town")) {
+            // 乡镇以下的所有部门
+            List<SysDept> depts = remoteDeptService.listChildrenDepts(deptId);
+            condition.setDeptIdList(map(depts, SysDept::getId));
+        }
+
+        List<VaccineInfoOperation> infoOperations = vaccineInfoMapper.listByXz(condition);
+        for (VaccineInfoOperation infoOperation : infoOperations) {
+            String province = infoOperation.getProvince(); //省
+            String city = infoOperation.getCity();  //市
+            String region = infoOperation.getRegion();   //区
+            String domicile = infoOperation.getDomicile(); //户籍地
+            StringBuilder sbDomicile = new StringBuilder();
+            StringBuilder sbNowIn = new StringBuilder();
+            if (StringUtils.isNotBlank(province)) {
+                sbDomicile.append(province);
+                sbNowIn.append(province);
+            }
+            if (StringUtils.isNotBlank(city)) {
+                sbDomicile.append(city);
+                sbNowIn.append(city);
+            }
+            if (StringUtils.isNotBlank(region)) {
+                sbDomicile.append(region);
+                sbNowIn.append(region);
+            }
+            if (StringUtils.isNotBlank(domicile)) {
+                sbDomicile.append(domicile);
             }
             }
 
 
-            result.put("xz", xz);
-            result.put("js", js);
+            String nowIn = infoOperation.getNowIn(); //现居地
+            if (StringUtils.isNotBlank(nowIn)) {
+                sbNowIn.append(nowIn);
+            }
+
+            infoOperation.setDomicileSelect(sbDomicile.toString());
+            infoOperation.setNowInSelect(sbNowIn.toString());
         }
         }
 
 
-        result.put("czrk", vaccineInfoMapper.countCzrk(condition));
-        return result;
+        return infoOperations;
     }
     }
 
 
     @Override
     @Override
@@ -1273,12 +1593,75 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
             return AjaxResult.error("该信息不存在,无法删除");
             return AjaxResult.error("该信息不存在,无法删除");
         }
         }
 
 
-        if (isEmpty(operation.getVillageTowns())) {
-            return AjaxResult.error("该人员为未认领人员,无法删除");
-        }
+//        if (isEmpty(operation.getVillageTowns())) {
+//            return AjaxResult.error("该人员为未认领人员,无法删除");
+//        }
 
 
         vaccineInfoOperation.setUpdateBy(AuthUtils.getLoginUser().getSysUser().getUserName());
         vaccineInfoOperation.setUpdateBy(AuthUtils.getLoginUser().getSysUser().getUserName());
         int delete = vaccineInfoMapper.deleteCzrk(vaccineInfoOperation);
         int delete = vaccineInfoMapper.deleteCzrk(vaccineInfoOperation);
         return delete > 0 ? AjaxResult.success() : AjaxResult.error();
         return delete > 0 ? AjaxResult.success() : AjaxResult.error();
     }
     }
+
+    @Override
+    public List<VaccineInfoOperation> family(String code) {
+        if (isEmpty(code)) {
+            return Collections.emptyList();
+        }
+
+        List<VaccineInfoOperation> infoOperations = vaccineInfoMapper.listByCode(code);
+        for (VaccineInfoOperation infoOperation : infoOperations) {
+            String province = infoOperation.getProvince(); //省
+            String city = infoOperation.getCity();  //市
+            String region = infoOperation.getRegion();   //区
+            String domicile = infoOperation.getDomicile(); //户籍地
+            StringBuilder sbDomicile = new StringBuilder();
+            StringBuilder sbNowIn = new StringBuilder();
+            if (StringUtils.isNotBlank(province)) {
+                sbDomicile.append(province);
+                sbNowIn.append(province);
+            }
+            if (StringUtils.isNotBlank(city)) {
+                sbDomicile.append(city);
+                sbNowIn.append(city);
+            }
+            if (StringUtils.isNotBlank(region)) {
+                sbDomicile.append(region);
+                sbNowIn.append(region);
+            }
+            if (StringUtils.isNotBlank(domicile)) {
+                sbDomicile.append(domicile);
+            }
+
+            String nowIn = infoOperation.getNowIn(); //现居地
+            if (StringUtils.isNotBlank(nowIn)) {
+                sbNowIn.append(nowIn);
+            }
+
+            infoOperation.setDomicileSelect(sbDomicile.toString());
+            infoOperation.setNowInSelect(sbNowIn.toString());
+        }
+
+        return infoOperations;
+    }
+
+    /**
+     * 功能描述: 回收站的还原功能
+     *
+     * @param id id
+     * @return int
+     */
+    @Override
+    public int reduction(String id) {
+        if (isEmpty(id)) return 0;
+
+        return vaccineInfoMapper.reduction(id);
+    }
+
+    private String packRedisKey(String deptId){
+        return STS_CZRK_ + deptId + ":" + DateUtils.getDate();
+    }
+
+    private void setIntoRedis(String key, Object result){
+        redisService.setCacheObject(key, result, 1L, TimeUnit.HOURS);
+    }
 }
 }

+ 8 - 5
boman-web-core/src/main/java/com/boman/web/core/utils/IdCardUtils.java

@@ -13,7 +13,7 @@ import java.util.Date;
  **/
  **/
 public class IdCardUtils {
 public class IdCardUtils {
 
 
-    private static SimpleDateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd");
+    private static final SimpleDateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd");
 
 
     public static String hideIdCard(String idCard) {
     public static String hideIdCard(String idCard) {
         if (ObjectUtils.isEmpty(idCard)) {
         if (ObjectUtils.isEmpty(idCard)) {
@@ -21,10 +21,13 @@ public class IdCardUtils {
         }
         }
 
 
         // 340104202201050105
         // 340104202201050105
-        String before = idCard.substring(0, 4);
-        String after = idCard.substring(13);
-        return before + "*********" + after;
-
+        try {
+            String before = idCard.substring(0, 4);
+            String after = idCard.substring(13);
+            return before + "*********" + after;
+        } catch (Exception e) {
+            return idCard;
+        }
     }
     }
 
 
 
 

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

@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.boman.web.core.mapper.CzrkJzdzMapper">
+    
+    <resultMap type="com.boman.domain.CzrkJzdz" id="CzrkJzdzResult">
+        <result property="id"    column="id"    />
+        <result property="czrkId"    column="czrk_id"    />
+        <result property="idCard"    column="id_card"    />
+        <result property="userName"    column="user_name"    />
+        <result property="sort"    column="sort"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="provinceId"    column="province_id"    />
+        <result property="province"    column="province"    />
+        <result property="cityId"    column="city_id"    />
+        <result property="city"    column="city"    />
+        <result property="regionId"    column="region_id"    />
+        <result property="region"    column="region"    />
+        <result property="townId"    column="town_id"    />
+        <result property="town"    column="town"    />
+        <result property="villageId"    column="village_id"    />
+        <result property="village"    column="village"    />
+        <result property="nowIn"    column="now_in"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="status"    column="status"    />
+    </resultMap>
+
+    <sql id="selectCzrkJzdzVo">
+        select id, czrk_id, id_card, user_name, sort, dept_id, province_id, province, city_id, city, region_id, region, town_id, town, village_id, village, now_in, create_by, create_time, update_by, update_time, status from czrk_jzdz
+    </sql>
+
+    <select id="selectCzrkJzdzList" resultMap="CzrkJzdzResult">
+        <include refid="selectCzrkJzdzVo"/>
+        <where>  
+            <if test="czrkId != null "> and czrk_id = #{czrkId}</if>
+            <if test="idCard != null  and idCard != ''"> and id_card = #{idCard}</if>
+            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
+            <if test="sort != null "> and sort = #{sort}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="provinceId != null  and provinceId != ''"> and province_id = #{provinceId}</if>
+            <if test="province != null  and province != ''"> and province = #{province}</if>
+            <if test="cityId != null  and cityId != ''"> and city_id = #{cityId}</if>
+            <if test="city != null  and city != ''"> and city = #{city}</if>
+            <if test="regionId != null  and regionId != ''"> and region_id = #{regionId}</if>
+            <if test="region != null  and region != ''"> and region = #{region}</if>
+            <if test="townId != null  and townId != ''"> and town_id = #{townId}</if>
+            <if test="town != null  and town != ''"> and town = #{town}</if>
+            <if test="villageId != null  and villageId != ''"> and village_id = #{villageId}</if>
+            <if test="village != null  and village != ''"> and village = #{village}</if>
+            <if test="nowIn != null  and nowIn != ''"> and now_in = #{nowIn}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+        </where>
+    </select>
+    
+    <select id="selectCzrkJzdzById" parameterType="Long" resultMap="CzrkJzdzResult">
+        <include refid="selectCzrkJzdzVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertCzrkJzdz" useGeneratedKeys="true" keyProperty="id">
+        insert into czrk_jzdz
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="czrkId != null">czrk_id,</if>
+            <if test="idCard != null">id_card,</if>
+            <if test="userName != null">user_name,</if>
+            <if test="sort != null">sort,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="provinceId != null">province_id,</if>
+            <if test="province != null">province,</if>
+            <if test="cityId != null">city_id,</if>
+            <if test="city != null">city,</if>
+            <if test="regionId != null">region_id,</if>
+            <if test="region != null">region,</if>
+            <if test="townId != null">town_id,</if>
+            <if test="town != null">town,</if>
+            <if test="villageId != null">village_id,</if>
+            <if test="village != null">village,</if>
+            <if test="nowIn != null">now_in,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="status != null">status,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="czrkId != null">#{czrkId},</if>
+            <if test="idCard != null">#{idCard},</if>
+            <if test="userName != null">#{userName},</if>
+            <if test="sort != null">#{sort},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="provinceId != null">#{provinceId},</if>
+            <if test="province != null">#{province},</if>
+            <if test="cityId != null">#{cityId},</if>
+            <if test="city != null">#{city},</if>
+            <if test="regionId != null">#{regionId},</if>
+            <if test="region != null">#{region},</if>
+            <if test="townId != null">#{townId},</if>
+            <if test="town != null">#{town},</if>
+            <if test="villageId != null">#{villageId},</if>
+            <if test="village != null">#{village},</if>
+            <if test="nowIn != null">#{nowIn},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="status != null">#{status},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCzrkJzdz" >
+        update czrk_jzdz
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="czrkId != null">czrk_id = #{czrkId},</if>
+            <if test="idCard != null">id_card = #{idCard},</if>
+            <if test="userName != null">user_name = #{userName},</if>
+            <if test="sort != null">sort = #{sort},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="provinceId != null">province_id = #{provinceId},</if>
+            <if test="province != null">province = #{province},</if>
+            <if test="cityId != null">city_id = #{cityId},</if>
+            <if test="city != null">city = #{city},</if>
+            <if test="regionId != null">region_id = #{regionId},</if>
+            <if test="region != null">region = #{region},</if>
+            <if test="townId != null">town_id = #{townId},</if>
+            <if test="town != null">town = #{town},</if>
+            <if test="villageId != null">village_id = #{villageId},</if>
+            <if test="village != null">village = #{village},</if>
+            <if test="nowIn != null">now_in = #{nowIn},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="status != null">status = #{status},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCzrkJzdzById" parameterType="Long">
+        delete from czrk_jzdz where id = #{id}
+    </delete>
+
+    <delete id="deleteCzrkJzdzByIds" parameterType="String">
+        delete from czrk_jzdz where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 211 - 0
boman-web-core/src/main/resources/mapper/CzrkMapper.xml

@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.boman.web.core.mapper.CzrkMapper">
+    
+    <resultMap type="com.boman.domain.Czrk" id="CzrkResult">
+        <result property="id"    column="id"    />
+        <result property="userName"    column="user_name"    />
+        <result property="gender"    column="gender"    />
+        <result property="age"    column="age"    />
+        <result property="birthday"    column="birthday"    />
+        <result property="idCard"    column="id_card"    />
+        <result property="phoneNum"    column="phone_num"    />
+        <result property="code"    column="code"    />
+        <result property="houseType"    column="house_type"    />
+        <result property="rlr"    column="rlr"    />
+        <result property="rlTime"    column="rl_time"    />
+        <result property="yhzgx"    column="yhzgx"    />
+        <result property="workUnit"    column="work_unit"    />
+        <result property="provinceId"    column="province_id"    />
+        <result property="province"    column="province"    />
+        <result property="cityId"    column="city_id"    />
+        <result property="city"    column="city"    />
+        <result property="regionId"    column="region_id"    />
+        <result property="region"    column="region"    />
+        <result property="villageTownsId"    column="village_towns_id"    />
+        <result property="villageTowns"    column="village_towns"    />
+        <result property="villageId"    column="village_id"    />
+        <result property="village"    column="village"    />
+        <result property="villagerGroupId"    column="villager_group_id"    />
+        <result property="villagerGroup"    column="villager_group"    />
+        <result property="nowIn"    column="now_in"    />
+        <result property="remark"    column="remark"    />
+        <result property="status"    column="status"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="isDel"    column="is_del"    />
+        <result property="deleteReason"    column="delete_reason"    />
+    </resultMap>
+
+    <sql id="selectCzrkVo">
+        select id, user_name, gender, age, birthday, id_card, phone_num, code, house_type, rlr, rl_time, yhzgx, work_unit, province_id, province, city_id, city, region_id, region, village_towns_id, village_towns, village_id, village, villager_group_id, villager_group, now_in, remark, status, create_by, create_time, update_by, update_time, is_del, delete_reason from czrk
+    </sql>
+
+    <select id="selectCzrkList"  resultMap="CzrkResult">
+        <include refid="selectCzrkVo"/>
+        <where>  
+            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
+            <if test="gender != null  and gender != ''"> and gender = #{gender}</if>
+            <if test="age != null "> and age = #{age}</if>
+            <if test="birthday != null "> and birthday = #{birthday}</if>
+            <if test="idCard != null  and idCard != ''"> and id_card = #{idCard}</if>
+            <if test="phoneNum != null  and phoneNum != ''"> and phone_num = #{phoneNum}</if>
+            <if test="code != null  and code != ''"> and code = #{code}</if>
+            <if test="houseType != null  and houseType != ''"> and house_type = #{houseType}</if>
+            <if test="rlr != null  and rlr != ''"> and rlr = #{rlr}</if>
+            <if test="rlTime != null "> and rl_time = #{rlTime}</if>
+            <if test="yhzgx != null  and yhzgx != ''"> and yhzgx = #{yhzgx}</if>
+            <if test="workUnit != null  and workUnit != ''"> and work_unit = #{workUnit}</if>
+            <if test="provinceId != null  and provinceId != ''"> and province_id = #{provinceId}</if>
+            <if test="province != null  and province != ''"> and province = #{province}</if>
+            <if test="cityId != null  and cityId != ''"> and city_id = #{cityId}</if>
+            <if test="city != null  and city != ''"> and city = #{city}</if>
+            <if test="regionId != null  and regionId != ''"> and region_id = #{regionId}</if>
+            <if test="region != null  and region != ''"> and region = #{region}</if>
+            <if test="villageTownsId != null  and villageTownsId != ''"> and village_towns_id = #{villageTownsId}</if>
+            <if test="villageTowns != null  and villageTowns != ''"> and village_towns = #{villageTowns}</if>
+            <if test="villageId != null  and villageId != ''"> and village_id = #{villageId}</if>
+            <if test="village != null  and village != ''"> and 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 now_in = #{nowIn}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="isDel != null  and isDel != ''"> and is_del = #{isDel}</if>
+            <if test="deleteReason != null  and deleteReason != ''"> and delete_reason = #{deleteReason}</if>
+        </where>
+    </select>
+    
+    <select id="selectCzrkById" parameterType="Long" resultMap="CzrkResult">
+        <include refid="selectCzrkVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertCzrk"  useGeneratedKeys="true" keyProperty="id">
+        insert into czrk
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userName != null">user_name,</if>
+            <if test="gender != null">gender,</if>
+            <if test="age != null">age,</if>
+            <if test="birthday != null">birthday,</if>
+            <if test="idCard != null">id_card,</if>
+            <if test="phoneNum != null">phone_num,</if>
+            <if test="code != null">code,</if>
+            <if test="houseType != null">house_type,</if>
+            <if test="rlr != null">rlr,</if>
+            <if test="rlTime != null">rl_time,</if>
+            <if test="yhzgx != null">yhzgx,</if>
+            <if test="workUnit != null">work_unit,</if>
+            <if test="provinceId != null">province_id,</if>
+            <if test="province != null">province,</if>
+            <if test="cityId != null">city_id,</if>
+            <if test="city != null">city,</if>
+            <if test="regionId != null">region_id,</if>
+            <if test="region != null">region,</if>
+            <if test="villageTownsId != null">village_towns_id,</if>
+            <if test="villageTowns != null">village_towns,</if>
+            <if test="villageId != null">village_id,</if>
+            <if test="village != null">village,</if>
+            <if test="villagerGroupId != null">villager_group_id,</if>
+            <if test="villagerGroup != null">villager_group,</if>
+            <if test="nowIn != null">now_in,</if>
+            <if test="remark != null">remark,</if>
+            <if test="status != null">status,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="isDel != null and isDel != ''">is_del,</if>
+            <if test="deleteReason != null">delete_reason,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userName != null">#{userName},</if>
+            <if test="gender != null">#{gender},</if>
+            <if test="age != null">#{age},</if>
+            <if test="birthday != null">#{birthday},</if>
+            <if test="idCard != null">#{idCard},</if>
+            <if test="phoneNum != null">#{phoneNum},</if>
+            <if test="code != null">#{code},</if>
+            <if test="houseType != null">#{houseType},</if>
+            <if test="rlr != null">#{rlr},</if>
+            <if test="rlTime != null">#{rlTime},</if>
+            <if test="yhzgx != null">#{yhzgx},</if>
+            <if test="workUnit != null">#{workUnit},</if>
+            <if test="provinceId != null">#{provinceId},</if>
+            <if test="province != null">#{province},</if>
+            <if test="cityId != null">#{cityId},</if>
+            <if test="city != null">#{city},</if>
+            <if test="regionId != null">#{regionId},</if>
+            <if test="region != null">#{region},</if>
+            <if test="villageTownsId != null">#{villageTownsId},</if>
+            <if test="villageTowns != null">#{villageTowns},</if>
+            <if test="villageId != null">#{villageId},</if>
+            <if test="village != null">#{village},</if>
+            <if test="villagerGroupId != null">#{villagerGroupId},</if>
+            <if test="villagerGroup != null">#{villagerGroup},</if>
+            <if test="nowIn != null">#{nowIn},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="status != null">#{status},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="isDel != null and isDel != ''">#{isDel},</if>
+            <if test="deleteReason != null">#{deleteReason},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCzrk" >
+        update czrk
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userName != null">user_name = #{userName},</if>
+            <if test="gender != null">gender = #{gender},</if>
+            <if test="age != null">age = #{age},</if>
+            <if test="birthday != null">birthday = #{birthday},</if>
+            <if test="idCard != null">id_card = #{idCard},</if>
+            <if test="phoneNum != null">phone_num = #{phoneNum},</if>
+            <if test="code != null">code = #{code},</if>
+            <if test="houseType != null">house_type = #{houseType},</if>
+            <if test="rlr != null">rlr = #{rlr},</if>
+            <if test="rlTime != null">rl_time = #{rlTime},</if>
+            <if test="yhzgx != null">yhzgx = #{yhzgx},</if>
+            <if test="workUnit != null">work_unit = #{workUnit},</if>
+            <if test="provinceId != null">province_id = #{provinceId},</if>
+            <if test="province != null">province = #{province},</if>
+            <if test="cityId != null">city_id = #{cityId},</if>
+            <if test="city != null">city = #{city},</if>
+            <if test="regionId != null">region_id = #{regionId},</if>
+            <if test="region != null">region = #{region},</if>
+            <if test="villageTownsId != null">village_towns_id = #{villageTownsId},</if>
+            <if test="villageTowns != null">village_towns = #{villageTowns},</if>
+            <if test="villageId != null">village_id = #{villageId},</if>
+            <if test="village != null">village = #{village},</if>
+            <if test="villagerGroupId != null">villager_group_id = #{villagerGroupId},</if>
+            <if test="villagerGroup != null">villager_group = #{villagerGroup},</if>
+            <if test="nowIn != null">now_in = #{nowIn},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
+            <if test="deleteReason != null">delete_reason = #{deleteReason},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCzrkById" parameterType="Long">
+        delete from czrk where id = #{id}
+    </delete>
+
+    <delete id="deleteCzrkByIds" parameterType="String">
+        delete from czrk where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 13 - 3
boman-web-core/src/main/resources/mapper/FxryMapper.xml

@@ -56,14 +56,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="list" resultType="com.boman.domain.Fxry">
     <select id="list" resultType="com.boman.domain.Fxry">
         select id,
         select id,
                `name`,
                `name`,
+               `sex`,
                telephone,
                telephone,
-               id_card_hide idCard,
+               id_card idCardHide,
                wzhjdz,
                wzhjdz,
                addr_outside_province addrOutsideProvince,
                addr_outside_province addrOutsideProvince,
-               intended_return_time intendedReturnTime
+               intended_return_time intendedReturnTime,
+               village_towns villageTowns
         from fxry
         from fxry
         where `delete` = '否'
         where `delete` = '否'
-        <if test="name != null and name != ''">and `name` like concat('%', #{name}, '%')</if>
+        <if test="name != null and name != ''">
+          and (`name` like concat('%', #{name}, '%') or `id_card` like concat('%', #{name}, '%'))
+        </if>
         <if test="sex != null and sex != ''">and `sex` = #{sex}</if>
         <if test="sex != null and sex != ''">and `sex` = #{sex}</if>
         <if test="idCard != null and idCard != ''">and `id_card` like concat('%', #{idCard}, '%')</if>
         <if test="idCard != null and idCard != ''">and `id_card` like concat('%', #{idCard}, '%')</if>
         <if test="telephone != null and telephone != ''">and telephone = #{telephone}</if>
         <if test="telephone != null and telephone != ''">and telephone = #{telephone}</if>
@@ -90,4 +94,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from fxry
         from fxry
         where id = #{id} limit 1;
         where id = #{id} limit 1;
     </select>
     </select>
+
+    <select id="countByIdCard" resultType="int">
+        select count(id)
+        from fxry
+        where id_card = #{idCard}
+    </select>
 </mapper>
 </mapper>

+ 278 - 15
boman-web-core/src/main/resources/mapper/VaccineInfoMapper.xml

@@ -16,6 +16,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="city"    column="city"  />
         <result property="city"    column="city"  />
         <result property="region"    column="region"  />
         <result property="region"    column="region"  />
         <result property="vaccineName"    column="vaccine_name"  />
         <result property="vaccineName"    column="vaccine_name"  />
+        <result property="residenceTown"    column="residence_town"  />
+        <result property="residenceVillage"    column="residence_village"  />
         <result property="userName"    column="user_name"  />
         <result property="userName"    column="user_name"  />
         <result property="gender"    column="gender"  />
         <result property="gender"    column="gender"  />
         <result property="idCard"    column="id_card"  />
         <result property="idCard"    column="id_card"  />
@@ -47,6 +49,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="vaccinationTime"    column="vaccination_time"    />
         <result property="vaccinationTime"    column="vaccination_time"    />
         <result property="progress"    column="progress"    />
         <result property="progress"    column="progress"    />
         <result property="deptId"    column="dept_id"    />
         <result property="deptId"    column="dept_id"    />
+        <result property="rlr"    column="rlr"    />
+        <result property="yhzgx"    column="yhzgx"    />
+        <result property="deleteReason"    column="delete_reason"    />
         <collection  property="vaccineInfoUserList"   javaType="java.util.List"        resultMap="VaccineInfoUser" />
         <collection  property="vaccineInfoUserList"   javaType="java.util.List"        resultMap="VaccineInfoUser" />
     </resultMap>
     </resultMap>
 
 
@@ -68,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         vi.vaccination_time, vi.vaccination_place, vi.contraindication, vi.suspend,vi.suspend_url,vi.other_url,vi.vaccination_time,
         vi.vaccination_time, vi.vaccination_place, vi.contraindication, vi.suspend,vi.suspend_url,vi.other_url,vi.vaccination_time,
         vi.should_be, vi.other, vi.progress, vi.remark, vi.status, vi.create_by, vi.create_time, vi.update_by, vi.update_time,
         vi.should_be, vi.other, vi.progress, vi.remark, vi.status, vi.create_by, vi.create_time, vi.update_by, vi.update_time,
                vi.is_del,vi.code,vi.birthday,vi.work_unit,vi.crowd_classification,vi.manufacturer,vi.now_in,vi.url,vi.dept_id,
                vi.is_del,vi.code,vi.birthday,vi.work_unit,vi.crowd_classification,vi.manufacturer,vi.now_in,vi.url,vi.dept_id,
-
+               vi.residence_town as residenceTown, vi.residence_village as residenceVillage,
                viu.id as id_user,viu.id_card as id_card_user,viu.vaccine_name as vaccine_name_user,viu.jici as jici_user,viu.vaccination_time as vaccination_time_user,
                viu.id as id_user,viu.id_card as id_card_user,viu.vaccine_name as vaccine_name_user,viu.jici as jici_user,viu.vaccination_time as vaccination_time_user,
                viu.vaccination_place as vaccination_place_user,viu.progress as progress_user,viu.status as status_user,viu.url as url_user
                viu.vaccination_place as vaccination_place_user,viu.progress as progress_user,viu.status as status_user,viu.url as url_user
                from vaccine_info vi left join vaccine_info_user viu
                from vaccine_info vi left join vaccine_info_user viu
@@ -135,19 +140,223 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by vi.create_time DESC ,vi.vaccination_time DESC
         order by vi.create_time DESC ,vi.vaccination_time DESC
     </select>
     </select>
 
 
-    <select id="listByXzAndJs"  resultMap="VaccineInfoResult">
-        select vi.id, vi.village_towns, vi.village, vi.villager_group,vi.age, vi.house_type, vi.domicile, vi.province,
-        vi.city,vi.should_slow,
-        vi.region, vi.user_name, vi.gender, vi.id_card, vi.phone_num, vi.key_industries, vi.is_vaccination,
-        vi.vaccine_name, vi.jici,
-        vi.vaccination_time, vi.vaccination_place, vi.contraindication,
-        vi.suspend,vi.suspend_url,vi.other_url,vi.vaccination_time,
-        vi.should_be, vi.other, vi.progress, vi.remark, vi.status, vi.create_by, vi.create_time, vi.update_by,
-        vi.update_time,
-        vi.is_del,vi.code,vi.birthday,vi.work_unit,vi.crowd_classification,vi.manufacturer,vi.now_in,vi.url,vi.dept_id
+    <select id="listByXz"  resultMap="VaccineInfoResult">
+        select vi.id, vi.create_time, vi.update_time, vi.is_del, vi.update_by, vi.user_name, vi.phone_num, vi.id_card
+             , vi.gender, vi.province, vi.city, vi.region, vi.now_in, vi.house_type, vi.update_by, vi.code
+        from vaccine_info vi
+        where vi.is_del = 'N' and vi.create_time &gt;= #{startTime} and vi.create_time &lt;= #{endTime}
+        <if test="userName != null  and userName != ''">
+            and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
+        </if>
+        <if test="villageTowns != null  and villageTowns != ''">
+            and vi.village_towns = #{villageTowns}
+        </if>
+        <if test="village != null  and village != ''"> and vi.village = #{village}</if>
+        <if test="villagerGroup != null  and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
+        <if test="houseType != null  and houseType != ''"> and vi.house_type = #{houseType}</if>
+        <if test="domicile != null  and domicile != ''"> and vi.domicile = #{domicile}</if>
+        <if test="province != null  and province != ''"> and vi.province = #{province}</if>
+        <if test="city != null  and city != ''"> and vi.city = #{city}</if>
+        <if test="jici != null  and jici != ''"> and vi.jici &lt;= #{jici}</if>
+        <if test="vaccineName != null  and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
+        <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</if>
+        <if test="region != null  and region != ''"> and vi.region = #{region}</if>
+<!--        <if test="userName != null  and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>-->
+        <if test="gender != null  and gender != ''"> and vi.gender = #{gender}</if>
+        <if test="idCard != null  and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
+        <if test="phoneNum != null  and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
+        <if test="keyIndustries != null  and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
+        <if test="isVaccination != null  and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
+        <if test="params.startAge != null  and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
+        <if test="params.endAge != null  and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
+        <if test="contraindication != null  and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
+        <if test="suspend != null  and suspend != ''"> and vi.suspend = #{suspend}</if>
+        <if test="shouldBe != null  and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
+        <if test="other != null  and other != ''"> and vi.other = #{other}</if>
+        <if test="status != null  and status != ''"> and vi.status = #{status}</if>
+        <if test="code != null  and code != ''"> and vi.code = #{code}</if>
+        <if test="birthday != null  and birthday != ''"> and vi.birthday = #{birthday}</if>
+        <if test="workUnit != null  and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
+        <if test="crowdClassification != null  and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
+        <if test="manufacturer != null  and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
+        <if test="nowIn != null  and nowIn != ''"> and vi.now_in = #{nowIn}</if>
+        <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="createTime != null and createTime != ''"> and vi.create_time &gt;= #{startTime}</if>
+        <if test="endTime != null and endTime != ''"> and vi.create_time &lt;= #{endTime}</if>
+        <if test="shouldSlow != null  and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="idCardS != null  and idCardS.size() > 0">
+            and vi.id_card in
+            <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
+                #{idCard}
+            </foreach>
+        </if>
+
+        <if test="deptIdList != null  and deptIdList.size() > 0">
+            and vi.dept_id in
+            <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
+                #{deptId}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="countByXz" resultType="int">
+        select count(1)
+        from vaccine_info vi
+        where vi.is_del = 'N' and vi.create_time &gt;= #{startTime} and vi.create_time &lt;= #{endTime}
+        <if test="villageTowns != null  and villageTowns != ''">
+            and vi.village_towns = #{villageTowns}
+        </if>
+        <if test="village != null  and village != ''"> and vi.village = #{village}</if>
+        <if test="villagerGroup != null  and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
+        <if test="houseType != null  and houseType != ''"> and vi.house_type = #{houseType}</if>
+        <if test="domicile != null  and domicile != ''"> and vi.domicile = #{domicile}</if>
+        <if test="province != null  and province != ''"> and vi.province = #{province}</if>
+        <if test="city != null  and city != ''"> and vi.city = #{city}</if>
+        <if test="jici != null  and jici != ''"> and vi.jici &lt;= #{jici}</if>
+        <if test="vaccineName != null  and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
+        <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</if>
+        <if test="region != null  and region != ''"> and vi.region = #{region}</if>
+        <if test="userName != null  and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>
+        <if test="gender != null  and gender != ''"> and vi.gender = #{gender}</if>
+        <if test="idCard != null  and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
+        <if test="phoneNum != null  and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
+        <if test="keyIndustries != null  and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
+        <if test="isVaccination != null  and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
+        <if test="params.startAge != null  and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
+        <if test="params.endAge != null  and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
+        <if test="contraindication != null  and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
+        <if test="suspend != null  and suspend != ''"> and vi.suspend = #{suspend}</if>
+        <if test="shouldBe != null  and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
+        <if test="other != null  and other != ''"> and vi.other = #{other}</if>
+        <if test="status != null  and status != ''"> and vi.status = #{status}</if>
+        <if test="code != null  and code != ''"> and vi.code = #{code}</if>
+        <if test="birthday != null  and birthday != ''"> and vi.birthday = #{birthday}</if>
+        <if test="workUnit != null  and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
+        <if test="crowdClassification != null  and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
+        <if test="manufacturer != null  and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
+        <if test="nowIn != null  and nowIn != ''"> and vi.now_in = #{nowIn}</if>
+        <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="createTime != null and createTime != ''"> and vi.create_time &gt;= #{startTime}</if>
+        <if test="endTime != null and endTime != ''"> and vi.create_time &lt;= #{endTime}</if>
+        <if test="shouldSlow != null  and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="idCardS != null  and idCardS.size() > 0">
+            and vi.id_card in
+            <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
+                #{idCard}
+            </foreach>
+        </if>
+        <if test="deptIdList != null  and deptIdList.size() > 0">
+            and vi.dept_id in
+            <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
+                #{deptId}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="listByJs" resultMap="VaccineInfoResult">
+        select vi.id, vi.create_time, vi.update_time, vi.is_del, vi.update_by, vi.user_name, vi.phone_num, vi.id_card
+        , vi.gender, vi.province, vi.city, vi.region, vi.now_in, vi.house_type, vi.update_by, vi.code
+        from vaccine_info vi
+        where vi.is_del = 'Y' and vi.update_time &gt;= #{startTime} and vi.update_time &lt;= #{endTime}
+        <if test="userName != null  and userName != ''">
+            and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
+        </if>
+          <if test="villageTowns != null  and villageTowns != ''">
+            and vi.village_towns = #{villageTowns}
+        </if>
+        <if test="village != null  and village != ''"> and vi.village = #{village}</if>
+        <if test="villagerGroup != null  and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
+        <if test="houseType != null  and houseType != ''"> and vi.house_type = #{houseType}</if>
+        <if test="domicile != null  and domicile != ''"> and vi.domicile = #{domicile}</if>
+        <if test="province != null  and province != ''"> and vi.province = #{province}</if>
+        <if test="city != null  and city != ''"> and vi.city = #{city}</if>
+        <if test="jici != null  and jici != ''"> and vi.jici &lt;= #{jici}</if>
+        <if test="vaccineName != null  and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
+        <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</if>
+        <if test="region != null  and region != ''"> and vi.region = #{region}</if>
+        <!--<if test="userName != null  and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>-->
+        <if test="gender != null  and gender != ''"> and vi.gender = #{gender}</if>
+        <if test="idCard != null  and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
+        <if test="phoneNum != null  and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
+        <if test="keyIndustries != null  and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
+        <if test="isVaccination != null  and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
+        <if test="params.startAge != null  and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
+        <if test="params.endAge != null  and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
+        <if test="contraindication != null  and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
+        <if test="suspend != null  and suspend != ''"> and vi.suspend = #{suspend}</if>
+        <if test="shouldBe != null  and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
+        <if test="other != null  and other != ''"> and vi.other = #{other}</if>
+        <if test="status != null  and status != ''"> and vi.status = #{status}</if>
+        <if test="code != null  and code != ''"> and vi.code = #{code}</if>
+        <if test="birthday != null  and birthday != ''"> and vi.birthday = #{birthday}</if>
+        <if test="workUnit != null  and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
+        <if test="crowdClassification != null  and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
+        <if test="manufacturer != null  and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
+        <if test="nowIn != null  and nowIn != ''"> and vi.now_in = #{nowIn}</if>
+        <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="createTime != null and createTime != ''"> and vi.create_time &gt;= #{startTime}</if>
+        <if test="endTime != null and endTime != ''"> and vi.create_time &lt;= #{endTime}</if>
+        <if test="shouldSlow != null  and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="idCardS != null  and idCardS.size() > 0">
+            and vi.id_card in
+            <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
+                #{idCard}
+            </foreach>
+        </if>
+        <if test="deptIdList != null  and deptIdList.size() > 0">
+            and vi.dept_id in
+            <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
+                #{deptId}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="countByJs" resultType="int">
+        select count(1)
         from vaccine_info vi
         from vaccine_info vi
-        where (vi.is_del = 'N' and vi.create_time &gt;= #{startTime} and vi.create_time &lt;= #{endTime}) or
-        (vi.is_del = 'Y' and vi.update_time &gt;= #{startTime} and vi.update_time &lt;= #{endTime})
+        where vi.is_del = 'Y' and vi.update_time &gt;= #{startTime} and vi.update_time &lt;= #{endTime}
+        <if test="villageTowns != null  and villageTowns != ''">
+            and vi.village_towns = #{villageTowns}
+        </if>
+        <if test="village != null  and village != ''"> and vi.village = #{village}</if>
+        <if test="villagerGroup != null  and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
+        <if test="houseType != null  and houseType != ''"> and vi.house_type = #{houseType}</if>
+        <if test="domicile != null  and domicile != ''"> and vi.domicile = #{domicile}</if>
+        <if test="province != null  and province != ''"> and vi.province = #{province}</if>
+        <if test="city != null  and city != ''"> and vi.city = #{city}</if>
+        <if test="jici != null  and jici != ''"> and vi.jici &lt;= #{jici}</if>
+        <if test="vaccineName != null  and vaccineName != ''"> and vi.vaccine_name like concat('%', #{vaccineName}, '%')</if>
+        <if test="vaccinationTime != null "> and DATE_FORMAT(vi.vaccination_time,'%Y-%m-%d') = DATE_FORMAT(#{vaccinationTime},'%Y-%m-%d')</if>
+        <if test="region != null  and region != ''"> and vi.region = #{region}</if>
+        <if test="userName != null  and userName != ''"> and vi.user_name like concat('%', #{userName}, '%')</if>
+        <if test="gender != null  and gender != ''"> and vi.gender = #{gender}</if>
+        <if test="idCard != null  and idCard != ''"> and vi.id_card like concat('%', #{idCard}, '%')</if>
+        <if test="phoneNum != null  and phoneNum != ''"> and vi.phone_num = #{phoneNum}</if>
+        <if test="keyIndustries != null  and keyIndustries != ''"> and vi.key_industries = #{keyIndustries}</if>
+        <if test="isVaccination != null  and isVaccination != ''"> and vi.is_vaccination = #{isVaccination}</if>
+        <if test="params.startAge != null  and params.startAge != ''"> and vi.age &gt;= #{params.startAge}</if>
+        <if test="params.endAge != null  and params.endAge != ''"> and vi.age &lt;= #{params.endAge}</if>
+        <if test="contraindication != null  and contraindication != ''"> and vi.contraindication = #{contraindication}</if>
+        <if test="suspend != null  and suspend != ''"> and vi.suspend = #{suspend}</if>
+        <if test="shouldBe != null  and shouldBe != ''"> and vi.should_be = #{shouldBe}</if>
+        <if test="other != null  and other != ''"> and vi.other = #{other}</if>
+        <if test="status != null  and status != ''"> and vi.status = #{status}</if>
+        <if test="code != null  and code != ''"> and vi.code = #{code}</if>
+        <if test="birthday != null  and birthday != ''"> and vi.birthday = #{birthday}</if>
+        <if test="workUnit != null  and workUnit != ''"> and vi.work_unit = #{workUnit}</if>
+        <if test="crowdClassification != null  and crowdClassification != ''"> and vi.crowd_classification = #{crowdClassification}</if>
+        <if test="manufacturer != null  and manufacturer != ''"> and vi.manufacturer = #{manufacturer}</if>
+        <if test="nowIn != null  and nowIn != ''"> and vi.now_in = #{nowIn}</if>
+        <if test="shouldSlow != null and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="createTime != null and createTime != ''"> and vi.create_time &gt;= #{startTime}</if>
+        <if test="endTime != null and endTime != ''"> and vi.create_time &lt;= #{endTime}</if>
+        <if test="shouldSlow != null  and shouldSlow != ''"> and vi.should_slow = #{shouldSlow}</if>
+        <if test="idCardS != null  and idCardS.size() > 0">
+            and vi.id_card in
+            <foreach item="idCard" collection="idCardS" open="(" separator="," close=")">
+                #{idCard}
+            </foreach>
+        </if>
         <if test="deptIdList != null  and deptIdList.size() > 0">
         <if test="deptIdList != null  and deptIdList.size() > 0">
             and vi.dept_id in
             and vi.dept_id in
             <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
             <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
@@ -171,17 +380,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
         </if>
     </select>
     </select>
 
 
+    <select id="countIdCard" resultType="int">
+        select count(vi.id) from vaccine_info vi where vi.is_del = 'N' and id_card = #{idCard}
+    </select>
+
+    <select id="listByCode" resultMap="VaccineInfoResult">
+        select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender, vi.province, vi.city, vi.region, vi.now_in
+        , vi.house_type, vi.update_by, vi.code, vi.rlr, vi.yhzgx
+        from vaccine_info vi
+        <!--把户主放第一位-->
+        where vi.is_del = 'N' and code = #{code} order by house_type desc;
+    </select>
+
     <select id="listByRlry" resultMap="VaccineInfoResult">
     <select id="listByRlry" resultMap="VaccineInfoResult">
         select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender, vi.province, vi.city, vi.region, vi.now_in
         select vi.id, vi.user_name, vi.phone_num, vi.id_card, vi.gender, vi.province, vi.city, vi.region, vi.now_in
+               , vi.house_type, vi.update_by, vi.code, vi.rlr, vi.update_time, vi.delete_reason, vi.domicile, vi.now_in
         from vaccine_info vi
         from vaccine_info vi
         <where>
         <where>
-            vi.is_del = 'N'
+            vi.is_del = #{isDel}
             <!-- 已认领 -->
             <!-- 已认领 -->
             <if test="ryrl == true">and (vi.village_towns is not null or vi.village_towns != '')</if>
             <if test="ryrl == true">and (vi.village_towns is not null or vi.village_towns != '')</if>
             <!-- 未认领 -->
             <!-- 未认领 -->
             <if test="ryrl == false">and (vi.village_towns is null or vi.village_towns = '')</if>
             <if test="ryrl == false">and (vi.village_towns is null or vi.village_towns = '')</if>
 
 
 
 
+            <if test="villageTowns != null  and villageTowns != ''">and vi.village_towns = #{villageTowns}</if>
+            <if test="village != null  and village != ''">and vi.village = #{village}</if>
             <if test="houseType != null  and houseType != ''">and vi.house_type = #{houseType}</if>
             <if test="houseType != null  and houseType != ''">and vi.house_type = #{houseType}</if>
             <if test="domicile != null  and domicile != ''">and vi.domicile = #{domicile}</if>
             <if test="domicile != null  and domicile != ''">and vi.domicile = #{domicile}</if>
             <if test="province != null  and province != ''">and vi.province = #{province}</if>
             <if test="province != null  and province != ''">and vi.province = #{province}</if>
@@ -241,6 +465,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where vi.is_del = 'N'
         where vi.is_del = 'N'
         <!-- 已认领 -->
         <!-- 已认领 -->
         and (vi.village_towns is not null or vi.village_towns != '')
         and (vi.village_towns is not null or vi.village_towns != '')
+        <if test="userName != null  and userName != ''">
+            and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
+        </if>
         <if test="deptIdList != null  and deptIdList.size() > 0">
         <if test="deptIdList != null  and deptIdList.size() > 0">
             and vi.dept_id in
             and vi.dept_id in
             <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
             <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
@@ -255,6 +482,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where vi.is_del = 'N'
         where vi.is_del = 'N'
         <!-- 未认领 -->
         <!-- 未认领 -->
         and (vi.village_towns is null or vi.village_towns = '')
         and (vi.village_towns is null or vi.village_towns = '')
+        <if test="userName != null  and userName != ''">
+            and (vi.user_name like concat('%', #{userName}, '%') or vi.id_card like concat('%', #{userName}, '%'))
+        </if>
         <if test="deptIdList != null  and deptIdList.size() > 0">
         <if test="deptIdList != null  and deptIdList.size() > 0">
             and vi.dept_id in
             and vi.dept_id in
             <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
             <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
@@ -272,10 +502,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
         where id = #{id}
     </update>
     </update>
 
 
+    <update id="reduction">
+        update vaccine_info
+        set is_del        = 'N'
+          , update_by     = #{updateBy}
+          , update_time   = sysdate()
+        where id = #{id}
+    </update>
+
     <select id="selectVaccineInfoListByPage" parameterType="Integer" resultMap="VaccineInfoResult">
     <select id="selectVaccineInfoListByPage" parameterType="Integer" resultMap="VaccineInfoResult">
         select * from vaccine_info limit   #{startNum}, #{endNum}
         select * from vaccine_info limit   #{startNum}, #{endNum}
     </select>
     </select>
 
 
+    <select id="handleData" resultMap="VaccineInfoResult">
+        SELECT (DATE_FORMAT(substring(t.id_card, 7, 8), "%Y-%m-%d")) AS birthday
+            , ((YEAR(now())) - (YEAR(substring(t.id_card, 7, 8)))) AS age
+            , id AS id
+        FROM vaccine_info t where age is null or age = 0 or age = ''
+    </select>
+
+    <select id="getHouseType" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT zjhm idCard, hh code, yhzgx yhzgx FROM std_ga_hjrkxx
+    </select>
+
+    <update id="setHouseType">
+        update vaccine_info set code = #{code}, yhzgx = #{yhzgx}, house_type = #{houseType} where id_card = #{idCard}
+    </update>
 
 
     <select id="selectVaccineInfoById" parameterType="Long" resultMap="VaccineInfoResult">
     <select id="selectVaccineInfoById" parameterType="Long" resultMap="VaccineInfoResult">
         <include refid="selectVaccineInfoVo"/>
         <include refid="selectVaccineInfoVo"/>
@@ -423,7 +675,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="updateTime != null">update_time = sysdate(),</if>
             <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
             <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
             <if test="code != null and code != ''">code = #{code},</if>
             <if test="code != null and code != ''">code = #{code},</if>
             <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
             <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
@@ -437,6 +689,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="otherUrl != null and otherUrl != ''">other_url = #{otherUrl},</if>
             <if test="otherUrl != null and otherUrl != ''">other_url = #{otherUrl},</if>
             <if test="age != null and age != ''">age = #{age},</if>
             <if test="age != null and age != ''">age = #{age},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="rlr != null and rlr != ''">rlr = #{rlr},</if>
+            <if test="deleteReason != null and deleteReason != ''">delete_reason = #{deleteReason},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="updateAgeBirthday" >
+        update vaccine_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="age != null and age != ''">age = #{age},</if>
+            <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
         </trim>
         </trim>
         where id = #{id}
         where id = #{id}
     </update>
     </update>