diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index 49dbbb94d5..76cfc7865d 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/epmet-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://192.168.1.130:3306/epmet_evaluation_index?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://192.168.1.130:3306/epmet_data_statistical?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: epmet_dba password: EpmEt-dbA-UsEr #oracle配置 diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index b618bd54d1..a7a768b095 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -19,8 +19,11 @@ import org.joda.time.format.DateTimeFormatter; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.time.DateTimeException; import java.time.ZoneId; import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * 日期处理工具类 @@ -640,4 +643,42 @@ public class DateUtils { } return minusMonthId; } + + /** + * @Description 根据传入的时间维度判断格式,日、周、月、季、年 + * @param dimension + * @return + * @author wangc + * @date 2020.09.24 10:11 + **/ + public static String identifyTimeDimension(String dimension){ + //yyyyMMdd DATE_PATTERN_YYYYMMDD + //yyyyMM DATE_PATTERN_YYYYMM + //yyyy DATE_PATTERN_YYYY + //yyyyWcc + //yyyyQc + if(dimension.length() == NumConstant.EIGHT){ + + SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYYMMDD); + try{ df.parse(dimension); }catch (ParseException e){ return null; } + return "date"; + + }else if(dimension.length() == NumConstant.FOUR){ + SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYY); + try{df.parse(dimension);}catch (ParseException e){return null;} + return "year"; + }else if(dimension.length() == NumConstant.SEVEN){ + if(dimension.contains("W")){ + return "week"; + }else return null; + }else if(dimension.length() == NumConstant.SIX){ + if(dimension.contains("Q")){ + return "quarter"; + }else{ + SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYYMM); + try{df.parse(dimension);}catch (ParseException e){return null;} + return "month"; + } + }else return null; + } } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java index bdf6aa34c5..4db977d5b4 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java @@ -3,7 +3,6 @@ package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; -import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -15,19 +14,24 @@ import java.io.Serializable; public class AblityIndexFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; /** - * 查询月份的前12个月对应的monthId + * 组织或网格Id */ - private String startMonthId; + @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgId; /** * 组织Id */ @NotBlank(message = "客户ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) private String customerId; /** - * 组织Id + * 组织或网格类型 */ - @NotBlank(message = "组织ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) - private String agencyId; + @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 查询月份的前12个月对应的monthId + */ + private String startMonthId; /** * 月份Id(格式:202009) */ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java index f1c4221482..ab4a4696c6 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java @@ -14,15 +14,21 @@ import java.io.Serializable; public class AblityListFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; /** - * 组织Id + * 客户Id */ @NotBlank(message = "客户ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) private String customerId; /** - * 组织Id + * 组织或网格Id */ - @NotBlank(message = "组织ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) - private String agencyId; + @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 组织或网格类型 + */ + @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgType; + public interface AddUserInternalGroup {} /** * 月份Id(格式:202009) */ @@ -37,6 +43,5 @@ public class AblityListFormDTO implements Serializable { * 所有有权重的指标code拼接的字符串 冒号隔开 */ private String allParentIndexCode; - public interface AddUserInternalGroup {} } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthAblityListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthAblityListFormDTO.java index 365fdb2000..8289173d9e 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthAblityListFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthAblityListFormDTO.java @@ -14,15 +14,21 @@ import java.io.Serializable; public class MonthAblityListFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; /** - * 组织Id + * 客户Id */ @NotBlank(message = "客户ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) private String customerId; /** - * 组织Id + * 组织或网格Id */ - @NotBlank(message = "组织ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) - private String agencyId; + @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 组织或网格类型 + */ + @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgType; + public interface AddUserInternalGroup {} /** * 月份Id(格式:202009) */ @@ -37,7 +43,5 @@ public class MonthAblityListFormDTO implements Serializable { * 查询月份的前12个月对应的monthId */ private String startMonthId; - public interface AddUserInternalGroup {} - } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java index 3efeee665f..805495b293 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java @@ -13,21 +13,34 @@ import java.io.Serializable; @Data public class MonthScoreListFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgId; /** * 组织Id */ @NotBlank(message = "客户ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) private String customerId; /** - * 组织Id + * 组织或网格类型 */ - @NotBlank(message = "组织ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) - private String agencyId; + @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) + */ + private String indexCode; /** * 月份Id(格式:202009) */ @NotBlank(message = "月份ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) private String monthId; + /** + * 查询月份的前12个月对应的monthId + */ + private String startMonthId; public interface AddUserInternalGroup {} } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartIndexScroeRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartIndexScroeRankFormDTO.java new file mode 100644 index 0000000000..da2d919c2f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartIndexScroeRankFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 党员(指标得分)排行--接口入参 + * @Author sun + */ +@Data +public class PartIndexScroeRankFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {PartIndexScroeRankFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 类型(组织:agency 网格:grid) + */ + @NotBlank(message = "数据类型不能为空",groups = {PartIndexScroeRankFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 默认显示前5名 + */ + @Min(value = 1, message = "查询条数必须大于0", groups = {PartIndexScroeRankFormDTO.AddUserInternalGroup.class }) + private Integer topNum; + public interface AddUserInternalGroup {} + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java index 2d0b69bd2f..aff83eca85 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java @@ -15,15 +15,21 @@ import java.io.Serializable; public class PeerComparisonFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; /** - * 组织Id + * 客户Id */ @NotBlank(message = "客户ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) private String customerId; /** - * 组织Id + * 组织或网格Id */ - @NotBlank(message = "组织ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) - private String agencyId; + @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 组织或网格类型 + */ + @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgType; + public interface AddUserInternalGroup {} /** * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) */ @@ -34,6 +40,5 @@ public class PeerComparisonFormDTO implements Serializable { */ @Min(value = 1, message = "查询条数必须大于0", groups = {PeerComparisonFormDTO.AddUserInternalGroup.class }) private Integer pageSize; - public interface AddUserInternalGroup {} } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java index 97355373a3..42a67c936f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java @@ -3,7 +3,6 @@ package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; -import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -14,12 +13,12 @@ import java.io.Serializable; @Data public class RootAgencyFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; + public interface AddUserInternalGroup {} + /** * 组织Id */ @NotBlank(message = "组织ID不能为空",groups = {RootAgencyFormDTO.AddUserInternalGroup.class}) private String agencyId; - public interface AddUserInternalGroup {} - } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java index ea430fa0a7..5070202432 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java @@ -13,16 +13,22 @@ import java.io.Serializable; @Data public class ScoreListFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgId; /** * 组织Id */ @NotBlank(message = "客户ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) private String customerId; /** - * 组织Id + * 组织或网格类型 */ - @NotBlank(message = "组织ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) - private String agencyId; + @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgType; + public interface AddUserInternalGroup {} /** * 月份Id(格式:202009) */ @@ -33,6 +39,4 @@ public class ScoreListFormDTO implements Serializable { */ private String indexCode; - public interface AddUserInternalGroup {} - } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserPointRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserPointRankFormDTO.java new file mode 100644 index 0000000000..cc1ad2bd36 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserPointRankFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 热心市民积分排行列表--接口入参 + * @Author sun + */ +@Data +public class UserPointRankFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {UserPointRankFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 类型(组织:agency 网格:grid) + */ + @NotBlank(message = "数据类型不能为空",groups = {UserPointRankFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 默认显示前5名 + */ + @Min(value = 1, message = "查询条数必须大于0", groups = {UserPointRankFormDTO.AddUserInternalGroup.class }) + private Integer topNum; + public interface AddUserInternalGroup {} + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java index d50bcdc137..b93016bca3 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java @@ -29,14 +29,6 @@ public class AblityIndexResultDTO implements Serializable { * 能力总分 */ private Double indexTotal; - /** - * 本级能力分 - */ - private Double agencyScore; - /** - * 下级能力分 - */ - private Double subAgencyScore; /** * 横坐标(202009) */ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartIndexScroeRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartIndexScroeRankResultDTO.java new file mode 100644 index 0000000000..48472ad581 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartIndexScroeRankResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党员(指标得分)排行--接口返参 + * @Author sun + */ +@Data +public class PartIndexScroeRankResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 组织ID + */ + private String agencyId; + /** + * 组织名称 + */ + private String agencyName; + /** + * 用户Id + */ + private String userId; + /** + * 用户名称 + */ + private String userName; + /** + * 网格Id + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + /** + * 党员指标得分 + */ + private Integer indexScore; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java index 95e9545a8c..9a89c5daa8 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java @@ -14,13 +14,13 @@ public class PeerComparisonResultDTO implements Serializable { private static final long serialVersionUID = 3860268744336541373L; /** - * 组织Id + * 组织或网格Id */ - private String agencyId; + private String orgId; /** - * 组织名称 + * 组织或网格名称 */ - private String agencyName; + private String orgName; /** * 能力分值(保留一位小数) */ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointRankListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointRankListResultDTO.java new file mode 100644 index 0000000000..d2909faffd --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointRankListResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 热心市民积分排行列表--接口返参 + * @Author sun + */ +@Data +public class UserPointRankListResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 组织ID + */ + private String agencyId; + /** + * 组织名称 + */ + private String agencyName; + /** + * 用户Id + */ + private String userId; + /** + * 用户名称 + */ + private String userName; + /** + * 网格Id + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + /** + * 用户积分 + */ + private Integer pointTotal; + +} diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 5624cec102..4db52fbeeb 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -62,11 +62,11 @@ 0.3.1 - + com.epmet diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java index 529563feb2..70c5614f65 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java @@ -5,6 +5,14 @@ package com.epmet.datareport.constant; * @dscription 数据 */ public interface FactConstant { + /** + * 组织类型 + */ + String AGENCY = "agency"; + /** + * 网格类型 + */ + String GRID = "grid"; /** * 能力指标 */ @@ -33,4 +41,8 @@ public interface FactConstant { * 社区相关 */ String SHE_QU_XIANG_GUAN = "shequxiangguan"; + /** + * 网格相关 + */ + String WANG_GE_XIANG_GUAN = "wanggexiangguan"; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java index 4399756545..fbf0e78748 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java @@ -17,6 +17,7 @@ import java.util.List; /** * 数据改版api + * * @author sun */ @RestController @@ -28,77 +29,77 @@ public class FactIndexController { /** * @param tokenDTO - * @Description 能力指数 + * @Description 能力指数 * @author sun */ @PostMapping("index/ablityindex") - public Result> ablityIndex(@LoginUser TokenDto tokenDTO, @RequestBody AblityIndexFormDTO formDTO){ + public Result> ablityIndex(@LoginUser TokenDto tokenDTO, @RequestBody AblityIndexFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AblityIndexFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.ablityIndex(formDTO)); } /** * @param tokenDTO - * @Description 按月份查询各项能力分数 + * @Description 按月份查询各项能力分数 * @author sun */ @PostMapping("index/scorelist") - public Result> scoreList(@LoginUser TokenDto tokenDTO, @RequestBody ScoreListFormDTO formDTO){ + public Result> scoreList(@LoginUser TokenDto tokenDTO, @RequestBody ScoreListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ScoreListFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.scoreList(formDTO)); } /** * @param tokenDTO - * @Description 按月份查询各项能力最近12个月得分 + * @Description 按月份查询各项能力最近12个月得分 * @author sun */ @PostMapping("index/monthscorelist") - public Result> monthScoreList(@LoginUser TokenDto tokenDTO, @RequestBody MonthScoreListFormDTO formDTO){ + public Result> monthScoreList(@LoginUser TokenDto tokenDTO, @RequestBody MonthScoreListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, MonthScoreListFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.monthScoreList(formDTO)); } /** * @param tokenDTO - * @Description 按月查询各项指标数据 + * @Description 按月查询各项指标数据 * @author sun */ @PostMapping("index/ablitylist") - public Result> ablityList(@LoginUser TokenDto tokenDTO, @RequestBody AblityListFormDTO formDTO){ + public Result> ablityList(@LoginUser TokenDto tokenDTO, @RequestBody AblityListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AblityListFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.ablityList(formDTO)); } /** * @param tokenDTO - * @Description 按月查询各项指标最近12个月数据 + * @Description 按月查询各项指标最近12个月数据 * @author sun */ @PostMapping("index/monthablitylist") - public Result> monthAblityList(@LoginUser TokenDto tokenDTO, @RequestBody MonthAblityListFormDTO formDTO){ + public Result> monthAblityList(@LoginUser TokenDto tokenDTO, @RequestBody MonthAblityListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, MonthAblityListFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.monthAblityList(formDTO)); } /** * @param tokenDTO - * @Description 同级对比各项数据查询 + * @Description 同级对比各项数据查询 * @author sun */ @PostMapping("index/peercomparison") - public Result> peerComparison(@LoginUser TokenDto tokenDTO, @RequestBody PeerComparisonFormDTO formDTO){ + public Result> peerComparison(@LoginUser TokenDto tokenDTO, @RequestBody PeerComparisonFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, PeerComparisonFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.peerComparison(formDTO)); } /** * @param tokenDTO - * @Description 是否根组织 + * @Description 是否根组织 * @author sun */ @PostMapping("index/rootagency") - public Result rootAgency(@LoginUser TokenDto tokenDTO, @RequestBody RootAgencyFormDTO formDTO){ + public Result rootAgency(@LoginUser TokenDto tokenDTO, @RequestBody RootAgencyFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class); return new Result().ok(factIndexService.rootAgency(formDTO)); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java index 1828f19ac8..035dab63d9 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -1,21 +1,13 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; +import org.springframework.web.bind.annotation.*; /** * 组织相关api @@ -31,19 +23,14 @@ public class AgencyController { private AgencyService agencyService; /** - * @Description 1、组织机构树 * @param + * @Description 1、组织机构树 只返回 is_display = '1'的 * @author zxc * @date 2020/8/18 2:04 下午 */ - @ExternalAppRequestAuth @PostMapping("tree") - public Result tree(HttpServletRequest request, ExternalAppRequestParam externalAppRequestParam){ - String customerId = request.getHeader("CustomerId"); - if(StringUtils.isBlank(externalAppRequestParam.getCustomerId())){ - externalAppRequestParam.setCustomerId(customerId); - } - return new Result().ok(agencyService.tree(externalAppRequestParam)); + public Result tree(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(agencyService.tree(customerId)); } /** @@ -52,7 +39,6 @@ public class AgencyController { * @author zxc * @date 2020/8/18 2:33 下午 */ - @ExternalAppRequestAuth @PostMapping("compartment") public Result compartment(@RequestBody CompartmentFormDTO compartmentFormDTO){ ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentFormDTO.Compartment.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java index 30f0f82584..8c17f03238 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.DistributionService; @@ -33,7 +32,6 @@ public class DistributionController { * @author zxc * @date 2020/8/18 10:59 上午 */ - @ExternalAppRequestAuth @PostMapping("branch") public Result> branch(@RequestBody BranchFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, BranchFormDTO.Branch.class); @@ -46,7 +44,6 @@ public class DistributionController { * @author zxc * @date 2020/8/18 11:10 上午 */ - @ExternalAppRequestAuth @PostMapping("user") public Result user(@RequestBody UserFormDTO userFormDTO){ ValidatorUtils.validateEntity(userFormDTO, UserFormDTO.User.class); @@ -59,7 +56,6 @@ public class DistributionController { * @author zxc * @date 2020/8/18 11:20 上午 */ - @ExternalAppRequestAuth @PostMapping("parymember") public Result parymember(@RequestBody ParymemberFormDTO parymemberFormDTO){ ValidatorUtils.validateEntity(parymemberFormDTO, ParymemberFormDTO.Parymember.class); @@ -72,7 +68,6 @@ public class DistributionController { * @author zxc * @date 2020/8/19 1:29 下午 */ - @ExternalAppRequestAuth @PostMapping("project") public Result> project(@RequestBody ProjectFormDTO projectFormDTO){ ValidatorUtils.validateEntity(projectFormDTO, ProjectFormDTO.Project.class); @@ -85,7 +80,6 @@ public class DistributionController { * @author zxc * @date 2020/8/19 1:52 下午 */ - @ExternalAppRequestAuth @PostMapping("topprofile") public Result topProfile(@RequestBody TopProfileFormDTO topProfileFormDTO){ ValidatorUtils.validateEntity(topProfileFormDTO, TopProfileFormDTO.TopProfile.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java index 1ee85baeb4..4cec62dc66 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService; @@ -39,7 +38,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 11:16 **/ - @ExternalAppRequestAuth @PostMapping("userpointrank") public Result userPointRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); @@ -54,7 +52,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 13:55 **/ - @ExternalAppRequestAuth @PostMapping("difficultprojects") public Result> difficultProject(@RequestBody AgencyNumTypeParamFormDTO param){ ValidatorUtils.validateEntity(param, AgencyNumTypeParamFormDTO.AgencyNumTypeParamGroup.class); @@ -69,7 +66,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 14:37 **/ - @ExternalAppRequestAuth @PostMapping("publicpartiprofile") public Result publicPartiProfile(@RequestBody AgencyFormDTO param){ ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); @@ -84,7 +80,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 15:32 **/ - @ExternalAppRequestAuth @PostMapping("publicpartirank") public Result> publicPartiRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); @@ -99,7 +94,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 17:46 **/ - @ExternalAppRequestAuth @PostMapping("governcapacityrank") public Result> governCapacityRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java index db7c83089f..f7273b3da8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService; @@ -38,7 +37,6 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.18 16:59 **/ - @ExternalAppRequestAuth @PostMapping("basicinfo") public Result baseInfo(@RequestBody ParymemberFormDTO param){ ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); @@ -53,7 +51,6 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.18 17:54 **/ - @ExternalAppRequestAuth @PostMapping("ageinfo") public Result ageInfo(@RequestBody ParymemberFormDTO param){ ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); @@ -68,7 +65,6 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.19 11:02 **/ - @ExternalAppRequestAuth @PostMapping("branchbuildtrend") public Result branchBuildTrend(@RequestBody BranchBuildTrendFormDTO param){ ValidatorUtils.validateEntity(param, BranchBuildTrendFormDTO.branchBuildTrendGroup.class); @@ -83,7 +79,6 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.19 15:25 **/ - @ExternalAppRequestAuth @PostMapping("branchbuildrank") public Result branchBuildRank(@RequestBody BranchBuildRankFormDTO param){ ValidatorUtils.validateEntity(param, BranchBuildRankFormDTO.BranchBuildRankGroup.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index 162065563b..d3ece6a658 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -1,8 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.eum.OrgTypeEnum; @@ -10,10 +7,7 @@ import com.epmet.datareport.service.evaluationindex.screen.IndexService; import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -36,7 +30,6 @@ public class IndexController { * @author zxc * @date 2020/8/19 2:53 下午 */ - @ExternalAppRequestAuth @PostMapping("yearaverageindex") public Result yearAverageIndex(@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){ ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class); @@ -49,7 +42,6 @@ public class IndexController { * @author zxc * @date 2020/8/19 3:17 下午 */ - @ExternalAppRequestAuth @PostMapping("monthindexanalysis/piechart") public Result monthPieChart(@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){ ValidatorUtils.validateEntity(monthPieChartFormDTO, MonthPieChartFormDTO.MonthPieChart.class); @@ -62,7 +54,6 @@ public class IndexController { * @author zxc * @date 2020/8/19 5:27 下午 */ - @ExternalAppRequestAuth @PostMapping("monthindexanalysis/barchart") public Result monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO){ ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); @@ -75,7 +66,6 @@ public class IndexController { * @author zxc * @date 2020/8/20 10:02 上午 */ - @ExternalAppRequestAuth @PostMapping("subagencyindexrank") public Result> subAgencyIndexRank(@RequestBody SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO){ ValidatorUtils.validateEntity(subAgencyIndexRankFormDTO, SubAgencyIndexRankFormDTO.SubAgencyIndexRank.class); @@ -90,8 +80,6 @@ public class IndexController { * @Author zhangyong * @Date 13:39 2020-09-11 **/ - @InternalAppRequestAuth - @ExternalAppRequestAuth @PostMapping("dataclient/subagencyindexrank") public Result> getSubAgencyIndexRank(@RequestBody SubAgencyIndexRankYMFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, SubAgencyIndexRankYMFormDTO.SubAgencyIndexRank.class); @@ -104,10 +92,9 @@ public class IndexController { * @author jianjun.liu * @date 2020/8/20 10:02 上午 */ - @ExternalAppRequestAuth @PostMapping("gridindexrank") - public Result> gridIndexRank(ExternalAppRequestParam extParam, @RequestBody GridIndexRankFormDTO formDTO) { - formDTO.setCustomerId(extParam.getCustomerId()); + public Result> gridIndexRank(@RequestHeader("CustomerId") String customerId, @RequestBody GridIndexRankFormDTO formDTO) { + formDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(formDTO); formDTO.setOrgType(OrgTypeEnum.GRID.getCode()); return new Result>().ok(indexService.selectIndexRankByOrgType(formDTO)); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java index c56c3e8df8..855be093c1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java @@ -1,8 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.KcScreenService; @@ -17,10 +14,7 @@ import com.epmet.dto.result.issue.KcIssueSummary; import com.epmet.dto.result.issue.KcPartiTrendResultDTO; import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -39,47 +33,37 @@ public class KcScreenController { /** - * @param externalAppRequestParam * @Description 首页-平台各类总数 * @author sun */ - @ExternalAppRequestAuth @PostMapping("homepage/summary") - public Result homepageSummary(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.homepageSummary(externalAppRequestParam)); + public Result homepageSummary(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.homepageSummary(customerId)); } /** - * @param externalAppRequestParam * @Description 公益互助-各类总数汇总 * @author sun */ - @ExternalAppRequestAuth @PostMapping("heart/summary") - public Result heartSummary(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.heartSummary(externalAppRequestParam)); + public Result heartSummary(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.heartSummary(customerId)); } /** - * @param externalAppRequestParam * @Description 公益互助-公益活动次数 * @author sun */ - @ExternalAppRequestAuth @PostMapping("heart/actcounttrend") - public Result heartActcounttrend(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.heartActcounttrend(externalAppRequestParam)); + public Result heartActcounttrend(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.heartActcounttrend(customerId)); } /** * 议题分析-各类总数 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth - @InternalAppRequestAuth @PostMapping("issue/summary") - public Result getIssueSummary(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); + public Result getIssueSummary(@RequestHeader("CustomerId") String customerId) { //String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; KcIssueSummary issueSummary = kcScreenService.getIssueSummary(customerId); return new Result().ok(issueSummary); @@ -87,326 +71,247 @@ public class KcScreenController { /** * 参与趋势 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("issue/partitrend") - public Result getIssuePartiTrend(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + public Result getIssuePartiTrend(@RequestHeader("CustomerId") String customerId) { KcPartiTrendResultDTO trendResultDTO = kcScreenService.getIssuePartiTrend(customerId); return new Result().ok(trendResultDTO); } /** * 按照议题数量排名 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("issue/gridtotalrank") - public Result getIssueGridTotalRank(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + public Result getIssueGridTotalRank(@RequestHeader("CustomerId") String customerId) { return new Result().ok(kcScreenService.getIssueGridTotalRank(customerId)); } /** * 议题分析-审核效率排名 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("issue/avgaudittimerank") - public Result getAvgAuditTimeRank(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + public Result getAvgAuditTimeRank(@RequestHeader("CustomerId") String customerId) { return new Result().ok(kcScreenService.getAvgAuditTimeRank(customerId)); } /** * 议题分析-议题效率 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("issue/effective") - public Result getIssueEffective(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); + public Result getIssueEffective(@RequestHeader("CustomerId") String customerId) { //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; return new Result().ok(kcScreenService.getIssueEffective(customerId)); } /** - * @param externalAppRequestParam * @Description 公益互助-志愿者画像 * @author sun */ - @ExternalAppRequestAuth @PostMapping("heart/volunteerportrayal") - public Result heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.heartVolunteerportrayal(externalAppRequestParam)); + public Result heartVolunteerportrayal(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.heartVolunteerportrayal(customerId)); } /** - * @param externalAppRequestParam * @Description 公益互助-个人(志愿者)公益时长排名 * @author sun */ - @ExternalAppRequestAuth @PostMapping("heart/volunteerrank") - public Result> heartVolunteerrank(ExternalAppRequestParam externalAppRequestParam, @RequestBody HeartVolunteerrankFormDTO formDTO){ + public Result> heartVolunteerrank(@RequestHeader("CustomerId") String customerId, @RequestBody HeartVolunteerrankFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, HeartVolunteerrankFormDTO.AddUserInternalGroup.class); - formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + formDTO.setCustomerId(customerId); return new Result>().ok(kcScreenService.heartVolunteerrank(formDTO)); } /** - * @param externalAppRequestParam * @Description 邻里党群-各类总数 * @author sun */ - @ExternalAppRequestAuth @PostMapping("group/summary") - public Result groupSummary(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.groupSummary(externalAppRequestParam)); + public Result groupSummary(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.groupSummary(customerId)); } /** - * @param externalAppRequestParam * @Description 邻里党群-话题参与趋势 * @author sun */ - @ExternalAppRequestAuth @PostMapping("group/partitopictrend") - public Result groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.groupPartitopictrend(externalAppRequestParam)); + public Result groupPartitopictrend(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.groupPartitopictrend(customerId)); } /** - * @param externalAppRequestParam * @Description 邻里党群-社群数量排名 * @author sun */ - @ExternalAppRequestAuth @PostMapping("group/gridgroupcountrank") - public Result groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.groupGridgroupcountrank(externalAppRequestParam)); + public Result groupGridgroupcountrank(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.groupGridgroupcountrank(customerId)); } /** - * @param externalAppRequestParam * @Description 邻里党群-社群数量排名 * @author sun */ - @ExternalAppRequestAuth @PostMapping("group/usercountrank") - public Result> groupUserCountRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupUserCountRankFormDTO formDTO){ + public Result> groupUserCountRank(@RequestHeader("CustomerId") String customerId, @RequestBody GroupUserCountRankFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, GroupUserCountRankFormDTO.AddUserInternalGroup.class); - formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + formDTO.setCustomerId(customerId); return new Result>().ok(kcScreenService.groupUserCountRank(formDTO)); } /** - * @param externalAppRequestParam * @Description 邻里党群-话题转化率排名 * @author sun */ - @ExternalAppRequestAuth @PostMapping("group/topicshiftissueratiorank") - public Result> groupTopicShiftIssueRatioRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupTopicShiftIssueRatioRankFormDTO formDTO){ + public Result> groupTopicShiftIssueRatioRank(@RequestHeader("CustomerId") String customerId, @RequestBody GroupTopicShiftIssueRatioRankFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, GroupTopicShiftIssueRatioRankFormDTO.AddUserInternalGroup.class); - formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + formDTO.setCustomerId(customerId); return new Result>().ok(kcScreenService.groupTopicShiftIssueRatioRank(formDTO)); } /** * 项目各类总数汇总 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("project/summary") - public Result getProjectSummary(ExternalAppRequestParam externalAppRequestParam){ - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; - String customerId = externalAppRequestParam.getCustomerId(); + public Result getProjectSummary(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getProjectSummary(customerId)); } /** * 项目分析-网格下项目数量排名 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("project/gridcountrank") - public Result getProjectGridCountRank(ExternalAppRequestParam externalAppRequestParam){ - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; - String customerId = externalAppRequestParam.getCustomerId(); + public Result getProjectGridCountRank(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getGridProjectCountRank(customerId)); } /** * 项目分析-项目类别 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("project/categoryanalysis") - public Result> getProjectCategoryAnalysis(ExternalAppRequestParam externalAppRequestParam){ - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; - String customerId = externalAppRequestParam.getCustomerId(); + public Result> getProjectCategoryAnalysis(@RequestHeader("CustomerId") String customerId){ return new Result>().ok(kcScreenService.getProjectCategoryAnalysis(customerId)); } /** * 网格项目平均结案时间 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("project/avgclosedtimeanalysis") - public Result> getGridProjectAvgClosedTimeAnalysis(ExternalAppRequestParam externalAppRequestParam){ - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; - String customerId = externalAppRequestParam.getCustomerId(); + public Result> getGridProjectAvgClosedTimeAnalysis(@RequestHeader("CustomerId") String customerId){ return new Result>().ok(kcScreenService.getGridProjectAvgClosedTimeAnalysis(customerId)); } /** * 项目分析-居民满意度 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("project/statis") - public Result getProjectSatisfactionAnalyze(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getProjectSatisfactionAnalyze(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getProjectSatisfactionAnalyze(customerId)); } /** * 用户-summary - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("user/summary") - public Result getUserSummary(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + public Result getUserSummary(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getUserSummary(customerId)); } /** * 用户量趋势 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("user/trend") - public Result getUserTrend(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getUserTrend(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getUserTrend(customerId)); } /** * 网格用户数量排名 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("user/griduserrank") - public Result getUserRank(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getUserRank(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getUserRank(customerId)); } /** * 用户画像 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("user/userportrayal") - public Result getUserPortrayal(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getUserPortrayal(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getUserPortrayal(customerId)); } /** * 用户积分排名 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("user/pointsrank") - public Result getUserPointsRank(ExternalAppRequestParam externalAppRequestParam, + public Result getUserPointsRank(@RequestHeader("CustomerId") String customerId, @RequestBody PageFormDTO form) { - String customerId = externalAppRequestParam.getCustomerId(); return new Result().ok(kcScreenService.getUserPointsRank(customerId, form.getPageNo(), form.getPageSize())); } /** * 党建声音-各类总数 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("news/summary") - public Result getNewsSummary(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getNewsSummary(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getNewsSummary(customerId)); } /** * 新闻阅读参与趋势 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("news/partitrend") - public Result getNewsPartiTrend(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getNewsPartiTrend(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getNewsPartiTrend(customerId)); } /** * 党建声音-分类的news数量 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("news/category") - public Result> getNewsCountGroupByCategory(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result> getNewsCountGroupByCategory(@RequestHeader("CustomerId") String customerId){ return new Result>().ok(kcScreenService.getNewsCountOfCategory(customerId)); } /** * 党建声音-分类的用户参与数排行 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("news/userparticategoryrank") - public Result getNewsPartiCategoryRank(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getNewsPartiCategoryRank(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getNewsPartiCategoryRank(customerId)); } /** * 党建声音-热点新闻排行 - * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("news/hotrank") - public Result> listNewsHotRank(ExternalAppRequestParam externalAppRequestParam, + public Result> listNewsHotRank(@RequestHeader("CustomerId") String customerId, @RequestBody PageFormDTO form){ - String customerId = externalAppRequestParam.getCustomerId(); return new Result>().ok(kcScreenService.getNewsHotRank(customerId, form.getPageNo(), form.getPageSize())); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java index 5530fae8b0..ca1104f534 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; @@ -33,7 +32,6 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 1:56 下午 */ - @ExternalAppRequestAuth @PostMapping("fineexample") public Result fineExample(@RequestBody FineExampleFormDTO fineExampleFormDTO){ ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class); @@ -46,7 +44,6 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 2:35 下午 */ - @ExternalAppRequestAuth @PostMapping("contactmasslinechart") public Result contactMassLineChart(@RequestBody ContactMassLineChartFormDTO contactMassLineChartFormDTO){ ValidatorUtils.validateEntity(contactMassLineChartFormDTO, ContactMassLineChartFormDTO.ContactMassLineChart.class); @@ -59,7 +56,6 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 3:19 下午 */ - @ExternalAppRequestAuth @PostMapping("volunteerservice") public Result volunteerService(@RequestBody VolunteerServiceFormDTO volunteerServiceFormDTO){ ValidatorUtils.validateEntity(volunteerServiceFormDTO, VolunteerServiceFormDTO.VolunteerService.class); @@ -74,7 +70,6 @@ public class PartyMemberLeadController { * @author wangc * @date 2020.08.21 11:05 **/ - @ExternalAppRequestAuth @PostMapping("advancedbranchrank") Result> advancedBranchRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); @@ -89,7 +84,6 @@ public class PartyMemberLeadController { * @author wangc * @date 2020.08.21 14:22 **/ - @ExternalAppRequestAuth @PostMapping("advancedpartymemberrank") Result> advancedPartymemberRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 5417767ee6..483e3edcc1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; @@ -31,7 +30,6 @@ public class ScreenProjectController { * @author zxc * @date 2020/8/19 4:36 下午 */ - @ExternalAppRequestAuth @PostMapping("detail") public Result projectDetail(@RequestBody ProjectDetailFormDTO projectDetailFormDTO){ ValidatorUtils.validateEntity(projectDetailFormDTO, ProjectDetailFormDTO.ProjectDetail.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java new file mode 100644 index 0000000000..bc6997d45f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java @@ -0,0 +1,56 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService; +import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 数据改版api + * + * @author sun + */ +@RestController +@RequestMapping("/screen/user") +public class ScreenUserController { + + @Autowired + private ScreenUserService screenUserService; + + /** + * @param tokenDTO + * @Description 热心市民积分排行列表 + * @author sun + */ + @PostMapping("userpointrank") + public Result> userPointRank(@LoginUser TokenDto tokenDTO, @RequestBody UserPointRankFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UserPointRankFormDTO.AddUserInternalGroup.class); + return new Result>().ok(screenUserService.userPointRank(formDTO)); + } + + /** + * @param tokenDTO + * @Description 党员(指标得分)排行 + * @author sun + */ + @PostMapping("partindexscroerank") + public Result> partIndexScroeRank(@LoginUser TokenDto tokenDTO, @RequestBody PartIndexScroeRankFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PartIndexScroeRankFormDTO.AddUserInternalGroup.class); + return new Result>().ok(screenUserService.partIndexScroeRank(formDTO)); + } + + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 3374c24026..9025780837 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -80,7 +80,7 @@ public interface ScreenIndexDataMonthlyDao{ /** * @param formDTO - * @Description 同级对比--根据组织Id的上级组织Id查询同级组织对应类型的得分排名(查询最近一个月数据) + * @Description 同级对比--根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名(查询最近一个月数据) * @author sun */ List selectScoreList(PeerComparisonFormDTO formDTO); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java index bc15ca191f..0f442931b5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java @@ -18,7 +18,11 @@ package com.epmet.datareport.dao.evaluationindex.screen; import com.epmet.dto.result.user.KcUserPointRankResultDTO; +import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.PartyUserPointResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; import com.epmet.evaluationindex.screen.dto.result.UserPointResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -53,4 +57,18 @@ public interface ScreenPartyUserRankDataDao{ List selectPartymemberPointOrder(@Param("agencyId")String agencyId); List listUserPoints(String customerId); + + /** + * @param formDTO + * @Description 查询组织下居民积分排行,按积分值降序 + * @author sun + */ + List selectAgencyUserPointList(UserPointRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 查询组织下党员的积分排行,按积分值降序 + * @author sun + */ + List selectPartymemberPointList(PartIndexScroeRankFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java index b57cb76571..062465f3a7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java @@ -18,8 +18,10 @@ package com.epmet.datareport.dao.fact; import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; import org.apache.ibatis.annotations.Mapper; @@ -34,17 +36,24 @@ import java.util.LinkedList; @Mapper public interface FactIndexAgencyScoreDao { + /** + * @param formDTO + * @Description 分别查询区县、乡镇街道过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + * @author sun + */ + LinkedList selectAblityIndex(AblityIndexFormDTO formDTO); + /** * @param formDTO * @Description 分别查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 * @author sun */ - ScoreListResultDTO selectScore(ScoreListFormDTO formDTO); + ScoreListResultDTO selectScoreList(ScoreListFormDTO formDTO); /** * @param formDTO * @Description 分别查询区县、乡镇街道过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 * @author sun */ - LinkedList selectAblityIndex(AblityIndexFormDTO formDTO); + LinkedList selectMonthScoreList(MonthScoreListFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java index ed9be12d6d..f0f381e156 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java @@ -18,7 +18,11 @@ package com.epmet.datareport.dao.fact; import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; import org.apache.ibatis.annotations.Mapper; import java.util.LinkedList; @@ -38,4 +42,18 @@ public interface FactIndexCommunityScoreDao { * @author sun */ LinkedList selectCommunityAblityIndex(AblityIndexFormDTO formDTO); + + /** + * @param formDTO + * @Description 分别查询社区级组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 + * @author sun + */ + ScoreListResultDTO selectCommunityScoreList(ScoreListFormDTO formDTO); + + /** + * @param formDTO + * @Description 分别查询社区过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + * @author sun + */ + LinkedList selectCommunityMonthScoreList(MonthScoreListFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java index 7944793f56..a70efe0ce6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java @@ -17,8 +17,16 @@ package com.epmet.datareport.dao.fact; +import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; import org.apache.ibatis.annotations.Mapper; +import java.util.LinkedList; + /** * 网格相关分值记录表 * @@ -28,4 +36,24 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface FactIndexGridScoreDao { + /** + * @param formDTO + * @Description 分别查网格过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + * @author sun + */ + LinkedList selectGridAblityIndex(AblityIndexFormDTO formDTO); + + /** + * @param formDTO + * @Description 分别查网格某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 + * @author sun + */ + ScoreListResultDTO selectGridScoreList(ScoreListFormDTO formDTO); + + /** + * @param formDTO + * @Description 分别查网格过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + * @author sun + */ + LinkedList selectGridMonthScoreList(MonthScoreListFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java index 2edc0a1965..8900171322 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java @@ -17,8 +17,15 @@ package com.epmet.datareport.dao.fact; +import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO; import org.apache.ibatis.annotations.Mapper; +import java.util.LinkedList; +import java.util.List; + /** * 网格相关分值记录表 * @@ -28,4 +35,17 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface FactIndexGridSubScoreDao { + /** + * @param formDTO + * @Description 查询网格某月份某项能力对应的各项指标 + * @author sun + */ + List selectGridAblityList(AblityListFormDTO formDTO); + + /** + * @param formDTO + * @Description 查询网格层级某项能力对应的一项指标过去12个月份数据 + * @author sun + */ + LinkedList selectGridMonthAblityList(MonthAblityListFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java index d633b94ea2..eee423ca41 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java @@ -1,6 +1,5 @@ package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; @@ -14,12 +13,12 @@ import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; public interface AgencyService { /** - * @Description 1、组织机构树 * @param + * @Description 1、组织机构树 只返回 is_display = '1'的 * @author zxc * @date 2020/8/18 2:04 下午 */ - TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam); + TreeResultDTO tree(String customerId); /** * @Description 2、组织区域查询 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java index d17df56ba1..480601a129 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java @@ -1,6 +1,5 @@ package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.dto.result.issue.*; import com.epmet.dto.result.project.*; import com.epmet.dto.result.user.*; @@ -22,32 +21,28 @@ import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO; public interface KcScreenService { /** - * @param externalAppRequestParam * @Description 首页-平台各类总数 * @author sun */ - HomepageSummaryResultDTO homepageSummary(ExternalAppRequestParam externalAppRequestParam); + HomepageSummaryResultDTO homepageSummary(String customerId); /** - * @param externalAppRequestParam * @Description 公益互助-各类总数汇总 * @author sun */ - HeartSummaryResultDTO heartSummary(ExternalAppRequestParam externalAppRequestParam); + HeartSummaryResultDTO heartSummary(String customerId); /** - * @param externalAppRequestParam * @Description 公益互助-公益活动次数 * @author sun */ - HeartActcounttrendResultDTO heartActcounttrend(ExternalAppRequestParam externalAppRequestParam); + HeartActcounttrendResultDTO heartActcounttrend(String customerId); /** - * @param externalAppRequestParam * @Description 公益互助-志愿者画像 * @author sun */ - HeartVolunteerportrayalResultDTO heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam); + HeartVolunteerportrayalResultDTO heartVolunteerportrayal(String customerId); /** * @param formDTO @@ -67,25 +62,22 @@ public interface KcScreenService { /** - * @param externalAppRequestParam * @Description 邻里党群-各类总数 * @author sun */ - GroupSummaryResultDTO groupSummary(ExternalAppRequestParam externalAppRequestParam); + GroupSummaryResultDTO groupSummary(String customerId); /** - * @param externalAppRequestParam * @Description 邻里党群-话题参与趋势 * @author sun */ - GroupPartitopictrendResultDTO groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam); + GroupPartitopictrendResultDTO groupPartitopictrend(String customerId); /** - * @param externalAppRequestParam * @Description 邻里党群-社群数量排名 * @author sun */ - GroupGridgroupcountrankResultDTO groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam); + GroupGridgroupcountrankResultDTO groupGridgroupcountrank(String customerId); /** * @param formDTO diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java new file mode 100644 index 0000000000..f5e2428f09 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java @@ -0,0 +1,30 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; + +import java.util.List; + +/** + * 数据改版 + * + * @author sun + */ +public interface ScreenUserService { + + /** + * @param formDTO + * @Description 热心市民积分排行列表 + * @author sun + */ + List userPointRank(UserPointRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 党员(指标得分)排行 + * @author sun + */ + List partIndexScroeRank(PartIndexScroeRankFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index c5bf2bab81..104e941333 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.constant.DataSourceConstant; @@ -13,7 +12,6 @@ import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; -import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.exceptions.TooManyResultsException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -44,15 +42,9 @@ public class AgencyServiceImpl implements AgencyService { */ @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override - public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) { + public TreeResultDTO tree(String customerId) { // 1. 查询客户根组织ID - String customerId = externalAppRequestParam.getCustomerId(); - - // 验签关闭,customerId无法获取,暂时写死 - if (StringUtils.isBlank(customerId)) { - customerId = "b09527201c4409e19d1dbc5e3c3429a1"; - } TreeResultDTO rootAgency = null; try { rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java index b82d6b654f..6a84e531d7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyUserRankDataDao; @@ -99,37 +98,34 @@ public class KcScreenServiceImpl implements KcScreenService { private ScreenKcNewsRankDao screenKcNewsRankDao; /** - * @param externalAppRequestParam * @Description 首页-平台各类总数 * @author sun */ @Override - public HomepageSummaryResultDTO homepageSummary(ExternalAppRequestParam externalAppRequestParam) { - return screenKcPlatformSummaryDailyDao.selectSummaryDaily(externalAppRequestParam.getCustomerId()); + public HomepageSummaryResultDTO homepageSummary(String customerId) { + return screenKcPlatformSummaryDailyDao.selectSummaryDaily(customerId); } /** - * @param externalAppRequestParam * @Description 公益互助-各类总数汇总 * @author sun */ @Override - public HeartSummaryResultDTO heartSummary(ExternalAppRequestParam externalAppRequestParam) { - return screenKcActSummaryDailyDao.selectHeartSummary(externalAppRequestParam.getCustomerId()); + public HeartSummaryResultDTO heartSummary(String customerId) { + return screenKcActSummaryDailyDao.selectHeartSummary(customerId); } /** - * @param externalAppRequestParam * @Description 公益互助-公益活动次数 * @author sun */ @Override - public HeartActcounttrendResultDTO heartActcounttrend(ExternalAppRequestParam externalAppRequestParam) { + public HeartActcounttrendResultDTO heartActcounttrend(String customerId) { HeartActcounttrendResultDTO resultDTO = new HeartActcounttrendResultDTO(); LinkedList xAxis = new LinkedList<>(); LinkedList actCountDataList = new LinkedList<>(); //1.按客户查询最近十二个月数据 - List list = screenKcActTrendMonthlyDao.selectActTrendMonthly(externalAppRequestParam.getCustomerId()); + List list = screenKcActTrendMonthlyDao.selectActTrendMonthly(customerId); //2.倒序遍历封装数据 for (int i = list.size() - 1; i >= 0; i--) { xAxis.add(list.get(i).getMonthId()); @@ -142,16 +138,15 @@ public class KcScreenServiceImpl implements KcScreenService { } /** - * @param externalAppRequestParam * @Description 公益互助-志愿者画像 * @author sun */ @Override - public HeartVolunteerportrayalResultDTO heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam) { + public HeartVolunteerportrayalResultDTO heartVolunteerportrayal(String customerId) { HeartVolunteerportrayalResultDTO resultDTO = new HeartVolunteerportrayalResultDTO(); GenderDistributionResultDTO genderDistribution = new GenderDistributionResultDTO(); //1.根据客户Id查询最近日期志愿者统计数据 - AgeDistributionResultDTO ageDistribution = screenKcVolunteerSummaryDailyDao.selectVolunteerSummaryDaily(externalAppRequestParam.getCustomerId()); + AgeDistributionResultDTO ageDistribution = screenKcVolunteerSummaryDailyDao.selectVolunteerSummaryDaily(customerId); //2.封装数据并返回 if (null == ageDistribution) { resultDTO.setAgeDistribution(new AgeDistributionResultDTO()); @@ -219,14 +214,13 @@ public class KcScreenServiceImpl implements KcScreenService { } /** - * @param externalAppRequestParam * @Description 邻里党群-各类总数 * @author sun */ @Override - public GroupSummaryResultDTO groupSummary(ExternalAppRequestParam externalAppRequestParam) { + public GroupSummaryResultDTO groupSummary(String customerId) { //1.按客户查询最近一天各网格各项数据的汇总值 - GroupSummaryResultDTO resultDTO = screenKcGroupSummaryGridDailyDao.selectGroupSummaryDaily(externalAppRequestParam.getCustomerId()); + GroupSummaryResultDTO resultDTO = screenKcGroupSummaryGridDailyDao.selectGroupSummaryDaily(customerId); if (null == resultDTO) { return new GroupSummaryResultDTO(); } @@ -246,17 +240,16 @@ public class KcScreenServiceImpl implements KcScreenService { } /** - * @param externalAppRequestParam * @Description 邻里党群-话题参与趋势 * @author sun */ @Override - public GroupPartitopictrendResultDTO groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam) { + public GroupPartitopictrendResultDTO groupPartitopictrend(String customerId) { GroupPartitopictrendResultDTO resultDTO = new GroupPartitopictrendResultDTO(); LinkedList xAxis = new LinkedList<>(); LinkedList actCountDataList = new LinkedList<>(); //1.按客户查询最近十二个月所有网格汇总数据 - List list = screenKcTopicTrendGridMonthlyDao.selectActTrendMonthly(externalAppRequestParam.getCustomerId()); + List list = screenKcTopicTrendGridMonthlyDao.selectActTrendMonthly(customerId); //2.倒序遍历封装数据 for (int i = list.size() - 1; i >= 0; i--) { xAxis.add(list.get(i).getMonthId()); @@ -269,17 +262,16 @@ public class KcScreenServiceImpl implements KcScreenService { } /** - * @param externalAppRequestParam * @Description 邻里党群-社群数量排名 * @author sun */ @Override - public GroupGridgroupcountrankResultDTO groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam) { + public GroupGridgroupcountrankResultDTO groupGridgroupcountrank(String customerId) { GroupGridgroupcountrankResultDTO resultDTO = new GroupGridgroupcountrankResultDTO(); LinkedList gridNameDataList = new LinkedList<>(); LinkedList groupCountDataList = new LinkedList<>(); //1.按日期降序,查询客户最近一天所有网格数据,按每个网格的社区总数降序排列 - LinkedList list = screenKcGroupSummaryGridDailyDao.selectGridDailyList(externalAppRequestParam.getCustomerId()); + LinkedList list = screenKcGroupSummaryGridDailyDao.selectGridDailyList(customerId); //2.封装数据 list.forEach(l -> { gridNameDataList.add(l.getGridName()); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java new file mode 100644 index 0000000000..1a92a59d95 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java @@ -0,0 +1,61 @@ +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.constant.FactConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyUserRankDataDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService; +import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 数据改版 + * + * @author sun + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenUserServiceImpl implements ScreenUserService { + + @Autowired + private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + + /** + * @param formDTO + * @Description 热心市民积分排行列表 + * @author sun + */ + @Override + public List userPointRank(UserPointRankFormDTO formDTO) { + //1.参数校验 + if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + //2.查询组织下居民积分排行,按积分值降序 screen_party_user_rank_data + return screenPartyUserRankDataDao.selectAgencyUserPointList(formDTO); + } + + /** + * @param formDTO + * @Description 党员(指标得分)排行 + * @author sun + */ + @Override + public List partIndexScroeRank(PartIndexScroeRankFormDTO formDTO) { + //1.参数校验 + if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + //2.查询组织下党员的积分排行 screen_party_user_rank_data + return screenPartyUserRankDataDao.selectPartymemberPointList(formDTO); + } + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java index 0ee79681fb..523bf3a7e5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java @@ -7,16 +7,14 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.constant.FactConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; -import com.epmet.datareport.dao.fact.FactIndexAgencyScoreDao; -import com.epmet.datareport.dao.fact.FactIndexAgencySubScoreDao; -import com.epmet.datareport.dao.fact.FactIndexCommunityScoreDao; -import com.epmet.datareport.dao.fact.FactIndexCommunitySubScoreDao; +import com.epmet.datareport.dao.fact.*; import com.epmet.datareport.service.fact.FactIndexService; import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -45,6 +43,10 @@ public class FactIndexServiceImpl implements FactIndexService { private FactIndexCommunityScoreDao factIndexCommunityScoreDao; @Autowired private FactIndexCommunitySubScoreDao factIndexCommunitySubScoreDao; + @Autowired + private FactIndexGridScoreDao factIndexGridScoreDao; + @Autowired + private FactIndexGridSubScoreDao factIndexGridSubScoreDao; /** * @param formDTO @@ -53,76 +55,91 @@ public class FactIndexServiceImpl implements FactIndexService { */ @Override public List ablityIndex(AblityIndexFormDTO formDTO) { - LinkedList resultDTO = new LinkedList<>(); + LinkedList resultList = new LinkedList<>(); LinkedList djList = null; LinkedList zlList = null; LinkedList fwList = null; - //分别查询过去12个月党建能力、治理能力、服务能力各自总分乘权重后的分值,每个月份三个分值的加和就是当月的能力指数的分值 fact_index_agency_score 按月份升序 //1.计算所查月份前12个月的monthId formDTO.setStartMonthId(getDate(formDTO.getMonthId())); - //2.根据组织Id查询组织信息 - CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); - if (null == agency) { - throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId())); - } - //1.根据组织级别判断查询哪类数据表 - //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { - //2-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union) - formDTO.setIndexCode(FactConstant.DJNL); - djList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); - //2-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据 - formDTO.setIndexCode(FactConstant.ZLNL); - zlList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); - //2-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据 - formDTO.setIndexCode(FactConstant.FWNL); - fwList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); + //2.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //3.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + if (null == agency) { + throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); + } + //4.根据组织级别判断查询哪类数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + //4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union) + formDTO.setIndexCode(FactConstant.DJNL); + djList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); + //4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.ZLNL); + zlList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); + //4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.FWNL); + fwList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); - //社区级 - } else if ("community".equals(agency.getLevel())) { - //2-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据 + //社区级 + } else if ("community".equals(agency.getLevel())) { + //4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.DJNL); + djList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); + //4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.ZLNL); + zlList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); + //4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.FWNL); + fwList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); + } else { + throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + } + //网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //5.查询过去12个月网格层级各项能力对应的各项得分数据 + //5-1.查询网格过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union) formDTO.setIndexCode(FactConstant.DJNL); - djList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); - //2-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据 + djList = factIndexGridScoreDao.selectGridAblityIndex(formDTO); + //5-2.查询网格过去12个月治理能力每月总分、本级得分、下级得分数据 formDTO.setIndexCode(FactConstant.ZLNL); - zlList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); - //2-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据 + zlList = factIndexGridScoreDao.selectGridAblityIndex(formDTO); + //5-3.查询网格过去12个月服务能力每月总分、本级得分、下级得分数据 formDTO.setIndexCode(FactConstant.FWNL); - fwList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); - + fwList = factIndexGridScoreDao.selectGridAblityIndex(formDTO); } else { - throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); + throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); } - //3.遍历计算每个月能力指数 + //6.遍历计算每个月能力指数 LinkedList nlList = new LinkedList<>(); for (int i = 0; i < djList.size(); i++) { AblityIndexResultDTO.ScoreListResultDTO nldto = new AblityIndexResultDTO.ScoreListResultDTO(); - nldto.setIndexTotal(djList.get(i).getIndexTotal() + zlList.get(i).getIndexTotal() + fwList.get(i).getIndexTotal()); - nldto.setAgencyScore(djList.get(i).getAgencyScore() + zlList.get(i).getAgencyScore() + fwList.get(i).getAgencyScore()); - nldto.setSubAgencyScore(djList.get(i).getSubAgencyScore() + zlList.get(i).getSubAgencyScore() + fwList.get(i).getSubAgencyScore()); + double num1 = new BigDecimal((djList.get(i).getIndexTotal() + zlList.get(i).getIndexTotal() + fwList.get(i).getIndexTotal())).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); + nldto.setIndexTotal(num1); nldto.setMonthId(djList.get(i).getMonthId()); nlList.add(nldto); } //5.封装数据并返回 AblityIndexResultDTO nl = new AblityIndexResultDTO(); nl.setIndexCode(FactConstant.NLZB); - nl.setScoreList(djList); - resultDTO.add(nl); + nl.setScoreList(nlList); + if(null != nlList){resultList.add(nl);} AblityIndexResultDTO dj = new AblityIndexResultDTO(); dj.setIndexCode(FactConstant.DJNL); dj.setScoreList(djList); - resultDTO.add(dj); + if(null != djList){resultList.add(dj);} AblityIndexResultDTO zl = new AblityIndexResultDTO(); zl.setIndexCode(FactConstant.ZLNL); - zl.setScoreList(djList); - resultDTO.add(zl); + zl.setScoreList(zlList); + if(null != zlList){resultList.add(zl);} AblityIndexResultDTO fw = new AblityIndexResultDTO(); fw.setIndexCode(FactConstant.FWNL); - fw.setScoreList(djList); - resultDTO.add(fw); + fw.setScoreList(fwList); + if(null != fwList){resultList.add(fw);} - return resultDTO; + return resultList; } /** @@ -132,13 +149,65 @@ public class FactIndexServiceImpl implements FactIndexService { */ @Override public List scoreList(ScoreListFormDTO formDTO) { - //1.查询当前组织某一月份党建能力对应的总分、本级分、下级分 - formDTO.setIndexCode(FactConstant.DJNL); - ScoreListResultDTO dj = factIndexAgencyScoreDao.selectScore(formDTO); - //2.查询当前组织某一月份治理能力对应的总分、本级分、下级分 - //3.查询当前组织某一月份服务能力对应的总分、本级分、下级分 + LinkedList resultList = new LinkedList<>(); + ScoreListResultDTO dj = new ScoreListResultDTO(); + ScoreListResultDTO zl = new ScoreListResultDTO(); + ScoreListResultDTO fw = new ScoreListResultDTO(); + //1.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //2.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + if (null == agency) { + throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); + } + //3.根据组织级别判断查询哪类数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + //3-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.DJNL); + dj = factIndexAgencyScoreDao.selectScoreList(formDTO); + //3-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.ZLNL); + zl = factIndexAgencyScoreDao.selectScoreList(formDTO); + //3-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.FWNL); + fw = factIndexAgencyScoreDao.selectScoreList(formDTO); + //社区级 + } else if ("community".equals(agency.getLevel())) { + //3-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.DJNL); + dj = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO); + //3-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.ZLNL); + zl = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO); + //3-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.FWNL); + fw = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO); + } else { + throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + } - return null; + //4.网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //4-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.DJNL); + dj = factIndexGridScoreDao.selectGridScoreList(formDTO); + //4-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.ZLNL); + zl = factIndexGridScoreDao.selectGridScoreList(formDTO); + //4-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.FWNL); + fw = factIndexGridScoreDao.selectGridScoreList(formDTO); + } else { + throw new RenException(String.format("按月份查询各项能力分数,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); + } + //5.封装数据并返回 + if(null != dj){resultList.add(dj);} + if(null != zl){resultList.add(zl);} + if(null != fw){resultList.add(fw);} + + return resultList; } /** @@ -148,7 +217,78 @@ public class FactIndexServiceImpl implements FactIndexService { */ @Override public List monthScoreList(MonthScoreListFormDTO formDTO) { - return null; + LinkedList resultList = new LinkedList<>(); + LinkedList djList = new LinkedList<>(); + LinkedList zlList = new LinkedList<>(); + LinkedList fwList = new LinkedList<>(); + //1.计算所查月份前12个月的monthId + formDTO.setStartMonthId(getDate(formDTO.getMonthId())); + //2.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //3.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + if (null == agency) { + throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); + } + //4.根据组织级别判断查询哪类数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + //4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.DJNL); + djList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO); + //4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.ZLNL); + zlList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO); + //4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.FWNL); + fwList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO); + + //社区级 + } else if ("community".equals(agency.getLevel())) { + //4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.DJNL); + djList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO); + //4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.ZLNL); + zlList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO); + //4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.FWNL); + fwList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO); + } else { + throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + } + //网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //5.查询过去12个月网格层级各项能力对应的各项得分数据 + //5-1.查询网格过去12个月党建能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.DJNL); + djList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO); + //5-2.查询网格过去12个月治理能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.ZLNL); + zlList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO); + //5-3.查询网格过去12个月服务能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.FWNL); + fwList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO); + } else { + throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); + } + + //5.封装数据并返回 + MonthScoreListResultDTO dj = new MonthScoreListResultDTO(); + dj.setIndexCode(FactConstant.DJNL); + dj.setScoreList(djList); + if(null != djList){resultList.add(dj);} + MonthScoreListResultDTO zl = new MonthScoreListResultDTO(); + zl.setIndexCode(FactConstant.ZLNL); + zl.setScoreList(zlList); + if(null != zlList){resultList.add(zl);} + MonthScoreListResultDTO fw = new MonthScoreListResultDTO(); + fw.setIndexCode(FactConstant.FWNL); + fw.setScoreList(fwList); + if(null != fwList){resultList.add(fw);} + + return resultList; } /** @@ -159,30 +299,41 @@ public class FactIndexServiceImpl implements FactIndexService { @Override public List ablityList(AblityListFormDTO formDTO) { List resultList = new ArrayList<>(); - //按月份查询当前组织各项指标数据 fact_index_agency_sub_score - //1.根据组织Id查询组织信息 - CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); - if (null == agency) { - throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId())); - } - //2.根据组织级别拼接查询条件,判断查询不同数据表 - //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { - if ("district".equals(agency.getLevel())) { - formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); - } else { - formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode()); + //1.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //2.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + if (null == agency) { + throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); } - resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO); + //3.根据组织级别拼接查询条件,判断查询不同数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + if ("district".equals(agency.getLevel())) { + formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); + } else { + formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode()); + } + resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO); - //社区级 - } else if ("community".equals(agency.getLevel())) { - formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); - resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO); + //社区级 + } else if ("community".equals(agency.getLevel())) { + formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); + resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO); + } else { + throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + } + //网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //4.查询网格层级各项能力对应指标数据 + formDTO.setAllParentIndexCode(FactConstant.WANG_GE_XIANG_GUAN + ":" + formDTO.getIndexCode()); + resultList = factIndexGridSubScoreDao.selectGridAblityList(formDTO); } else { - throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); + throw new RenException(String.format("按月查询各项指标数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); } - //3.调用方法判断各项指标是数字指标还是百分比指标 //TODO + + //4.调用方法判断各项指标是数字指标还是百分比指标 //TODO 记得value值保留一位小数 是数的保留零位小数 是百分比的保留一位小数 return resultList; } @@ -196,24 +347,33 @@ public class FactIndexServiceImpl implements FactIndexService { LinkedList resultList = new LinkedList<>(); //1.计算所查月份前12个月的monthId formDTO.setStartMonthId(getDate(formDTO.getMonthId())); - //2.根据组织Id查询组织信息 - CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); - if (null == agency) { - throw new RenException(String.format("查询到组织信息失败,组织Id:%s", formDTO.getAgencyId())); - } - - //3.根据组织级别拼接查询条件,判断查询不同数据表 - //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { - resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO); - - //社区级 - } else if ("community".equals(agency.getLevel())) { - resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO); + //2.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //3.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + if (null == agency) { + throw new RenException(String.format("查询到组织信息失败,组织Id:%s", formDTO.getOrgId())); + } + //4.根据组织级别拼接查询条件,判断查询不同数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO); + //社区级 + } else if ("community".equals(agency.getLevel())) { + resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO); + } else { + throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + } + //网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //5.查询网格层级某项能力对应的一项指标过去12个月份数据 + resultList = factIndexGridSubScoreDao.selectGridMonthAblityList(formDTO); } else { - throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); + throw new RenException(String.format("按月查询各项指标最近12个月数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); } - //3.调用方法判断各项指标是数字指标还是百分比指标//TODO + + //6.调用方法判断各项指标是数字指标还是百分比指标//TODO 记得value值保留一位小数 是数的保留零位小数 是百分比的保留一位小数 return resultList; } @@ -243,7 +403,7 @@ public class FactIndexServiceImpl implements FactIndexService { */ @Override public List peerComparison(PeerComparisonFormDTO formDTO) { - //1.根据组织Id的上级组织Id查询同级组织对应类型的得分排名(查询最近一个月数据) + //1.根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名(查询最近一个月数据) List resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO); return resultList; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml index 87a08ed389..374814375d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml @@ -3,16 +3,49 @@ - + SELECT + fact.month_id AS "monthId", + ROUND(fact.score, 1) AS "indexTotal" + FROM + fact_index_agency_score fact + WHERE + fact.del_flag = '0' + AND fact.customer_id = #{customerId} + AND fact.agency_id = #{orgId} + AND fact.month_id > #{startMonthId} + AND fact.month_id <= #{monthId} + AND fact.index_code = #{indexCode} + ORDER BY + fact.month_id ASC + + - SELECT fact.month_id AS "monthId", - ROUND(fact.score * fact.weight, 1) AS "indexTotal", - ROUND(self.self_score * self.self_weight,1) AS "agencyScore", - ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore" + ROUND(fact.score, 1) AS "indexTotal", + ROUND(self.self_score, 1) AS "agencyScore", + ROUND(self.sub_score, 1) AS "subAgencyScore" FROM fact_index_agency_score fact INNER JOIN fact_index_agency_self_sub_score self ON fact.agency_id = self.agency_id @@ -22,7 +55,7 @@ fact.del_flag = '0' AND self.del_flag = '0' AND fact.customer_id = #{customerId} - AND fact.agency_id = #{agencyId} + AND fact.agency_id = #{orgId} AND fact.month_id > #{startMonthId} AND fact.month_id <= #{monthId} AND fact.index_code = #{indexCode} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml index db62b6c918..879d8b521e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml @@ -6,7 +6,7 @@ SELECT fact.month_id AS "monthId", - ROUND(fact.score * fact.weight, 1) AS "indexTotal", - ROUND(self.self_score * self.self_weight,1) AS "agencyScore", - ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore" + ROUND(fact.score, 1) AS "indexTotal" + FROM + fact_index_community_score fact + WHERE + fact.del_flag = '0' + AND fact.customer_id = #{customerId} + AND fact.agency_id = #{orgId} + AND fact.month_id > #{startMonthId} + AND fact.month_id <= #{monthId} + AND fact.index_code = #{indexCode} + ORDER BY + fact.month_id ASC + + + + + SELECT fact.index_code AS "key", - IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", + IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "value", dict.index_name AS "name" FROM fact_index_community_sub_score fact @@ -16,14 +16,14 @@ AND dict.del_flag = '0' AND fact.all_parent_index_code = #{allParentIndexCode} AND customer_id = #{customerId} - AND agency_id = #{agencyId} + AND agency_id = #{orgId} AND month_id = #{monthId} + SELECT + fact.month_id AS "monthId", + ROUND(fact.score, 1) AS "indexTotal" + FROM + fact_index_grid_score fact + WHERE + fact.del_flag = '0' + AND fact.customer_id = #{customerId} + AND fact.grid_id = #{orgId} + AND fact.month_id > #{startMonthId} + AND fact.month_id <= #{monthId} + AND fact.index_code = #{indexCode} + ORDER BY + fact.month_id ASC + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml index ff7c0031c7..d48f24966e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml @@ -3,5 +3,40 @@ + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 932149d9c5..969bcea847 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -16,6 +16,7 @@ WHERE del_flag = 0 AND pid = '0' + AND IS_DISPLAY = '1' AND customer_id = #{customerId} @@ -31,6 +32,7 @@ screen_customer_agency WHERE del_flag = '0' + AND IS_DISPLAY = '1' AND pids = #{subAgencyPids} ORDER BY created_time DESC diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 6cafd96036..b17fe0f6a8 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -77,6 +77,7 @@ screen_customer_grid WHERE del_flag = '0' + AND IS_DISPLAY = '1' AND parent_agency_id = #{agencyId} ORDER BY created_time DESC diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 0676fb2177..f84ce8c28d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -110,8 +110,8 @@ + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java index b20619837c..064104b9b2 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java @@ -14,4 +14,5 @@ public interface DataSourceConstant { String EVALUATION_INDEX = "evaluationIndex"; String PARTY_MEMBER = "partyMember"; String EPMET_HEART="epmetHeart"; + String EPMET_POINT = "epmetPoint"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java index 0f4fccc58f..5cbaa9f748 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java @@ -91,6 +91,11 @@ public class IssueMainDailyFormDTO implements Serializable { */ private String issueStatus; + /** + * 关闭状态 + */ + private String resolveType; + /** * 创建话题用户身份标识 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java new file mode 100644 index 0000000000..06b95d02d2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java @@ -0,0 +1,97 @@ +package com.epmet.dto.extract.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/25 9:07 上午 + */ +@Data +public class ScreenPartyBranchDataFormDTO implements Serializable { + + private static final long serialVersionUID = -5521810726686859779L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice + */ + private String type; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 会议分类Id + */ + private String meetCategoryId; + + /** + * 会议分类名称(三会党课、主题党日.....等等) + */ + private String meetCategoryName; + + /** + * 组织次数 + */ + private Integer organizeCount; + + /** + * 参加人数 + */ + private Integer joinUserCount; + + /** + * 平均参加人数 + */ + private Integer averageJoinUserCount; + + private String delFlag; + + private Integer revision; + + private String createdBy; + + private String updatedBy; + + public ScreenPartyBranchDataFormDTO() { + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + this.type = "voluntaryservice"; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java new file mode 100644 index 0000000000..3ff541a16d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java @@ -0,0 +1,73 @@ +package com.epmet.dto.extract.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/24 6:03 下午 + */ +@Data +public class ScreenPartyLinkMassesDataFormDTO implements Serializable { + + private static final long serialVersionUID = -7534140815638694052L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 党员建群总数 + */ + private Integer createGroupTotal; + + /** + * 群成员总数 + */ + private Integer groupUserTotal; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + private String delFlag; + + private Integer revision; + + private String createdBy; + + private String updatedBy; + + public ScreenPartyLinkMassesDataFormDTO() { + this.createGroupTotal = NumConstant.ZERO; + this.groupUserTotal = NumConstant.ZERO; + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java new file mode 100644 index 0000000000..9555ea578c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/24 2:59 下午 + */ +@Data +public class GridInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -8146474744340303247L; + + private String agencyId; + + private String gridId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java new file mode 100644 index 0000000000..910ea4759a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.extract.result; + +import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/24 2:45 下午 + */ +@Data +@AllArgsConstructor +public class GridPartyDTO implements Serializable { + + private static final long serialVersionUID = -6699064424253966688L; + + private List orgIds; + + private List result; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java new file mode 100644 index 0000000000..7646ff9567 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.extract.result; + +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/25 10:10 上午 + */ +@Data +@AllArgsConstructor +public class GridPartyGuideDTO implements Serializable { + + private static final long serialVersionUID = 8986034496647129566L; + + private List orgIds; + + private List result; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java index 4dd3bcac07..b09aefb549 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java @@ -47,4 +47,9 @@ public class IssueInfoResultDTO implements Serializable { * 用户ID */ private String userId; + + /** + * 关闭状态 + */ + private String resolveType; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgNameResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgNameResultDTO.java new file mode 100644 index 0000000000..66764c2674 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgNameResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/24 1:23 下午 + */ +@Data +public class OrgNameResultDTO implements Serializable { + + private static final long serialVersionUID = -4815327768546033428L; + + private String gridId; + + private String agencyId; + + private String gridName; + + private String agencyName; + + private String parentId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java index 991a132d09..06bc4d9cca 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java @@ -35,6 +35,7 @@ public class GridInfoDTO implements Serializable { /** * 所有上级组织ID,英文:隔开 + * agencyId的pids */ private String pids; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenCentralZoneDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenCentralZoneDataFormDTO.java new file mode 100644 index 0000000000..6eb609fc5d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenCentralZoneDataFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 大屏中央区数据写入传参DTO + * @ClassName ScreenCentralZoneDataFormDTO + * @Auth wangc + * @Date 2020-09-24 10:02 + */ +@Data +public class ScreenCentralZoneDataFormDTO implements Serializable { + private static final long serialVersionUID = -6621150245370746092L; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 时间维度 不一定是dateId 需要根据其格式进行判断维度的类型 + * */ + private String dateId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 72de92dd19..520b6bee09 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -220,4 +220,13 @@ public interface DataStatisticalOpenFeignClient { */ @PostMapping("/data/stats/eidim/init-all") Result initAllEIDims(); + + /** + * @Description 抽取数据到大屏【天】 + * @param extractFormDTO + * @author zxc + * @date 2020/9/24 10:15 上午 + */ + @PostMapping(value = "/data/stats/screenextract/extractdailyall") + Result extractDailyAll(@RequestBody(required = false) ExtractFormDTO extractFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index aa4021bff0..d56296bf42 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -212,4 +212,9 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result initAllEIDims() { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "initAllEIDims"); } + + @Override + public Result extractDailyAll(ExtractFormDTO extractFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractDailyAll",extractFormDTO); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 773ef7bebd..e9633c29aa 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -70,7 +70,7 @@ com.epmet - epmet-commons-extapp-auth + common-service-client 2.0.0 compile @@ -216,6 +216,12 @@ epmet_heart_user EpmEt-db-UsEr + + + + epmet_point_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -326,6 +332,12 @@ epmet_heart_user EpmEt-db-UsEr + + + + epmet_point_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -436,6 +448,12 @@ epmet elink@833066 + + + + epmet + elink@833066 + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -542,6 +560,12 @@ epmet_heart_user EpmEt-db-UsEr + + + + epmet_point_user + EpmEt-db-UsEr + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index 3758d966f1..ff2c4558c5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -53,4 +53,13 @@ public interface ProjectConstant { */ String STATS_FAILED_PREFIX = "统计数据执行失败:%s 客户ID:%s,统计日期:%s"; + /** + * 自身 + */ + String ZI_SHEN = "zishen"; + + /** + * 下级 + */ + String XIA_JI = "xiaji"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index ce10359a47..010b6ed47c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -18,6 +18,7 @@ import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.ExtractFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity; @@ -35,11 +36,14 @@ import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollStreetServ import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenCentralZoneDataAbsorptionService; +import com.epmet.service.evaluationindex.extract.toscreen.PartyGuideService; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimCustomerPartymemberService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -99,6 +103,8 @@ public class DemoController { private IndexCollCommunityService indexCollCommunityService; @Autowired private IndexCollStreetService indexCollStreetService; + @Autowired + private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService; @GetMapping("testAlarm") public void testAlarm() { @@ -642,4 +648,18 @@ public class DemoController { return new Result(); } + @Autowired + private PartyGuideService partyGuideService; + + @PostMapping("zxczxc") + public Result getZxcZxc(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ + partyGuideService.partyGuideExtract(formDTO.getCustomerId(),formDTO.getDateId()); + return new Result(); + } + + @PostMapping("centralzonedatacleaning") + public Result centralZoneDataCleaning(@RequestBody ScreenCentralZoneDataFormDTO param){ + screenCentralZoneDataAbsorptionService.centralZoneDataHub(param); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java index 0a8740c63b..77f2ce51ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java @@ -1,15 +1,10 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.indexcollect.form.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * 指标采集相关api @@ -27,128 +22,112 @@ public class FactIndexCollectController { /** * 1、党建能力-党员相关指标上报(按照月份) * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("gridpartymemberdata") - public Result gridPartyMemberData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyMemberDataFormDTO formDTO) { - factIndexCollectService.insertGridPartyMemberData(formDTO,externalAppRequestParam.getCustomerId() ); + public Result gridPartyMemberData(@RequestHeader("CustomerId") String customerId, @RequestBody GridPartyMemberDataFormDTO formDTO) { + factIndexCollectService.insertGridPartyMemberData(formDTO, customerId); return new Result(); } /** * 2、党建能力-网格相关指标上报(按照月份) * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("gridpartyability") - public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyAbilityDataFormDTO formDTO) { - factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result gridPartyAbility(@RequestHeader("CustomerId") String customerId, @RequestBody GridPartyAbilityDataFormDTO formDTO) { + factIndexCollectService.insertGridPartyAbility(formDTO, customerId); return new Result(); } /** * 3、党建能力-街道及社区相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("orgpartyability") - public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgPartyAbilityDataFormDTO formDTO) { - factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result orgPartyAbility(@RequestHeader("CustomerId") String customerId, @RequestBody OrgPartyAbilityDataFormDTO formDTO) { + factIndexCollectService.insertOrgPartyAbility(formDTO, customerId); return new Result(); } /** * 4、服务能力-网格相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("gridserviceability") - public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridServiceAbilityDataFormDTO formDTO) { - factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result gridServiceAbility(@RequestHeader("CustomerId") String customerId, @RequestBody GridServiceAbilityDataFormDTO formDTO) { + factIndexCollectService.insertGridServiceAbility(formDTO, customerId); return new Result(); } /** * 5、服务能力-组织(街道|社区|全区)相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("orgserviceability") - public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgServiceAbilityDataFormDTO formDTO) { - factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result orgServiceAbility(@RequestHeader("CustomerId") String customerId, @RequestBody OrgServiceAbilityDataFormDTO formDTO) { + factIndexCollectService.insertOrgServiceAbility(formDTO, customerId); return new Result(); } /** * 6、治理能力-网格相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("gridgovrnability") - public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridGovrnAbilityDataFormDTO formDTO) { - factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result gridGovrnAbility(@RequestHeader("CustomerId") String customerId, @RequestBody GridGovrnAbilityDataFormDTO formDTO) { + factIndexCollectService.insertGridGovrnAbility(formDTO, customerId); return new Result(); } /** * 7、治理能力-街道及社区相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("orggovrnability") - public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgGovrnAbilityDataFormDTO formDTO) { - factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result orgGovrnAbility(@RequestHeader("CustomerId") String customerId, @RequestBody OrgGovrnAbilityDataFormDTO formDTO) { + factIndexCollectService.insertOrgGovrnAbility(formDTO, customerId); return new Result(); } /** * 8、治理能力-部门相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("deptgovrnability") - public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody DeptGovrnAbilityDataFormDTO formDTO) { - factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result deptGovrnAbility(@RequestHeader("CustomerId") String customerId, @RequestBody DeptGovrnAbilityDataFormDTO formDTO) { + factIndexCollectService.insertDeptGovrnAbility(formDTO, customerId); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index c6e24b6893..ae50deb189 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -1,7 +1,5 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.RedisKeys; @@ -20,10 +18,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.PreDestroy; import java.util.Date; @@ -103,11 +98,8 @@ public class IndexCalculateController { * @Author zhangyongç * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("all") - public Result indexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody CalculateCommonFormDTO formDTO) { - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "epmettest"; + public Result indexCalculate(@RequestHeader("CustomerId") String customerId, @RequestBody CalculateCommonFormDTO formDTO) { formDTO.setCustomerId(customerId); indexCalculate(formDTO); return new Result().ok(true); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java index 09d06df653..b64d7855a0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java @@ -1,16 +1,11 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.KcScreenCollService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * 孔村大屏数据采集api @@ -31,16 +26,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_platform_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("homepage/platformsummary") - public Result platFormSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertPlatFormSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result platFormSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertPlatFormSummary(formDTO, customerId); return new Result(); } @@ -50,16 +45,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_issue_summary_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("issue/summary") - public Result issueSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertIssueSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result issueSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertIssueSummary(formDTO, customerId); return new Result(); } @@ -69,16 +64,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table: screen_kc_issue_trend_grid_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("issue/trend") - public Result issueTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertIssueTrend(formDTO, externalAppRequestParam.getCustomerId()); + public Result issueTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertIssueTrend(formDTO, customerId); return new Result(); } @@ -88,16 +83,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_user_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("user/summary") - public Result userSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertUserSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result userSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertUserSummary(formDTO, customerId); return new Result(); } @@ -107,16 +102,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_volunteer_heat_rank_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("volunteer/heartrank") - public Result volunteerHeartRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertVolunteerHeartRank(formDTO, externalAppRequestParam.getCustomerId()); + public Result volunteerHeartRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertVolunteerHeartRank(formDTO, customerId); return new Result(); } @@ -126,16 +121,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_user_trend_grid_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("user/userheartrank") - public Result userHeartRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertUserHeartRank(formDTO, externalAppRequestParam.getCustomerId()); + public Result userHeartRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertUserHeartRank(formDTO, customerId); return new Result(); } @@ -145,16 +140,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_act_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("act/summary") - public Result actSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertActSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result actSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertActSummary(formDTO, customerId); return new Result(); } @@ -164,16 +159,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_act_trend_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("act/trend") - public Result actTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertActTrend(formDTO, externalAppRequestParam.getCustomerId()); + public Result actTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertActTrend(formDTO, customerId); return new Result(); } @@ -183,16 +178,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_volunteer_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("act/volunteersummary") - public Result volunteerSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertVolunteerSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result volunteerSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertVolunteerSummary(formDTO, customerId); return new Result(); } @@ -202,16 +197,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_project_summary_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("project/summary") - public Result projectSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertProjectSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result projectSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertProjectSummary(formDTO, customerId); return new Result(); } @@ -221,16 +216,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_project_category_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("project/categorysummary") - public Result categorySummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertCategorySummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result categorySummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertCategorySummary(formDTO, customerId); return new Result(); } @@ -240,16 +235,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_project_satis_grid_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("project/satisanalysis") - public Result projectSatisanalysis(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertProjectSatisanalysis(formDTO, externalAppRequestParam.getCustomerId()); + public Result projectSatisanalysis(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertProjectSatisanalysis(formDTO, customerId); return new Result(); } @@ -259,16 +254,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_news_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("news/summary") - public Result newsSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result newsSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertNewsSummary(formDTO, customerId); return new Result(); } @@ -278,16 +273,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_news_trend_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("news/trend") - public Result newsTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsTrend(formDTO, externalAppRequestParam.getCustomerId()); + public Result newsTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertNewsTrend(formDTO, customerId); return new Result(); } @@ -297,16 +292,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_news_rank * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("news/hotrank") - public Result newsHotRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsHotRank(formDTO, externalAppRequestParam.getCustomerId()); + public Result newsHotRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertNewsHotRank(formDTO, customerId); return new Result(); } @@ -316,16 +311,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_news_category_analysis * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("news/categoryanalysis") - public Result newsCategoryAnalysis(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsCategoryAnalysis(formDTO, externalAppRequestParam.getCustomerId()); + public Result newsCategoryAnalysis(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertNewsCategoryAnalysis(formDTO, customerId); return new Result(); } @@ -335,16 +330,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_group_summary_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("group/summary") - public Result groupSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result groupSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertGroupSummary(formDTO, customerId); return new Result(); } @@ -354,16 +349,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_group_detail_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("group/detail") - public Result groupDetail(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupDetail(formDTO, externalAppRequestParam.getCustomerId()); + public Result groupDetail(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertGroupDetail(formDTO, customerId); return new Result(); } @@ -373,16 +368,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_topic_trend_grid_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("group/topictrend") - public Result groupTopicTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupTopicTrend(formDTO, externalAppRequestParam.getCustomerId()); + public Result groupTopicTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertGroupTopicTrend(formDTO, customerId); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java new file mode 100644 index 0000000000..2f81eeadc2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java @@ -0,0 +1,35 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author zxc + * @DateTime 2020/9/24 9:42 上午 + */ +@RestController +@RequestMapping("screenextract") +public class ScreenExtractDailyController { + + @Autowired + private ScreenExtractService screenExtractService; + + /** + * @Description 抽取数据到大屏【天】 + * @param extractFormDTO + * @author zxc + * @date 2020/9/24 10:15 上午 + */ + @PostMapping("extractdailyall") + public Result screenExtractDaily(@RequestBody ExtractFormDTO extractFormDTO){ + screenExtractService.extractDailyAll(extractFormDTO); + return new Result(); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java index 73d6db7bb6..a55567eb45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java @@ -1,15 +1,10 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** @@ -28,144 +23,126 @@ public class ShiBeiScreenCollController { /** * 9、党建引领|基层治理-居民(党员)积分排行榜 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("partyuserrankdata") - public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyUserRankDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result partyUserRankData(@RequestHeader("CustomerId") String customerId, @RequestBody PartyUserRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyUserRankData(formDTO, customerId); return new Result(); } /** * 8、党建引领-党员联系群众数据 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("partylinkmassesdata") - public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyLinkMassesDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); + public Result partyLinkMassesData(@RequestHeader("CustomerId") String customerId, @RequestBody PartyLinkMassesDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyLinkMassesData(formDTO, customerId); return new Result(); } /** * 7、基层党建-建设情况数据(支部、联建、志愿) * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("meetdata") - public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyBranchDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); + public Result meetData(@RequestHeader("CustomerId") String customerId, @RequestBody PartyBranchDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyBranchData(formDTO, customerId); return new Result(); } /** * 6、党建引领-组织排行 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("orgrankdata") - public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgRankDataListFormDTO formDTO) { - shiBeiScreenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result orgRankData(@RequestHeader("CustomerId") String customerId, @RequestBody OrgRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertOrgRankData(formDTO, customerId); return new Result(); } /** * 5、基层治理-治理能力数据 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("governrankdata") - public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GovernRankDataListFormDTO formDTO) { - shiBeiScreenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result governRankData(@RequestHeader("CustomerId") String customerId, @RequestBody GovernRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertGovernRankData(formDTO, customerId); return new Result(); } /** * 4、事件数据 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("eventdata") - public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody EventDataListFormDTO formDTO) { - shiBeiScreenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); + public Result eventData(@RequestHeader("CustomerId") String customerId, @RequestBody EventDataListFormDTO formDTO) { + shiBeiScreenCollService.insertEventData(formDTO, customerId); return new Result(); } /** * 3、难点赌点 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("difficultydata") - public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody DifficultyDataFormDTO formDTO) { - shiBeiScreenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); + public Result difficultyData(@RequestHeader("CustomerId") String customerId, @RequestBody DifficultyDataFormDTO formDTO) { + shiBeiScreenCollService.insertDifficultyData(formDTO, customerId); return new Result(); } /** * 2、党员基本情况 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("cpcbasedata") - public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody CpcBaseDataListFormDTO formDTO) { - shiBeiScreenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); + public Result cpcbaseData(@RequestHeader("CustomerId") String customerId, @RequestBody CpcBaseDataListFormDTO formDTO) { + shiBeiScreenCollService.insertCpcbaseData(formDTO, customerId); return new Result(); } /** * 1、指数_按月统计 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("indexdatamonthly") - public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListMonthlyFormDTO formDTO) { - shiBeiScreenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); + public Result indexDataMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody IndexDataListMonthlyFormDTO formDTO) { + shiBeiScreenCollService.insertIndexDataMonthly(formDTO, customerId); return new Result(); } @@ -174,112 +151,98 @@ public class ShiBeiScreenCollController { /** * 17、指数_按年统计 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("indexdatayearly") - public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListYearlyFormDTO formDTO) { - shiBeiScreenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); + public Result indexDataYearly(@RequestHeader("CustomerId") String customerId, @RequestBody IndexDataListYearlyFormDTO formDTO) { + shiBeiScreenCollService.insertIndexDataYearly(formDTO, customerId); return new Result(); } /** * 16、部门信息上传 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("customerdept") - public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerDeptListFormDTO formDTO) { - shiBeiScreenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerDept(@RequestHeader("CustomerId") String customerId, @RequestBody CustomerDeptListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerDept(formDTO, customerId); return new Result(); } /** * 15、网格信息上传 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("customergrid") - public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerGridListFormDTO formDTO) { - shiBeiScreenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerGrid(@RequestHeader("CustomerId") String customerId, @RequestBody CustomerGridListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerGrid(formDTO, customerId); return new Result(); } /** * 14、组织层级 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("customeragency") - public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerAgencyListFormDTO formDTO) { - shiBeiScreenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerAgency(@RequestHeader("CustomerId") String customerId, @RequestBody CustomerAgencyListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerAgency(formDTO, customerId); return new Result(); } /** * 12、中央区各类总数 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("usertotaldata") - public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserTotalDataListFormDTO formDTO) { - shiBeiScreenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); + public Result userTotalData(@RequestHeader("CustomerId") String customerId, @RequestBody UserTotalDataListFormDTO formDTO) { + shiBeiScreenCollService.insertUserTotalData(formDTO, customerId); return new Result(); } /** * 11、基层治理-公众参与 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("userjoin") - public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserJoinListFormDTO formDTO) { - shiBeiScreenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); + public Result userJoin(@RequestHeader("CustomerId") String customerId, @RequestBody UserJoinListFormDTO formDTO) { + shiBeiScreenCollService.insertUserJoin(formDTO, customerId); return new Result(); } /** * 10、党建引领-先锋模范数据 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("pioneerdata") - public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PioneerDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); + public Result pioneerData(@RequestHeader("CustomerId") String customerId, @RequestBody PioneerDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPioneerData(formDTO, customerId); return new Result(); } @@ -293,10 +256,9 @@ public class ShiBeiScreenCollController { * @Author zhangyong * @Date 09:44 2020-08-25 **/ - @ExternalAppRequestAuth @PostMapping("publicpartitotaldata") - public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PublicPartiTotalDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); + public Result publicPartiTotalData(@RequestHeader("CustomerId") String customerId, @RequestBody PublicPartiTotalDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPublicPartiTotalData(formDTO, customerId); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java index 5844aa19f8..66a156557d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.extract.form.GridHeartedFormDTO; @@ -137,4 +138,13 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectGroupMemberList(@Param("list") List groupIdList); + + /** + * @Description 查询党员建组信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/25 9:46 上午 + */ + List selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("gridIds") List gridIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index 10be6f5bb3..79a1487328 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -123,30 +123,64 @@ public interface FactOriginIssueMainDailyDao extends BaseDao partyMemberUserIds); + int getParyPublishIssueTotal(@Param("customerId") String customerId, + @Param("gridId")String gridId, + @Param("agencyId")String agencyId); /** * @param customerId * @param gridId * @return int * @author yinzuomei - * @description 具体某个网格的议题总数 + * @description 具体某个网格/社区下的议题总数 * @Date 2020/9/23 15:23 **/ - int getGridIssueTotalByGrid(@Param("customerId") String customerId, @Param("gridId") String gridId); + int getGridOrCommunityIssueTotal(@Param("customerId") String customerId, @Param("gridId") String gridId,@Param("communityId") String communityId); /** * @return int * @param customerId * @param gridId + * @param communityId * @author yinzuomei - * @description 网格内议题转项目数 + * @description 网格、社区内议题转项目数 * @Date 2020/9/23 15:45 **/ - int getShiftProjectTotalByGrid(@Param("customerId") String customerId, @Param("gridId") String gridId); + int getGridOrCommunityShiftProjectTotal(@Param("customerId") String customerId, @Param("gridId") String gridId,@Param("communityId") String communityId); + + /** + * @return java.lang.Integer + * @param customerId + * @param agencyPath + * @author yinzuomei + * @description 组织内: 党员发布议题 + * @Date 2020/9/24 16:23 + **/ + Integer getAgencyParyPublishIssueTotal(@Param("customerId")String customerId, + @Param("agencyPath")String agencyPath); + + /** + * @return int + * @param customerId + * @param agencyPath + * @author yinzuomei + * @description 组织内:所有议题总数 + * @Date 2020/9/24 16:26 + **/ + int getAgencyIssueTotal(@Param("customerId")String customerId, + @Param("agencyPath")String agencyPath); + /** + * @return java.lang.Integer + * @param customerId + * @param agencyPath + * @author yinzuomei + * @description 组织下:议题转项目数 + * @Date 2020/9/24 17:05 + **/ + Integer getAgencyShiftProjectTotal(@Param("customerId")String customerId, + @Param("agencyPath")String agencyPath); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index f338e88695..2b5c16dc5e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -111,10 +111,27 @@ public interface FactOriginProjectMainDailyDao extends BaseDao partyMemberUserIds); + int selectPublishedByPartyTopicCount(@Param("customerId") String customerId, + @Param("gridId")String gridId, + @Param("agencyId")String agencyId); /** - * @return int * @param customerId * @param gridId + * @return int * @author yinzuomei * @description 具体某个网格的话题数 * @Date 2020/9/23 14:23 **/ - int selectGridTopicTotalByGrid(@Param("customerId")String customerId, @Param("gridId")String gridId); + int selectGridOrCommunityTopicTotal(@Param("customerId") String customerId, @Param("gridId") String gridId, @Param("agencyId") String agencyId); /** * @return void - * @param list * @author yinzuomei * @description 更新话题主表的TOPIC_STATUS , CLOSED_STATUS * @Date 2020/9/23 17:59 **/ - void updateFactOriginTopicMain(@Param("list") List list); + void updateFactOriginTopicMain(@Param("topicId")String topicId,@Param("topicStatus")String topicStatus,@Param("closedStatus")String closedStatus); + + /** + * @return java.lang.Integer + * @param customerId + * @param agencyPath + * @author yinzuomei + * @description + * @Date 2020/9/24 15:53 + **/ + Integer getAgencyPartyTopicTotal(@Param("customerId") String customerId, + @Param("agencyPath")String agencyPath, + @Param("createTopicUserIsParty") String createTopicUserIsParty); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java index 9adf9fc179..366b23af58 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java @@ -35,5 +35,5 @@ public interface AgencySelfSubScoreDao extends BaseDao int insertBatch(@Param("list") List list); - int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode); + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType, @Param("parentIndexCode") String parentIndexCode); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java index 3a28e2d908..be812e2ca4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java @@ -52,5 +52,6 @@ public interface AgencySubScoreDao extends BaseDao { */ Integer deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType, @Param("delNum") Integer delNum); - List selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("levelIndexPath") String levelIndexPath); + List selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("dataType") String dataType, @Param("allIndexCodePath") String allIndexCodePath); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java index 9827dbaa64..12e8631a77 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java @@ -33,7 +33,7 @@ import java.util.List; @Mapper public interface CommunitySelfSubScoreDao extends BaseDao { - int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode); int insertBatch(@Param("list") List communitySelfSubScoreEntities); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java index ac850fc317..c9f7ca35b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java @@ -52,5 +52,5 @@ public interface CommunitySubScoreDao extends BaseDao selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("levelIndexPath") String levelIndexPath); + List selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allIndexCodePath") String allIndexCodePath); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSelfSubScoreDao.java new file mode 100644 index 0000000000..a8b5b90a2b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSelfSubScoreDao.java @@ -0,0 +1,39 @@ +/** + * 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.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.indexcal.DeptSelfSubScoreEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 社区相关 自身/下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Mapper +public interface DeptSelfSubScoreDao extends BaseDao { + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode); + + int insertBatch(@Param("list") List deptSelfSubScoreEntities); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java index fe388c6b6b..c9ec728209 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java @@ -22,7 +22,6 @@ import com.epmet.entity.evaluationindex.indexcal.DeptSubScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import javax.annotation.security.PermitAll; import java.util.List; /** @@ -54,7 +53,9 @@ public interface DeptSubScoreDao extends BaseDao { * @Date 2020/9/10 12:28 **/ int deleteBatches(@Param("customerId") String customerId, - @Param("monthId") String monthId, - @Param("allParentIndexCode") String allParentIndexCode, - @Param("deleteSize") Integer deleteSize); + @Param("monthId") String monthId, + @Param("allParentIndexCode") String allParentIndexCode, + @Param("deleteSize") Integer deleteSize); + + List selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allIndexCodePath") String allIndexCodePath); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index 927e157db0..2e047268de 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -104,21 +104,6 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao selectAllGridInfo(String customerId); - /** - * @Description 查询全部网格信息 - * @param customerId - * @author zxc - * @date 2020/9/19 10:50 上午 - */ - List selectAllGridInfoToParty(String customerId); - /** * @Description 批量插入治理能力 * @param lists @@ -135,4 +120,14 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao + */ + List selectGridByCustomer(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java index c27f8b8857..716d9b2cfb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java @@ -85,4 +85,12 @@ public interface ScreenCpcBaseDataDao extends BaseDao { * @date 2020/9/23 2:01 下午 */ List selectPartyInfo(@Param("customerId") String customerId,@Param("dateId") String dateId, String agencyId); + + /** + * @Description 查询党员信息【直属网格的】 + * @param gridIds + * @author zxc + * @date 2020/9/24 3:23 下午 + */ + List selectDirectGridPartyInfo(@Param("gridIds") List gridIds,@Param("customerId") String customerId,@Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 65f2faf3b1..62ba836b5c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -19,7 +19,9 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; +import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.screen.result.TreeResultDTO; import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; @@ -152,4 +154,21 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAllAgencyIdToParty(@Param("customerId")String customerId,@Param("dateId")String dateId); + + /** + * @Description 查询客户下所有机关ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:39 上午 + */ + List selectAllAgencyIdToPartyLinkMessage(String customerId, String monthId); + + /** + * @Description 查询org名称【机关】 + * @param agencyIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgNameAgency(@Param("agencyIds") List agencyIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java index 28338f0da7..d917f62ffb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -19,7 +19,12 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ScreenCustomerGridDTO; +import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; +import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.result.GridInfoResultDTO; +import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.screencoll.form.CustomerGridFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; @@ -138,4 +143,45 @@ public interface ScreenCustomerGridDao extends BaseDao * @date 2020/9/23 3:10 下午 */ List selectAllGridIdToParty(String customerId, String dateId); + + /** + * @Description 查询客户下所有网格ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:43 上午 + */ + List selectAllGridIdToPartyLinkMessage(@Param("customerId") String customerId,@Param("monthId") String monthId); + + /** + * @Description 查询org名称 + * @param gridIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgName(@Param("gridIds") List gridIds); + + /** + * @Description 查询机关的直属网格 + * @param agencyIds + * @author zxc + * @date 2020/9/24 2:33 下午 + */ + List selectDirectGrid(@Param("agencyIds") List agencyIds); + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/19 10:50 上午 + */ + List selectAllGridInfoToParty(String customerId); + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/18 10:47 上午 + */ + List selectAllGridInfo(@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java index 24e3d65a09..d40a702dbe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java @@ -56,4 +56,23 @@ public interface ScreenGovernRankDataDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * 组织级别初始化数据 + * @author zhaoqifeng + * @date 2020/9/24 14:52 + * @param customerId + * @param level + * @return java.util.List + */ + List initAgencyDataList(@Param("customerId") String customerId, @Param("level") String level); + + /** + * 网格级别初始化数据 + * @author zhaoqifeng + * @date 2020/9/24 14:52 + * @param customerId + * @return java.util.List + */ + List initGridDataList(@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java index 385f27d2f9..8c5211cefc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.screencoll.form.PartyBranchDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -56,4 +57,12 @@ public interface ScreenPartyBranchDataDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 插入建设情况数据 + * @param lists + * @author zxc + * @date 2020/9/25 9:16 上午 + */ + void insertScreenPartyBranchData(@Param("lists") List lists); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java index 857958ad1c..586ab1d0a8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.screencoll.form.PartyLinkMassesDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -55,4 +56,32 @@ public interface ScreenPartyLinkMassesDataDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 批量插入党员联系群众数据 + * @param lists + * @author zxc + * @date 2020/9/24 6:06 下午 + */ + void insertScreenPartyLinkMassesData(@Param("lists")List lists); + + /** + * @Description 删除旧的党员联系群众 + * @param customerId + * @param monthId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + Integer deleteOldPartyLinkInfo(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("orgIds") List orgIds); + + /** + * @Description 查询党员联系群众信息 + * @Param customerId + * @Param monthId + * @Param agencyId + * @author zxc + * @date 2020/9/25 1:19 下午 + */ + List selectPartyLinkMassesInfo(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("agencyId") String agencyId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java index becb9d1034..daeb4c7443 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java @@ -43,10 +43,24 @@ public interface ScreenPioneerDataDao extends BaseDao { * @Author zhangyong * @Date 10:52 2020-08-18 **/ + Integer deletePioneerDataByCustomerId(@Param("customerId") String customerId, + @Param("deleteSize") Integer deleteSize); + + + /** + * @return java.lang.Integer + * @param customerId + * @param orgType + * @param deleteSize + * @param orgIds + * @author yinzuomei + * @description 产品客户采集用删除方法 + * @Date 2020/9/24 14:59 + **/ Integer deletePioneerData(@Param("customerId") String customerId, @Param("orgType") String orgType, - @Param("dataEndTime")String dataEndTime, - @Param("deleteSize") Integer deleteSize); + @Param("deleteSize") Integer deleteSize, + @Param("orgIds")List orgIds); /** * 10、党建引领-先锋模范数据 @@ -71,12 +85,20 @@ public interface ScreenPioneerDataDao extends BaseDao { /** * @return java.util.List * @param customerId - * @param agencyLevel * @author yinzuomei - * @description 初始化好orgType="agency"的插入对象 + * @description 初始化好社区, orgType="agency"的插入对象 * @Date 2020/9/22 15:03 **/ - List initAgencyPioneerDataList(@Param("customerId")String customerId, @Param("agencyLevel")String agencyLevel); + List initCommunityPioneerDataList(@Param("customerId")String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 初始化好非社区的, orgType="agency"的插入对象 + * @Date 2020/9/24 13:45 + **/ + List initExceptCommunityPioneerDataList(@Param("customerId")String customerId); /** * @return void diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java index f09189dce0..2456d0d93a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java @@ -55,4 +55,6 @@ public interface ScreenUserTotalDataDao extends BaseDao list, @Param("customerId")String customerId); + + void insertBatch(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java index 22129567a5..0d614b2e4a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java @@ -76,8 +76,28 @@ public interface DimCustomerPartymemberDao extends BaseDao selectGridPartyMemberUserIds(@Param("customerId") String customerId, @Param("gridId")String gridId); + + /** + * @return java.util.List + * @param customerId + * @param communityId + * @author yinzuomei + * @description 社区内注册的党员 + * @Date 2020/9/24 10:22 + **/ + List selectCommunityPartyMemberUserIds(@Param("customerId") String customerId, @Param("communityId")String communityId); + + /** + * @return java.util.List + * @param customerId + * @param pids + * @author yinzuomei + * @description 根据pids查询党员 + * @Date 2020/9/24 14:31 + **/ + List selectPartyMemberUserIdsByPids(@Param("customerId") String customerId, @Param("pids")String pids); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java index 2fbabdec6c..87409a6607 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java @@ -19,8 +19,10 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.project.form.MonthProjectListFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.FactAgencyProjectDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -46,4 +48,16 @@ public interface FactAgencyProjectDailyDao extends BaseDao selectProjectCountByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId ); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java index c97f5c8120..5dfd4bc79d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java @@ -19,11 +19,13 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.group.result.GroupGridDailyResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.FactGroupGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 组-网格日统计数据 @@ -47,5 +49,15 @@ public interface FactGroupGridDailyDao extends BaseDao * @author zxc */ void deleteInsertDateId(@Param("dateId")String dateId,@Param("customerId")String customerId); - + + /** + * @Description 根据机关级别查询小组数据 + * @param orgLevel + * @param customerId + * @param dateId + * @return + * @author wangc + * @date 2020.09.24 16:19 + **/ + List selectGroupCountByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java index 595131257d..c26edcd375 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java @@ -18,10 +18,13 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.FactIssueGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 网格议题数量(按日) * @@ -39,5 +42,16 @@ public interface FactIssueGridDailyDao extends BaseDao * @return void */ void deleteByCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 根据机关类型查询议题数据 + * @param orgLevel + * @param customerId + * @param dateId + * @return + * @author wangc + * @date 2020.09.24 17:19 + **/ + List selectIssueCountByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId ); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java index 7276945b90..7a0e6439df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.stats.topic; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.stats.topic.FactTopicTotalGridDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.topic.FactTopicTotalGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -36,4 +37,15 @@ public interface FactTopicTotalGridDailyDao extends BaseDao list); void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); + + /** + * @Description 根据机关类型查询话题数据 + * @param orgLevel + * @param customerId + * @param dateId + * @return + * @author wangc + * @date 2020.09.24 17:19 + **/ + List selectTopicCountByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId ); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java index 248efe22a6..cd84b6d3b0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.result.UserCountResultDTO; import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -48,4 +49,12 @@ public interface FactParticipationUserGridDailyDao extends BaseDao selectUserCount(String customerId, String dateId); + /** + * @Description 根据机构级别查询用户数与党员数 + * @param orgLevel + * @return + * @author wangc + * @date 2020.09.24 14:59 + **/ + List selectUserAndPartymemberByOrgLevel(@Param("orgLevel") String orgLevel,@Param("customerId") String customerId, @Param("dateId")String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java index 8b87b26a4e..3fc2a5888b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java @@ -96,4 +96,9 @@ public class AgencySubScoreEntity extends BaseEpmetEntity { * 权重(同一组权重总和=1) */ private BigDecimal weight; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSelfSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSelfSubScoreEntity.java new file mode 100644 index 0000000000..7e5395450f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSelfSubScoreEntity.java @@ -0,0 +1,100 @@ +/** + * 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.epmet.entity.evaluationindex.indexcal; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 区直部门相关 自身/下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-23 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_dept_self_sub_score") +public class DeptSelfSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 部门id + */ + private String deptId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 自身指标得分 + */ + private BigDecimal selfScore; + + /** + * 下级指标得分 + */ + private BigDecimal subScore; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; + */ + private String parentIndexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 自身指标权重 + */ + private BigDecimal selfWeight; + + /** + * 下级指标权重 + */ + private BigDecimal subWeight; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java index a51b8b6449..c03d32f1df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java @@ -117,4 +117,11 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity { */ private String dataEndTime; + + /** + * + */ + private String pid; + private String agencyPids; + private String agencyPath; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index 5e69ff1c2d..9a9b0c0aa1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -15,6 +15,7 @@ import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; import com.epmet.service.heart.ActInfoService; import com.epmet.service.partymember.PartyMemberService; import com.epmet.service.stats.FactArticlePublishedGridDailyService; @@ -74,6 +75,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { private UserService userService; @Autowired private PartyMemberService partyMemberService; + @Autowired + private ScreenCustomerGridService gridService; /** * @Description 计算网格指标党建能力 @@ -84,7 +87,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { */ @Override public Boolean calGridIndexPartyAbility(String customerId, String monthId) { - List result = governAbilityDao.selectAllGridInfoToParty(customerId); + List result = gridService.selectAllGridInfoToParty(customerId); if (CollectionUtils.isEmpty(result)){ log.warn(String.format(ExtractConstant.CUSTOMER_INFO_NULL,customerId)); return true; @@ -239,7 +242,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { @Override public Boolean calGridIndexGovernAbility(String customerId, String monthId) { - List result = governAbilityDao.selectAllGridInfo(customerId); + List result = gridService.selectAllGridInfo(customerId); if (CollectionUtils.isEmpty(result)){ log.warn(String.format(ExtractConstant.CUSTOMER_INFO_NULL,customerId)); return true; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java index bf40ac8388..fdaac9d36e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java @@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; @@ -62,4 +63,13 @@ public interface FactOriginGroupMainDailyService extends BaseService originGroupData,List memberList); + + /** + * @Description 查询党员建组信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/25 9:46 上午 + */ + List selectPartyCreateGroupInfo(String customerId,String monthId,List gridIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java index 7061178362..8afc53cd16 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java @@ -20,8 +20,6 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; -import java.util.List; - /** * 议题主表 * @@ -33,29 +31,59 @@ public interface FactOriginIssueMainDailyService extends BaseService partyMemberUserIds); + int getParyPublishIssueTotal(String customerId,String gridId,String agencyId); + /** - * @return int + * @return java.lang.Integer * @param customerId * @param gridId * @author yinzuomei - * @description 具体某个网格的议题总数 - * @Date 2020/9/23 15:22 + * @description 网格内议题转项目数 + * @Date 2020/9/23 15:39 + **/ + Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId,String communityId); + + /** + * @return int + * @param customerId + * @param communityId + * @author yinzuomei + * @description 某个网格内或者社区内议题总数 + * @Date 2020/9/24 10:45 **/ - int getGridIssueTotalByGrid(String customerId, String gridId); + int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId); /** * @return java.lang.Integer * @param customerId - * @param gridId + * @param agencyPath * @author yinzuomei - * @description 网格内议题转项目数 - * @Date 2020/9/23 15:39 + * @description 组织内: 党员发布议题 + * @Date 2020/9/24 16:23 + **/ + Integer getAgencyParyPublishIssueTotal(String customerId, String agencyPath); + + /** + * @return int + * @param customerId + * @param agencyPath + * @author yinzuomei + * @description 组织内:所有议题总数 + * @Date 2020/9/24 16:26 + **/ + int getAgencyIssueTotal(String customerId, String agencyPath); + + /** + * @return java.lang.Integer + * @param customerId + * @param agencyPath + * @author yinzuomei + * @description 组织下:议题转项目数 + * @Date 2020/9/24 17:04 **/ - Integer getShiftProjectTotalByGrid(String customerId, String gridId); + Integer getAgencyShiftProjectTotal(String customerId, String agencyPath); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index ea2679c372..9440cf9bc8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -173,5 +173,16 @@ public interface FactOriginProjectMainDailyService extends BaseService partyMemberUserIds); + int calPublishedByPartyTopicCount(String customerId,String gridId,String agencyId); /** * @return int * @param customerId * @param gridId * @author yinzuomei - * @description 具体某个网格的话题数 + * @description 具体某个网格或者社区的话题数 * @Date 2020/9/23 14:22 **/ - int calGridTopicTotalByGrid(String customerId, String gridId); + int calGridOrCommunityTopicTotal(String customerId, String gridId,String communityId); + + /** + * @return java.lang.Integer + * @param customerId + * @param agencyPath + * @param createTopicUserIsParty 1是党员 + * @author yinzuomei + * @description 在当前组织下,话题总数(createTopicUserIsParty=1时查询党员发布的话题总数) + * @Date 2020/9/24 15:49 + **/ + Integer getAgencyPartyTopicTotal(String customerId, String agencyPath,String createTopicUserIsParty); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index ed5aeca1a1..4cc0ebb248 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -21,13 +21,16 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -97,4 +100,19 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl selectPartyCreateGroupInfo(String customerId, String monthId,List gridIds) { + if (!CollectionUtils.isEmpty(gridIds)){ + return baseDao.selectPartyCreateGroupInfo(customerId, monthId, gridIds); + } + return new ArrayList<>(); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java index 78d9434cd1..c67d2d8151 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java @@ -19,16 +19,12 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.List; /** * 议题主表 @@ -44,43 +40,78 @@ public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl partyMemberUserIds) { - if(CollectionUtils.isEmpty(partyMemberUserIds)){ - return NumConstant.ZERO; - } - return baseDao.getParyPublishIssueTotal(customerId,partyMemberUserIds); + public int getParyPublishIssueTotal(String customerId,String gridId,String agencyId) { + return baseDao.getParyPublishIssueTotal(customerId,gridId,agencyId); } /** * @param customerId * @param gridId + * @return java.lang.Integer + * @author yinzuomei + * @description 网格内议题转项目数 + * @Date 2020/9/23 15:39 + **/ + @Override + public Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId,String communityId) { + return baseDao.getGridOrCommunityShiftProjectTotal(customerId,gridId,communityId); + } + + /** + * @param customerId + * @param communityId * @return int * @author yinzuomei - * @description 具体某个网格的议题总数 - * @Date 2020/9/23 15:22 + * @description 网格内或者社区内议题总数 + * @Date 2020/9/24 10:45 **/ @Override - public int getGridIssueTotalByGrid(String customerId, String gridId) { - return baseDao.getGridIssueTotalByGrid(customerId,gridId); + public int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId) { + return baseDao.getGridOrCommunityIssueTotal(customerId,gridId,communityId); } /** * @param customerId - * @param gridId + * @param agencyPath * @return java.lang.Integer * @author yinzuomei - * @description 网格内议题转项目数 - * @Date 2020/9/23 15:39 + * @description 组织内: 党员发布议题 + * @Date 2020/9/24 16:23 + **/ + @Override + public Integer getAgencyParyPublishIssueTotal(String customerId, String agencyPath) { + return baseDao.getAgencyParyPublishIssueTotal(customerId,agencyPath); + } + + /** + * @param customerId + * @param agencyPath + * @return int + * @author yinzuomei + * @description 组织内:所有议题总数 + * @Date 2020/9/24 16:26 + **/ + @Override + public int getAgencyIssueTotal(String customerId, String agencyPath) { + return baseDao.getAgencyIssueTotal(customerId,agencyPath); + } + + /** + * @param customerId + * @param agencyPath + * @return java.lang.Integer + * @author yinzuomei + * @description 组织下:议题转项目数 + * @Date 2020/9/24 17:04 **/ @Override - public Integer getShiftProjectTotalByGrid(String customerId, String gridId) { - return baseDao.getShiftProjectTotalByGrid(customerId,gridId); + public Integer getAgencyShiftProjectTotal(String customerId, String agencyPath) { + return baseDao.getAgencyShiftProjectTotal(customerId,agencyPath); } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index f38a04aefc..68bea2819d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -181,7 +181,21 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl updateTopicOriginInfoList) { - //批量更新 - List> partition = ListUtils.partition(updateTopicOriginInfoList, IndexCalConstant.INSERT_SIZE); - partition.forEach(list -> { - baseDao.updateFactOriginTopicMain(list); + updateTopicOriginInfoList.forEach(topicOriginInfoDTO -> { + baseDao.updateFactOriginTopicMain(topicOriginInfoDTO.getTopicId(), + topicOriginInfoDTO.getTopicStatus(), + topicOriginInfoDTO.getClosedStatus()); }); } @@ -277,18 +277,14 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl partyMemberUserIds) { - if(CollectionUtils.isEmpty(partyMemberUserIds)){ - return NumConstant.ZERO; - } - return baseDao.selectPublishedByPartyTopicCount(customerId,partyMemberUserIds); + public int calPublishedByPartyTopicCount(String customerId,String gridId,String agencyId) { + return baseDao.selectPublishedByPartyTopicCount(customerId,gridId,agencyId); } /** @@ -296,11 +292,25 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl { if (r.getAgencyId().equals(pid.getAgencyId())){ r.setPid(pid.getPid()); - r.setPids(pid.getPids()); + r.setPids(pid.getPids().concat(":").concat(pid.getPid())); } }); }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java new file mode 100644 index 0000000000..0d44c2143e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java @@ -0,0 +1,41 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/24 14:28 + */ +public interface GovernRankDataExtractService { + /** + * 网格治理能力 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:16 + */ + void extractGridData(String customerId, String monthId); + + /** + * 社区治理能力 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractCommunityData(String customerId, String monthId); + + /** + * 街道治理能力 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractStreetData(String customerId, String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java new file mode 100644 index 0000000000..8700a2b7e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +/** + * @Author zxc + * @DateTime 2020/9/24 5:05 下午 + */ +public interface PartyGuideService { + + /** + * @Description 党建引领抽取 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/24 5:10 下午 + */ + Boolean partyGuideExtract(String customerId,String monthId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java index 7aadba0ae5..0b8384a024 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java @@ -26,11 +26,5 @@ public interface PioneerDataExtractService { // 社区、街道、区县、市级别、省级 void extractCommunityPioneerData(String customerId, String dateId); - void extractStreetPioneerData(String customerId, String dateId); - - void extractDistrictPioneerData(String customerId, String dateId); - - void extractCityPioneerData(String customerId, String dateId); - - void extractProvincePioneerData(String customerId, String dateId); + void extractExceptCommunityPioneerData(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java new file mode 100644 index 0000000000..388559649d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java @@ -0,0 +1,32 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +/** + * @desc: 大屏 公众参与抽取服务接口 + * @Author: LiuJanJun + * @Date: 2020/9/25 10:03 上午 + * @Version: 1.0 + */ +public interface PublicPartExtractService { + + /** + * desc: 抽取公众参与 人均议题 总次数和平均参与度 + * target:screen_user_join + * + * @param + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + Boolean extractTotalDataMonthly(); + + /** + * desc: 抽取公众参与 各类总数 + * target:screen_public_parti_total_data + * + * @param + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + Boolean extractPerTotalDataDaily(); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenCentralZoneDataAbsorptionService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenCentralZoneDataAbsorptionService.java new file mode 100644 index 0000000000..7c11d3acb3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenCentralZoneDataAbsorptionService.java @@ -0,0 +1,19 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; + +/** + * 大屏中央区数据写入 + * */ + +public interface ScreenCentralZoneDataAbsorptionService { + + /** + * @Description 中央区数据写入 + * @param param + * @return + * @author wangc + * @date 2020.09.24 10:41 + **/ + void centralZoneDataHub(ScreenCentralZoneDataFormDTO param); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java new file mode 100644 index 0000000000..70ff60bff3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java @@ -0,0 +1,19 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +import com.epmet.dto.extract.form.ExtractFormDTO; + +/** + * @Author zxc + * @DateTime 2020/9/24 9:57 上午 + */ +public interface ScreenExtractService { + + /** + * @Description 抽取数据到大屏【天】 + * @param extractFormDTO + * @author zxc + * @date 2020/9/24 10:15 上午 + */ + void extractDailyAll(ExtractFormDTO extractFormDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenOrgService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenOrgService.java new file mode 100644 index 0000000000..bb177bd877 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenOrgService.java @@ -0,0 +1,32 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +/** + * @desc: 大屏 产品内部客户组织结构数据 + * @Author: LiuJanJun + * @Date: 2020/9/25 10:03 上午 + * @Version: 1.0 + */ +public interface ScreenOrgService { + + /** + * desc: 抽取公众参与 人均议题 总次数和平均参与度 + * target:screen_user_join + * + * @param + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + Boolean getInnerCustomerAgencyTree(); + + /** + * desc: 抽取公众参与 各类总数 + * target:screen_public_parti_total_data + * + * @param + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + Boolean extractPerTotalDataDaily(); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java new file mode 100644 index 0000000000..58e149d6fd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java @@ -0,0 +1,64 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; +import com.epmet.service.evaluationindex.extract.toscreen.GovernRankDataExtractService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/24 14:31 + */ +public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractService { + @Autowired + private ScreenGovernRankDataService screenGovernRankDataService; + @Autowired + private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; + @Autowired + private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService; + + @Override + public void extractGridData(String customerId, String monthId) { + List list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.GRID, null); + if (CollectionUtils.isEmpty(list)) { + return; + } + List gridList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId); + list.forEach(entity -> gridList.stream().filter(gridAblity -> entity.getOrgId().equals(gridAblity.getGridId())).forEach(grid -> { + BigDecimal total = new BigDecimal(grid.getProjectTotal()); + entity.setYearId(grid.getYearId()); + entity.setMonthId(grid.getMonthId()); + //TODO 响应率 + //解决率 + BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount()); + entity.setResolvedRatio(resolveCount.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + //自治率 + BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount()); + entity.setGovernRatio(selfCount.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + //满意率 + entity.setSatisfactionRatio(grid.getSatisfactionRatio()); + })); + } + + @Override + public void extractCommunityData(String customerId, String monthId) { + + } + + @Override + public void extractStreetData(String customerId, String monthId) { + + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java index 050b8df4ce..f30e987bb9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java @@ -2,10 +2,7 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; -import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; -import com.epmet.dto.extract.result.PartyInfoResultDTO; -import com.epmet.dto.extract.result.PartyMemberInfoResultDTO; -import com.epmet.dto.extract.result.UserCountResultDTO; +import com.epmet.dto.extract.result.*; import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; import com.epmet.service.evaluationindex.screen.ScreenCpcBaseDataService; import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; @@ -63,24 +60,30 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { public Boolean statsPartyMemberBaseInfoToScreen(String customerId, String dateId) { List agencyIdList = agencyService.selectAllAgencyId(customerId); if (!CollectionUtils.isEmpty(agencyIdList)){ + // 根据组织级别分组 Map> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel)); if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){ + // 社区级别 List customerGridInfoList = groupByLevel.get(ScreenConstant.COMMUNITY); disPose(customerGridInfoList,true,customerId,dateId); } if (groupByLevel.containsKey(ScreenConstant.STREET)){ + // 街道级别 List customerGridInfoList = groupByLevel.get(ScreenConstant.STREET); disPose(customerGridInfoList,false,customerId,dateId); } if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){ + // 区级 List customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT); disPose(customerGridInfoList,false,customerId,dateId); } if (groupByLevel.containsKey(ScreenConstant.CITY)){ + // 市级 List customerGridInfoList = groupByLevel.get(ScreenConstant.CITY); disPose(customerGridInfoList,false,customerId,dateId); } if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){ + // 省级 List customerGridInfoList = groupByLevel.get(ScreenConstant.PROVINCE); disPose(customerGridInfoList,false,customerId,dateId); } @@ -96,60 +99,34 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { */ public void disPose(List agencyIdList, Boolean isGrid, String customerId, String dateId){ if (!CollectionUtils.isEmpty(agencyIdList)){ + // 网格ID或机关Id List orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); List result = new ArrayList<>(); if (isGrid == true){ + // 是 community 级别,子级为gridId List userCountList = userGridDailyService.selectUserCount(customerId, dateId); agencyIdList.forEach(agency -> { - // 1. 处理社区下的所有网格中的党员信息 - String agencyId = agency.getAgencyId(); - Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); - List gridIds = (List) agencyMap.get(agencyId); - orgIds.addAll(gridIds); - List partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, gridIds); - if (!CollectionUtils.isEmpty(partyMemberInfoList)){ - // 为每个人赋值年龄 - partyMemberInfoList.forEach(party -> { - party.setAge(getAge(party.getBirthday())); - }); - Map> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId)); - groupByGridId.forEach((gridId,partyInfos) -> { - PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); - form.setOrgType(ScreenConstant.GRID); - form.setOrgId(gridId); - form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName()); - form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false)); - form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY)); - form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY)); - form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY)); - form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY)); - form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true)); - form.setCustomerId(customerId); - form.setDataEndTime(dateId); - form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId()); - if (!CollectionUtils.isEmpty(userCountList)){ - userCountList.forEach(user -> { - if (gridId.equals(user.getOrgId())){ - form.setResiTotal(user.getResiTotal()); - form.setRegisterUserCount(user.getRegisterUserCount()); - form.setPartyMemberCount(user.getPartyMemberCount()); - } - }); - } - result.add(form); - }); - } + GridPartyDTO gridPartyDTO = gridParty(customerId, dateId, agency); + result.addAll(gridPartyDTO.getResult()); + orgIds.addAll(gridPartyDTO.getOrgIds()); }); - // 2. 处理社区级别的党员信息 + // 2. 处理社区级别的党员信息(因为网格级别的已算出,社区级别直接累加) Map> groupByAgency = result.stream().collect(Collectors.groupingBy(PartyBaseInfoFormDTO::getParentId)); + List orgNameAgencyList = agencyService.selectOrgNameAgency(result.stream().map(m -> m.getParentId()).distinct().collect(Collectors.toList())); groupByAgency.forEach((commAgencyId,party) -> { PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); - form.setOrgName(party.get(NumConstant.ZERO).getOrgName()); + if (!CollectionUtils.isEmpty(orgNameAgencyList)){ + orgNameAgencyList.forEach(name -> { + if (commAgencyId.equals(name.getAgencyId())){ + form.setOrgName(name.getAgencyName()); + form.setParentId(name.getParentId()); + } + }); + } form.setOrgId(commAgencyId); form.setCustomerId(customerId); form.setDataEndTime(dateId); form.setOrgType(ScreenConstant.AGENCY); - form.setParentId(party.get(NumConstant.ZERO).getParentId()); form.setAgeLevel1(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel1))); form.setAgeLevel2(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel2))); form.setAgeLevel3(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel3))); @@ -163,9 +140,66 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { }); delAndInsert(result,customerId,dateId,orgIds); }else { + // 级别为 street,district,city,province + List directGridIds = gridService.selectDirectGrid(orgIds); + List userCountList = userGridDailyService.selectUserCount(customerId, dateId); agencyIdList.forEach(agency -> { String agencyId = agency.getAgencyId(); + List dGridId = new ArrayList<>(); + directGridIds.forEach(grid -> { + if (agencyId.equals(grid.getAgencyId())){ + dGridId.add(grid.getGridId()); + } + }); + // 不为空 存在直属网格 + if (!CollectionUtils.isEmpty(dGridId)){ + List disGrid = new ArrayList<>(); + List partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, dGridId); + List orgNameList = agencyService.selectOrgNameGrid(partyMemberInfoList.stream().map(m -> m.getGridId()).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(partyMemberInfoList)){ + // 为每个人赋值年龄 + partyMemberInfoList.forEach(party -> { + party.setAge(getAge(party.getBirthday())); + orgNameList.forEach(orgName -> { + if (party.getGridId().equals(orgName.getGridId())){ + party.setGridName(orgName.getGridName()); + party.setAgencyName(orgName.getAgencyName()); + } + }); + }); + Map> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId)); + groupByGridId.forEach((gridId,partyInfos) -> { + PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); + form.setOrgType(ScreenConstant.GRID); + form.setOrgId(gridId); + form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName()); + form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false)); + form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY)); + form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY)); + form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY)); + form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY)); + form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true)); + form.setCustomerId(customerId); + form.setDataEndTime(dateId); + form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId()); + if (!CollectionUtils.isEmpty(userCountList)){ + userCountList.forEach(user -> { + if (gridId.equals(user.getOrgId())){ + form.setResiTotal(user.getResiTotal()); + form.setRegisterUserCount(user.getRegisterUserCount()); + form.setPartyMemberCount(user.getPartyMemberCount()); + } + }); + } + disGrid.add(form); + }); + } + delAndInsert(disGrid,customerId,dateId,dGridId); + } + // 查询下级机关的党员信息,直接累加 【包括直属网格】 + List directGridList = cpcBaseDataService.selectDirectGridPartyInfo(dGridId, customerId, dateId); List partyInfoList = cpcBaseDataService.selectPartyInfo(customerId, dateId, agencyId); + partyInfoList.addAll(directGridList); if (!CollectionUtils.isEmpty(partyInfoList)){ PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); form.setOrgName(partyInfoList.get(NumConstant.ZERO).getOrgName()); @@ -207,6 +241,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { int birthDayMonth = birth.getMonthValue(); int birthDayOfMonth = birth.getDayOfMonth(); int age = nowYear - birthDayYear; + // 当前月小于出生年的月份 或者 当前月等于出生年的月 并且 当前日小于出生年的日,就是不满一岁 if (nowMonth < birthDayMonth || (nowMonth == birthDayMonth && nowDayOfMonth < birthDayOfMonth)) { age--; } @@ -223,6 +258,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { */ public Integer disposeAgeArea(List partyMemberInfoList, Integer startAge,Integer endAge ){ if (!CollectionUtils.isEmpty(partyMemberInfoList)){ + // 计算大于多少岁并小于多少岁的人 List collect = partyMemberInfoList.stream().filter(p -> p.getAge() >= startAge).filter(p -> p.getAge() <= endAge).collect(Collectors.toList()); return collect.size(); } @@ -241,8 +277,10 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { if (!CollectionUtils.isEmpty(partyMemberInfoList)){ List collect = new ArrayList<>(); if (isGreater == true){ + // 大于 collect = partyMemberInfoList.stream().filter(p -> p.getAge() > age).collect(Collectors.toList()); }else { + // 小于 collect = partyMemberInfoList.stream().filter(p -> p.getAge() < age).collect(Collectors.toList()); } return collect.size(); @@ -260,10 +298,13 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { */ @Transactional(rollbackFor = Exception.class) public void delAndInsert(List result, String customerId, String dateId, List orgIds){ + // 查询客户下所有的agency List partyBaseInfoList = agencyService.selectAllAgencyIdToParty(customerId,dateId); + // 查询客户下所有的grid List resultList = gridService.selectAllGridIdToParty(customerId, dateId); resultList.addAll(partyBaseInfoList); List finalResult = new ArrayList<>(); + // 因为是根据级别来删除,插入,所以把需要操作的orgIds单独出来 resultList.forEach(rl -> { orgIds.forEach(orgId -> { if (rl.getOrgId().equals(orgId)){ @@ -289,4 +330,57 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { cpcBaseDataService.insertPartyBaseInfo(p); }); } + + public GridPartyDTO gridParty(String customerId,String dateId,CustomerAgencyInfoResultDTO agency){ + List result = new ArrayList<>(); + List orgIds = new ArrayList<>(); + List userCountList = userGridDailyService.selectUserCount(customerId, dateId); + // 1. 处理社区下的所有网格中的党员信息 + String agencyId = agency.getAgencyId(); + // 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId) + Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); + List gridIds = (List) agencyMap.get(agencyId); + orgIds.addAll(gridIds); + List partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, gridIds); + List orgNameList = agencyService.selectOrgNameGrid(partyMemberInfoList.stream().map(m -> m.getGridId()).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(partyMemberInfoList)){ + // 为每个人赋值年龄 + partyMemberInfoList.forEach(party -> { + party.setAge(getAge(party.getBirthday())); + orgNameList.forEach(orgName -> { + if (party.getGridId().equals(orgName.getGridId())){ + party.setGridName(orgName.getGridName()); + party.setAgencyName(orgName.getAgencyName()); + } + }); + }); + Map> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId)); + groupByGridId.forEach((gridId,partyInfos) -> { + PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); + form.setOrgType(ScreenConstant.GRID); + form.setOrgId(gridId); + form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName()); + form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false)); + form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY)); + form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY)); + form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY)); + form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY)); + form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true)); + form.setCustomerId(customerId); + form.setDataEndTime(dateId); + form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId()); + if (!CollectionUtils.isEmpty(userCountList)){ + userCountList.forEach(user -> { + if (gridId.equals(user.getOrgId())){ + form.setResiTotal(user.getResiTotal()); + form.setRegisterUserCount(user.getRegisterUserCount()); + form.setPartyMemberCount(user.getPartyMemberCount()); + } + }); + } + result.add(form); + }); + } + return new GridPartyDTO(orgIds, result); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java new file mode 100644 index 0000000000..19b0eaa9d4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java @@ -0,0 +1,253 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.ScreenConstant; +import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.result.*; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; +import com.epmet.service.evaluationindex.extract.toscreen.PartyGuideService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import com.epmet.service.evaluationindex.screen.ScreenPartyBranchDataService; +import com.epmet.service.evaluationindex.screen.ScreenPartyLinkMassesDataService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.springframework.beans.BeanUtils; +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.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/9/24 5:06 下午 + */ +@Service +@Slf4j +public class PartyGuideServiceImpl implements PartyGuideService { + + @Autowired + private ScreenPartyLinkMassesDataService linkMassesDataService; + @Autowired + private ScreenPartyBranchDataService partyBranchDataService; + @Autowired + private FactOriginGroupMainDailyService groupMainService; + @Autowired + private ScreenCustomerAgencyService agencyService; + @Autowired + private ScreenCustomerGridService gridService; + + /** + * @Description 党建引领抽取 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/24 5:10 下午 + */ + @Override + public Boolean partyGuideExtract(String customerId, String monthId) { + //【党员建群数,群成员数】 + List agencyIdList = agencyService.selectAllAgencyId(customerId); + if (!CollectionUtils.isEmpty(agencyIdList)){ + // 根据组织级别分组 + Map> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel)); + if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){ + // 社区级别 + List customerGridInfoList = groupByLevel.get(ScreenConstant.COMMUNITY); + disPose(customerGridInfoList,true,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.STREET)){ + // 街道级别 + List customerGridInfoList = groupByLevel.get(ScreenConstant.STREET); + disPose(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){ + // 区级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT); + disPose(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.CITY)){ + // 市级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.CITY); + disPose(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){ + // 省级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.PROVINCE); + disPose(customerGridInfoList,false,customerId,monthId); + } + } + return true; + } + + /** + * @Description 处理 + * @Param agencyIdList + * @Param isGrid + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 2:57 下午 + */ + public void disPose(List agencyIdList, Boolean isGrid, String customerId, String monthId) { + List result = new ArrayList<>(); + if (!CollectionUtils.isEmpty(agencyIdList)){ + List orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); + if (isGrid == true){ + agencyIdList.forEach(agency -> { + GridPartyGuideDTO gridPartyGuideDTO = communityLevelSubGrid(customerId, monthId, agency); + orgIds.addAll(gridPartyGuideDTO.getOrgIds()); + result.addAll(gridPartyGuideDTO.getResult()); + }); + Map> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyLinkMassesDataFormDTO::getParentId)); + groupByAgency.forEach((agencyId,gridList) -> { + ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO(); + List orgNameAgencyList = agencyService.selectOrgNameAgency(result.stream().map(m -> m.getParentId()).distinct().collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(orgNameAgencyList)){ + orgNameAgencyList.forEach(name -> { + if (agencyId.equals(name.getAgencyId())){ + form.setOrgName(name.getAgencyName()); + form.setParentId(name.getParentId()); + } + }); + } + form.setOrgId(agencyId); + form.setCustomerId(customerId); + form.setDataEndTime(monthId); + form.setOrgType(ScreenConstant.AGENCY); + form.setCreateGroupTotal(gridList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal))); + form.setGroupUserTotal(gridList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal))); + result.add(form); + }); + delAndInsertLink(result,customerId,monthId,orgIds); + }else { + // 级别为 street,district,city,province + List directGridIds = gridService.selectDirectGrid(orgIds); + agencyIdList.forEach(agency -> { + String agencyId = agency.getAgencyId(); + List disGridIds = new ArrayList<>(); + directGridIds.forEach(grid -> { + if (agencyId.equals(grid.getAgencyId())){ + disGridIds.add(grid.getGridId()); + } + }); + // 不为空 存在直属网格 + if (!CollectionUtils.isEmpty(disGridIds)){ + List gridResult = new ArrayList<>(); + List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds); + List orgNameList = agencyService.selectOrgNameGrid(partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(partyLinkMassesDataList)){ + partyLinkMassesDataList.forEach(party -> { + orgNameList.forEach(org -> { + if (party.getOrgId().equals(org.getGridId())){ + party.setOrgName(org.getGridName()); + } + }); + ScreenPartyLinkMassesDataFormDTO copyParty = ConvertUtils.sourceToTarget(party, ScreenPartyLinkMassesDataFormDTO.class); + gridResult.add(copyParty); + }); + } + delAndInsertLink(gridResult,customerId,monthId,disGridIds); + } + List screenPartyLinkMassesDataGrid = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds); + List screenPartyLinkMassesDataList = linkMassesDataService.selectPartyLinkMassesInfo(customerId, monthId, agencyId); + screenPartyLinkMassesDataList.addAll(screenPartyLinkMassesDataGrid); + if (!CollectionUtils.isEmpty(screenPartyLinkMassesDataList)){ + ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO(); + form.setOrgId(agencyId); + form.setOrgType(ScreenConstant.AGENCY); + form.setOrgName(screenPartyLinkMassesDataList.get(NumConstant.ZERO).getOrgName()); + form.setCustomerId(customerId); + form.setDataEndTime(monthId); + form.setParentId(screenPartyLinkMassesDataList.get(NumConstant.ZERO).getParentId()); + form.setGroupUserTotal(screenPartyLinkMassesDataList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal))); + form.setCreateGroupTotal(screenPartyLinkMassesDataList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal))); + result.add(form); + } + }); + delAndInsertLink(result,customerId,monthId,orgIds); + } + } + } + + /** + * @Description 社区级别的处理 + * @Param customerId + * @Param monthId + * @Param agency + * @author zxc + * @date 2020/9/25 10:06 上午 + */ + public GridPartyGuideDTO communityLevelSubGrid(String customerId, String monthId, CustomerAgencyInfoResultDTO agency){ + String agencyId = agency.getAgencyId(); + // 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId) + Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); + List gridIds = (List) agencyMap.get(agencyId); + List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, gridIds); + List orgIds = partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList()); + List orgNameList = agencyService.selectOrgNameGrid(orgIds); + partyLinkMassesDataList.forEach(party -> { + orgNameList.forEach(orgName -> { + if (party.getOrgId().equals(orgName.getGridId())){ + party.setOrgName(orgName.getGridName()); + } + }); + }); + return new GridPartyGuideDTO(gridIds,partyLinkMassesDataList); + } + + /** + * @Description 删除并插入党员联系群众【党员建群数,群成员数】 + * @Param result + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/25 2:57 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsertLink(List result, String customerId, String monthId, List orgIds){ + List screenPartyLinkMassesAgencyList = agencyService.selectAllAgencyIdToPartyLinkMessage(customerId, monthId); + List resultList = gridService.selectAllGridIdToPartyLinkMessage(customerId, monthId); + resultList.addAll(screenPartyLinkMassesAgencyList); + List finalResult = new ArrayList<>(); + // 因为是根据级别来删除,插入,所以把需要操作的orgIds单独出来 + resultList.forEach(rl -> { + orgIds.forEach(orgId -> { + if (rl.getOrgId().equals(orgId)){ + finalResult.add(rl); + } + }); + }); + if (!CollectionUtils.isEmpty(result)){ + finalResult.forEach(fr -> { + result.forEach(r -> { + if (fr.getOrgId().equals(r.getOrgId())){ + BeanUtils.copyProperties(r,fr); + } + }); + }); + } + Integer delNum; + do { + delNum = linkMassesDataService.deleteOldPartyLinkInfo(customerId, monthId, orgIds); + }while (delNum > NumConstant.ZERO); + List> partition = ListUtils.partition(finalResult, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + linkMassesDataService.insertScreenPartyLinkMassesData(p); + }); + } + + + + + + // TODO 党员志愿服务【参与人数,组织次数】 +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java index e363b39646..df9d7ab3c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java @@ -9,9 +9,10 @@ import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDai import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService; import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService; -import com.epmet.service.stats.DimCustomerPartymemberService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import java.math.BigDecimal; import java.math.RoundingMode; @@ -23,6 +24,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/9/22 11:25 */ +@Service public class PioneerDataExtractServiceImpl implements PioneerDataExtractService { @Autowired @@ -30,8 +32,6 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService @Autowired private FactOriginTopicMainDailyService factOriginTopicMainDailyService; @Autowired - private DimCustomerPartymemberService dimCustomerPartymemberService; - @Autowired private FactOriginIssueMainDailyService factOriginIssueMainDailyService; @Autowired private FactOriginProjectMainDailyService factOriginProjectMainDailyService; @@ -47,7 +47,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService @Override public void extractGridPioneerData(String customerId, String dateId) { //查询客户下所有的网格,初始数据值为0 - List gridList = screenPioneerDataService.initPioneerDataList(customerId, "grid", StrConstant.EPMETY_STR); + List gridList = screenPioneerDataService.initPioneerDataList(customerId, "grid"); if (CollectionUtils.isEmpty(gridList)) { return; } @@ -60,26 +60,22 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setIssueRatio(BigDecimal.ZERO); - //网格内的党员集合 - List partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, gridId); - - //3、党员发布话题: - entity.setTopicTotal(getTopicTotal(customerId, partyMemberUserIds)); + entity.setTopicTotal(getTopicTotal(customerId, gridId, null)); //4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率 if (entity.getTopicTotal() == NumConstant.ZERO) { entity.setTopicRatio(BigDecimal.ZERO); } else { //当前网格内所有话题总数 - int gridTopicTotal = getGridTopicTotal(customerId, gridId); + int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId, null); entity.setTopicRatio(gridTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / gridTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } //当前网格内所有议题总数 - int gridIssueTotal = getGridIssueTotal(customerId, gridId); + int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId, null); if (gridIssueTotal != NumConstant.ZERO) { //5、党员发布议题 - entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds)); + entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, gridId, null)); //6、党员发布议题占比 : 占网格内所有议题的比率 if (entity.getPublishIssueTotal() == NumConstant.ZERO) { entity.setPublishIssueRatio(BigDecimal.ZERO); @@ -87,128 +83,239 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setPublishIssueRatio(gridIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); //7、议题转项目数 - entity.setShiftProjectTotal(getGridShiftProjectTotal(customerId, gridId)); + entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null)); //8、议题转项目占比 : 占网格内议题总数的比率 entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } // 9、已解决项目 - entity.setResolvedProjectTotal(getGridClosedProjectTotal(customerId,gridId,"resolved")); - if(entity.getResolvedProjectTotal()==NumConstant.ZERO){ + entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, "resolved")); + if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { + entity.setResolvedProjectRatio(BigDecimal.ZERO); + } else { + // 10、占总结项目 + int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, gridId, null, null); + entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + }); + screenPioneerDataService.delAndSavePioneerData(customerId, "grid", IndexCalConstant.DELETE_SIZE, gridList); + } + + @Override + public void extractCommunityPioneerData(String customerId, String dateId) { + //查询客户下所有的社区,初始数据值为0 + List communityList = screenPioneerDataService.initPioneerDataList(customerId, "community"); + if (CollectionUtils.isEmpty(communityList)) { + return; + } + communityList.forEach(entity -> { + entity.setDataEndTime(dateId); + String communityId = entity.getOrgId(); + //1、党员参与议事 todo + entity.setIssueTotal(NumConstant.ZERO); + //2、党员参与议事占比 todo + entity.setIssueRatio(BigDecimal.ZERO); + + + //3、党员发布话题: + entity.setTopicTotal(getTopicTotal(customerId, null, communityId)); + //4、党员发布话题占比: 社区内注册党员发布的话题总数占 社区内话题总数的 比率 + if (entity.getTopicTotal() == NumConstant.ZERO) { + entity.setTopicRatio(BigDecimal.ZERO); + } else { + //当前社区内所有话题总数 + int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null, communityId); + entity.setTopicRatio(communityTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / communityTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + + //当前社区内所有议题总数 + int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null, communityId); + if (communityIssueTotal != NumConstant.ZERO) { + //5、党员发布议题 + entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, null, communityId)); + //6、党员发布议题占比 : 占社区内所有议题的比率 + if (entity.getPublishIssueTotal() == NumConstant.ZERO) { + entity.setPublishIssueRatio(BigDecimal.ZERO); + } + entity.setPublishIssueRatio(communityIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + + //7、议题转项目数 + entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, null, communityId)); + //8、议题转项目占比 : 占社区内议题总数的比率 + entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + + + // 9、已解决项目 + entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, "resolved")); + if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { + entity.setResolvedProjectRatio(BigDecimal.ZERO); + } else { + // 10、占总结项目 + int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, null, communityId, null); + entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + }); + screenPioneerDataService.delAndSavePioneerData(customerId, "agency", IndexCalConstant.DELETE_SIZE, communityList); + } + + + @Override + public void extractExceptCommunityPioneerData(String customerId, String dateId) { + //查询客户下所有的组织(社区除外),初始数据值为0 + List agencyList = screenPioneerDataService.initPioneerDataList(customerId, "agency"); + if (CollectionUtils.isEmpty(agencyList)) { + return; + } + agencyList.forEach(entity -> { + entity.setDataEndTime(dateId); + String agencyId = entity.getOrgId(); + //1、党员参与议事 todo + entity.setIssueTotal(NumConstant.ZERO); + //2、党员参与议事占比 todo + entity.setIssueRatio(BigDecimal.ZERO); + if (StringUtils.isEmpty(entity.getPid()) || NumConstant.ZERO_STR.equals(entity.getPid())) { + entity.setAgencyPath(entity.getOrgId()); + } else { + entity.setAgencyPath(entity.getAgencyPids().concat(StrConstant.COLON).concat(entity.getOrgId())); + } + + + //3、党员发布话题: + entity.setTopicTotal(getAgencyTopicTotal(customerId, entity.getAgencyPath(),NumConstant.ONE_STR)); + //4、党员发布话题占比: 组织内注册党员发布的话题总数占 组织内话题总数的 比率 + if (entity.getTopicTotal() == NumConstant.ZERO) { + entity.setTopicRatio(BigDecimal.ZERO); + } else { + //当前组织内所有话题总数 + int agencyTopicTotal = getAgencyTopicTotal(customerId, entity.getAgencyPath(),null); + entity.setTopicRatio(agencyTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / agencyTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + + //当前组织内所有议题总数 + int agencyIssueTotal = getAgencyIssueTotal(customerId, entity.getAgencyPath()); + if (agencyIssueTotal != NumConstant.ZERO) { + //5、党员发布议题 + entity.setPublishIssueTotal(getAgencyParyPublishIssueTotal(customerId, entity.getAgencyPath())); + //6、党员发布议题占比 : 占社区内所有议题的比率 + if (entity.getPublishIssueTotal() == NumConstant.ZERO) { + entity.setPublishIssueRatio(BigDecimal.ZERO); + } + entity.setPublishIssueRatio(agencyIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + + //7、议题转项目数 + entity.setShiftProjectTotal(getAgencyShiftProjectTotal(customerId, entity.getAgencyPath())); + //8、议题转项目占比 : 占网格内议题总数的比率 + entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + + + // 9、已解决项目 + entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), "resolved")); + if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { entity.setResolvedProjectRatio(BigDecimal.ZERO); - }else{ + } else { // 10、占总结项目 - int closedProjectTotal=getGridClosedProjectTotal(customerId,gridId,null); - entity.setResolvedProjectRatio(closedProjectTotal==NumConstant.ZERO?BigDecimal.ZERO:new BigDecimal(entity.getResolvedProjectTotal()/closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + int closedProjectTotal = getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), null); + entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } }); - screenPioneerDataService.delAndSavePioneerData(customerId, "grid", dateId, IndexCalConstant.DELETE_SIZE, gridList); + screenPioneerDataService.delAndSavePioneerData(customerId, "agency", IndexCalConstant.DELETE_SIZE, agencyList); + + } + + //组织下:已解决项目 or 已结案项目总数 + private int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus) { + return factOriginProjectMainDailyService.getAgencyClosedProjectTotal(customerId,agencyPath,closedStatus); + } + + //组织下:议题转项目数 + private Integer getAgencyShiftProjectTotal(String customerId, String agencyPath) { + return factOriginIssueMainDailyService.getAgencyShiftProjectTotal(customerId,agencyPath); + } + + //组织内: 党员发布议题 + private Integer getAgencyParyPublishIssueTotal(String customerId, String agencyPath) { + return factOriginIssueMainDailyService.getAgencyParyPublishIssueTotal(customerId,agencyPath); + } + + //组织内:所有议题总数 + private int getAgencyIssueTotal(String customerId, String agencyPath) { + return factOriginIssueMainDailyService.getAgencyIssueTotal(customerId,agencyPath); + } + + + //在当前组织下,话题总数(createTopicUserIsParty=1时查询党员发布的话题总数) + private Integer getAgencyTopicTotal(String customerId, String agencyPath,String createTopicUserIsParty) { + return factOriginTopicMainDailyService.getAgencyPartyTopicTotal(customerId,agencyPath,createTopicUserIsParty); } + /** - * @return java.lang.Integer - * @param customerId - * @param gridId + * @param customerId 客户id + * @param gridId 网格id + * @param communityId 社区的agencyId * @param closedStatus 结案状态:已解决 resolved,未解决 unresolved - * @author yinzuomei - * @description 网格内已解决项目 - * @Date 2020/9/23 16:24 + * @description 网格或者社区下: 已解决项目 **/ - private Integer getGridClosedProjectTotal(String customerId, String gridId,String closedStatus) { - return factOriginProjectMainDailyService.getGridClosedProjectTotal(customerId,gridId,closedStatus); + private Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId, String closedStatus) { + return factOriginProjectMainDailyService.getGridOrCommunityClosedProjectTotal(customerId, gridId, communityId, closedStatus); } /** - * @param customerId - * @param partyMemberUserIds * @return int - * @author yinzuomei - * @description 党员发布的话题总数 - * @Date 2020/9/23 13:44 + * @param customerId 客户id + * @param gridId 网格id + * @param agencyId 社区的agencyId + * @description 网格或者社区下: 党员发布的话题总数 **/ - private int getTopicTotal(String customerId, List partyMemberUserIds) { - if (CollectionUtils.isEmpty(partyMemberUserIds)) { - //如果网格内没有党员,直接返回0 - return NumConstant.ZERO; - } - return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, partyMemberUserIds); + private int getTopicTotal(String customerId, String gridId, String agencyId) { + return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, gridId, agencyId); } /** - * @param customerId - * @param gridId * @return int - * @author yinzuomei - * @description 当前网格内,发布的话题总数 - * @Date 2020/9/23 14:18 + * @param customerId 客户id + * @param gridId 网格id + * @param communityId 社区的agencyId + * @description 网格或者社区下 :话题总数 **/ - private int getGridTopicTotal(String customerId, String gridId) { - return factOriginTopicMainDailyService.calGridTopicTotalByGrid(customerId, gridId); + private int getGridOrCommunityTopicTotal(String customerId, String gridId, String communityId) { + return factOriginTopicMainDailyService.calGridOrCommunityTopicTotal(customerId, gridId, communityId); } /** - * @param customerId - * @param partyMemberUserIds - * @return java.lang.Integer - * @author yinzuomei - * @description 党员发布的议题总数 - * @Date 2020/9/23 14:39 + * @return int + * @param customerId 客户id + * @param gridId 网格id + * @param agencyId 社区的agencyId + * @description 网格或者社区下: 党员发布的议题总数 **/ - private int getParyPublishIssueTotal(String customerId, List partyMemberUserIds) { - if (CollectionUtils.isEmpty(partyMemberUserIds)) { - return NumConstant.ZERO; - } - return factOriginIssueMainDailyService.getParyPublishIssueTotal(customerId, partyMemberUserIds); + private int getParyPublishIssueTotal(String customerId, String gridId, String agencyId) { + return factOriginIssueMainDailyService.getParyPublishIssueTotal(customerId, gridId, agencyId); } /** - * @param customerId - * @param gridId * @return int - * @author yinzuomei - * @description 当前网格内所有议题总数 - * @Date 2020/9/23 15:21 + * @param customerId 客户id + * @param gridId 网格id + * @param communityId 社区的agencyId + * @description 网格或者社区下 :议题总数 **/ - private int getGridIssueTotal(String customerId, String gridId) { - return factOriginIssueMainDailyService.getGridIssueTotalByGrid(customerId, gridId); + private int getGridOrCommunityIssueTotal(String customerId, String gridId, String communityId) { + return factOriginIssueMainDailyService.getGridOrCommunityIssueTotal(customerId, gridId, communityId); } /** - * @param customerId - * @param gridId * @return java.lang.Integer - * @author yinzuomei - * @description 网格内议题转项目数 - * @Date 2020/9/23 15:38 + * @param customerId 客户id + * @param gridId 网格id + * @param communityId 社区的agencyId + * @description 网格或者社区下: 议题转项目数 **/ - private Integer getGridShiftProjectTotal(String customerId, String gridId) { - return factOriginIssueMainDailyService.getShiftProjectTotalByGrid(customerId, gridId); - } - - - @Override - public void extractCommunityPioneerData(String customerId, String dateId) { - + private Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId, String communityId) { + return factOriginIssueMainDailyService.getGridOrCommunityShiftProjectTotal(customerId, gridId, communityId); } - @Override - public void extractStreetPioneerData(String customerId, String dateId) { - - } - - @Override - public void extractDistrictPioneerData(String customerId, String dateId) { - - } - - @Override - public void extractCityPioneerData(String customerId, String dateId) { - - } - - @Override - public void extractProvincePioneerData(String customerId, String dateId) { - - } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java new file mode 100644 index 0000000000..ae0aab7fa0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java @@ -0,0 +1,54 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.extract.toscreen.PublicPartExtractService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; +import com.epmet.service.evaluationindex.screen.ScreenPublicPartiTotalDataService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * desc:公众参与抽取到大屏的接口实现类 + * + * @author: LiuJanJun + * @date: 2020/9/25 10:46 上午 + * @version: 1.0 + */ +@Service +public class PublicPartExtractServiceImpl implements PublicPartExtractService { + + @Autowired + private ScreenPublicPartiTotalDataService screenPublicPartiTotalDataService; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private ScreenCustomerAgencyService agencyService; + + + /** + * desc: 【月】抽取公众参与 人均议题 总次数和平均参与度 + * target:screen_user_join + * + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + @Override + public Boolean extractTotalDataMonthly() { + //agencyService.initAgencies(); + return null; + } + + /** + * desc: 【日】抽取公众参与 各类总数 + * target:screen_public_parti_total_data + * + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + @Override + public Boolean extractPerTotalDataDaily() { + return null; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenCentralZoneDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenCentralZoneDataAbsorptionServiceImpl.java new file mode 100644 index 0000000000..40d47d4f91 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenCentralZoneDataAbsorptionServiceImpl.java @@ -0,0 +1,50 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenCentralZoneDataAbsorptionService; +import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService; +import com.epmet.service.stats.ScreenCentralZoneDataExtractService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * @Description + * @ClassName ScreenCentralZoneDataAbsorptionServiceImpl + * @Auth wangc + * @Date 2020-09-24 10:42 + */ +@Service +@Slf4j +public class ScreenCentralZoneDataAbsorptionServiceImpl implements ScreenCentralZoneDataAbsorptionService { + + @Autowired + private ScreenCentralZoneDataExtractService screenCentralZoneDataExtractService; + @Autowired + private ScreenUserTotalDataService screenUserTotalDataService; + + /** + * @Description 中央区数据写入 + * @param param + * @return + * @author wangc + * @date 2020.09.24 10:41 + **/ + @Override + public void centralZoneDataHub(ScreenCentralZoneDataFormDTO param) { + if(StringUtils.isBlank(param.getDateId())){ + //默认前一天 + param.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); + } + List dataList = screenCentralZoneDataExtractService.extractCentralZoneData(param.getCustomerId(),param.getDateId()); + + screenUserTotalDataService.dataClean(dataList,param.getCustomerId()); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java new file mode 100644 index 0000000000..bab236a466 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -0,0 +1,82 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; +import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService; +import com.epmet.service.stats.DimCustomerService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/24 9:57 上午 + */ +@Service +@Slf4j +public class ScreenExtractServiceImpl implements ScreenExtractService { + + @Autowired + private DimCustomerService dimCustomerService; + @Autowired + private PartyBaseInfoService partyBaseInfoService; + @Autowired + private PioneerDataExtractService pioneerDataExtractService; + + /** + * @Description 抽取数据到大屏【天】 + * @param extractFormDTO + * @author zxc + * @date 2020/9/24 10:15 上午 + */ + @Override + public void extractDailyAll(ExtractFormDTO extractFormDTO) { + List customerIds = new ArrayList<>(); + if (StringUtils.isNotBlank(extractFormDTO.getCustomerId())){ + customerIds.add(extractFormDTO.getCustomerId()); + }else { + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); + } + if (!CollectionUtils.isEmpty(customerIds)){ + customerIds.forEach(customerId -> { + if (StringUtils.isNotBlank(extractFormDTO.getStartDate()) && StringUtils.isNotBlank(extractFormDTO.getEndDate())){ + List daysBetween = DateUtils.getDaysBetween(extractFormDTO.getStartDate(), extractFormDTO.getEndDate()); + daysBetween.forEach(dateId -> { + extractDaily(customerId,dateId); + }); + }else if (StringUtils.isNotBlank(extractFormDTO.getDateId())){ + extractDaily(customerId,extractFormDTO.getDateId()); + }else { + String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", ""); + extractDaily(customerId,dateId); + } + }); + } + + } + + /** + * @Description 按天计算 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/24 10:16 上午 + */ + public void extractDaily(String customerId,String dateId){ + partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId); + pioneerDataExtractService.extractGridPioneerData(customerId,dateId); + pioneerDataExtractService.extractCommunityPioneerData(customerId,dateId); + pioneerDataExtractService.extractExceptCommunityPioneerData(customerId,dateId); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java index c9e0411462..33246cad86 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -26,14 +26,18 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; +import com.epmet.dao.evaluationindex.indexcal.DeptSelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.DeptSubScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyDao; +import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerDeptDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.DeotScore; import com.epmet.dto.indexcal.DeptScoreDetailDTO; import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.DeptSelfSubScoreEntity; import com.epmet.entity.evaluationindex.indexcal.DeptSubScoreEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; @@ -59,10 +63,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -91,6 +92,10 @@ public class DeptScoreServiceImpl extends BaseServiceImpl indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.QU_ZHI_BU_MEN.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关】指标权重信息不存在"); + } + indexList.forEach(index -> { + String levelIndexPath = index.getAllParentIndexCode().concat(StrConstant.COLON).concat(index.getIndexCode()); + //获取出指标之间的关系 + List selfSubIndexList = indexGroupDetailDao.selectSelfSubIndex(formDTO.getCustomerId(), levelIndexPath); + if (CollectionUtils.isEmpty(selfSubIndexList)) { + log.error("calculateSelfSubScore indexGroupDetailDao.selectSelfSubIndex return empty,customerId:{}", formDTO.getCustomerId()); + return; + } + //获取该能力下的分数 + List subScore = deptSubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath); + if (CollectionUtils.isEmpty(subScore)) { + log.error("calculateSelfSubScore communitySubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId()); + return; + } + Map> selfSubParentMap = new HashMap<>(); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); + selfSubIndexList.forEach(o -> { + //找出自身 和下级的指标 + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); + } else { + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); + } + }); + Map insertMap = new HashMap<>(); + subScore.forEach(score -> { + String key = score.getAgencyId().concat(index.getIndexCode()); + DeptSelfSubScoreEntity scoreEntity = insertMap.get(key); + if (scoreEntity == null) { + scoreEntity = ConvertUtils.sourceToTarget(score, DeptSelfSubScoreEntity.class); + insertMap.put(key, scoreEntity); + scoreEntity.setSelfScore(new BigDecimal(0)); + scoreEntity.setSubScore(new BigDecimal(0)); + scoreEntity.setParentIndexCode(index.getIndexCode()); + scoreEntity.setSelfWeight(new BigDecimal(0)); + scoreEntity.setSubWeight(new BigDecimal(0)); + } + BigDecimal partScore = score.getScore().multiply(score.getWeight()); + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { + scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); + scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); + } else { + scoreEntity.setSelfScore(scoreEntity.getSelfScore().add(partScore)); + scoreEntity.setSelfWeight(scoreEntity.getSelfWeight().add(score.getWeight())); + } + log.debug("=====key" + key + ",grid:{},originScore:{},weight:{},finalScore:{},total", score.getAgencyId(), score.getScore(), score.getWeight(), partScore); + }); + deleteAndInsertSelfSubScore(formDTO, index.getIndexCode(), insertMap); + }); + } + + @Transactional(rollbackFor = Exception.class) + public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map insertMap) { + int effectRow = 0; + do { + deptSelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); + } while (effectRow > 0); + + deptSelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values())); + } + /** - * @return void * @param formDTO + * @return void * @author yinzuomei * @description 区直部门-党建能力分值计算 - * @Date 2020/9/10 17:21 + * @Date 2020/9/10 17:21 **/ private void calculateZhiLiNengLiScore(CalculateCommonFormDTO formDTO) { //获取区直部门的治理能力下,五级指标权重 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index 96a20fa266..dd000900d3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -9,6 +9,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao; import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; import com.epmet.dao.evaluationindex.indexcal.GridSelfSubScoreDao; @@ -126,14 +127,14 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { return; } Map> selfSubParentMap = new HashMap<>(); - selfSubParentMap.put("zishen", new HashSet<>()); - selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { - selfSubParentMap.get("xiaji").add(o.getIndexCode()); + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); } else { - selfSubParentMap.get("zishen").add(o.getIndexCode()); + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); } }); Map insertMap = new HashMap<>(); @@ -151,8 +152,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { scoreEntity.setSubWeight(new BigDecimal(0)); } BigDecimal partScore = score.getScore().multiply(score.getWeight()); - BigDecimal partWeight = score.getScore().multiply(score.getWeight()); - if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) { + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); } else { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java index 9fee142586..5d9523550c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; import com.epmet.dao.evaluationindex.indexcal.CommunitySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.CommunitySubScoreDao; @@ -135,14 +136,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return; } Map> selfSubParentMap = new HashMap<>(); - selfSubParentMap.put("zishen", new HashSet<>()); - selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { - selfSubParentMap.get("xiaji").add(o.getIndexCode()); + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); } else { - selfSubParentMap.get("zishen").add(o.getIndexCode()); + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); } }); Map insertMap = new HashMap<>(); @@ -159,7 +160,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni scoreEntity.setSubWeight(new BigDecimal(0)); } BigDecimal partScore = score.getScore().multiply(score.getWeight()); - if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) { + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); } else { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 0c5ecca06c..80163e8646 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -10,6 +10,8 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao; @@ -112,7 +114,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict private void calculateSelfSubScore(CalculateCommonFormDTO formDTO) { //todo 指标添加缓存 List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), - IndexCodeEnum.QU_ZHI_BU_MEN.getCode()); + IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); if (CollectionUtils.isEmpty(indexList)) { log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关】指标权重信息不存在"); @@ -126,20 +128,20 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return; } //获取该能力下的分数 - List subScore = agencySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath); + List subScore = agencySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.DISTRICT, levelIndexPath); if (CollectionUtils.isEmpty(subScore)) { log.error("calculateSelfSubScore communitySubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId()); return; } Map> selfSubParentMap = new HashMap<>(); - selfSubParentMap.put("zishen", new HashSet<>()); - selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { - selfSubParentMap.get("xiaji").add(o.getIndexCode()); + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); } else { - selfSubParentMap.get("zishen").add(o.getIndexCode()); + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); } }); Map insertMap = new HashMap<>(); @@ -156,7 +158,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict scoreEntity.setSubWeight(new BigDecimal(0)); } BigDecimal partScore = score.getScore().multiply(score.getWeight()); - if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) { + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); } else { @@ -173,7 +175,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map insertMap) { int effectRow = 0; do { - agencySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); + agencySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.DISTRICT, indexCode); } while (effectRow > 0); agencySelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values())); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index c5099fe557..88d329ca6b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -10,6 +10,8 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao; @@ -129,20 +131,20 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return; } //获取该能力下的分数 - List subScore = agencySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath); + List subScore = agencySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.STREET, levelIndexPath); if (CollectionUtils.isEmpty(subScore)) { log.error("calculateSelfSubScore communitySubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId()); return; } Map> selfSubParentMap = new HashMap<>(); - selfSubParentMap.put("zishen", new HashSet<>()); - selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { - selfSubParentMap.get("xiaji").add(o.getIndexCode()); + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); } else { - selfSubParentMap.get("zishen").add(o.getIndexCode()); + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); } }); Map insertMap = new HashMap<>(); @@ -159,7 +161,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ scoreEntity.setSubWeight(new BigDecimal(0)); } BigDecimal partScore = score.getScore().multiply(score.getWeight()); - if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) { + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); } else { @@ -176,7 +178,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map insertMap) { int effectRow = 0; do { - agencySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); + agencySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.STREET, indexCode); } while (effectRow > 0); agencySelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values())); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java new file mode 100644 index 0000000000..8010a566d2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java @@ -0,0 +1,24 @@ +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/24 14:34 + */ +public interface FactIndexGovrnAblityGridMonthlyService extends BaseService { + /** + * 查询客户下网格治理能力 + * + * @param customerId + * @param monthId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 15:41 + */ + List getGridByCustomer(String customerId, String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..5143882c49 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java @@ -0,0 +1,20 @@ +package com.epmet.service.evaluationindex.indexcoll.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/24 14:36 + */ +public class FactIndexGovrnAblityGridMonthlyServiceImpl extends BaseServiceImpl implements FactIndexGovrnAblityGridMonthlyService { + @Override + public List getGridByCustomer(String customerId, String monthId) { + return baseDao.selectGridByCustomer(customerId, monthId); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java index d6fc5828cc..314bd3181a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java @@ -60,4 +60,12 @@ public interface ScreenCpcBaseDataService extends BaseService selectPartyInfo(String customerId, String dateId,String agencyId); + /** + * @Description 查询党员信息【直属网格的】 + * @param gridIds + * @author zxc + * @date 2020/9/24 3:23 下午 + */ + List selectDirectGridPartyInfo(List gridIds,String customerId,String dateId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java index 6d955563f7..0b2ee8e93e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java @@ -18,9 +18,12 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import java.util.List; + +import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.org.CustomerAgencyEntity; @@ -75,4 +78,29 @@ public interface ScreenCustomerAgencyService{ * @date 2020/9/23 3:10 下午 */ List selectAllAgencyIdToParty(String customerId,String dateId); + + /** + * @Description 查询客户下所有机关ID + * @Param customerId + * @Param dateId + * @author zxc + * @date 2020/9/25 10:39 上午 + */ + List selectAllAgencyIdToPartyLinkMessage(String customerId, String dateId); + + /** + * @Description 查询org名称【网格】 + * @param gridIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgNameGrid(List gridIds); + + /** + * @Description 查询org名称【机关】 + * @param agencyIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgNameAgency(List agencyIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java index 504af8521d..02e3b21f67 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java @@ -19,7 +19,11 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; +import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; @@ -46,4 +50,37 @@ public interface ScreenCustomerGridService extends BaseService selectAllGridIdToParty(String customerId, String dateId); + + /** + * @Description 查询客户下所有网格ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:43 上午 + */ + List selectAllGridIdToPartyLinkMessage(String customerId, String monthId); + + /** + * @Description 查询机关的直属网格 + * @param agencyIds + * @author zxc + * @date 2020/9/24 2:33 下午 + */ + List selectDirectGrid(List agencyIds); + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/19 10:50 上午 + */ + List selectAllGridInfoToParty(String customerId); + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/18 10:47 上午 + */ + List selectAllGridInfo(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java index a707ea1dec..5c5fb96844 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java @@ -21,6 +21,8 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; +import java.util.List; + /** * 基层治理-治理能力排行数据(按月统计) * @@ -28,5 +30,14 @@ import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; * @since v1.0.0 2020-09-22 */ public interface ScreenGovernRankDataService extends BaseService { - + /** + * 构造screen_govern_rank_data 初始数据,先赋值为0 + * @author zhaoqifeng + * @date 2020/9/24 14:41 + * @param customerId + * @param orgType + * @param agencyLevel + * @return java.util.List + */ + List initList(String customerId, String orgType, String agencyLevel); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java index 657faf457d..68197d665c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java @@ -18,8 +18,11 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; +import java.util.List; + /** * 基层党建-建设情况数据(支部,联建,志愿服务)按月 * @@ -28,4 +31,12 @@ import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; */ public interface ScreenPartyBranchDataService extends BaseService { + /** + * @Description 插入建设情况数据 + * @param lists + * @author zxc + * @date 2020/9/25 9:16 上午 + */ + void insertScreenPartyBranchData(List lists); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java index 669e20f18d..f03255904a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java @@ -18,8 +18,11 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; +import java.util.List; + /** * 党建引领-党员联系群众数据 * @@ -28,4 +31,32 @@ import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; */ public interface ScreenPartyLinkMassesDataService extends BaseService { + /** + * @Description 批量插入党员联系群众数据 + * @param lists + * @author zxc + * @date 2020/9/24 6:06 下午 + */ + void insertScreenPartyLinkMassesData(List lists); + + /** + * @Description 删除旧的党员联系群众 + * @param customerId + * @param monthId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + Integer deleteOldPartyLinkInfo(String customerId, String monthId, List orgIds); + + /** + * @Description 查询党员联系群众信息 + * @Param customerId + * @Param monthId + * @Param agencyId + * @author zxc + * @date 2020/9/25 1:19 下午 + */ + List selectPartyLinkMassesInfo(String customerId, String monthId,String agencyId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java index 1e42747a4a..99196d9950 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java @@ -34,23 +34,21 @@ public interface ScreenPioneerDataService extends BaseService * @param customerId * @param orgType :grid,agency - * @param agencyLevel : 机关级别(社区级:community, 乡(镇、街道)级:street,区县级: district,市级: city 省级:province) * @author yinzuomei * @description 构造screen_pioneer_data 初始数据,先赋值为0 * @Date 2020/9/22 14:41 **/ - List initPioneerDataList(String customerId, String orgType,String agencyLevel); + List initPioneerDataList(String customerId, String orgType); /** * @return void * @param customerId * @param orgType grid, agency - * @param dataEndTime * @param deleteSize * @param entityList 待插入的数据 * @author yinzuomei * @description 保存抽取结果 * @Date 2020/9/22 15:54 **/ - void delAndSavePioneerData(String customerId, String orgType, String dataEndTime, Integer deleteSize, List entityList); + void delAndSavePioneerData(String customerId, String orgType, Integer deleteSize, List entityList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java index fd8e5f94e8..3f38a3a683 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java @@ -21,6 +21,8 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; +import java.util.List; + /** * 中央区-各类(用户|党员|党群|话题|议题|项目)总数 * @@ -28,5 +30,14 @@ import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; * @since v1.0.0 2020-09-22 */ public interface ScreenUserTotalDataService extends BaseService { - + + + /** + * @Description 大屏中央区数据清洗 + * @param list + * @return + * @author wangc + * @date 2020.09.24 17:59 + **/ + void dataClean(List list,String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java index ab1e25f294..7505476087 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java @@ -26,7 +26,9 @@ import com.epmet.dto.extract.result.PartyInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity; import com.epmet.service.evaluationindex.screen.ScreenCpcBaseDataService; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.List; @@ -71,4 +73,18 @@ public class ScreenCpcBaseDataServiceImpl extends BaseServiceImpl selectPartyInfo(String customerId, String dateId, String agencyId) { return baseDao.selectPartyInfo(customerId, dateId, agencyId); } + + /** + * @Description 查询党员信息【直属网格的】 + * @param gridIds + * @author zxc + * @date 2020/9/24 3:23 下午 + */ + @Override + public List selectDirectGridPartyInfo(List gridIds,String customerId,String dateId) { + if (!CollectionUtils.isEmpty(gridIds)){ + return baseDao.selectDirectGridPartyInfo(gridIds, customerId, dateId); + } + return new ArrayList<>(); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java index cf159bae2f..9b7d925e05 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java @@ -17,15 +17,19 @@ package com.epmet.service.evaluationindex.screen.impl; +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.constant.OrgSourceTypeConstant; +import com.epmet.constant.ScreenConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; +import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.screen.result.TreeResultDTO; -import com.epmet.constant.ScreenConstant; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; @@ -36,10 +40,6 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import java.util.stream.Collectors; /** @@ -50,6 +50,7 @@ import java.util.stream.Collectors; */ @Service @Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyService { @Autowired @@ -110,7 +111,7 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ @Transactional(rollbackFor = Exception.class) @Override public void initAgencies(List agencies2Add, List agencies2Update) { - String dateEndTime = DateUtils.format(new Date(), "YYYYmmdd"); + String dateEndTime = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); if (!CollectionUtils.isEmpty(agencies2Add)) { // 添加 for (CustomerAgencyEntity e : agencies2Add) { @@ -159,6 +160,46 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ return screenCustomerAgencyDao.selectAllAgencyIdToParty(customerId,dateId); } + /** + * @Description 查询客户下所有机关ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:39 上午 + */ + @Override + public List selectAllAgencyIdToPartyLinkMessage(String customerId, String monthId) { + return screenCustomerAgencyDao.selectAllAgencyIdToPartyLinkMessage(customerId, monthId); + } + + /** + * @Description 查询org名称 + * @param gridIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + @Override + public List selectOrgNameGrid(List gridIds) { + if (!CollectionUtils.isEmpty(gridIds)){ + return screenCustomerGridDao.selectOrgName(gridIds); + } + return new ArrayList<>(); + } + + /** + * @Description 查询org名称【机关】 + * @param agencyIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + @Override + public List selectOrgNameAgency(List agencyIds) { + if (!CollectionUtils.isEmpty(agencyIds)){ + return screenCustomerAgencyDao.selectOrgNameAgency(agencyIds); + } + return new ArrayList<>(); + } + private void updateAgency(ScreenCustomerAgencyEntity exists) { screenCustomerAgencyDao.updateById(exists); } @@ -193,4 +234,6 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ public List selectAllAgencyId(String customerId) { return screenCustomerAgencyDao.selectAllAgencyId(customerId); } + + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index 2d25673a50..f1ac5f0d71 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java @@ -24,14 +24,21 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgSourceTypeConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; +import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import org.apache.ibatis.annotations.Param; 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.ArrayList; import java.util.Date; import java.util.List; @@ -102,4 +109,52 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl selectAllGridIdToParty(String customerId, String dateId) { return screenCustomerGridDao.selectAllGridIdToParty(customerId, dateId); } + + /** + * @Description 查询客户下所有网格ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:43 上午 + */ + @Override + public List selectAllGridIdToPartyLinkMessage(String customerId, String monthId) { + return screenCustomerGridDao.selectAllGridIdToPartyLinkMessage(customerId, monthId); + } + + /** + * @Description 查询机关的直属网格 + * @param agencyIds + * @author zxc + * @date 2020/9/24 2:33 下午 + */ + @Override + public List selectDirectGrid(List agencyIds) { + if (!CollectionUtils.isEmpty(agencyIds)){ + return screenCustomerGridDao.selectDirectGrid(agencyIds); + } + return new ArrayList<>(); + } + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/19 10:50 上午 + */ + @Override + public List selectAllGridInfoToParty(String customerId) { + return screenCustomerGridDao.selectAllGridInfoToParty(customerId); + } + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/18 10:47 上午 + */ + @Override + public List selectAllGridInfo(String customerId) { + return screenCustomerGridDao.selectAllGridInfo(customerId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java index c500c767ad..e4fea260dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java @@ -19,11 +19,16 @@ package com.epmet.service.evaluationindex.screen.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDao; import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; + /** * 基层治理-治理能力排行数据(按月统计) * @@ -31,7 +36,26 @@ import org.springframework.stereotype.Service; * @since v1.0.0 2020-09-22 */ @Service +@Slf4j public class ScreenGovernRankDataServiceImpl extends BaseServiceImpl implements ScreenGovernRankDataService { + @Override + public List initList(String customerId, String orgType, String agencyLevel) { + List list = new ArrayList<>(); + switch (orgType) { + case OrgTypeConstant.AGENCY: + log.info("组织级别统计"); + list = baseDao.initAgencyDataList(customerId, agencyLevel); + break; + case OrgTypeConstant.GRID: + log.info("网格级别统计"); + list = baseDao.initGridDataList(customerId); + break; + default: + log.info("部门级别统计"); + break; + } + return list; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java index 8c1f8e9182..271ac60c71 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java @@ -20,9 +20,13 @@ package com.epmet.service.evaluationindex.screen.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.evaluationindex.screen.ScreenPartyBranchDataDao; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPartyBranchDataService; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; /** * 基层党建-建设情况数据(支部,联建,志愿服务)按月 @@ -33,5 +37,16 @@ import org.springframework.stereotype.Service; @Service public class ScreenPartyBranchDataServiceImpl extends BaseServiceImpl implements ScreenPartyBranchDataService { - + /** + * @Description 插入建设情况数据 + * @param lists + * @author zxc + * @date 2020/9/25 9:16 上午 + */ + @Override + public void insertScreenPartyBranchData(List lists) { + if (!CollectionUtils.isEmpty(lists)){ + baseDao.insertScreenPartyBranchData(lists); + } + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java index 256246ad11..2aec948249 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java @@ -18,11 +18,17 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.ScreenPartyLinkMassesDataDao; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPartyLinkMassesDataService; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; /** * 党建引领-党员联系群众数据 @@ -31,7 +37,46 @@ import org.springframework.stereotype.Service; * @since v1.0.0 2020-09-22 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenPartyLinkMassesDataServiceImpl extends BaseServiceImpl implements ScreenPartyLinkMassesDataService { + /** + * @Description 批量插入党员联系群众数据 + * @param lists + * @author zxc + * @date 2020/9/24 6:06 下午 + */ + @Override + public void insertScreenPartyLinkMassesData(List lists) { + if (!CollectionUtils.isEmpty(lists)){ + baseDao.insertScreenPartyLinkMassesData(lists); + } + } + + /** + * @Description 删除旧的党员联系群众 + * @param customerId + * @param monthId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + @Override + public Integer deleteOldPartyLinkInfo(String customerId, String monthId, List orgIds) { + return baseDao.deleteOldPartyLinkInfo(customerId, monthId, orgIds); + } + + /** + * @Description 查询党员联系群众信息 + * @Param customerId + * @Param monthId + * @Param agencyId + * @author zxc + * @date 2020/9/25 1:19 下午 + */ + @Override + public List selectPartyLinkMassesInfo(String customerId, String monthId, String agencyId) { + return baseDao.selectPartyLinkMassesInfo(customerId, monthId, agencyId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java index da031da750..0ae80e0b0c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java @@ -27,6 +27,7 @@ import com.epmet.dao.evaluationindex.screen.ScreenPioneerDataDao; import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.ListUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -47,8 +48,7 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl * @author yinzuomei * @description 构造screen_pioneer_data 初始数据,先赋值为0 @@ -56,12 +56,16 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl initPioneerDataList(String customerId, String orgType, String agencyLevel) { + public List initPioneerDataList(String customerId, String orgType) { List list = new ArrayList<>(); if ("grid".equals(orgType)) { + //按网格构造 list = baseDao.initGridPioneerDataList(customerId); - } else if ("agency".equals(orgType)) { - list = baseDao.initAgencyPioneerDataList(customerId, agencyLevel); + } else if ("community".equals(orgType)) { + //按社构造 + list = baseDao.initCommunityPioneerDataList(customerId); + }else if("agency".equals(orgType)){ + list = baseDao.initExceptCommunityPioneerDataList(customerId); } return list; } @@ -70,7 +74,6 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl entityList) { + public void delAndSavePioneerData(String customerId, String orgType, Integer deleteSize, List entityList) { + if(CollectionUtils.isEmpty(entityList)){ + return; + } + List orgIds=new ArrayList<>(); + for(ScreenPioneerDataEntity entity:entityList){ + orgIds.add(entity.getOrgId()); + } int deleteNum; do { - deleteNum = baseDao.deletePioneerData(customerId, orgType, dataEndTime, deleteSize); + deleteNum = baseDao.deletePioneerData(customerId, orgType, deleteSize,orgIds); } while (deleteNum != NumConstant.ZERO); List> partition = ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java index 308ba90d08..a1b21beced 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java @@ -19,10 +19,15 @@ package com.epmet.service.evaluationindex.screen.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dao.evaluationindex.screen.ScreenUserTotalDataDao; import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; /** * 中央区-各类(用户|党员|党群|话题|议题|项目)总数 @@ -33,4 +38,22 @@ import org.springframework.stereotype.Service; @Service public class ScreenUserTotalDataServiceImpl extends BaseServiceImpl implements ScreenUserTotalDataService { + /** + * @Description 大屏中央区数据清洗 + * @param list + * @return + * @author wangc + * @date 2020.09.24 17:59 + **/ + @Override + public void dataClean(List list,String customerId) { + int deleteNum; + do { + deleteNum = baseDao.deleteUserTotalData(customerId); + } while (deleteNum <= NumConstant.ZERO); + + if(!CollectionUtils.isEmpty(list)){ + baseDao.insertBatch(list); + } + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java index 3608048a66..4a5e9697fb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java @@ -448,7 +448,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenPioneerDataDao.deletePioneerData(customerId,null,null, IndexCalConstant.DELETE_SIZE); + deleteNum = screenPioneerDataDao.deletePioneerDataByCustomerId(customerId,IndexCalConstant.DELETE_SIZE); } while (deleteNum != NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java index 5dda2848cc..d231065d66 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java @@ -124,10 +124,11 @@ public interface DimCustomerPartymemberService extends BaseService * @param customerId - * @param gridId - * @author yinzuomei - * @description 查询在本网格注册的党员id + * @param orgId: 网格id 或者社区id + * @type grid,community + * @author yinzuomei 暂时这个方法没用 + * @description 查询在本网格或者社区注册 或者 组织下 的党员id * @Date 2020/9/23 14:18 **/ - List getPartyMemberUserIds(String customerId, String gridId); + List getPartyMemberUserIds(String customerId, String type,String orgId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/ScreenCentralZoneDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/ScreenCentralZoneDataExtractService.java new file mode 100644 index 0000000000..0406c9f42a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/ScreenCentralZoneDataExtractService.java @@ -0,0 +1,22 @@ +package com.epmet.service.stats; + +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; + +import java.util.List; + +/** + * 大屏中央区数据抽取(form : date-statistical) + * */ +public interface ScreenCentralZoneDataExtractService { + + /** + * @Description 抽取中央区数据 + * @param customerId + * @param dimId + * @return + * @author wangc + * @date 2020.09.24 11:13 + **/ + List extractCentralZoneData(String customerId,String dimId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java index a6b02ff384..0b0e1fa1ae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java @@ -49,6 +49,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -185,7 +186,10 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl selectPartyMemberInfo(String customerId, List gridIds) { - return baseDao.selectPartyMemberInfo(customerId, gridIds); + if (!CollectionUtils.isEmpty(gridIds)){ + return baseDao.selectPartyMemberInfo(customerId, gridIds); + } + return new ArrayList<>(); } /** @@ -205,18 +209,26 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl * @author yinzuomei - * @description 查询在本网格注册的党员id + * @description 查询在本网格注册的党员id,或者社区下的党员, 或者组织下的 * @Date 2020/9/23 14:18 **/ @DataSource(value = DataSourceConstant.STATS) @Override - public List getPartyMemberUserIds(String customerId, String gridId) { - return baseDao.selectGridPartyMemberUserIds(customerId,gridId); + public List getPartyMemberUserIds(String customerId, String type, String orgId) { + List partyMemberUserIds = new ArrayList<>(); + if ("grid".equals(type)) { + partyMemberUserIds = baseDao.selectGridPartyMemberUserIds(customerId, orgId); + } else if ("community".equals(type)) { + partyMemberUserIds = baseDao.selectCommunityPartyMemberUserIds(customerId, orgId); + } else if("agency".equals(type)){ + partyMemberUserIds = baseDao.selectPartyMemberUserIdsByPids(customerId, orgId); + } + return partyMemberUserIds; } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java new file mode 100644 index 0000000000..a36695b6b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java @@ -0,0 +1,164 @@ +package com.epmet.service.stats.impl; + +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.stats.*; +import com.epmet.dao.stats.topic.FactTopicTotalAgencyDailyDao; +import com.epmet.dao.stats.topic.FactTopicTotalGridDailyDao; + + +import com.epmet.dao.stats.user.FactParticipationUserGridDailyDao; + +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; +import com.epmet.service.stats.ScreenCentralZoneDataExtractService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Description 大屏中央区数据抽取(form : date-statistical) + * @ClassName ScreenCentralZoneDataExtractServiceImpl + * @Auth wangc + * @Date 2020-09-24 11:15 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.STATS) +public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZoneDataExtractService { + + @Autowired + private FactParticipationUserGridDailyDao factParticipationUserGridDailyDao; + @Autowired + private FactGroupGridDailyDao factGroupGridDailyDao; + @Autowired + private FactTopicTotalGridDailyDao factTopicTotalGridDailyDao; + @Autowired + private FactIssueGridDailyDao factIssueGridDailyDao; + @Autowired + private FactAgencyProjectDailyDao factAgencyProjectDailyDao; + + + private final String ORG_LEVEL_AGENCY = "agency"; + private final String ORG_LEVEL_GRID = "grid"; + + + /** + * @Description 抽取中央区数据 + * @param customerId + * @param dimId + * @return + * @author wangc + * @date 2020.09.24 11:13 + **/ + @Override + public List extractCentralZoneData(String customerId, String dimId) { + + //1.查询用户与党员数据,判断dimId是否为昨天,如果根据这个dimId没有查询出结果,则取前天的数据 + //如果还是查不出数据,继续向下执行,这部分数据设置默认值 + List result = + factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(result)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + result = factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + if(null == result) result = new LinkedList<>(); + } + List gridUserResult = + factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + + if(CollectionUtils.isEmpty(gridUserResult)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridUserResult = factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + if(!CollectionUtils.isEmpty(gridUserResult)){ + result.addAll(gridUserResult); + } + + //2.组 + List agencyGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(agencyGroup)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + agencyGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + List gridGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + if(CollectionUtils.isEmpty(gridGroup)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + Map groupMap = agencyGroup.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getGroupTotal)); + groupMap.putAll(gridGroup.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getGroupTotal))); + + + //3.话题 + List agencyTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(agencyTopic)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + agencyTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + List gridTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + if(CollectionUtils.isEmpty(gridTopic)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + Map topicMap = agencyTopic.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getTopicTotal)); + topicMap.putAll(gridTopic.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getTopicTotal))); + + //4.议题 + List agencyIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(agencyIssue)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + agencyIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + List gridIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + if(CollectionUtils.isEmpty(gridIssue)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + Map issueMap = agencyIssue.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal)); + issueMap.putAll(gridIssue.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal))); + + //5.项目 + List agencyProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(agencyProject)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + agencyProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + List gridProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + if(CollectionUtils.isEmpty(gridProject)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + Map projectMap = agencyProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal)); + projectMap.putAll(gridProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal))); + + result.forEach(o -> { + String orgId = o.getOrgId(); + o.setGroupTotal(groupMap.get(orgId)); + o.setTopicTotal(topicMap.get(orgId)); + o.setIssueTotal(issueMap.get(orgId)); + o.setProjectTotal(projectMap.get(orgId)); + o.setDataEndTime(dimId); + }); + + + + return result; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml index 0772838230..8f22922df8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml @@ -180,6 +180,11 @@ dynamic: url: @datasource.druid.epmetHeart.url@ username: @datasource.druid.epmetHeart.username@ password: @datasource.druid.epmetHeart.password@ + epmetPoint: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.epmetPoint.url@ + username: @datasource.druid.epmetPoint.username@ + password: @datasource.druid.epmetPoint.password@ thread: # 线程池配置 @@ -189,7 +194,7 @@ thread: queueCapacity: @thread.pool.queue-capacity@ keepAlive: @thread.pool.keep-alive@ -#dingTalk: -# robot: -# webHook: @dingTalk.robot.webHook@ -# secret: @dingTalk.robot.secret@ +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml index 134c359fd2..a6c9b62bee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -238,4 +238,30 @@ m.GROUP_ID =#{groupId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index f3e69ac3c8..75762c410c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -22,6 +22,7 @@ PIDS, AGENCY_ID, ISSUE_STATUS, + RESOLVE_TYPE, TOPIC_USER_IS_PARTY, DEL_FLAG, REVISION, @@ -48,6 +49,7 @@ #{item.pids}, #{item.agencyId}, #{item.issueStatus}, + #{item.resolveType}, #{item.topicUserIsParty}, #{item.delFlag}, #{item.revision}, @@ -176,7 +178,7 @@ GROUP BY GRID_ID - + - - + SELECT + count( ID ) AS total + FROM + fact_origin_issue_main_daily t1 + WHERE + t1.DEL_FLAG = '0' + AND t1.CUSTOMER_ID = #{customerId} + + and t1.GRID_ID=#{gridId} + + + and t1.AGENCY_ID=#{communityId} + + + + + + + + + + + - - SELECT count( ID ) AS total FROM fact_origin_issue_main_daily t1 WHERE t1.DEL_FLAG = '0' + AND t1.ISSUE_STATUS = 'shift_project' AND t1.CUSTOMER_ID = #{customerId} - and t1.GRID_ID=#{gridId} - AND T1.ISSUE_STATUS='shift_project' + and t1.PIDS LIKE CONCAT(#{agencyPath},'%') \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index a6aa5a8078..6129ab0f2f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -144,8 +144,8 @@ - - SELECT COUNT( 1 ) AS TOTAL FROM @@ -153,7 +153,27 @@ WHERE T1.DEL_FLAG = '0' AND T1.CUSTOMER_ID = #{customerId} - and t1.GRID_ID=#{gridId} + + and t1.GRID_ID=#{gridId} + + + and t1.AGENCY_ID=#{communityId} + + + and t1.CLOSED_STATUS=#{closedStatus} + + + + + - - SELECT count(T1.ID) AS TOTAL FROM @@ -120,16 +123,34 @@ WHERE T1.DEL_FLAG = '0' AND T1.CUSTOMER_ID = #{customerId} - AND T1.GRID_ID=#{gridId} + + AND T1.GRID_ID=#{gridId} + + + AND T1.AGENCY_ID=#{agencyId} + - update fact_origin_topic_main_daily - set TOPIC_STATUS=#{item.topicStatus}, - CLOSED_STATUS=#{item.closedStatus}, + set TOPIC_STATUS=#{topicStatus}, + CLOSED_STATUS=#{closedStatus}, UPDATED_TIME=NOW() - where id = ${item.topicId} - + where id = #{topicId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySelfSubScoreDao.xml index 6ae6d742ef..4504a7fe6c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySelfSubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySelfSubScoreDao.xml @@ -6,6 +6,7 @@ delete from fact_index_agency_self_sub_score where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + and DATA_TYPE = #{dataType,jdbcType=VARCHAR} and MONTH_ID = #{monthId,jdbcType=VARCHAR} and PARENT_INDEX_CODE = #{parentIndexCode,jdbcType=VARCHAR} limit 1000 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml index bc3f151ff8..b142e7349d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml @@ -54,6 +54,7 @@ fact_index_agency_sub_score WHERE DEL_FLAG = '0' + AND data_type = #{dataType} AND CUSTOMER_ID = #{customerId} AND ALL_PARENT_INDEX_CODE = #{allIndexCodePath,jdbcType=VARCHAR} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySelfSubScoreDao.xml index f077cb0f13..f9fa8c6d9b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySelfSubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySelfSubScoreDao.xml @@ -12,7 +12,7 @@ - INSERT INTO `fact_index_grid_self_sub_score` ( + INSERT INTO `fact_index_community_self_sub_score` ( `ID`, `CUSTOMER_ID`, `AGENCY_ID`, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml index b4a245a758..d3e94036f2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml @@ -50,7 +50,7 @@ ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, ORIGIN_VALUE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, WEIGHT FROM - fact_index_grid_sub_score + fact_index_community_sub_score WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSelfSubScoreDao.xml new file mode 100644 index 0000000000..b9d9c4ff14 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSelfSubScoreDao.xml @@ -0,0 +1,61 @@ + + + + + + + delete from fact_index_dept_self_sub_score + where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + AND PARENT_INDEX_CODE = #{parentIndexCode,jdbcType=VARCHAR} + limit 1000 + + + + INSERT INTO `fact_index_dept_self_sub_score` ( + `ID`, + `CUSTOMER_ID`, + `AGENCY_ID`, + `DEPT_ID`, + `QUARTER_ID`, + `YEAR_ID`, + `MONTH_ID`, + `SELF_SCORE`, + `SUB_SCORE`, + `PARENT_INDEX_CODE`, + `ALL_PARENT_INDEX_CODE`, + `SELF_WEIGHT`, + `SUB_WEIGHT`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME` + ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.agencyId}, + #{item.deptId}, + #{item.quarterId}, + #{item.yearId}, + #{item.monthId}, + #{item.selfScore}, + #{item.subScore}, + #{item.parentIndexCode}, + #{item.allParentIndexCode}, + #{item.selfWeight}, + #{item.subWeight}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml index 8a035e4d2e..df3ac417d6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml @@ -59,4 +59,26 @@ limit #{deleteSize} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index c0a7c1d8f1..e30d52c675 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -187,6 +187,21 @@ DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml index 7700490255..9de96650b5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml @@ -38,6 +38,40 @@ AND PARENT_ID = #{agencyId} + + + insert into screen_cpc_base_data ( @@ -160,6 +194,7 @@ org_id = #{orgId} ) + LIMIT 1000 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index 1a66ff709b..df9a6fd514 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -286,4 +286,38 @@ del_flag = '0' AND CUSTOMER_ID = #{customerId} + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml index 419674a89d..459e873378 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml @@ -233,4 +233,83 @@ del_flag = '0' AND CUSTOMER_ID = #{customerId} + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml index f569cb89a9..a85df25770 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml @@ -8,6 +8,39 @@ where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} limit 1000; + + insert into screen_govern_rank_data diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml index a7058e4a08..92b2b888b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml @@ -58,4 +58,55 @@ ) + + + + INSERT INTO screen_party_branch_data ( + ID, + CUSTOMER_ID, + YEAR_ID, + MONTH_ID, + TYPE, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + MEET_CATEGORY_ID, + MEET_CATEGORY_NAME, + ORGANIZE_COUNT, + JOIN_USER_COUNT, + AVERAGE_JOIN_USER_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.yearId}, + #{item.monthId}, + #{item.type}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.meetCategoryId}, + #{item.meetCategoryName}, + #{item.organizeCount}, + #{item.joinUserCount}, + #{item.averageJoinUserCount}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml index f6760538d1..20d7c3f7e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml @@ -9,6 +9,41 @@ limit 1000; + + + delete from screen_party_link_masses_data + where CUSTOMER_ID = #{customerId} + and DATA_END_TIME = #{monthId} + and + ( + + org_id = #{orgId} + + ) + LIMIT 1000 + + + + + insert into screen_party_link_masses_data ( @@ -49,4 +84,29 @@ + + + INSERT INTO screen_party_link_masses_data ( ID, CUSTOMER_ID, ORG_TYPE, ORG_ID, PARENT_ID, ORG_NAME, CREATE_GROUP_TOTAL, GROUP_USER_TOTAL, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, DATA_END_TIME ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.createGroupTotal}, + #{item.groupUserTotal}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW(), + #{item.dataEndTime} + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml index 64f19416a9..c2ad6b5722 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml @@ -3,14 +3,25 @@ + + delete from screen_pioneer_data + where CUSTOMER_ID = #{customerId} + limit #{deleteSize} + + delete from screen_pioneer_data where CUSTOMER_ID = #{customerId} and ORG_TYPE=#{orgType} - - and DATA_END_TIME=#{dataEndTime} + + and + ( + + ORG_ID = #{orgId} + + ) limit #{deleteSize} @@ -99,28 +110,56 @@ - SELECT sca.CUSTOMER_ID, 'agency' AS ORG_TYPE, - sca.AGENCY_NAME AS ORG_ID, + sca.AGENCY_ID AS ORG_ID, sca.PID AS PARENT_ID, sca.AGENCY_NAME AS ORG_NAME, 0 as ISSUE_TOTAL, - 0 asISSUE_RATIO, - 0 asTOPIC_TOTAL, - 0 asTOPIC_RATIO, - 0 asPUBLISH_ISSUE_TOTAL, - 0 asPUBLISH_ISSUE_RATIO, - 0 asSHIFT_PROJECT_TOTAL, - 0 asSHIFT_PROJECT_RATIO, - 0 asRESOLVED_PROJECT_TOTAL, - 0 asRESOLVED_PROJECT_RATIO + 0 as ISSUE_RATIO, + 0 as TOPIC_TOTAL, + 0 as TOPIC_RATIO, + 0 as PUBLISH_ISSUE_TOTAL, + 0 as PUBLISH_ISSUE_RATIO, + 0 as SHIFT_PROJECT_TOTAL, + 0 as SHIFT_PROJECT_RATIO, + 0 as RESOLVED_PROJECT_TOTAL, + 0 as RESOLVED_PROJECT_RATIO + FROM + screen_customer_agency sca + WHERE + sca.DEL_FLAG = '0' + and sca.`LEVEL`='community' + AND sca.CUSTOMER_ID = #{customerId} + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml index ecf0039810..e8c0e8c660 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml @@ -57,4 +57,52 @@ + + insert into screen_user_total_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + DATA_END_TIME, + USER_TOTAL, + PARTY_TOTAL, + GROUP_TOTAL, + TOPIC_TOTAL, + ISSUE_TOTAL, + PROJECT_TOTAL, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.dataEndTime}, + #{item.userTotal}, + #{item.partyTotal}, + #{item.groupTotal}, + #{item.topicTotal}, + #{item.issueTotal}, + #{item.projectTotal}, + 0, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml index e226e3964d..eeb0458c56 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml @@ -209,9 +209,8 @@ + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml index 34327672d6..b2333a5451 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml @@ -25,4 +25,24 @@ AND date_id = #{dateId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml index 8c8ab22e50..c8e631ed88 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml @@ -76,4 +76,25 @@ AND customer_id = #{customerId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml index 998f24e343..de8596943f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml @@ -50,4 +50,24 @@ + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml index 537a46cebb..097fb515a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml @@ -90,4 +90,22 @@ + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml index 96e16db5be..2837f9c4a1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml @@ -121,5 +121,42 @@ AND DATE_ID = #{dateId} + + \ No newline at end of file diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ScreenExtractTaskService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ScreenExtractTaskService.java new file mode 100644 index 0000000000..5e144642ed --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ScreenExtractTaskService.java @@ -0,0 +1,13 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +/** + * @Author zxc + * @DateTime 2020/9/24 10:21 上午 + */ +public interface ScreenExtractTaskService { + + Result screenExtractDaily(String params); + +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java new file mode 100644 index 0000000000..0566277dc5 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java @@ -0,0 +1,33 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.ScreenExtractTaskService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Author zxc + * @DateTime 2020/9/24 10:22 上午 + */ +@Service +@Slf4j +public class ScreenExtractTaskServiceImpl implements ScreenExtractTaskService { + + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + + @Override + public Result screenExtractDaily(String params) { + ExtractFormDTO extractFormDTO = new ExtractFormDTO(); + if (StringUtils.isNotBlank(params)) { + extractFormDTO = JSON.parseObject(params, ExtractFormDTO.class); + } + return dataStatisticalOpenFeignClient.extractDailyAll(extractFormDTO); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ScreenExtractDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ScreenExtractDailyTask.java new file mode 100644 index 0000000000..3e5c130e1a --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ScreenExtractDailyTask.java @@ -0,0 +1,33 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.ScreenExtractTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @DateTime 2020/9/24 10:26 上午 + */ +@Component("screenExtractDailyTask") +public class ScreenExtractDailyTask implements ITask{ + + @Autowired + private ScreenExtractTaskService screenExtractTaskService; + + private Logger logger = LoggerFactory.getLogger(getClass()); + + + @Override + public void run(String params) { + logger.info("ScreenExtractDailyTask定时任务正在执行,参数为:{}", params); + Result result = screenExtractTaskService.screenExtractDaily(params); + if (result.success()){ + logger.info("ScreenExtractDailyTask定时任务执行成功"); + }else { + logger.error("ScreenExtractDailyTask定时任务执行失败:" + result.getMsg()); + } + } +}