diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenFormDTO.java new file mode 100644 index 0000000000..4d1c87981d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 9:47 + */ +@Data +public class AnScreenFormDTO implements Serializable { + private static final long serialVersionUID = 5402826635847080766L; + + public interface AnScreenGroup extends CustomerClientShowGroup {} + + /** + * 组织ID + */ + @NotBlank(message = "机关Id不能为空", groups = AnScreenGroup.class) + + private String agencyId; + /** + * 月份ID + */ + @NotBlank(message = "月份Id不能为空", groups = AnScreenGroup.class) + private String monthId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenRankFormDTO.java new file mode 100644 index 0000000000..2b787582dd --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenRankFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 9:47 + */ +@Data +public class AnScreenRankFormDTO implements Serializable { + private static final long serialVersionUID = -766779327034367216L; + + public interface AnScreenRankGroup extends CustomerClientShowGroup {} + + /** + * 组织ID + */ + @NotBlank(message = "机关Id不能为空", groups = AnScreenRankFormDTO.AnScreenRankGroup.class) + private String agencyId; + @NotNull(message = "top值不能为空", groups = AnScreenRankFormDTO.AnScreenRankGroup.class) + private Integer topNum; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenTrendFormDTO.java new file mode 100644 index 0000000000..88d0215be4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenTrendFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 9:48 + */ +@Data +public class AnScreenTrendFormDTO implements Serializable { + private static final long serialVersionUID = -766779327034367216L; + + public interface AnScreenTrendGroup extends CustomerClientShowGroup {} + + /** + * 组织ID + */ + @NotBlank(message = "机关Id不能为空", groups = AnScreenTrendFormDTO.AnScreenTrendGroup.class) + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernRankResultDTO.java new file mode 100644 index 0000000000..ac2072d44c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernRankResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 09、基层治理-治理排行 + * @date 2020/10/9 10:54 + */ +@NoArgsConstructor +@Data +public class GrassRootsGovernRankResultDTO implements Serializable { + + private static final long serialVersionUID = 5175488557393182160L; + /** + * 参与项目数 + */ + private Integer partiProjectTotal; + /** + * 办结项目数 + */ + private Integer closedProjectTotal; + /** + * 响应度 + */ + private String projectResponseRatio; + /** + * 满意度 + */ + private String projectSatisRatio; + /** + * 办结率 当前界面在社区时才显示 + */ + private String closedProjectRatio; + /** + * 组织名称 + */ + private String orgName; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernResultDTO.java new file mode 100644 index 0000000000..05b2e6c382 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernResultDTO.java @@ -0,0 +1,38 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 07、基层治理-总数 + * @date 2020/10/9 10:36 + */ +@NoArgsConstructor +@Data +public class GrassRootsGovernResultDTO implements Serializable { + + private static final long serialVersionUID = 3455494963816549169L; + /** + * 参与项目数 + */ + private Integer partiProjectTotal; + /** + * 办结项目数 + */ + private Integer closedProjectTotal; + /** + * 项目响应度 + */ + private String projectResponseRatio; + /** + * 项目满意率 + */ + private String projectSatisRatio; + /** + * 办结率(当前界面是社区时显示) + */ + private String closedProjectRatio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernTrendDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernTrendDTO.java new file mode 100644 index 0000000000..4c27d422ea --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernTrendDTO.java @@ -0,0 +1,42 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 15:08 + */ +@NoArgsConstructor +@Data +public class GrassRootsGovernTrendDTO implements Serializable { + private static final long serialVersionUID = 4977117178308139861L; + /** + * 月份 + */ + private String monthId; + /** + * 参与项目数 + */ + private Integer partiProjectTotal; + /** + * 办结项目数 + */ + private Integer closedProjectTotal; + /** + * 项目响应度 + */ + private BigDecimal projectResponseRatio; + /** + * 项目满意率 + */ + private BigDecimal projectSatisRatio; + /** + * 办结率(当前界面是社区时显示) + */ + private BigDecimal closedProjectRatio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernTrendResultDTO.java new file mode 100644 index 0000000000..1a1daf5cb0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsGovernTrendResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription 08、基层治理-指标月度趋势 + * @date 2020/10/9 10:48 + */ +@NoArgsConstructor +@Data +public class GrassRootsGovernTrendResultDTO implements Serializable { + + private static final long serialVersionUID = 5640652259031475809L; + /** + * 横坐标集合 + */ + private List xAxis; + /** + * 参与项目数 + */ + private List partiProjectTotalList; + /** + * 办结项目数 + */ + private List closedProjectTotalList; + /** + * 项目响应度 + */ + private List projectResponseRatioList; + /** + * 项目满意率 + */ + private List projectSatisRatioList; + /** + * 办结率(当前界面是社区时显示) + */ + private List closedProjectRatioList; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgRankResultDTO.java new file mode 100644 index 0000000000..61b7ab9b74 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgRankResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 06、基层组织-组织排行榜单 + * @date 2020/10/9 10:32 + */ +@NoArgsConstructor +@Data +public class GrassRootsOrgRankResultDTO implements Serializable { + + private static final long serialVersionUID = 3573854743057339033L; + /** + * 党群数 + */ + private Integer groupTotal; + /** + * 议题数 + */ + private Integer issueTotal; + /** + * 项目数 + */ + private Integer projectTotal; + /** + * 组织名称 + */ + private String orgName; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgResultDTO.java new file mode 100644 index 0000000000..d01bf5837e --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 04、基层组织-党群数、议题数、项目数 + * @date 2020/10/9 10:22 + */ +@NoArgsConstructor +@Data +public class GrassRootsOrgResultDTO implements Serializable { + + private static final long serialVersionUID = 6623022965863266247L; + /** + * 党群数 + */ + private Integer groupTotal; + /** + * 议题数 + */ + private Integer issueTotal; + /** + * 项目数 + */ + private Integer projectTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgTrendDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgTrendDTO.java new file mode 100644 index 0000000000..b8d5e64963 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgTrendDTO.java @@ -0,0 +1,33 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 15:10 + */ +@NoArgsConstructor +@Data +public class GrassRootsOrgTrendDTO implements Serializable { + private static final long serialVersionUID = 6172847581584903056L; + /** + * 月份 + */ + private String monthId; + /** + * 党群数 + */ + private Integer groupTotal; + /** + * 议题数 + */ + private Integer issueTotal; + /** + * 项目数 + */ + private Integer projectTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgTrendResultDTO.java new file mode 100644 index 0000000000..0116ca6309 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GrassRootsOrgTrendResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription 05、基层组织-指标月度趋势 + * @date 2020/10/9 10:25 + */ +@NoArgsConstructor +@Data +public class GrassRootsOrgTrendResultDTO implements Serializable { + private static final long serialVersionUID = -6911028881641915610L; + /** + * 横坐标集合 + */ + private List xAxis; + /** + * 党群数 + */ + private List groupTotalList; + /** + * 议题数 + */ + private List issueTotalList; + /** + * 项目数 + */ + private List projectTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmRankResultDTO.java new file mode 100644 index 0000000000..c813fdf694 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmRankResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 03、基层党员-党员排行榜单 + * @date 2020/10/9 10:12 + */ +@NoArgsConstructor +@Data +public class PmRankResultDTO implements Serializable { + + private static final long serialVersionUID = 2939125411579816231L; + /** + * 用户ID + */ + private String userId; + /** + * 姓名 + */ + private String userName; + /** + * 所属支部名称 + */ + private String branchName; + /** + * 所属社区名称 + */ + private String communityName; + /** + * 群成员数 + */ + private Integer groupMemberTotal; + /** + * 话题数 + */ + private Integer topicTotal; + /** + * 参与人次 + */ + private Integer partiUserTotal; + /** + * 议题数 + */ + private Integer issueTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalResultDTO.java new file mode 100644 index 0000000000..aa5dcb67b5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 01、基层党员-各类总数 + * @date 2020/10/9 10:04 + */ +@NoArgsConstructor +@Data +public class PmTotalResultDTO implements Serializable { + + private static final long serialVersionUID = 4317234373580733128L; + /** + * 群成员数 + */ + private Integer groupMemberTotal; + /** + * 话题数 + */ + private Integer topicTotal; + /** + * 话题参与人次 + */ + private Integer topicPartiUserTotal; + /** + * 议题数 + */ + private Integer issueTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalTrendDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalTrendDTO.java new file mode 100644 index 0000000000..6ddfd0a5a9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalTrendDTO.java @@ -0,0 +1,35 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 15:05 + */ +@Data +public class PmTotalTrendDTO implements Serializable { + private static final long serialVersionUID = -6773118646805355171L; + /** + * 月份 + */ + private String monthId; + /** + * 群成员数 + */ + private Integer groupMemberTotal; + /** + * 话题数 + */ + private Integer topicTotal; + /** + * 话题参与人次 + */ + private Integer topicPartiUserTotal; + /** + * 议题数 + */ + private Integer issueTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalTrendResultDTO.java new file mode 100644 index 0000000000..7676688788 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PmTotalTrendResultDTO.java @@ -0,0 +1,39 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription 02、基层党员-指标月度趋势 + * @date 2020/10/9 10:06 + */ +@NoArgsConstructor +@Data +public class PmTotalTrendResultDTO implements Serializable { + + private static final long serialVersionUID = -5705077703115309896L; + /** + * 横坐标集合 + */ + private List xAxis; + /** + * 群成员数 + */ + private List groupMemberTotalList; + /** + * 话题数 + */ + private List topicTotalList; + /** + * 话题参与人次 + */ + private List topicPartiUserTotalList; + /** + * 议题数 + */ + private List issueTotalList; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectProfileResultDTO.java new file mode 100644 index 0000000000..9e6b2d509e --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ProjectProfileResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription 10、项目 + * @date 2020/10/9 10:57 + */ +@NoArgsConstructor +@Data +public class ProjectProfileResultDTO implements Serializable { + + private static final long serialVersionUID = -6525050844558886157L; + /** + * 组织id + */ + private String orgId; + /** + * 项目数量 + */ + private Integer projectTotal; + /** + * 级别 + */ + private String level; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AnScreenController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AnScreenController.java new file mode 100644 index 0000000000..3c2871ab67 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AnScreenController.java @@ -0,0 +1,175 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.evaluationindex.screen.AnScreenService; +import com.epmet.evaluationindex.screen.dto.form.AnScreenFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AnScreenRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AnScreenTrendFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 安宁大屏 + * + * @author zhaoqifeng + * @date 2020/10/9 9:32 + */ +@RestController +@RequestMapping("anscreen") +public class AnScreenController { + + @Autowired + private AnScreenService anScreenService; + + /** + * 基层党员-各类总数 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.PmTotalResultDTO + * @author zhaoqifeng + * @date 2020/10/9 13:55 + */ + @PostMapping("pmtotal") + public Result pmTotal(@RequestBody AnScreenFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenFormDTO.AnScreenGroup.class); + PmTotalResultDTO result = anScreenService.pmTotal(formDTO); + return new Result().ok(result); + } + + /** + * 基层党员-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.PmTotalTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 13:57 + */ + @PostMapping("pmtotaltrend") + public Result pmTotalTrend(@RequestBody AnScreenTrendFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenTrendFormDTO.AnScreenTrendGroup.class); + PmTotalTrendResultDTO result = anScreenService.pmTotalTrend(formDTO); + return new Result().ok(result); + } + + /** + * 基层党员-党员排行榜单 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 13:59 + */ + @PostMapping("pmrank") + public Result> pmRank(@RequestBody AnScreenRankFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenRankFormDTO.AnScreenRankGroup.class); + List result = anScreenService.pmRank(formDTO); + return new Result>().ok(result); + } + + /** + * 基层组织-党群数、议题数、项目数 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:01 + */ + @PostMapping("grassrootsorg") + public Result grassRootsOrg(@RequestBody AnScreenFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenFormDTO.AnScreenGroup.class); + GrassRootsOrgResultDTO result = anScreenService.grassRootsOrg(formDTO); + return new Result().ok(result); + } + + /** + * 基层组织-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:03 + */ + @PostMapping("grassrootsorgtrend") + public Result grassRootsOrgTrend(@RequestBody AnScreenTrendFormDTO formDTO) { + GrassRootsOrgTrendResultDTO result = anScreenService.grassRootsOrgTrend(formDTO); + return new Result().ok(result); + } + + /** + * 基层组织-组织排行榜单 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:06 + */ + @PostMapping("grassrootsorgrank") + public Result> grassRootsOrgRank(@RequestBody AnScreenFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenFormDTO.AnScreenGroup.class); + List result = anScreenService.grassRootsOrgRank(formDTO); + return new Result>().ok(result); + } + + /** + * 基层治理-总数 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:10 + */ + @PostMapping("grassrootsgovern") + public Result grassRootsGovern(@RequestBody AnScreenFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenFormDTO.AnScreenGroup.class); + GrassRootsGovernResultDTO result = anScreenService.grassRootsGovern(formDTO); + return new Result().ok(result); + } + + /** + * 基层治理-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:11 + */ + @PostMapping("grassrootsgoverntrend") + public Result grassRootsGovernTrend(@RequestBody AnScreenTrendFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenTrendFormDTO.AnScreenTrendGroup.class); + GrassRootsGovernTrendResultDTO result = anScreenService.grassRootsGovernTrend(formDTO); + return new Result().ok(result); + } + + /** + * 基层治理-治理排行 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:13 + */ + @PostMapping("grassrootsgovernrank") + public Result> grassRootsGovernRank(@RequestBody AnScreenFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AnScreenFormDTO.AnScreenGroup.class); + List result = anScreenService.grassRootsGovernRank(formDTO); + return new Result>().ok(result); + } + + /** + * 项目 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:16 + */ + @PostMapping("projectprofile") + public Result> projectProfile(@RequestHeader("CustomerId") String customerId) { + List result = anScreenService.projectProfile(customerId); + return new Result>().ok(result); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnCommunityProjectProfileDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnCommunityProjectProfileDao.java new file mode 100644 index 0000000000..a8eb3b762d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnCommunityProjectProfileDao.java @@ -0,0 +1,43 @@ +/** + * 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.datareport.dao.evaluationindex.screenan; + +import com.epmet.evaluationindex.screen.dto.result.ProjectProfileResultDTO; +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-10-09 + */ +@Mapper +public interface ScreenAnCommunityProjectProfileDao { + /** + * 项目 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 17:17 + */ + List selectProjectProfile(@Param("customerId") String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java new file mode 100644 index 0000000000..40609442aa --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java @@ -0,0 +1,69 @@ +/** + * 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.datareport.dao.evaluationindex.screenan; + +import com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernResultDTO; +import com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernTrendDTO; +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-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsGovernMonthlyDao { + /** + * 基层治理-总数 + * + * @param agencyId + * @param monthId + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernResultDTO + * @author zhaoqifeng + * @date 2020/10/9 16:48 + */ + GrassRootsGovernResultDTO selectGrassRootsGovern(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * 基层治理-指标月度趋势 + * + * @param agencyId + * @param yearId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 16:49 + */ + List selectGrassRootsGovernTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + + /** + * 基层治理-治理排行 + * + * @param agencyId + * @param monthId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 16:49 + */ + List selectGrassRootsGovernRank(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java new file mode 100644 index 0000000000..9fb38ae91e --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java @@ -0,0 +1,70 @@ +/** + * 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.datareport.dao.evaluationindex.screenan; + +import com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgResultDTO; +import com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgTrendDTO; +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-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsOrgMonthlyDao { + + /** + * 基层组织-党群数、议题数、项目数 + * + * @param agencyId + * @param monthId + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgResultDTO + * @author zhaoqifeng + * @date 2020/10/9 16:25 + */ + GrassRootsOrgResultDTO selectGrassRootsOrg(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * 基层组织-指标月度趋势 + * + * @param agencyId + * @param yearId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 16:32 + */ + List selectGrassRootsOrgTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + + /** + * 基层组织-组织排行榜单 + * + * @param agencyId + * @param monthId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 16:36 + */ + List selectGrassRootsOrgRank(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmRankDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmRankDao.java new file mode 100644 index 0000000000..141853010d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmRankDao.java @@ -0,0 +1,45 @@ +/** + * 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.datareport.dao.evaluationindex.screenan; + +import com.epmet.evaluationindex.screen.dto.result.PmRankResultDTO; +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-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsPmRankDao { + /** + * 基层党员-党员排行榜单 + * + * @param agencyId + * @param topNum + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 15:43 + */ + List selectPmRank(@Param("agencyId") String agencyId, @Param("topNum") Integer topNum); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.java new file mode 100644 index 0000000000..3e0c05e93f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.java @@ -0,0 +1,59 @@ +/** + * 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.datareport.dao.evaluationindex.screenan; + +import com.epmet.evaluationindex.screen.dto.form.AnScreenFormDTO; +import com.epmet.evaluationindex.screen.dto.result.PmTotalResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PmTotalTrendDTO; +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-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsPmTotalMonthlyDao { + /** + * 基层党员-各类总数 + * + * @param agencyId + * @param monthId + * @return com.epmet.evaluationindex.screen.dto.result.PmTotalResultDTO + * @author zhaoqifeng + * @date 2020/10/9 15:14 + */ + PmTotalResultDTO selectPmTotal(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * 基层党员-指标月度趋势 + * + * @param agencyId + * @param yearId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 15:12 + */ + List selectPmTotalTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AnScreenService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AnScreenService.java new file mode 100644 index 0000000000..5ed96488cb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AnScreenService.java @@ -0,0 +1,115 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.form.AnScreenFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AnScreenRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AnScreenTrendFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 9:34 + */ +public interface AnScreenService { + /** + * 基层党员-各类总数 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.PmTotalResultDTO + * @author zhaoqifeng + * @date 2020/10/9 13:55 + */ + PmTotalResultDTO pmTotal(AnScreenFormDTO formDTO); + + /** + * 基层党员-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.PmTotalTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 13:57 + */ + PmTotalTrendResultDTO pmTotalTrend(AnScreenTrendFormDTO formDTO); + + /** + * 基层党员-党员排行榜单 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 13:59 + */ + List pmRank(AnScreenRankFormDTO formDTO); + + /** + * 基层组织-党群数、议题数、项目数 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:01 + */ + GrassRootsOrgResultDTO grassRootsOrg(AnScreenFormDTO formDTO); + + /** + * 基层组织-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:03 + */ + GrassRootsOrgTrendResultDTO grassRootsOrgTrend(AnScreenTrendFormDTO formDTO); + + /** + * 基层组织-组织排行榜单 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:06 + */ + List grassRootsOrgRank(AnScreenFormDTO formDTO); + + /** + * 基层治理-总数 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:10 + */ + GrassRootsGovernResultDTO grassRootsGovern(AnScreenFormDTO formDTO); + + /** + * 基层治理-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:11 + */ + GrassRootsGovernTrendResultDTO grassRootsGovernTrend(AnScreenTrendFormDTO formDTO); + + /** + * 基层治理-治理排行 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:13 + */ + List grassRootsGovernRank(AnScreenFormDTO formDTO); + + /** + * 项目 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:16 + */ + List projectProfile(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java new file mode 100644 index 0000000000..0d8a064bcb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java @@ -0,0 +1,255 @@ +package com.epmet.datareport.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.datareport.dao.evaluationindex.screenan.*; +import com.epmet.datareport.service.evaluationindex.screen.AnScreenService; +import com.epmet.evaluationindex.screen.dto.form.AnScreenFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AnScreenRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AnScreenTrendFormDTO; +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.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/10/9 9:35 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class AnScreenServiceImpl implements AnScreenService { + + @Autowired + private ScreenAnGrassRootsPmTotalMonthlyDao screenAnGrassRootsPmTotalMonthlyDao; + @Autowired + private ScreenAnGrassRootsPmRankDao screenAnGrassRootsPmRankDao; + @Autowired + private ScreenAnGrassRootsOrgMonthlyDao screenAnGrassRootsOrgMonthlyDao; + @Autowired + private ScreenAnGrassRootsGovernMonthlyDao screenAnGrassRootsGovernMonthlyDao; + @Autowired + private ScreenAnCommunityProjectProfileDao screenAnCommunityProjectProfileDao; + + /** + * 基层党员-各类总数 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.PmTotalResultDTO + * @author zhaoqifeng + * @date 2020/10/9 13:55 + */ + @Override + public PmTotalResultDTO pmTotal(AnScreenFormDTO formDTO) { + return screenAnGrassRootsPmTotalMonthlyDao.selectPmTotal(formDTO.getAgencyId(), formDTO.getMonthId()); + } + + /** + * 基层党员-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.PmTotalTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 13:57 + */ + @Override + public PmTotalTrendResultDTO pmTotalTrend(AnScreenTrendFormDTO formDTO) { + PmTotalTrendResultDTO resultDTO = new PmTotalTrendResultDTO(); + String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY); + List list = screenAnGrassRootsPmTotalMonthlyDao.selectPmTotalTrend(formDTO.getAgencyId(), yearId); + List xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList()); + List groupMemberTotalList = list.stream().map(PmTotalTrendDTO::getGroupMemberTotal).collect(Collectors.toList()); + List topicTotalList = list.stream().map(PmTotalTrendDTO::getTopicTotal).collect(Collectors.toList()); + List topicPartiUserTotalList = list.stream().map(PmTotalTrendDTO::getTopicPartiUserTotal).collect(Collectors.toList()); + List issueTotalList = list.stream().map(PmTotalTrendDTO::getIssueTotal).collect(Collectors.toList()); + resultDTO.setXAxis(xAxis); + resultDTO.setGroupMemberTotalList(groupMemberTotalList); + resultDTO.setTopicTotalList(topicTotalList); + resultDTO.setTopicPartiUserTotalList(topicPartiUserTotalList); + resultDTO.setIssueTotalList(issueTotalList); + return resultDTO; + } + + /** + * 基层党员-党员排行榜单 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 13:59 + */ + @Override + public List pmRank(AnScreenRankFormDTO formDTO) { + return screenAnGrassRootsPmRankDao.selectPmRank(formDTO.getAgencyId(), formDTO.getTopNum()); + } + + /** + * 基层组织-党群数、议题数、项目数 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:01 + */ + @Override + public GrassRootsOrgResultDTO grassRootsOrg(AnScreenFormDTO formDTO) { + return screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrg(formDTO.getAgencyId(), formDTO.getMonthId()); + } + + /** + * 基层组织-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:03 + */ + @Override + public GrassRootsOrgTrendResultDTO grassRootsOrgTrend(AnScreenTrendFormDTO formDTO) { + GrassRootsOrgTrendResultDTO resultDTO = new GrassRootsOrgTrendResultDTO(); + String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY); + List list = screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrgTrend(formDTO.getAgencyId(), yearId); + List xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList()); + List groupTotalList = list.stream().map(GrassRootsOrgTrendDTO::getGroupTotal).collect(Collectors.toList()); + List issueTotalList = list.stream().map(GrassRootsOrgTrendDTO::getIssueTotal).collect(Collectors.toList()); + List projectTotal = list.stream().map(GrassRootsOrgTrendDTO::getProjectTotal).collect(Collectors.toList()); + resultDTO.setXAxis(xAxis); + resultDTO.setGroupTotalList(groupTotalList); + resultDTO.setIssueTotalList(issueTotalList); + resultDTO.setProjectTotal(projectTotal); + return resultDTO; + } + + /** + * 基层组织-组织排行榜单 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:06 + */ + @Override + public List grassRootsOrgRank(AnScreenFormDTO formDTO) { + return screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrgRank(formDTO.getAgencyId(), formDTO.getMonthId()); + } + + /** + * 基层治理-总数 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:10 + */ + @Override + public GrassRootsGovernResultDTO grassRootsGovern(AnScreenFormDTO formDTO) { + return screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovern(formDTO.getAgencyId(), formDTO.getMonthId()); + } + + /** + * 基层治理-指标月度趋势 + * + * @param formDTO + * @return com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernTrendResultDTO + * @author zhaoqifeng + * @date 2020/10/9 14:11 + */ + @Override + public GrassRootsGovernTrendResultDTO grassRootsGovernTrend(AnScreenTrendFormDTO formDTO) { + GrassRootsGovernTrendResultDTO resultDTO = new GrassRootsGovernTrendResultDTO(); + String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY); + List list = screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovernTrend(formDTO.getAgencyId(), yearId); + List xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList()); + List partiProjectTotalList = list.stream().map(GrassRootsGovernTrendDTO::getPartiProjectTotal).collect(Collectors.toList()); + List closedProjectTotalList = list.stream().map(GrassRootsGovernTrendDTO::getClosedProjectTotal).collect(Collectors.toList()); + List projectResponseRatioList = list.stream().map(GrassRootsGovernTrendDTO::getProjectResponseRatio).collect(Collectors.toList()); + List projectSatisRatioList = list.stream().map(GrassRootsGovernTrendDTO::getProjectSatisRatio).collect(Collectors.toList()); + List closedProjectRatioList = list.stream().map(GrassRootsGovernTrendDTO::getClosedProjectRatio).collect(Collectors.toList()); + resultDTO.setXAxis(xAxis); + resultDTO.setPartiProjectTotalList(partiProjectTotalList); + resultDTO.setClosedProjectTotalList(closedProjectTotalList); + resultDTO.setProjectResponseRatioList(projectResponseRatioList); + resultDTO.setProjectSatisRatioList(projectSatisRatioList); + resultDTO.setClosedProjectRatioList(closedProjectRatioList); + return resultDTO; + } + + /** + * 基层治理-治理排行 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:13 + */ + @Override + public List grassRootsGovernRank(AnScreenFormDTO formDTO) { + return screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovernRank(formDTO.getAgencyId(), formDTO.getMonthId()); + } + + /** + * 项目 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/10/9 14:16 + */ + @Override + public List projectProfile(String customerId) { + return screenAnCommunityProjectProfileDao.selectProjectProfile(customerId); + } + + private String getMonth(String monthId) { + String month = monthId.substring(NumConstant.FOUR, NumConstant.SIX); + String name = ""; + switch (month) { + case "01": + name = "1月"; + break; + case "02": + name = "2月"; + break; + case "03": + name = "3月"; + break; + case "04": + name = "4月"; + break; + case "05": + name = "5月"; + break; + case "06": + name = "6月"; + break; + case "07": + name = "7月"; + break; + case "08": + name = "8月"; + break; + case "09": + name = "9月"; + break; + case "10": + name = "10月"; + break; + case "11": + name = "11月"; + break; + case "12": + name = "12月"; + break; + default: + break; + } + return name; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnCommunityProjectProfileDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnCommunityProjectProfileDao.xml new file mode 100644 index 0000000000..10679f3f96 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnCommunityProjectProfileDao.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml new file mode 100644 index 0000000000..f88612d078 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml @@ -0,0 +1,44 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml new file mode 100644 index 0000000000..05c17e1378 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml @@ -0,0 +1,38 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmRankDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmRankDao.xml new file mode 100644 index 0000000000..dc13015231 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmRankDao.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml new file mode 100644 index 0000000000..82456904ea --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java new file mode 100644 index 0000000000..d81ae5cf9e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 安宁-社区-项目概况(数量、颜色) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +public class AnCommunityProjectProfileFormDTO implements Serializable { + private static final long serialVersionUID = 1466172677051250092L; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd,项目根据实际情况赋值 + */ + private String dataEndTime; + + /** + * 社区id + */ + private String orgId; + + /** + * 项目数 + */ + private Integer projectTotal; + + /** + * 等级 + */ + private String level; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java new file mode 100644 index 0000000000..adcb9f63b2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 安宁-基层治理-各类数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +public class AnGrassRootsGovernMonthlyFormDTO implements Serializable { + private static final long serialVersionUID = -6947401956711903753L; + + /** + * 网格,街道或社区id + */ + private String orgId; + + /** + * 网格,街道名称或者社区名称 + */ + private String orgName; + + /** + * 网格:grid;组织:agency + */ + private String orgType; + + /** + * org_id的上一级id + */ + private String pid; + + /** + * 参与项目数 + */ + private Integer partiProjectTotal; + + /** + * 办结项目数 + */ + private Integer closedProjectTotal; + + /** + * 项目响应度 存储的是%前面的数 + */ + private BigDecimal projectResponseRatio; + + /** + * 项目满意率,存储的是%前面的数 + */ + private BigDecimal projectSatisRatio; + + /** + * 办结率 for 社区 + */ + private BigDecimal closedProjectRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java new file mode 100644 index 0000000000..70242f1ad3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 安宁-基层组织(党群数|议题数|项目数)-按月 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +public class AnGrassRootsOrgMonthlyFormDTO implements Serializable { + private static final long serialVersionUID = -7389300512268641307L; + /** + * 网格id或者组织(街道或社区)id + */ + private String orgId; + + /** + * 组织名称OR网格名称 + */ + private String orgName; + + /** + * 网格:grid; 组织:agency + */ + private String orgType; + + /** + * org_id的上一级id + */ + private String pid; + + /** + * 党群数 + */ + private Integer groupTotal; + + /** + * 议题数 + */ + private Integer issueTotal; + + /** + * 项目数 + */ + private Integer projectTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java new file mode 100644 index 0000000000..b38f4c8653 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java @@ -0,0 +1,71 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 安宁-基层党员-排行榜单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +public class AnGrassRootsPmRankFormDTO implements Serializable { + private static final long serialVersionUID = 3642729389245262928L; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String userName; + + /** + * 所属支部id + */ + private String branchId; + + /** + * 所属支部名称 + */ + private String branchName; + + /** + * 所属社区id + */ + private String communityId; + + /** + * 所属社区名称 + */ + private String communityName; + + /** + * 群成员数 + */ + private Integer groupMemberTotal; + + /** + * 话题数 + */ + private Integer topicTotal; + + /** + * 参与人次 + */ + private Integer partiUserTotal; + + /** + * 议题数 + */ + private Integer issueTotal; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java new file mode 100644 index 0000000000..4adb2ee168 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java @@ -0,0 +1,57 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 安宁-基层党员-各类总数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +public class AnGrassRootsPmTotalMonthlyFormDTO implements Serializable { + private static final long serialVersionUID = 8675347783888892404L; + + /** + * 网格id或者组织(街道或社区)id + */ + private String orgId; + + /** + * 组织名称OR网格名称 + */ + private String orgName; + + /** + * 网格:grid;组织:agency + */ + private String orgType; + + /** + * org_id的上一级id + */ + private String pid; + + /** + * 群成员数 + */ + private Integer groupMemberTotal; + + /** + * 话题数 + */ + private Integer topicTotal; + + /** + * 话题参与人次 + */ + private Integer topicPartiUserTotal; + + /** + * 议题数 + */ + private Integer issueTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java new file mode 100644 index 0000000000..62dd550eb0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java @@ -0,0 +1,99 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.exception.ValidateException; +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.AnScreenCollService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @Description 安宁数据采集接口 + * @ClassName AnScreenCollController + * @Auth wangc + * @Date 2020-10-09 13:30 + */ +@RestController +@RequestMapping("anscreencoll") +public class AnScreenCollController { + + @Autowired + private AnScreenCollService screenCollService; + + /** + * @Description 安宁大屏数据采集 - 基层党员-各类总数 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:20 + */ + @PostMapping("pmtotal") + public Result pmTotal(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); + screenCollService.pmTotal(formDTO,customerId); + return new Result(); + } + + /** + * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:19 + */ + @PostMapping("pmrank") + public Result pmRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); + screenCollService.pmRank(formDTO,customerId); + return new Result(); + } + + /** + * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329498 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:22 + */ + @PostMapping("grassrootsorg") + public Result grassrootsOrg(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); + screenCollService.grassrootsOrg(formDTO,customerId); + return new Result(); + } + + /** + * @Description 安宁大屏数据采集 - 基层治理-各类数 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329499 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:23 + */ + @PostMapping("grassrootsgovern") + public Result grassrootsGovern(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); + screenCollService.grassrootsGovern(formDTO,customerId); + return new Result(); + } + + /** + * @Description 安宁大屏数据采集 - 中央区-项目概要 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 16:41 + */ + @PostMapping("projectfile") + public Result projectFile(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); + screenCollService.communityProjectProfile(formDTO,customerId); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnCommunityProjectProfileDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnCommunityProjectProfileDao.java new file mode 100644 index 0000000000..f3c04fc7d6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnCommunityProjectProfileDao.java @@ -0,0 +1,55 @@ +/** + * 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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.AnCommunityProjectProfileFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenAnCommunityProjectProfileEntity; +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-10-09 + */ +@Mapper +public interface ScreenAnCommunityProjectProfileDao extends BaseDao { + + /** + * @Description 批量删除 + * @param customerId + * @return int + * @author wangc + * @date 2020.10.09 15:30 + */ + int deleteBatch(@Param("customerId") String customerId); + + /** + * @Description 批量写入 + * @param list + * @param customerId + * @return int + * @author wangc + * @date 2020.10.09 15:30 + */ + int insertBatch(@Param("list") List list,@Param("customerId") String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyDao.java new file mode 100644 index 0000000000..f029b886b3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyDao.java @@ -0,0 +1,60 @@ +/** + * 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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.AnGrassRootsGovernMonthlyFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenAnGrassRootsGovernMonthlyEntity; +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-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsGovernMonthlyDao extends BaseDao { + + /** + * @Description 批量删除 + * @param customerId + * @return int + * @author wangc + * @date 2020.10.09 15:30 + */ + int deleteBatch(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @Description 批量新增 + * @param list + * @param customerId + * @param monthId + * @param quarterId + * @param yearId + * @return int + * @author wangc + * @date 2020.10.09 16:08 + */ + int insertBatch(@Param("list") List list, + @Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyDao.java new file mode 100644 index 0000000000..817d5d74b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyDao.java @@ -0,0 +1,61 @@ +/** + * 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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.AnGrassRootsOrgMonthlyFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenAnGrassRootsOrgMonthlyEntity; +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-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsOrgMonthlyDao extends BaseDao { + + /** + * @Description 批量删除 + * @param customerId + * @return int + * @author wangc + * @date 2020.10.09 15:30 + */ + int deleteBatch(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @Description 批量新增 + * @param list + * @param customerId + * @param monthId + * @param quarterId + * @param yearId + * @return int + * @author wangc + * @date 2020.10.09 16:07 + */ + int insertBatch(@Param("list") List list, + @Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("quarterId")String quarterId,@Param("yearId")String yearId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsPmRankDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsPmRankDao.java new file mode 100644 index 0000000000..422fb53937 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsPmRankDao.java @@ -0,0 +1,56 @@ +/** + * 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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.AnGrassRootsPmRankFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenAnGrassRootsPmRankEntity; +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-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsPmRankDao extends BaseDao { + + /*** + * @Description 批量删除 + * @param customerId + * @return int + * @author wangc + * @date 2020.10.09 16:07 + */ + int deleteBatch(@Param("customerId") String customerId); + + /** + * @Description 批量新增 + * @param list + * @param customerId + * @return int + * @author wangc + * @date 2020.10.09 16:10 + */ + int insertBatch(@Param("list") List list,@Param("customerId") String customerId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyDao.java new file mode 100644 index 0000000000..f793ba3e44 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyDao.java @@ -0,0 +1,64 @@ +/** + * 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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.AnGrassRootsPmTotalMonthlyFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenAnGrassRootsPmTotalMonthlyEntity; +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-10-09 + */ +@Mapper +public interface ScreenAnGrassRootsPmTotalMonthlyDao extends BaseDao { + + /** + * @Description 批量删除 + * @param customerId + * @param monthId + * @return int + * @author wangc + * @date 2020.10.09 16:25 + */ + int deleteBatch(@Param("customerId")String customerId,@Param("monthId")String monthId); + + /** + * @Description 批量新增 + * @param list + * @param customerId + * @param monthId + * @param quarterId + * @param yearId + * @return int + * @author wangc + * @date 2020.10.09 16:35 + */ + int insertBatch(@Param("list") List list, + @Param("customerId")String customerId, + @Param("monthId")String monthId, + @Param("quarterId")String quarterId, + @Param("yearId")String yearId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnCommunityProjectProfileEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnCommunityProjectProfileEntity.java new file mode 100644 index 0000000000..8f6e954b8b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnCommunityProjectProfileEntity.java @@ -0,0 +1,66 @@ +/** + * 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.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + + +/** + * 安宁-社区-项目概况(数量、颜色) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_an_community_project_profile") +public class ScreenAnCommunityProjectProfileEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd,项目根据实际情况赋值 + */ + private String dataEndTime; + + /** + * 社区id + */ + private String orgId; + + /** + * 项目数 + */ + private Integer projectTotal; + + /** + * 等级 + */ + private String level; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyEntity.java new file mode 100644 index 0000000000..3b738773e3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyEntity.java @@ -0,0 +1,107 @@ +/** + * 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.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 安宁-基层治理-各类数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_an_grass_roots_govern_monthly") +public class ScreenAnGrassRootsGovernMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 网格,街道或社区id + */ + private String orgId; + + /** + * 网格,街道名称或者社区名称 + */ + private String orgName; + + /** + * 网格:grid;组织:agency + */ + private String orgType; + + /** + * org_id的上一级id + */ + private String pid; + + /** + * 参与项目数 + */ + private Integer partiProjectTotal; + + /** + * 办结项目数 + */ + private Integer closedProjectTotal; + + /** + * 项目响应度 存储的是%前面的数 + */ + private BigDecimal projectResponseRatio; + + /** + * 项目满意率,存储的是%前面的数 + */ + private BigDecimal projectSatisRatio; + + /** + * 办结率 for 社区 + */ + private BigDecimal closedProjectRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyEntity.java new file mode 100644 index 0000000000..889650f9b7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyEntity.java @@ -0,0 +1,96 @@ +/** + * 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.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 安宁-基层组织(党群数|议题数|项目数)-按月 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_an_grass_roots_org_monthly") +public class ScreenAnGrassRootsOrgMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 网格id或者组织(街道或社区)id + */ + private String orgId; + + /** + * 组织名称OR网格名称 + */ + private String orgName; + + /** + * 网格:grid; 组织:agency + */ + private String orgType; + + /** + * org_id的上一级id + */ + private String pid; + + /** + * 党群数 + */ + private Integer groupTotal; + + /** + * 议题数 + */ + private Integer issueTotal; + + /** + * 项目数 + */ + private Integer projectTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsPmRankEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsPmRankEntity.java new file mode 100644 index 0000000000..721c1106ea --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsPmRankEntity.java @@ -0,0 +1,101 @@ +/** + * 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.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 安宁-基层党员-排行榜单 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_an_grass_roots_pm_rank") +public class ScreenAnGrassRootsPmRankEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String userName; + + /** + * 所属支部id + */ + private String branchId; + + /** + * 所属支部名称 + */ + private String branchName; + + /** + * 所属社区id + */ + private String communityId; + + /** + * 所属社区名称 + */ + private String communityName; + + /** + * 群成员数 + */ + private Integer groupMemberTotal; + + /** + * 话题数 + */ + private Integer topicTotal; + + /** + * 参与人次 + */ + private Integer partiUserTotal; + + /** + * 议题数 + */ + private Integer issueTotal; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyEntity.java new file mode 100644 index 0000000000..9ec3bfdb20 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyEntity.java @@ -0,0 +1,101 @@ +/** + * 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.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 安宁-基层党员-各类总数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-10-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_an_grass_roots_pm_total_monthly") +public class ScreenAnGrassRootsPmTotalMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 网格id或者组织(街道或社区)id + */ + private String orgId; + + /** + * 组织名称OR网格名称 + */ + private String orgName; + + /** + * 网格:grid;组织:agency + */ + private String orgType; + + /** + * org_id的上一级id + */ + private String pid; + + /** + * 群成员数 + */ + private Integer groupMemberTotal; + + /** + * 话题数 + */ + private Integer topicTotal; + + /** + * 话题参与人次 + */ + private Integer topicPartiUserTotal; + + /** + * 议题数 + */ + private Integer issueTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index 5b7d0fd8a6..9b5b67f36c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -710,7 +710,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } if ("".equals(agencyName)) { - throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + agencyScore.getKey()); + log.error("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + agencyScore.getKey()); + continue; } // 补充表中其他字段 monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, agencyScore.getKey(), diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java new file mode 100644 index 0000000000..15a9d72a35 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java @@ -0,0 +1,59 @@ +package com.epmet.service.evaluationindex.screen; + + +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.dto.screencoll.form.*; + +/** + * 大屏数据采集api - 安宁 + */ +public interface AnScreenCollService { + + /** + * @Description 安宁大屏数据采集 - 中央区-项目概要 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 16:41 + */ + void communityProjectProfile(ScreenCollFormDTO formDTO,String customerId); + + /** + * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:19 + */ + void pmRank(ScreenCollFormDTO formDTO,String customerId); + + /** + * @Description 安宁大屏数据采集 - 基层党员-各类总数 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:20 + */ + void pmTotal(ScreenCollFormDTO formDTO,String customerId); + + /** + * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:22 + */ + void grassrootsOrg(ScreenCollFormDTO formDTO,String customerId); + + /** + * @Description 安宁大屏数据采集 - 基层治理-各类数 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:23 + */ + void grassrootsGovern(ScreenCollFormDTO formDTO,String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java new file mode 100644 index 0000000000..41eac708e0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java @@ -0,0 +1,191 @@ +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.dao.evaluationindex.screen.ScreenAnCommunityProjectProfileDao; +import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsGovernMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsOrgMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmRankDao; +import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmTotalMonthlyDao; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.dto.screencoll.form.*; +import com.epmet.service.evaluationindex.screen.AnScreenCollService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + + +import java.util.List; + + +/** + * @Description 安宁数据采集 + * @ClassName AnScreenCollServiceImpl + * @Auth wangc + * @Date 2020-10-09 13:32 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Slf4j +public class AnScreenCollServiceImpl implements AnScreenCollService { + + @Autowired + private ScreenAnCommunityProjectProfileDao communityProjectProfileDao; + @Autowired + private ScreenAnGrassRootsGovernMonthlyDao governMonthlyDao; + @Autowired + private ScreenAnGrassRootsOrgMonthlyDao orgMonthlyDao; + @Autowired + private ScreenAnGrassRootsPmRankDao pmRankDao; + @Autowired + private ScreenAnGrassRootsPmTotalMonthlyDao pmTotalMonthlyDao; + + + /** + * @Description 安宁大屏数据采集 - 中央区-项目概要 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 16:41 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void communityProjectProfile(ScreenCollFormDTO formDTO,String customerId) { + List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ; + if(formDTO.getIsFirst()){ + int affectRows = communityProjectProfileDao.deleteBatch(customerId); + while(affectRows >= NumConstant.ONE){ + affectRows = communityProjectProfileDao.deleteBatch(customerId); + } + } + Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { + communityProjectProfileDao.insertBatch(list,customerId); + }); + + } + + /** + * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:19 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void pmRank(ScreenCollFormDTO formDTO,String customerId) { + List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ; + if(formDTO.getIsFirst()){ + int affectRows = pmRankDao.deleteBatch(customerId); + while(affectRows >= NumConstant.ONE){ + affectRows = pmRankDao.deleteBatch(customerId); + } + } + Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { + pmRankDao.insertBatch(list,customerId); + }); + } + + /** + * @Description 安宁大屏数据采集 - 基层党员-各类总数 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:20 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void pmTotal(ScreenCollFormDTO formDTO,String customerId) { + List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ; + + if(formDTO.getIsFirst()){ + int affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + while(affectRows >= NumConstant.ONE){ + affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + } + } + String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); + String yearId = DateUtils.getYearId(formDTO.getMonthId()); + Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { + pmTotalMonthlyDao.insertBatch(list, + customerId, + formDTO.getMonthId(), + quarterId, + yearId); + }); + + } + + /** + * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:22 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void grassrootsOrg(ScreenCollFormDTO formDTO,String customerId) { + List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ; + + if(formDTO.getIsFirst()){ + int affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + while(affectRows >= NumConstant.ONE){ + affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + } + } + String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); + String yearId = DateUtils.getYearId(formDTO.getMonthId()); + Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { + orgMonthlyDao.insertBatch(list, + customerId, + formDTO.getMonthId(), + quarterId, + yearId); + }); + + } + + /** + * @Description 安宁大屏数据采集 - 基层治理-各类数 + * @param formDTO + * @return void + * @author wangc + * @date 2020.10.09 17:23 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void grassrootsGovern(ScreenCollFormDTO formDTO,String customerId) { + List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ; + + if(formDTO.getIsFirst()){ + int affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + while(affectRows >= NumConstant.ONE){ + affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + } + } + String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); + String yearId = DateUtils.getYearId(formDTO.getMonthId()); + Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { + governMonthlyDao.insertBatch(list, + customerId, + formDTO.getMonthId(), + quarterId, + yearId); + }); + + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnCommunityProjectProfileDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnCommunityProjectProfileDao.xml new file mode 100644 index 0000000000..757f39f347 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnCommunityProjectProfileDao.xml @@ -0,0 +1,46 @@ + + + + + + + DELETE + FROM + screen_an_community_project_profile + WHERE + CUSTOMER_ID = #{customerId} + LIMIT 1000 + + + + INSERT INTO screen_an_community_project_profile + ( id, + customer_id, + data_end_time, + org_id, + project_total, + level, + created_by, + created_time, + updated_by, + updated_time + ) + values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.dataEndTime}, + #{item.orgId}, + #{item.projectTotal}, + #{item.level}, + '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/screen/ScreenAnGrassRootsGovernMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyDao.xml new file mode 100644 index 0000000000..5c6ce14824 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsGovernMonthlyDao.xml @@ -0,0 +1,63 @@ + + + + + + + DELETE + FROM + screen_an_grass_roots_govern_monthly + WHERE + CUSTOMER_ID = #{customerId} + AND + MONTH_ID = #{monthId} + LIMIT 1000 + + + + INSERT INTO screen_an_grass_roots_govern_monthly + ( + id, + customer_id, + month_id, + quarter_id, + year_id, + org_id, + org_name, + org_type, + pid, + parti_project_total, + closed_project_total, + project_response_ratio, + project_satis_ratio, + closed_project_ratio, + created_by, + created_time, + updated_by, + updated_time + )values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{monthId}, + #{quarterId}, + #{yearId}, + #{item.orgId}, + #{item.orgName}, + #{item.orgType}, + #{item.pid}, + #{item.partiProjectTotal}, + #{item.closedProjectTotal}, + #{item.projectResponseRatio}, + #{item.projectSatisRatio}, + #{item.closedProjectRatio}, + '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/screen/ScreenAnGrassRootsOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyDao.xml new file mode 100644 index 0000000000..f72fa27b99 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsOrgMonthlyDao.xml @@ -0,0 +1,60 @@ + + + + + + + DELETE + FROM + screen_an_grass_roots_org_monthly + WHERE + CUSTOMER_ID = #{customerId} + AND + MONTH_ID = #{monthId} + LIMIT 1000 + + + + + INSERT INTO screen_an_grass_roots_org_monthly + ( + id, + customer_id, + month_id, + quarter_id, + year_id, + org_id, + org_name, + org_type, + pid, + group_total, + issue_total, + project_total, + created_by, + created_time, + updated_by, + updated_time + )values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{monthId}, + #{quarterId}, + #{yearId}, + #{item.orgId}, + #{item.orgName}, + #{item.orgType}, + #{item.pid}, + #{item.groupTotal}, + #{item.issueTotal}, + #{item.projectTotal}, + '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/screen/ScreenAnGrassRootsPmRankDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsPmRankDao.xml new file mode 100644 index 0000000000..c76f1db82f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsPmRankDao.xml @@ -0,0 +1,59 @@ + + + + + + + DELETE + FROM + screen_an_grass_roots_pm_rank + WHERE + CUSTOMER_ID = #{customerId} + LIMIT 1000 + + + + INSERT INTO screen_an_grass_roots_pm_rank + ( + id, + customer_id, + user_id, + user_name, + branch_id, + branch_name, + community_id, + community_name, + group_member_total, + topic_total, + parti_user_total, + issue_total, + all_parent_ids, + created_by, + created_time, + updated_by, + updated_time + )values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.userId}, + #{item.userName}, + #{item.branchId}, + #{item.branchName}, + #{item.communityId}, + #{item.communityName}, + #{item.groupMemberTotal}, + #{item.topicTotal}, + #{item.partiUserTotal}, + #{item.issueTotal}, + #{item.allParentIds}, + '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/screen/ScreenAnGrassRootsPmTotalMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyDao.xml new file mode 100644 index 0000000000..6f4b7b7e67 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenAnGrassRootsPmTotalMonthlyDao.xml @@ -0,0 +1,61 @@ + + + + + + + DELETE + FROM + screen_an_grass_roots_pm_total_monthly + WHERE + CUSTOMER_ID = #{customerId} + AND + MONTH_ID = #{monthId} + LIMIT 1000 + + + + INSERT INTO screen_an_grass_roots_pm_total_monthly + ( + id, + customer_id, + month_id, + quarter_id, + year_id, + org_id, + org_name, + org_type, + pid, + group_member_total, + topic_total, + topic_parti_user_total, + issue_total, + created_by, + created_time, + updated_by, + updated_time + )values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{monthId}, + #{quarterId}, + #{yearId}, + #{item.orgId}, + #{item.orgName}, + #{item.orgType}, + #{item.pid}, + #{item.groupMemberTotal}, + #{item.topicTotal}, + #{item.topicPartiUserTotal}, + #{item.issueTotal}, + 'APP_USER', + NOW(), + 'APP_USER', + NOW() + ) + + + + \ No newline at end of file