From 2a1d19856d33cbe1e4ca21876e6668405ff4e2a1 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 25 Jun 2021 10:18:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=87=87=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/extract/FactAgencyGovernDailyDTO.java | 181 ++++++++++++++++ .../dto/extract/FactGridGovernDailyDTO.java | 193 ++++++++++++++++++ .../form/AgencyGovernDailyFormDTO.java | 28 +++ .../extract/form/GridGovernDailyFormDTO.java | 28 +++ .../screen/ScreenGovernRankDataDailyDTO.java | 29 +++ .../form/GovernRankDataDailyFormDTO.java | 29 +++ .../GovernanceDataReportController.java | 74 +++++++ .../ScreenGovernRankDataDailyEntity.java | 31 ++- .../service/GovernanceDataReportService.java | 48 +++++ .../todata/FactAgencyGovernDailyService.java | 22 ++ .../todata/FactGridGovernDailyService.java | 21 ++ .../FactAgencyGovernDailyServiceImpl.java | 33 +++ .../impl/FactGridGovernDailyServiceImpl.java | 38 +++- .../ScreenGovernRankDataDailyService.java | 19 ++ .../ScreenGovernRankDataDailyServiceImpl.java | 33 +++ .../impl/GovernanceDataReportServiceImpl.java | 112 ++++++++++ 16 files changed, 914 insertions(+), 5 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/AgencyGovernDailyFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridGovernDailyFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataDailyFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/GovernanceDataReportController.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/GovernanceDataReportService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/GovernanceDataReportServiceImpl.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java new file mode 100644 index 0000000000..3f9c614f8a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java @@ -0,0 +1,181 @@ +package com.epmet.dto.extract; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/6/24 15:32 + */ +@Data +public class FactAgencyGovernDailyDTO implements Serializable { + private static final long serialVersionUID = 4776545209536007717L; + private String id; + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 组织id + */ + private String agencyId; + + /** + * agency_id所属的机关级别(社区级:community, + 乡(镇、街道)级:street, + 区县级: district, + 市级: city + 省级:province) + */ + private String level; + + /** + * 组织i所属的组织id + */ + private String pid; + + /** + * 组织i所有上级id + */ + private String pids; + + /** + * 界面展示:问题解决总数=1+2+3+4+5+6+7+8 + */ + private Integer problemResolvedCount; + + /** + * 界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数 + */ + private BigDecimal groupSelfGovernRatio; + + /** + * 界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal gridSelfGovernRatio; + + /** + * 界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal communityClosedRatio; + + /** + * 界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal streetClosedRatio; + + /** + * 界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal districtDeptClosedRatio; + + /** + * 1、当前组织内,话题关闭已解决数 + */ + private Integer topicResolvedCount; + + /** + * 2、当前组织内,话题关闭无需解决数 + */ + private Integer topicUnResolvedCount; + + /** + * 3、当前组织内,议题关闭已解决数 + */ + private Integer issueResolvedCount; + + /** + * 4、当前组织内,议题关闭无需解决数 + */ + private Integer issueUnResolvedCount; + + /** + * 5、当前组织内:来源于议题的项目:结案已解决数 + */ + private Integer issueProjectResolvedCount; + + /** + * 6、当前组织内:来源于议题的项目:结案无需解决数 + */ + private Integer issueProjectUnResolvedCount; + + /** + * 7、当前组织内:项目立项,结案已解决数;默认为0, + */ + private Integer approvalProjectResolvedCount; + + /** + * 8、当前组织内:项目立项,结案无需解决数;默认为0, + */ + private Integer approvalProjectUnResolvedCount; + + /** + * 9、当前组织内,未出小组即未转议题的:话题关闭已解决数 + */ + private Integer inGroupTopicResolvedCount; + + /** + * 10、当前组织内,未出小组即未转议题的:话题关闭无需解决数 + */ + private Integer inGroupTopicUnResolvedCount; + + /** + * 未出当前网格的,结案项目数 + */ + private Integer gridSelfGovernProjectTotal; + + /** + * 当前组织内结案的项目中:由社区结案的项目总数 + */ + private Integer communityClosedCount; + + /** + * 当前组织内结案的项目中:由街道结案的项目总数 + */ + private Integer streetClosedCount; + + /** + * 当前组织内结案的项目中:由区直部门结案的项目总数 + */ + private Integer districtDeptClosedCount; + + /** + * 删除标识 默认为0 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java new file mode 100644 index 0000000000..778ffcb9a4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java @@ -0,0 +1,193 @@ +package com.epmet.dto.extract; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/6/24 15:34 + */ +@Data +public class FactGridGovernDailyDTO implements Serializable { + private static final long serialVersionUID = -5492115478082510064L; + private String id; + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有上级id + */ + private String pids; + + /** + * 界面展示:问题解决总数=1+2+3+4+5+6+7+8 + */ + private Integer problemResolvedCount; + + /** + * 界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数 + */ + private BigDecimal groupSelfGovernRatio; + + /** + * 界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal gridSelfGovernRatio; + + /** + * 界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal communityClosedRatio; + + /** + * 界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal streetClosedRatio; + + /** + * 界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal districtDeptClosedRatio; + + /** + * 1、当前网格内,话题关闭已解决数 + */ + private Integer topicResolvedCount; + + /** + * 2、当前网格内,话题关闭无需解决数 + */ + private Integer topicUnResolvedCount; + + /** + * 3、当前网格内,议题关闭已解决数 + */ + private Integer issueResolvedCount; + + /** + * 4、当前网格内,议题关闭无需解决数 + */ + private Integer issueUnResolvedCount; + + /** + * 5、当前网格内:来源于议题的项目:结案已解决数 + */ + private Integer issueProjectResolvedCount; + + /** + * 6、当前网格内:来源于议题的项目:结案无需解决数 + */ + private Integer issueProjectUnResolvedCount; + + /** + * 7、当前网格内:项目立项,结案已解决数;默认为0, + */ + private Integer approvalProjectResolvedCount; + + /** + * 8、当前网格内:项目立项,结案无需解决数;默认为0, + */ + private Integer approvalProjectUnResolvedCount; + + /** + * 9、当前网格内,未出小组即未转议题的:话题关闭已解决数 + */ + private Integer inGroupTopicResolvedCount; + + /** + * 10、当前网格内,未出小组即未转议题的:话题关闭无需解决数 + */ + private Integer inGroupTopicUnResolvedCount; + + /** + * 11、来源于议题的项目,未出网格结案并且已解决的项目数 + */ + private Integer fromIssueResolvedInGridCount; + + /** + * 12、来源于议题的项目,未出网格结案并且无需解决的项目数 + */ + private Integer fromIssueUnResolvedInGridCount; + + /** + * 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0 + */ + private Integer fromAgencyResolvedInGridCount; + + /** + * 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0 + */ + private Integer fromAgencyUnResolvedInGridCount; + + /** + * 15、未出当前网格的,结案项目数=11+12+13+14 + */ + private Integer gridSelfGovernProjectTotal; + + + /** + * 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 + */ + private Integer communityClosedCount; + + /** + * 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + */ + private Integer streetClosedCount; + + /** + * 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + */ + private Integer districtDeptClosedCount; + + /** + * 删除标识 默认为0 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/AgencyGovernDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/AgencyGovernDailyFormDTO.java new file mode 100644 index 0000000000..3f1c3a1bc7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/AgencyGovernDailyFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.extract.form; + +import com.epmet.dto.extract.FactAgencyGovernDailyDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/6/24 15:28 + */ +@Data +public class AgencyGovernDailyFormDTO implements Serializable { + private static final long serialVersionUID = 106752296400100448L; + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMMdd + */ + private String dateId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridGovernDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridGovernDailyFormDTO.java new file mode 100644 index 0000000000..173ba43011 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridGovernDailyFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.extract.form; + +import com.epmet.dto.extract.FactGridGovernDailyDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/6/24 15:36 + */ +@Data +public class GridGovernDailyFormDTO implements Serializable { + private static final long serialVersionUID = 1630151176835406040L; + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMMdd + */ + private String dateId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java index 29d988da64..9a1bc174c1 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java @@ -99,6 +99,35 @@ public class ScreenGovernRankDataDailyDTO implements Serializable { */ private BigDecimal satisfactionRatio; + /** + * 响应数 + */ + private Integer responseCount; + /** + * 项目转入次数 + */ + private Integer transferCount; + /** + * 解决项目数 + */ + private Integer resolvedCount; + /** + * 已关闭项目数 + */ + private Integer closedCount; + /** + * 自治项目数 + */ + private Integer governCount; + /** + * 满意项目数 + */ + private Integer satisfactionCount; + /** + * 已关闭项目(由议题转的项目)数 + */ + private Integer closedProjectCount; + /** * 删除标识 0未删除;1已删除 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataDailyFormDTO.java new file mode 100644 index 0000000000..f5b4cdb15d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataDailyFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import com.epmet.dto.screen.ScreenGovernRankDataDailyDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/6/24 10:04 + */ +@Data +public class GovernRankDataDailyFormDTO implements Serializable { + + private static final long serialVersionUID = 3485797660632260565L; + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMMdd + */ + private String dateId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/GovernanceDataReportController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/GovernanceDataReportController.java new file mode 100644 index 0000000000..77913ac0d9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/GovernanceDataReportController.java @@ -0,0 +1,74 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.AgencyGovernDailyFormDTO; +import com.epmet.dto.extract.form.GridGovernDailyFormDTO; +import com.epmet.dto.screencoll.form.GovernRankDataDailyFormDTO; +import com.epmet.service.GovernanceDataReportService; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.sql.ResultSet; + +/** + * 治理能力数据上报 + * + * @author zhaoqifeng + * @date 2021/6/24 15:16 + */ +@RestController +@RequestMapping("governance") +public class GovernanceDataReportController { + + @Resource + private GovernanceDataReportService governanceDataReportService; + + + /** + * 基层治理-治理能力排行数据(按天统计) + * + * @param customerId + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2021/6/24 10:02 + */ + @PostMapping("governrankdatadaily") + public Result governRankDataDaily(@RequestHeader("CustomerId") String customerId, @RequestBody GovernRankDataDailyFormDTO formDTO) { + governanceDataReportService.insertGovernRankDataDaily(formDTO, customerId); + return new Result(); + } + + + /** + * 组织的治理指数,按天统计 + * + * @param customerId + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2021/6/24 15:38 + */ + @PostMapping("agencygoverndaily") + public Result agencyGovernDaily(@RequestHeader("CustomerId") String customerId, @RequestBody AgencyGovernDailyFormDTO formDTO) { + governanceDataReportService.insertAgencyGovernDaily(formDTO, customerId); + return new Result(); + } + + /** + * 网格的治理指数,按天统计 + * + * @param customerId + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2021/6/24 15:38 + */ + @PostMapping("gridgoverndaily") + public Result gridGovernDaily(@RequestHeader("CustomerId") String customerId, @RequestBody GridGovernDailyFormDTO formDTO) { + governanceDataReportService.insertGridGovernDaily(formDTO, customerId); + return new Result(); + } + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java index 8bbe10f526..66b0db7dfa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java @@ -97,6 +97,35 @@ public class ScreenGovernRankDataDailyEntity extends BaseEpmetEntity { /** * 满意率 */ - private BigDecimal satisfactionRatio; + private BigDecimal satisfactionRatio;. + + /** + * 响应数 + */ + private Integer responseCount; + /** + * 项目转入次数 + */ + private Integer transferCount; + /** + * 解决项目数 + */ + private Integer resolvedCount; + /** + * 已关闭项目数 + */ + private Integer closedCount; + /** + * 自治项目数 + */ + private Integer governCount; + /** + * 满意项目数 + */ + private Integer satisfactionCount; + /** + * 已关闭项目(由议题转的项目)数 + */ + private Integer closedProjectCount; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/GovernanceDataReportService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/GovernanceDataReportService.java new file mode 100644 index 0000000000..db9808bf3f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/GovernanceDataReportService.java @@ -0,0 +1,48 @@ +package com.epmet.service; + +import com.epmet.dto.extract.form.AgencyGovernDailyFormDTO; +import com.epmet.dto.extract.form.GridGovernDailyFormDTO; +import com.epmet.dto.screencoll.form.GovernRankDataDailyFormDTO; + +/** + * 治理能力数据上报 + * + * @author zhaoqifeng + * @date 2021/6/24 15:18 + */ +public interface GovernanceDataReportService { + + /** + * 基层治理-治理能力排行数据(按天统计) + * + * @param formDTO + * @param customerId + * @return void + * @author zhaoqifeng + * @date 2021/6/24 10:14 + */ + void insertGovernRankDataDaily(GovernRankDataDailyFormDTO formDTO, String customerId); + + /** + * 组织的治理指数,按天统计 + * + * @param formDTO + * @param customerId + * @return void + * @author zhaoqifeng + * @date 2021/6/24 15:40 + */ + void insertAgencyGovernDaily(AgencyGovernDailyFormDTO formDTO, String customerId); + + /** + * 网格的治理指数,按天统计 + * + * @param formDTO + * @param customerId + * @return void + * @author zhaoqifeng + * @date 2021/6/24 15:40 + */ + void insertGridGovernDaily(GridGovernDailyFormDTO formDTO, String customerId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java index 0504164079..647d0650a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java @@ -18,8 +18,11 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.FactAgencyGovernDailyDTO; import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; +import java.util.List; + /** * 组织的治理指数,按天统计 * @@ -38,4 +41,23 @@ public interface FactAgencyGovernDailyService extends BaseService list); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java index 15447342ab..6d62d67c29 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java @@ -18,9 +18,12 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.FactGridGovernDailyDTO; import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO; import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; +import java.util.List; + /** * 网格的治理指数,按天统计 * @@ -41,4 +44,22 @@ public interface FactGridGovernDailyService extends BaseService list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java index 6629836e02..9cae42b818 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java @@ -17,10 +17,13 @@ package com.epmet.service.evaluationindex.extract.todata.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.*; import com.epmet.dao.evaluationindex.extract.FactAgencyGovernDailyDao; +import com.epmet.dto.extract.FactAgencyGovernDailyDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; @@ -301,6 +304,36 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(FactAgencyGovernDailyEntity :: getCustomerId, customerId) + .eq(FactAgencyGovernDailyEntity :: getDateId, dateId); + return baseDao.delete(wrapper); + } + + /** + * 批量插入 + * + * @param list + * @return void + * @author zhaoqifeng + * @date 2021/6/24 15:56 + */ + @Override + public void insertBatch(List list) { + this.insertBatch(ConvertUtils.sourceToTarget(list, FactAgencyGovernDailyEntity.class)); + } + private FactAgencyGovernDailyEntity initEntity(DimAgencyDTO agency, String dateId) { FactAgencyGovernDailyEntity entity = new FactAgencyGovernDailyEntity(); entity.setCustomerId(agency.getCustomerId()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java index 2a9b0e4120..9f7e4fcb36 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java @@ -17,19 +17,19 @@ package com.epmet.service.evaluationindex.extract.todata.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DimObjectActionConstant; import com.epmet.constant.DimObjectStatusConstant; import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao; +import com.epmet.dto.extract.FactGridGovernDailyDTO; import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO; import com.epmet.dto.org.GridInfoDTO; -import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; -import com.epmet.entity.evaluationindex.extract.GovernGridClosedTotalCommonDTO; -import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; -import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO; +import com.epmet.entity.evaluationindex.extract.*; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; @@ -247,6 +247,36 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(FactGridGovernDailyEntity :: getCustomerId, customerId) + .eq(FactGridGovernDailyEntity :: getDateId, dateId); + return baseDao.delete(wrapper); + } + + /** + * 批量插入 + * + * @param list + * @return void + * @author zhaoqifeng + * @date 2021/6/24 16:09 + */ + @Override + public void insertBatch(List list) { + this.insertBatch(ConvertUtils.sourceToTarget(list, FactGridGovernDailyEntity.class)); + } + private Map getGovernGridClosedTotalCommonDTOMap(String customerId, List gridIds) { Map resultMap = new HashMap<>(); for (String gridId : gridIds) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataDailyService.java index 0fa086cfb7..9775908921 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataDailyService.java @@ -118,4 +118,23 @@ public interface ScreenGovernRankDataDailyService extends BaseService entityList); + + /** + * 删除数据 + * @author zhaoqifeng + * @date 2021/6/24 14:46 + * @param customerId + * @param dateId + * @return java.lang.Integer + */ + Integer deleteGovernRankDataDaily(String customerId, String dateId); + + /** + * 批量插入 + * @author zhaoqifeng + * @date 2021/6/24 15:24 + * @param list + * @return void + */ + void insertBatch(List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java index 3c48645963..ca03285245 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.dynamic.datasource.annotation.DataSource; @@ -167,4 +168,36 @@ public class ScreenGovernRankDataDailyServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ScreenGovernRankDataDailyEntity :: getCustomerId, customerId) + .eq(ScreenGovernRankDataDailyEntity :: getDateId, dateId); + return baseDao.delete(wrapper); + } + + /** + * 批量插入 + * + * @param list + * @return void + * @author zhaoqifeng + * @date 2021/6/24 15:24 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void insertBatch(List list) { + this.insertBatch(ConvertUtils.sourceToTarget(list, ScreenGovernRankDataDailyEntity.class)); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/GovernanceDataReportServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/GovernanceDataReportServiceImpl.java new file mode 100644 index 0000000000..58e40fc7fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/GovernanceDataReportServiceImpl.java @@ -0,0 +1,112 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dto.extract.form.AgencyGovernDailyFormDTO; +import com.epmet.dto.extract.form.GridGovernDailyFormDTO; +import com.epmet.dto.screencoll.form.GovernRankDataDailyFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; +import com.epmet.service.GovernanceDataReportService; +import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; +import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataDailyService; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/6/24 15:19 + */ +@Service +public class GovernanceDataReportServiceImpl implements GovernanceDataReportService { + @Resource + private ScreenGovernRankDataDailyService screenGovernRankDataDailyService; + @Resource + private FactAgencyGovernDailyService factAgencyGovernDailyService; + @Resource + private FactGridGovernDailyService factGridGovernDailyService; + + + /** + * 基层治理-治理能力排行数据(按天统计) + * + * @param formDTO + * @param customerId + * @return void + * @author zhaoqifeng + * @date 2021/6/24 10:14 + */ + @Override + public void insertGovernRankDataDaily(GovernRankDataDailyFormDTO formDTO, String customerId) { + if (StringUtils.isEmpty(formDTO.getDateId()) || formDTO.getDateId().length() != NumConstant.SIX) { + throw new RenException("dateId格式应为: yyyyMMdd,当前传入:" + formDTO.getDateId()); + } + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenGovernRankDataDailyService.deleteGovernRankDataDaily(customerId, formDTO.getDateId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + formDTO.getDataList().forEach(item -> item.setCustomerId(customerId)); + screenGovernRankDataDailyService.insertBatch(formDTO.getDataList()); + } + } + + /** + * 组织的治理指数,按天统计 + * + * @param formDTO + * @param customerId + * @return void + * @author zhaoqifeng + * @date 2021/6/24 15:40 + */ + @Override + public void insertAgencyGovernDaily(AgencyGovernDailyFormDTO formDTO, String customerId) { + if (StringUtils.isEmpty(formDTO.getDateId()) || formDTO.getDateId().length() != NumConstant.SIX) { + throw new RenException("dateId格式应为: yyyyMMdd,当前传入:" + formDTO.getDateId()); + } + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factAgencyGovernDailyService.deleteAgencyGovernData(customerId, formDTO.getDateId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + formDTO.getDataList().forEach(item -> item.setCustomerId(customerId)); + factAgencyGovernDailyService.insertBatch(formDTO.getDataList()); + } + } + + /** + * 网格的治理指数,按天统计 + * + * @param formDTO + * @param customerId + * @return void + * @author zhaoqifeng + * @date 2021/6/24 15:40 + */ + @Override + public void insertGridGovernDaily(GridGovernDailyFormDTO formDTO, String customerId) { + if (StringUtils.isEmpty(formDTO.getDateId()) || formDTO.getDateId().length() != NumConstant.SIX) { + throw new RenException("dateId格式应为: yyyyMMdd,当前传入:" + formDTO.getDateId()); + } + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factGridGovernDailyService.deleteGridGovernData(customerId, formDTO.getDateId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + formDTO.getDataList().forEach(item -> item.setCustomerId(customerId)); + factGridGovernDailyService.insertBatch(formDTO.getDataList()); + } + } +}