From 8595a1d68884c84f05a4209441d07f3ec8098985 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 16 Mar 2021 12:47:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=AE=81=E6=95=B0=E6=8D=AE=E9=87=87?= =?UTF-8?q?=E9=9B=86=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/screencoll/ScreenCollFormDTO.java | 35 ++++++- .../AnCommunityProjectProfileFormDTO.java | 10 ++ .../AnGrassRootsGovernMonthlyFormDTO.java | 17 +++- .../form/AnGrassRootsOrgMonthlyFormDTO.java | 13 +++ .../form/AnGrassRootsPmRankFormDTO.java | 19 +++- .../AnGrassRootsPmTotalMonthlyFormDTO.java | 13 +++ .../controller/AnScreenCollController.java | 94 +++++++++++++------ .../screen/AnScreenCollService.java | 10 +- .../screen/impl/AnScreenCollServiceImpl.java | 70 ++++++-------- 9 files changed, 205 insertions(+), 76 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java index fa3e97d11d..16ab5fee7d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java @@ -1,8 +1,12 @@ package com.epmet.dto.screencoll; import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.Valid; +import javax.validation.constraints.*; import java.io.Serializable; import java.util.List; @@ -14,21 +18,47 @@ import java.util.List; */ @Data public class ScreenCollFormDTO implements Serializable { - private static final long serialVersionUID = 4605543711669000348L; + + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface IsFirstShowGroup extends CustomerClientShowGroup { + } + + public interface DateIdShowGroup extends CustomerClientShowGroup { + } + + public interface MonthIdShowGroup extends CustomerClientShowGroup { + } + + public interface CustomerIdShowGroup extends CustomerClientShowGroup { + } + + public interface DataListShowGroup extends CustomerClientShowGroup { + + } + /** * 当为true时后台将先删除当前维度的数据,后新增 */ + @NotNull(message = "isFirst不能为空", groups = IsFirstShowGroup.class) private Boolean isFirst; /** * 日期Id, 数据更新至:yyyyMMdd */ + @NotBlank(message = "dateId不能为空;", groups = DateIdShowGroup.class) + @Length(min = 8, max = 8, message = "dateId不能为空,格式应为yyyyMMdd;", groups = {DateIdShowGroup.class}) private String dateId; /** * yyyyMM */ + @NotBlank(message = "monthId不能为空,格式yyyyMM;", groups = MonthIdShowGroup.class) + @Length(min = 6, max = 6, message = "monthId不能为空,格式应为yyyyMM;", groups = {MonthIdShowGroup.class}) private String monthId; /** @@ -39,6 +69,8 @@ public class ScreenCollFormDTO implements Serializable { /** * 数据集合 */ + @Valid + @NotEmpty(message = "dataList不能为空", groups = DataListShowGroup.class) private List dataList; @Override @@ -49,5 +81,6 @@ public class ScreenCollFormDTO implements Serializable { /** * 当前客户id */ + @NotBlank(message = "customerId不能为空;", groups = CustomerIdShowGroup.class) private String customerId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java index d81ae5cf9e..0d52614cfd 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -14,23 +17,30 @@ import java.io.Serializable; public class AnCommunityProjectProfileFormDTO implements Serializable { private static final long serialVersionUID = 1466172677051250092L; + public interface DefaultShowGroup extends CustomerClientShowGroup { + } + /** * 数据更新至: yyyy|yyyyMM|yyyyMMdd,项目根据实际情况赋值 */ + @NotBlank(message = "dataEndTime不能为空;", groups = DefaultShowGroup.class) private String dataEndTime; /** * 社区id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 项目数 */ + @NotNull(message = "projectTotal不能为空;", groups = DefaultShowGroup.class) private Integer projectTotal; /** * 等级 */ + @NotBlank(message = "level不能为空;", groups = DefaultShowGroup.class) private String level; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java index adcb9f63b2..ff3727625b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.math.BigDecimal; @@ -12,51 +15,63 @@ import java.math.BigDecimal; * @since v1.0.0 2020-10-09 */ @Data -public class AnGrassRootsGovernMonthlyFormDTO implements Serializable { +public class AnGrassRootsGovernMonthlyFormDTO implements Serializable { private static final long serialVersionUID = -6947401956711903753L; + public interface DefaultShowGroup extends CustomerClientShowGroup { + } + /** * 网格,街道或社区id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 网格,街道名称或者社区名称 */ + @NotBlank(message = "orgName不能为空;", groups = DefaultShowGroup.class) private String orgName; /** * 网格:grid;组织:agency */ + @NotBlank(message = "orgType不能为空,网格:grid;组织:agency;", groups = DefaultShowGroup.class) private String orgType; /** * org_id的上一级id */ + @NotBlank(message = "pid不能为空;", groups = DefaultShowGroup.class) private String pid; /** * 参与项目数 */ + @NotNull(message = "partiProjectTotal不能为空;", groups = DefaultShowGroup.class) private Integer partiProjectTotal; /** * 办结项目数 */ + @NotNull(message = "closedProjectTotal不能为空;", groups = DefaultShowGroup.class) private Integer closedProjectTotal; /** * 项目响应度 存储的是%前面的数 */ + @NotNull(message = "projectResponseRatio不能为空;", groups = DefaultShowGroup.class) private BigDecimal projectResponseRatio; /** * 项目满意率,存储的是%前面的数 */ + @NotNull(message = "projectSatisRatio不能为空;", groups = DefaultShowGroup.class) private BigDecimal projectSatisRatio; /** * 办结率 for 社区 */ + @NotNull(message = "closedProjectRatio不能为空;", groups = DefaultShowGroup.class) private BigDecimal closedProjectRatio; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java index 70242f1ad3..5ca82e599e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -13,39 +16,49 @@ import java.io.Serializable; @Data public class AnGrassRootsOrgMonthlyFormDTO implements Serializable { private static final long serialVersionUID = -7389300512268641307L; + + public interface DefaultShowGroup extends CustomerClientShowGroup {} + /** * 网格id或者组织(街道或社区)id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 组织名称OR网格名称 */ + @NotBlank(message = "orgName不能为空;", groups = DefaultShowGroup.class) private String orgName; /** * 网格:grid; 组织:agency */ + @NotBlank(message = "orgType不能为空;", groups = DefaultShowGroup.class) private String orgType; /** * org_id的上一级id */ + @NotBlank(message = "pid不能为空;", groups = DefaultShowGroup.class) private String pid; /** * 党群数 */ + @NotNull(message = "groupTotal不能为空;", groups = DefaultShowGroup.class) private Integer groupTotal; /** * 议题数 */ + @NotNull(message = "issueTotal不能为空;", groups = DefaultShowGroup.class) private Integer issueTotal; /** * 项目数 */ + @NotNull(message = "projectTotal不能为空;", groups = DefaultShowGroup.class) private Integer projectTotal; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java index b889e54661..c558760bf4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java @@ -1,7 +1,11 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -13,60 +17,73 @@ import java.io.Serializable; @Data public class AnGrassRootsPmRankFormDTO implements Serializable { private static final long serialVersionUID = 3642729389245262928L; + public interface DefaultShowGroup extends CustomerClientShowGroup {} /** - * 月份Id + * 月份Id */ + @NotBlank(message = "monthId不能为空;", groups = DefaultShowGroup.class) + @Length(min = 6, max = 6, message = "monthId不能为空,格式应为yyyyMM;", groups = {DefaultShowGroup.class}) private String monthId; /** * 用户id */ + @NotBlank(message = "userId不能为空;", groups = DefaultShowGroup.class) private String userId; /** * 姓名 */ + @NotBlank(message = "userName不能为空;", groups = DefaultShowGroup.class) private String userName; /** * 所属支部id */ + @NotBlank(message = "branchId不能为空;", groups = DefaultShowGroup.class) private String branchId; /** * 所属支部名称 */ + @NotBlank(message = "branchName不能为空;", groups = DefaultShowGroup.class) private String branchName; /** * 所属社区id */ + @NotBlank(message = "communityId不能为空;", groups = DefaultShowGroup.class) private String communityId; /** * 所属社区名称 */ + @NotBlank(message = "communityName不能为空;", groups = DefaultShowGroup.class) private String communityName; /** * 群成员数 */ + @NotNull(message = "groupMemberTotal不能为空;",groups =DefaultShowGroup.class ) private Integer groupMemberTotal; /** * 话题数 */ + @NotNull(message = "topicTotal不能为空;",groups =DefaultShowGroup.class ) private Integer topicTotal; /** * 参与人次 */ + @NotNull(message = "partiUserTotal不能为空;",groups =DefaultShowGroup.class ) private Integer partiUserTotal; /** * 议题数 */ + @NotNull(message = "issueTotal不能为空;",groups =DefaultShowGroup.class ) private Integer issueTotal; /** diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java index 4adb2ee168..1f1bcb4315 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -14,44 +17,54 @@ import java.io.Serializable; public class AnGrassRootsPmTotalMonthlyFormDTO implements Serializable { private static final long serialVersionUID = 8675347783888892404L; + public interface DefaultShowGroup extends CustomerClientShowGroup {} + /** * 网格id或者组织(街道或社区)id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 组织名称OR网格名称 */ + @NotBlank(message = "orgName不能为空;", groups = DefaultShowGroup.class) private String orgName; /** * 网格:grid;组织:agency */ + @NotBlank(message = "orgType不能为空;", groups = DefaultShowGroup.class) private String orgType; /** * org_id的上一级id */ + @NotBlank(message = "pid不能为空;", groups = DefaultShowGroup.class) private String pid; /** * 群成员数 */ + @NotNull(message = "groupMemberTotal不能为空;", groups = DefaultShowGroup.class) private Integer groupMemberTotal; /** * 话题数 */ + @NotNull(message = "topicTotal不能为空;", groups = DefaultShowGroup.class) private Integer topicTotal; /** * 话题参与人次 */ + @NotNull(message = "topicPartiUserTotal不能为空;", groups = DefaultShowGroup.class) private Integer topicPartiUserTotal; /** * 议题数 */ + @NotNull(message = "issueTotal不能为空;", groups = DefaultShowGroup.class) private Integer issueTotal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java index 0766df597b..5b862b66ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java @@ -1,11 +1,10 @@ package com.epmet.controller; -import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.AnScreenCollService; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -23,79 +22,116 @@ public class AnScreenCollController { private AnScreenCollService screenCollService; /** - * @Description 安宁大屏数据采集 - 基层党员-各类总数 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层党员-各类总数 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494 * @author wangc * @date 2020.10.09 17:20 */ @PostMapping("pmtotal") - public Result pmTotal(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.pmTotal(formDTO,customerId); + public Result pmTotal(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsPmTotalMonthlyFormDTO.DefaultShowGroup.class); + }); + screenCollService.pmTotal(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 按月 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483 * @author wangc * @date 2020.10.09 17:19 */ @PostMapping("pmrank") - public Result pmRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if (StringUtils.isBlank(formDTO.getMonthId())){ - throw new ValidateException("月份Id不能为空"); - } - screenCollService.pmRank(formDTO,customerId); + public Result pmRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsPmRankFormDTO.DefaultShowGroup.class); + }); + screenCollService.pmRank(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329498 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329498 * @author wangc * @date 2020.10.09 17:22 */ @PostMapping("grassrootsorg") - public Result grassrootsOrg(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.grassrootsOrg(formDTO,customerId); + public Result grassrootsOrg(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsOrgMonthlyFormDTO.DefaultShowGroup.class); + }); + screenCollService.grassrootsOrg(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 基层治理-各类数 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329499 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层治理-各类数 按月 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329499 * @author wangc * @date 2020.10.09 17:23 */ @PostMapping("grassrootsgovern") - public Result grassrootsGovern(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.grassrootsGovern(formDTO,customerId); + public Result grassrootsGovern(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsGovernMonthlyFormDTO.DefaultShowGroup.class); + }); + screenCollService.grassrootsGovern(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 中央区-项目概要 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 中央区-项目概要 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502 * @author wangc * @date 2020.10.09 16:41 */ @PostMapping("projectfile") - public Result projectFile(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.communityProjectProfile(formDTO,customerId); + public Result projectFile(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnCommunityProjectProfileFormDTO.DefaultShowGroup.class); + }); + screenCollService.communityProjectProfile(formDTO); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java index 15a9d72a35..a347d5286d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java @@ -17,7 +17,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 16:41 */ - void communityProjectProfile(ScreenCollFormDTO formDTO,String customerId); + void communityProjectProfile(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 @@ -27,7 +27,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:19 */ - void pmRank(ScreenCollFormDTO formDTO,String customerId); + void pmRank(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层党员-各类总数 @@ -37,7 +37,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:20 */ - void pmTotal(ScreenCollFormDTO formDTO,String customerId); + void pmTotal(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 @@ -46,7 +46,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:22 */ - void grassrootsOrg(ScreenCollFormDTO formDTO,String customerId); + void grassrootsOrg(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层治理-各类数 @@ -55,5 +55,5 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:23 */ - void grassrootsGovern(ScreenCollFormDTO formDTO,String customerId); + void grassrootsGovern(ScreenCollFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java index e5229f146b..30adab1c63 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java @@ -4,11 +4,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; -import com.epmet.dao.evaluationindex.screen.ScreenAnCommunityProjectProfileDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsGovernMonthlyDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsOrgMonthlyDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmRankDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmTotalMonthlyDao; +import com.epmet.dao.evaluationindex.screen.*; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.AnScreenCollService; @@ -17,10 +13,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - - -import java.util.List; /** @@ -56,17 +48,17 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void communityProjectProfile(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void communityProjectProfile(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = communityProjectProfileDao.deleteBatch(customerId); + int affectRows = communityProjectProfileDao.deleteBatch(formDTO.getCustomerId()); while(affectRows >= NumConstant.ONE){ - affectRows = communityProjectProfileDao.deleteBatch(customerId); + affectRows = communityProjectProfileDao.deleteBatch(formDTO.getCustomerId()); } } Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { - communityProjectProfileDao.insertBatch(list,customerId); + communityProjectProfileDao.insertBatch(list,formDTO.getCustomerId()); }); } @@ -81,17 +73,17 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void pmRank(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void pmRank(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = pmRankDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = pmRankDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = pmRankDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = pmRankDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { - pmRankDao.insertBatch(list,customerId); + pmRankDao.insertBatch(list,formDTO.getCustomerId()); }); } @@ -105,21 +97,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void pmTotal(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void pmTotal(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = pmTotalMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = pmTotalMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { pmTotalMonthlyDao.insertBatch(list, - customerId, + formDTO.getCustomerId(), formDTO.getMonthId(), quarterId, yearId); @@ -136,21 +128,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void grassrootsOrg(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void grassrootsOrg(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = orgMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = orgMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { orgMonthlyDao.insertBatch(list, - customerId, + formDTO.getCustomerId(), formDTO.getMonthId(), quarterId, yearId); @@ -167,21 +159,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void grassrootsGovern(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void grassrootsGovern(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = governMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = governMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { governMonthlyDao.insertBatch(list, - customerId, + formDTO.getCustomerId(), formDTO.getMonthId(), quarterId, yearId);