diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenSpecialUserController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenSpecialUserController.java new file mode 100644 index 00000000..49369213 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenSpecialUserController.java @@ -0,0 +1,94 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.annotation.ReportData; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.form.SpecialUserDisabilityTypeFormDTO; +import com.elink.esua.epdc.dto.form.SpecialUserFormDTO; +import com.elink.esua.epdc.dto.form.SpecialUserMonthlySubsidyFormDTO; +import com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO; +import com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO; +import com.elink.esua.epdc.dto.result.SpecialUserMonthlySubsidyResultDTO; +import com.elink.esua.epdc.dto.result.SpecialUserResultDTO; +import com.elink.esua.epdc.service.CustomService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 特殊人群分析 + * + * @author songyunpeng + * @email yujintao@elink-cn.com + * @date 2019/9/6 19:30 + */ +@RestController +@RequestMapping("screenSpecialUser") +public class ApiScreenSpecialUserController { + + @Autowired + private CustomService customService; + + + /** + * @Description 特殊人群分析-人群分布接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @ReportData + @PostMapping("selectMonthlySubsidy") + public Result selectPopulationDistribution(){ + return customService.selectPopulationDistribution(); + } + /** + * @Description 特殊人群分析-查人接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @ReportData + @PostMapping("selectMonthlySubsidy") + public Result> selectPageSpecialUser(@RequestBody SpecialUserFormDTO dto){ + return customService.selectPageSpecialUser(dto); + } + /** + * @Description 特殊人群分析-详情接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [suId] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @ReportData + @PostMapping("selectSpecialUserDetail/{suId}") + public Result selectSpecialUserDetail(@PathVariable String suId){ + return customService.selectSpecialUserDetail(suId); + } + /** + * @Description 特殊人群分析-残疾类别分布接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserDisabilityTypeFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @ReportData + @PostMapping("selectDisabilityType") + public Result> selectDisabilityType(@RequestBody SpecialUserDisabilityTypeFormDTO dto){ + return customService.selectDisabilityType(dto); + } + + /** + * @Description 特殊人群分析-月度补贴情况接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserDisabilityTypeFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @ReportData + @PostMapping("selectMonthlySubsidy") + public Result> selectMonthlySubsidy(@RequestBody SpecialUserMonthlySubsidyFormDTO dto){ + return customService.selectMonthlySubsidy(dto); + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java index 2b546b7f..cb232f86 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java @@ -1,11 +1,9 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.form.ArchiveDeptFormDTO; -import com.elink.esua.epdc.dto.form.ArchiveFormDTO; -import com.elink.esua.epdc.dto.form.EpdcDeptInfoFormDTO; -import com.elink.esua.epdc.dto.form.EpiDemicReportFormDTO; +import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.feign.fallback.CustomFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; @@ -13,6 +11,7 @@ import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -23,49 +22,49 @@ import java.util.List; */ @FeignClient(name = ServiceConstant.EPDC_CUSTOM_SERVER, fallback = CustomFeignClientFallback.class) public interface CustomFeignClient { - /** - * @param formDTO - * @return com.elink.esua.epdc.commons.tools.utils.Result - * @Author yinzuomei - * @Description 疫情上报 - * @Date 2020/1/28 13:27 - **/ - @PostMapping(value = "custom/epidemic/report", consumes = MediaType.APPLICATION_JSON_VALUE) - Result report(EpiDemicReportFormDTO formDTO); + /** + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 疫情上报 + * @Date 2020/1/28 13:27 + **/ + @PostMapping(value = "custom/epidemic/report", consumes = MediaType.APPLICATION_JSON_VALUE) + Result report(EpiDemicReportFormDTO formDTO); - /* - * 移动端获取 了解锦水-模块管理接口 - * - * @param - * @return com.elink.esua.epdc.commons.tools.utils.Result> - * @Author zhangyong - * @Date 10:42 2020-05-20 - **/ - @Deprecated - @GetMapping(value = "custom/epdc-app/module/list", consumes = MediaType.APPLICATION_JSON_VALUE) - Result> selectListModule(); + /* + * 移动端获取 了解锦水-模块管理接口 + * + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 10:42 2020-05-20 + **/ + @Deprecated + @GetMapping(value = "custom/epdc-app/module/list", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> selectListModule(); - /** - * - * 根据模块分类获取模块 - * - * @params [moduleCategory] - * @return com.elink.esua.epdc.commons.tools.utils.Result> - * @author liuchuang - * @since 2020/7/15 17:43 - */ - @GetMapping("custom/epdc-app/module/list/{moduleCategory}") - Result> listOfModuleByModuleCategory(@PathVariable("moduleCategory") String moduleCategory); + /** + * 根据模块分类获取模块 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @params [moduleCategory] + * @author liuchuang + * @since 2020/7/15 17:43 + */ + @GetMapping("custom/epdc-app/module/list/{moduleCategory}") + Result> listOfModuleByModuleCategory(@PathVariable("moduleCategory") String moduleCategory); - /** - * 移动端获取 了解锦水-硬核管理接口 - * @param formDTO - * @return com.elink.esua.epdc.commons.tools.utils.Result> - * @Author zhangyong - * @Date 13:41 2020-05-20 - **/ - @GetMapping(value = "custom/epdc-app/deptinfo/list", consumes = MediaType.APPLICATION_JSON_VALUE) - Result> selectListDeptInfo(EpdcDeptInfoFormDTO formDTO); + /** + * 移动端获取 了解锦水-硬核管理接口 + * + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 13:41 2020-05-20 + **/ + @GetMapping(value = "custom/epdc-app/deptinfo/list", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> selectListDeptInfo(EpdcDeptInfoFormDTO formDTO); @GetMapping(value = "custom/archive/depts", consumes = MediaType.APPLICATION_JSON_VALUE) Result> listArchiveDeptInfo(ArchiveDeptFormDTO formDTO); @@ -75,4 +74,55 @@ public interface CustomFeignClient { @GetMapping(value = "custom/archive/detail/{id}", consumes = MediaType.APPLICATION_JSON_VALUE) Result getArchiveDetail(@PathVariable("id") String id); + + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Description 特殊人群分析-人群分布接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [] + **/ + @PostMapping(value = "custom/screenSpecialUser/selectMonthlySubsidy", consumes = MediaType.APPLICATION_JSON_VALUE) + Result selectPopulationDistribution(); + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Description 特殊人群分析-查人接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserFormDTO] + **/ + @PostMapping(value = "custom/screenSpecialUser/selectMonthlySubsidy", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> selectPageSpecialUser(@RequestBody SpecialUserFormDTO dto); + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Description 特殊人群分析-详情接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [suId] + **/ + @PostMapping(value = "custom/screenSpecialUser/selectSpecialUserDetail/{suId}", consumes = MediaType.APPLICATION_JSON_VALUE) + Result selectSpecialUserDetail(@PathVariable String suId); + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Description 特殊人群分析-残疾类别分布接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserDisabilityTypeFormDTO] + **/ + @PostMapping(value = "custom/screenSpecialUser/selectDisabilityType", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> selectDisabilityType(@RequestBody SpecialUserDisabilityTypeFormDTO dto); + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Description 特殊人群分析-月度补贴情况接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserDisabilityTypeFormDTO] + **/ + @PostMapping(value = "custom/screenSpecialUser/selectMonthlySubsidy", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> selectMonthlySubsidy(@RequestBody SpecialUserMonthlySubsidyFormDTO dto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java index d7fad41a..678e8dfe 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java @@ -1,12 +1,10 @@ package com.elink.esua.epdc.feign.fallback; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.form.ArchiveDeptFormDTO; -import com.elink.esua.epdc.dto.form.ArchiveFormDTO; -import com.elink.esua.epdc.dto.form.EpdcDeptInfoFormDTO; -import com.elink.esua.epdc.dto.form.EpiDemicReportFormDTO; +import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.feign.CustomFeignClient; import org.springframework.stereotype.Component; @@ -55,4 +53,29 @@ public class CustomFeignClientFallback implements CustomFeignClient { public Result getArchiveDetail(String id) { return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "getArchiveDetail", id); } + + @Override + public Result selectPopulationDistribution() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "selectPopulationDistribution"); + } + + @Override + public Result> selectPageSpecialUser(SpecialUserFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "selectPageSpecialUser", dto); + } + + @Override + public Result selectSpecialUserDetail(String suId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "selectSpecialUserDetail", suId); + } + + @Override + public Result> selectDisabilityType(SpecialUserDisabilityTypeFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "selectDisabilityType", dto); + } + + @Override + public Result> selectMonthlySubsidy(SpecialUserMonthlySubsidyFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "selectMonthlySubsidy", dto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java index 6c3eaf53..0ed38ba1 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java @@ -1,11 +1,9 @@ package com.elink.esua.epdc.service; +import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.DeptOption; -import com.elink.esua.epdc.dto.form.ArchiveDeptFormDTO; -import com.elink.esua.epdc.dto.form.ArchiveFormDTO; -import com.elink.esua.epdc.dto.form.EpdcDeptInfoFormDTO; -import com.elink.esua.epdc.dto.form.EpiDemicReportFormDTO; +import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import java.util.List; @@ -90,4 +88,45 @@ public interface CustomService { * @return com.elink.esua.epdc.commons.tools.utils.Result **/ Result getArchiveDetail(String id); + + /** + * @Description 特殊人群分析-人群分布接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result selectPopulationDistribution(); + /** + * @Description 特殊人群分析-查人接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @param specialUserFormDTO*/ + Result> selectPageSpecialUser(SpecialUserFormDTO specialUserFormDTO); + /** + * @Description 特殊人群分析-详情接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [suId] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result selectSpecialUserDetail(String suId); + /** + * @Description 特殊人群分析-残疾类别分布接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserDisabilityTypeFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result> selectDisabilityType(SpecialUserDisabilityTypeFormDTO specialUserDisabilityTypeFormDTO); + /** + * @Description 特殊人群分析-月度补贴情况接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + Result> selectMonthlySubsidy(SpecialUserMonthlySubsidyFormDTO dto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java index 9b319702..3728528c 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java @@ -1,13 +1,11 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.DeptOption; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; -import com.elink.esua.epdc.dto.form.ArchiveDeptFormDTO; -import com.elink.esua.epdc.dto.form.ArchiveFormDTO; -import com.elink.esua.epdc.dto.form.EpdcDeptInfoFormDTO; -import com.elink.esua.epdc.dto.form.EpiDemicReportFormDTO; +import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.CustomFeignClient; @@ -113,4 +111,29 @@ public class CustomServiceImpl implements CustomService { public Result getArchiveDetail(String id) { return customFeignClient.getArchiveDetail(id); } + + @Override + public Result selectPopulationDistribution() { + return customFeignClient.selectPopulationDistribution(); + } + + @Override + public Result> selectPageSpecialUser(SpecialUserFormDTO specialUserFormDTO) { + return customFeignClient.selectPageSpecialUser(specialUserFormDTO); + } + + @Override + public Result selectSpecialUserDetail(String suId) { + return customFeignClient.selectSpecialUserDetail(suId); + } + + @Override + public Result> selectDisabilityType(SpecialUserDisabilityTypeFormDTO specialUserDisabilityTypeFormDTO) { + return customFeignClient.selectDisabilityType(specialUserDisabilityTypeFormDTO); + } + + @Override + public Result> selectMonthlySubsidy(SpecialUserMonthlySubsidyFormDTO dto) { + return customFeignClient.selectMonthlySubsidy(dto); + } } diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/SpecialUserDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/SpecialUserDTO.java new file mode 100644 index 00000000..07eee047 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/SpecialUserDTO.java @@ -0,0 +1,147 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 特殊人群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@Data +public class SpecialUserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 所属村庄 + */ + private String suVillage; + + /** + * 姓名 + */ + private String suName; + + /** + * 出生日期 + */ + private Date suBirthday; + + /** + * 残疾证号 + */ + private String suDisabilityNumber; + + /** + * 残疾类别及等级 + */ + private String suDisabilityType; + + /** + * 是否低保 0:否1:是 + */ + private String suIsLow; + + /** + * 保障人口 + */ + private Integer suGuaranteedPopulation; + + /** + * 关系 + */ + private String suRelationship; + + /** + * 低保金额 + */ + private BigDecimal suLowMoney; + + /** + * 困难残疾人生活补贴 + */ + private BigDecimal suLivingSubsidy; + + /** + * 重度残疾人护理补贴 + */ + private BigDecimal suCareSubsidy; + + /** + * 经济困难老年人补贴 + */ + private BigDecimal suElderlySubsidy; + + /** + * 孤困儿童补贴 + */ + private BigDecimal suChildSubsidy; + + /** + * 分散五保补贴 + */ + private BigDecimal suFiveGuaranteesSubsidy; + + /** + * 是否贫困户 0:否1:是 + */ + private String suIsPoor; + + /** + * 删除表示 0:否1:是 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/SpecialUserDisabilityTypeFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/SpecialUserDisabilityTypeFormDTO.java new file mode 100644 index 00000000..28f90931 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/SpecialUserDisabilityTypeFormDTO.java @@ -0,0 +1,29 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * 残疾类别分布接口参数 + * + * @author songyunpeng + * @since v1.0.0 2020-05-20 + */ +@Data +public class SpecialUserDisabilityTypeFormDTO implements Serializable { + private static final long serialVersionUID = 2379520294973498819L; + + /** + * 页码 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 1, message = "页容量必须大于0") + private Integer pageSize; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/SpecialUserFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/SpecialUserFormDTO.java new file mode 100644 index 00000000..bd355aab --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/SpecialUserFormDTO.java @@ -0,0 +1,71 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * 查询特殊人群 参数 + * + * @author songyunpeng + * @since v1.0.0 2020-05-20 + */ +@Data +public class SpecialUserFormDTO implements Serializable { + private static final long serialVersionUID = 2379520294973498819L; + + /** + * 页码 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 1, message = "页容量必须大于0") + private Integer pageSize; + + + /** + * 姓名 + */ + private String suName; + /** + * 残疾类别及等级 + */ + private String suDisabilityType; + /** + * 所属村庄 + */ + private String suVillage; + /** + * 低保户 0:未选中 1:选中 + */ + private String suIsLow; + /** + * 贫困户 0:未选中 1:选中 + */ + private String suIsPoor; + /** + * 困难残疾人生活补贴 0:未选中 1:选中 + */ + private String suLivingSubsidy; + /** + * 重度残疾人护理补贴 0:未选中 1:选中 + */ + private String suCareSubsidy; + /** + * 经济困难老年人补贴 0:未选中 1:选中 + */ + private String suElderlySubsidy; + /** + * 孤困儿童补贴 0:未选中 1:选中 + */ + private String suChildSubsidy; + /** + * 分散五保补贴 0:未选中 1:选中 + */ + private String suFiveGuaranteesSubsidy; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/SpecialUserMonthlySubsidyFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/SpecialUserMonthlySubsidyFormDTO.java new file mode 100644 index 00000000..b13de4c8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/SpecialUserMonthlySubsidyFormDTO.java @@ -0,0 +1,29 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * 月度补贴情况接口参数 + * + * @author songyunpeng + * @since v1.0.0 2020-05-20 + */ +@Data +public class SpecialUserMonthlySubsidyFormDTO implements Serializable { + private static final long serialVersionUID = 2379520294973498819L; + + /** + * 页码 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 1, message = "页容量必须大于0") + private Integer pageSize; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSpecialUserErrorResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSpecialUserErrorResultDTO.java new file mode 100644 index 00000000..99002e8a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcSpecialUserErrorResultDTO.java @@ -0,0 +1,26 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author: songyunpeng + * @Date: 2020/7/4 17:066 + * @Description: 批量导入特殊人群错误反馈 + */ +@Data +public class EpdcSpecialUserErrorResultDTO implements Serializable { + + private static final long serialVersionUID = 5643743407138967806L; + + /** + * 错误数据行数 + */ + private String erroLine; + + /** + * 错误数据信息 + */ + private String errorInfo; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/SpecialPopulationDistributionResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/SpecialPopulationDistributionResultDTO.java new file mode 100644 index 00000000..1686e5a0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/SpecialPopulationDistributionResultDTO.java @@ -0,0 +1,50 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 特殊人群分布结果 + * + * @author songyunpeng + * @since v1.0.0 2020-05-20 + */ +@Data +public class SpecialPopulationDistributionResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 总人数 + */ + private Integer total; + + /** + * 20岁以下人数 + */ + private Integer ageLevel1; + + /** + * 20-30岁人数 + */ + private Integer ageLevel2; + + /** + * 30-40岁人数 + */ + private Integer ageLevel3; + + /** + * 40-50岁人数 + */ + private Integer ageLevel4; + + /** + * 50岁以上人数 + */ + private Integer ageLevel5; + + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/SpecialUserDisabilityTypeResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/SpecialUserDisabilityTypeResultDTO.java new file mode 100644 index 00000000..21993016 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/SpecialUserDisabilityTypeResultDTO.java @@ -0,0 +1,26 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 残疾类别分布接口参数 + * + * @author songyunpeng + * @since v1.0.0 2020-05-20 + */ +@Data +public class SpecialUserDisabilityTypeResultDTO implements Serializable { + private static final long serialVersionUID = 2379520294973498819L; + + /** + * 残疾类别及等级 + */ + private String suDisabilityType; + + /** + * 人数 + */ + private Integer userTotal; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/SpecialUserMonthlySubsidyResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/SpecialUserMonthlySubsidyResultDTO.java new file mode 100644 index 00000000..b2a491ca --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/SpecialUserMonthlySubsidyResultDTO.java @@ -0,0 +1,32 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 月度补贴情况接口参数 + * + * @author songyunpeng + * @since v1.0.0 2020-05-20 + */ +@Data +public class SpecialUserMonthlySubsidyResultDTO implements Serializable { + private static final long serialVersionUID = 2379520294973498819L; + + /** + * 村庄 + */ + private Integer suVillage; + + /** + * 人数 + */ + private Integer userTotal; + + /** + * 补贴金额 + */ + private BigDecimal subsidyMoney; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/SpecialUserResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/SpecialUserResultDTO.java new file mode 100644 index 00000000..6109bc40 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/SpecialUserResultDTO.java @@ -0,0 +1,98 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 查询特殊人群结果 + * + * @author songyunpeng + * @since v1.0.0 2020-05-20 + */ +@Data +public class SpecialUserResultDTO implements Serializable { + private static final long serialVersionUID = 2379520294973498819L; + + /** + * ID 主键 + */ + private String suId; + + /** + * 所属村庄 + */ + private String suVillage; + + /** + * 姓名 + */ + private String suName; + + /** + * 出生日期 + */ + private Date suBirthday; + + /** + * 残疾证号 + */ + private String suDisabilityNumber; + + /** + * 残疾类别及等级 + */ + private String suDisabilityType; + + /** + * 是否低保 0:否1:是 + */ + private String suIsLow; + + /** + * 保障人口 + */ + private Integer suGuaranteedPopulation; + + /** + * 关系 + */ + private String suRelationship; + + /** + * 低保金额 + */ + private BigDecimal suLowMoney; + + /** + * 困难残疾人生活补贴 + */ + private BigDecimal suLivingSubsidy; + + /** + * 重度残疾人护理补贴 + */ + private BigDecimal suCareSubsidy; + + /** + * 经济困难老年人补贴 + */ + private BigDecimal suElderlySubsidy; + + /** + * 孤困儿童补贴 + */ + private BigDecimal suChildSubsidy; + + /** + * 分散五保补贴 + */ + private BigDecimal suFiveGuaranteesSubsidy; + + /** + * 是否贫困户 0:否1:是 + */ + private String suIsPoor; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/controller/EpdcScreenSpecialUserController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/controller/EpdcScreenSpecialUserController.java new file mode 100644 index 00000000..1e46a0e3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/controller/EpdcScreenSpecialUserController.java @@ -0,0 +1,89 @@ +package com.elink.esua.epdc.modules.specialuser.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.form.SpecialUserDisabilityTypeFormDTO; +import com.elink.esua.epdc.dto.form.SpecialUserFormDTO; +import com.elink.esua.epdc.dto.form.SpecialUserMonthlySubsidyFormDTO; +import com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO; +import com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO; +import com.elink.esua.epdc.dto.result.SpecialUserMonthlySubsidyResultDTO; +import com.elink.esua.epdc.dto.result.SpecialUserResultDTO; +import com.elink.esua.epdc.modules.specialuser.service.SpecialUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author songyunpeng + * @Description + * @create 2020-11-04 + */ +@RestController("screenSpecialUser") +public class EpdcScreenSpecialUserController { + + + @Autowired + private SpecialUserService specialUserService; + + + /** + * @Description 特殊人群分析-人群分布接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("selectMonthlySubsidy") + public Result selectPopulationDistribution(){ + return specialUserService.selectPopulationDistribution(); + } + /** + * @Description 特殊人群分析-查人接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @PostMapping("selectMonthlySubsidy") + public Result> selectPageSpecialUser(@RequestBody SpecialUserFormDTO dto){ + return specialUserService.selectPageSpecialUser(dto); + } + /** + * @Description 特殊人群分析-详情接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [suId] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("selectSpecialUserDetail/{suId}") + public Result selectSpecialUserDetail(@PathVariable String suId){ + return specialUserService.selectSpecialUserDetail(suId); + } + /** + * @Description 特殊人群分析-残疾类别分布接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserDisabilityTypeFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("selectDisabilityType") + public Result> selectDisabilityType(@RequestBody SpecialUserDisabilityTypeFormDTO dto){ + return specialUserService.selectDisabilityType(dto); + } + + /** + * @Description 特殊人群分析-月度补贴情况接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserDisabilityTypeFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("selectMonthlySubsidy") + public Result> selectMonthlySubsidy(@RequestBody SpecialUserMonthlySubsidyFormDTO dto){ + return specialUserService.selectMonthlySubsidy(dto); + } + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/controller/SpecialUserController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/controller/SpecialUserController.java new file mode 100644 index 00000000..c2d02b8d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/controller/SpecialUserController.java @@ -0,0 +1,135 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.specialuser.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.SpecialUserDTO; +import com.elink.esua.epdc.modules.specialuser.excel.SpecialUserExcel; +import com.elink.esua.epdc.modules.specialuser.service.SpecialUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URLEncoder; +import java.util.List; +import java.util.Map; + + +/** + * 特殊人群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@RestController +@RequestMapping("specialuser") +public class SpecialUserController { + + @Autowired + private SpecialUserService specialUserService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = specialUserService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + SpecialUserDTO data = specialUserService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody SpecialUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + specialUserService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody SpecialUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + specialUserService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + specialUserService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = specialUserService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, SpecialUserExcel.class); + } + /** + * @Description 批量导入 + * @Author songyunpeng + * @Date 2020/8/31 + * @Param [file] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("importExcel") + public Result importExcel(@RequestParam("file") MultipartFile file) { + return specialUserService.importSpecialUser(file); + } + + /** + * @Description 导出模板 + * @Author songyunpeng + * @Date 2020/8/27 + * @Param [params, response] + * @return void + **/ + @GetMapping("exportModule") + public void exportModule(HttpServletResponse res) throws Exception{ + //获取要下载的模板名称 + String fileName = "民政享受政策人员表 - 样表"; + //设置要下载的文件的名称 + res.setCharacterEncoding("UTF-8"); + res.setHeader("content-Type", "application/vnd.ms-excel"); + res.setHeader("Content-Disposition", + "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xlsx"); + //获取文件的路径 + InputStream input = this.getClass().getResourceAsStream("/excel/民政享受政策人员表 - 样表.xlsx"); + OutputStream out = res.getOutputStream(); + byte[] b = new byte[2048]; + int len; + while ((len = input.read(b)) != -1) { + out.write(b, 0, len); + } + input.close(); + } +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/dao/SpecialUserDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/dao/SpecialUserDao.java new file mode 100644 index 00000000..2f7a41ce --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/dao/SpecialUserDao.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.specialuser.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.form.SpecialUserDisabilityTypeFormDTO; +import com.elink.esua.epdc.dto.form.SpecialUserFormDTO; +import com.elink.esua.epdc.dto.form.SpecialUserMonthlySubsidyFormDTO; +import com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO; +import com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO; +import com.elink.esua.epdc.dto.result.SpecialUserMonthlySubsidyResultDTO; +import com.elink.esua.epdc.dto.result.SpecialUserResultDTO; +import com.elink.esua.epdc.modules.specialuser.entity.SpecialUserEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 特殊人群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@Mapper +public interface SpecialUserDao extends BaseDao { + /** + * @Description 特殊人群分析-人群分布接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [] + * @return com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO + **/ + SpecialPopulationDistributionResultDTO selectPopulationDistribution(); + /** + * @Description 特殊人群分析-查人接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserFormDTO] + * @return java.util.List + **/ + List selectPageSpecialUser(SpecialUserFormDTO specialUserFormDTO); + /** + * @Description 特殊人群分析-查人接口count + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserFormDTO] + * @return long + **/ + long selectCountSpecialUser(SpecialUserFormDTO specialUserFormDTO); + /** + * @Description 特殊人群分析-残疾类别分布接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserDisabilityTypeFormDTO] + * @return java.util.List + **/ + List selectDisabilityType(SpecialUserDisabilityTypeFormDTO specialUserDisabilityTypeFormDTO); + /** + * @Description 特殊人群分析-残疾类别分布接口 count + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserDisabilityTypeFormDTO] + * @return java.util.List + **/ + long selectCountDisabilityType(SpecialUserDisabilityTypeFormDTO specialUserDisabilityTypeFormDTO); + /** + * @Description 特殊人群分析-月度补贴情况接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [dto] + * @return java.util.List + **/ + List selectMonthlySubsidy(SpecialUserMonthlySubsidyFormDTO dto); + /** + * @Description 特殊人群分析-月度补贴情况接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [dto] + * @return java.util.List + **/ + Long selectCountMonthlySubsidy(SpecialUserMonthlySubsidyFormDTO dto); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/entity/SpecialUserEntity.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/entity/SpecialUserEntity.java new file mode 100644 index 00000000..ffe93c31 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/entity/SpecialUserEntity.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.specialuser.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 特殊人群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_special_user") +public class SpecialUserEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 所属村庄 + */ + private String suVillage; + + /** + * 姓名 + */ + private String suName; + + /** + * 出生日期 + */ + private Date suBirthday; + + /** + * 残疾证号 + */ + private String suDisabilityNumber; + + /** + * 残疾类别及等级 + */ + private String suDisabilityType; + + /** + * 是否低保 0:否1:是 + */ + private String suIsLow; + + /** + * 保障人口 + */ + private Integer suGuaranteedPopulation; + + /** + * 关系 + */ + private String suRelationship; + + /** + * 低保金额 + */ + private BigDecimal suLowMoney; + + /** + * 困难残疾人生活补贴 + */ + private BigDecimal suLivingSubsidy; + + /** + * 重度残疾人护理补贴 + */ + private BigDecimal suCareSubsidy; + + /** + * 经济困难老年人补贴 + */ + private BigDecimal suElderlySubsidy; + + /** + * 孤困儿童补贴 + */ + private BigDecimal suChildSubsidy; + + /** + * 分散五保补贴 + */ + private BigDecimal suFiveGuaranteesSubsidy; + + /** + * 是否贫困户 0:否1:是 + */ + private String suIsPoor; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/excel/SpecialUserExcel.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/excel/SpecialUserExcel.java new file mode 100644 index 00000000..5acd3c2f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/excel/SpecialUserExcel.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.specialuser.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 特殊人群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@Data +public class SpecialUserExcel { + + @Excel(name = "所属村庄") + private String suVillage; + + @Excel(name = "姓名") + private String suName; + + @Excel(name = "出生日期") + private String suBirthday; + + @Excel(name = "残疾证号") + private String suDisabilityNumber; + + @Excel(name = "残疾类别及等级") + private String suDisabilityType; + + @Excel(name = "是否低保",replace = {"否_0","是_1"}) + private String suIsLow; + + @Excel(name = "保障人口") + private Integer suGuaranteedPopulation; + + @Excel(name = "关系") + private String suRelationship; + + @Excel(name = "低保金额") + private BigDecimal suLowMoney; + + @Excel(name = "困难残疾人生活补贴") + private BigDecimal suLivingSubsidy; + + @Excel(name = "重度残疾人护理补贴") + private BigDecimal suCareSubsidy; + + @Excel(name = "经济困难老年人补贴") + private BigDecimal suElderlySubsidy; + + @Excel(name = "孤困儿童补贴") + private BigDecimal suChildSubsidy; + + @Excel(name = "分散五保补贴") + private BigDecimal suFiveGuaranteesSubsidy; + + @Excel(name = "是否贫困户",replace = {"否_0","是_1"}) + private String suIsPoor; +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/service/SpecialUserService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/service/SpecialUserService.java new file mode 100644 index 00000000..fda532b7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/service/SpecialUserService.java @@ -0,0 +1,152 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.specialuser.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.SpecialUserDTO; +import com.elink.esua.epdc.dto.form.SpecialUserDisabilityTypeFormDTO; +import com.elink.esua.epdc.dto.form.SpecialUserFormDTO; +import com.elink.esua.epdc.dto.form.SpecialUserMonthlySubsidyFormDTO; +import com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO; +import com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO; +import com.elink.esua.epdc.dto.result.SpecialUserMonthlySubsidyResultDTO; +import com.elink.esua.epdc.dto.result.SpecialUserResultDTO; +import com.elink.esua.epdc.modules.specialuser.entity.SpecialUserEntity; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; + +/** + * 特殊人群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +public interface SpecialUserService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-11-03 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-11-03 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return SpecialUserDTO + * @author generator + * @date 2020-11-03 + */ + SpecialUserDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-03 + */ + void save(SpecialUserDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-03 + */ + void update(SpecialUserDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-11-03 + */ + void delete(String[] ids); + /** + * @Description 批量导入 + * @Author songyunpeng + * @Date 2020/11/3 + * @Param [file] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result importSpecialUser(MultipartFile file); + /** + * @Description 特殊人群分析-人群分布接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result selectPopulationDistribution(); + /** + * @Description 特殊人群分析-查人接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @param specialUserFormDTO*/ + Result> selectPageSpecialUser(SpecialUserFormDTO specialUserFormDTO); + /** + * @Description 特殊人群分析-详情接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [suId] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result selectSpecialUserDetail(String suId); + /** + * @Description 特殊人群分析-残疾类别分布接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [specialUserDisabilityTypeFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result> selectDisabilityType(SpecialUserDisabilityTypeFormDTO specialUserDisabilityTypeFormDTO); + /** + * @Description 特殊人群分析-月度补贴情况接口 + * @Author songyunpeng + * @Date 2020/11/4 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + Result> selectMonthlySubsidy(SpecialUserMonthlySubsidyFormDTO dto); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/service/impl/SpecialUserServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/service/impl/SpecialUserServiceImpl.java new file mode 100644 index 00000000..b8945fc0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/specialuser/service/impl/SpecialUserServiceImpl.java @@ -0,0 +1,222 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.specialuser.service.impl; + +import cn.afterturn.easypoi.excel.ExcelImportUtil; +import cn.afterturn.easypoi.excel.entity.ImportParams; +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.config.StreamUtils; +import com.elink.esua.epdc.dto.SpecialUserDTO; +import com.elink.esua.epdc.dto.form.SpecialUserDisabilityTypeFormDTO; +import com.elink.esua.epdc.dto.form.SpecialUserFormDTO; +import com.elink.esua.epdc.dto.form.SpecialUserMonthlySubsidyFormDTO; +import com.elink.esua.epdc.dto.result.*; +import com.elink.esua.epdc.modules.specialuser.dao.SpecialUserDao; +import com.elink.esua.epdc.modules.specialuser.entity.SpecialUserEntity; +import com.elink.esua.epdc.modules.specialuser.excel.SpecialUserExcel; +import com.elink.esua.epdc.modules.specialuser.service.SpecialUserService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * 特殊人群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@Service +public class SpecialUserServiceImpl extends BaseServiceImpl implements SpecialUserService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, SpecialUserDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SpecialUserDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + String suVillage = (String)params.get("suVillage"); + String suName = (String)params.get("suName"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.like(StringUtils.isNotBlank(suVillage), "SU_VILLAGE", suVillage); + wrapper.like(StringUtils.isNotBlank(suName), "SU_NAME", suName); + return wrapper; + } + + @Override + public SpecialUserDTO get(String id) { + SpecialUserEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, SpecialUserDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SpecialUserDTO dto) { + SpecialUserEntity entity = ConvertUtils.sourceToTarget(dto, SpecialUserEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SpecialUserDTO dto) { + SpecialUserEntity entity = ConvertUtils.sourceToTarget(dto, SpecialUserEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result importSpecialUser(MultipartFile file) { + File f = StreamUtils.conversionFile(file); + ImportParams importParams = new ImportParams(); + try { + List archivesExcelList = ExcelImportUtil.importExcel(f, SpecialUserExcel.class, importParams); + // 校验数据 + List epdcArchivesErrorResultDTOS = this.checkExcel(archivesExcelList); + if (epdcArchivesErrorResultDTOS.size() > 0) { + return new Result().ok(epdcArchivesErrorResultDTOS); + } + saveList(archivesExcelList); + for (SpecialUserExcel archivesExcel : archivesExcelList) { + System.out.println("从Excel导入数据到数据库的详细为 :{}" + JSON.toJSONString(archivesExcel)); + } + System.out.println("从Excel导入数据一共 {} 行 " + archivesExcelList.size()); + } catch (Exception e1) { + throw new RuntimeException("导入失败:{}" + e1.getMessage()); + } + return new Result(); + } + + @Override + public Result selectPopulationDistribution() { + return new Result().ok(baseDao.selectPopulationDistribution()); + } + + @Override + public Result> selectPageSpecialUser(SpecialUserFormDTO specialUserFormDTO) { + int pageIndex = (specialUserFormDTO.getPageIndex() - NumConstant.ONE) * specialUserFormDTO.getPageSize(); + specialUserFormDTO.setPageIndex(pageIndex); + List list = baseDao.selectPageSpecialUser(specialUserFormDTO); + PageData pageData = new PageData<>(list, baseDao.selectCountSpecialUser(specialUserFormDTO)); + return new Result>().ok(pageData); + } + + @Override + public Result selectSpecialUserDetail(String suId) { + SpecialUserEntity specialUserEntity = selectById(suId); + return new Result().ok(ConvertUtils.sourceToTarget(specialUserEntity,SpecialUserResultDTO.class)); + } + + @Override + public Result> selectDisabilityType(SpecialUserDisabilityTypeFormDTO specialUserDisabilityTypeFormDTO) { + int pageIndex = (specialUserDisabilityTypeFormDTO.getPageIndex() - NumConstant.ONE) * specialUserDisabilityTypeFormDTO.getPageSize(); + specialUserDisabilityTypeFormDTO.setPageIndex(pageIndex); + List list = baseDao.selectDisabilityType(specialUserDisabilityTypeFormDTO); + PageData pageData = new PageData<>(list, baseDao.selectCountDisabilityType(specialUserDisabilityTypeFormDTO)); + return new Result>().ok(pageData); + } + + @Override + public Result> selectMonthlySubsidy(SpecialUserMonthlySubsidyFormDTO dto) { + int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); + dto.setPageIndex(pageIndex); + List list = baseDao.selectMonthlySubsidy(dto); + PageData pageData = new PageData<>(list, baseDao.selectCountMonthlySubsidy(dto)); + return new Result>().ok(pageData); + } + + /*** + * 校验excel表格数据 + * @return java.lang.String + * @author songyunpeng + * @date 2020/7/6 10:25 + */ + private List checkExcel(List specialUserExcels) { + List errorLineinfoList = new ArrayList<>(); + EpdcSpecialUserErrorResultDTO errorLineinfoDto; + for (int i = 0; i < specialUserExcels.size(); i++) { + SpecialUserExcel specialUserExcel = specialUserExcels.get(i); + //档号 + String suBirthday = specialUserExcel.getSuBirthday(); + if (StringUtils.isNotBlank(suBirthday)) { + String eL = "(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})(((0[13578]|1[02])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9]|[12][0-9]|30))|(02(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))0229)"; + Pattern pat = Pattern.compile(eL); + Matcher matcher = pat.matcher(suBirthday); + boolean boo = matcher.matches(); + if(!boo){ + errorLineinfoDto = new EpdcSpecialUserErrorResultDTO(); + errorLineinfoDto.setErroLine((i + 2) + ""); + errorLineinfoDto.setErrorInfo("请检查出生日期格式,例:2021228"); + errorLineinfoList.add(errorLineinfoDto); + } + } + } + return errorLineinfoList; + } + /*** + * 批量添加 + * @return java.lang.String + * @author songyunpeng + * @date 2020/7/6 10:25 + */ + private void saveList(List partyList) { + List specialUserExcels = new ArrayList<>(); + for (SpecialUserExcel archivesExcel : partyList) { + SpecialUserEntity archivesEntity = ConvertUtils.sourceToTarget(archivesExcel, SpecialUserEntity.class); + archivesEntity.setSuBirthday(DateUtil.parse(archivesExcel.getSuBirthday())); + specialUserExcels.add(archivesEntity); + } + insertBatch(specialUserExcels); + } +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/excel/民政享受政策人员表 - 样表.xlsx b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/excel/民政享受政策人员表 - 样表.xlsx new file mode 100644 index 00000000..b9f6c3ba Binary files /dev/null and b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/excel/民政享受政策人员表 - 样表.xlsx differ diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/SpecialUserDao.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/SpecialUserDao.xml new file mode 100644 index 00000000..2103aa22 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/SpecialUserDao.xml @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file