diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/constant/ScreenConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/constant/ScreenConstant.java index fcbbfd7b35..b03dbe6466 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/constant/ScreenConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/constant/ScreenConstant.java @@ -8,4 +8,8 @@ public interface ScreenConstant { String COMMUNITY = "community"; + String MONTH = "月"; + + String RATIO = "%"; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ContactMassLineChartFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ContactMassLineChartFormDTO.java new file mode 100644 index 0000000000..e82038de21 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ContactMassLineChartFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 2:28 下午 + */ +@Data +public class ContactMassLineChartFormDTO implements Serializable { + + private static final long serialVersionUID = 5627978767044772204L; + + public interface ContactMassLineChart{} + + /** + * 机关ID + */ + @NotBlank(message = "机关ID不能为空",groups = {ContactMassLineChart.class}) + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/FineExampleFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/FineExampleFormDTO.java new file mode 100644 index 0000000000..1840c3048b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/FineExampleFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 1:46 下午 + */ +@Data +public class FineExampleFormDTO implements Serializable { + + private static final long serialVersionUID = -5402747414542735700L; + + public interface FineExample{} + + /** + * 机关ID + */ + @NotBlank(message = "机关ID不能为空",groups = {FineExample.class}) + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/VolunteerServiceFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/VolunteerServiceFormDTO.java new file mode 100644 index 0000000000..510bb5ec41 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/VolunteerServiceFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 3:12 下午 + */ +@Data +public class VolunteerServiceFormDTO implements Serializable { + + private static final long serialVersionUID = 7916606646764729831L; + + public interface VolunteerService{} + + /** + * 机关ID + */ + @NotBlank(message = "机关ID不能为空",groups = {VolunteerService.class}) + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResult.java new file mode 100644 index 0000000000..e77c336fbe --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResult.java @@ -0,0 +1,30 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 2:45 下午 + */ +@Data +public class ContactMassLineChartResult implements Serializable { + + private static final long serialVersionUID = 5668549816473850787L; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 党员建群数 + */ + private Integer groupTotal; + + /** + * 群成员数 + */ + private Integer userTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java new file mode 100644 index 0000000000..e57b0cc54f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/20 2:31 下午 + */ +@Data +public class ContactMassLineChartResultDTO implements Serializable { + + private static final long serialVersionUID = 192666933158635787L; + + /** + * 横坐标集合 + */ + private List xAxis; + + /** + * 党员建群数 + */ + private List groupData; + + /** + * 群成员数 + */ + private List groupMemberData; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/FineExampleResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/FineExampleResultDTO.java new file mode 100644 index 0000000000..a81f45fc05 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/FineExampleResultDTO.java @@ -0,0 +1,81 @@ +package com.epmet.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 1:48 下午 + */ +@Data +public class FineExampleResultDTO implements Serializable { + + private static final long serialVersionUID = -2754696449087950719L; + + /** + * 党员参与议事 + */ + private Integer issueTotal = 0; + + @JsonIgnore + private Double issueRatioA; + + /** + * 党员参与议事占比 + */ + private String issueRatio = "0.00%"; + + /** + * 党员发布话题总数 + */ + private Integer topicTotal = 0; + + @JsonIgnore + private Double topicRatioA; + + /** + * 党员发布话题占比 + */ + private String topicRatio = "0.00%"; + + /** + * 议题转项目 + */ + private Integer shiftProjectTotal = 0; + + @JsonIgnore + private Double shiftProjectRatioA; + + /** + * 议题转项目占比 + */ + private String shiftProjectRatio = "0.00%"; + + /** + * 解决项目 + */ + private Integer resolvedProjectTotal = 0; + + @JsonIgnore + private Double resolvedProjectRatioA; + + /** + * 解决项目占比 + */ + private String resolvedProjectRatio = "0.00%"; + + /** + * 党员发布议题数 + */ + private Integer publishIssueTotal = 0; + + @JsonIgnore + private Double publishIssueRatioA; + + /** + * 党员发布议题数占比 + */ + private String publishIssueRatio = "0.00%"; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResult.java new file mode 100644 index 0000000000..bc2d53edff --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResult.java @@ -0,0 +1,35 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 3:16 下午 + */ +@Data +public class VolunteerServiceResult implements Serializable { + + private static final long serialVersionUID = 959536759114517195L; + + /** + * 月份ID + */ + private String monthId; + + /** + * 组织次数 + */ + private Integer organizeData; + + /** + * 参与次数 + */ + private Integer joinData; + + /** + * 平均参与人次 + */ + private Integer averageJoinUserData; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java new file mode 100644 index 0000000000..18331f9ca7 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/20 3:14 下午 + */ +@Data +public class VolunteerServiceResultDTO implements Serializable { + + private static final long serialVersionUID = -6227889392267793005L; + + /** + * x轴,返回近12个月,不包含当前月 + */ + private List xAxis; + + /** + * 组织次数 + */ + private List organizeData; + + /** + * 参与次数 + */ + private List joinData; + + /** + * 平均参与人次 + */ + private List averageJoinUserData; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java index 34b2fee3c0..1401a7f036 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java @@ -1,5 +1,18 @@ package com.epmet.datareport.controller.screen; +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.screen.PartyMemberLeadService; +import com.epmet.screen.dto.form.ContactMassLineChartFormDTO; +import com.epmet.screen.dto.form.FineExampleFormDTO; +import com.epmet.screen.dto.form.VolunteerServiceFormDTO; +import com.epmet.screen.dto.result.ContactMassLineChartResultDTO; +import com.epmet.screen.dto.result.FineExampleResultDTO; +import com.epmet.screen.dto.result.VolunteerServiceResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -12,4 +25,47 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/screen/partymemberlead") public class PartyMemberLeadController { + + @Autowired + private PartyMemberLeadService partyMemberLeadService; + + /** + * @Description 1、先锋模范 + * @param fineExampleFormDTO + * @author zxc + * @date 2020/8/20 1:56 下午 + */ + @ExternalAppRequestAuth + @PostMapping("fineexample") + public Result fineExample(@RequestBody FineExampleFormDTO fineExampleFormDTO){ + ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class); + return new Result().ok(partyMemberLeadService.fineExample(fineExampleFormDTO)); + } + + /** + * @Description 2、党员联系群众 + * @param contactMassLineChartFormDTO + * @author zxc + * @date 2020/8/20 2:35 下午 + */ + @ExternalAppRequestAuth + @PostMapping("contactmasslinechart") + public Result contactMassLineChart(@RequestBody ContactMassLineChartFormDTO contactMassLineChartFormDTO){ + ValidatorUtils.validateEntity(contactMassLineChartFormDTO, ContactMassLineChartFormDTO.ContactMassLineChart.class); + return new Result().ok(partyMemberLeadService.contactMassLineChart(contactMassLineChartFormDTO)); + } + + /** + * @Description 3、党员志愿服务 + * @param volunteerServiceFormDTO + * @author zxc + * @date 2020/8/20 3:19 下午 + */ + @ExternalAppRequestAuth + @PostMapping("volunteerservice") + public Result volunteerService(@RequestBody VolunteerServiceFormDTO volunteerServiceFormDTO){ + ValidatorUtils.validateEntity(volunteerServiceFormDTO, VolunteerServiceFormDTO.VolunteerService.class); + return new Result().ok(partyMemberLeadService.volunteerService(volunteerServiceFormDTO)); + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java index 5b6bbbed94..b5ab2e28e8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java @@ -19,6 +19,7 @@ package com.epmet.datareport.dao.screen; import com.epmet.screen.dto.result.BranchBuildOrderByCountResultDTO; import com.epmet.screen.dto.result.BranchIssueDataResultDTO; +import com.epmet.screen.dto.result.VolunteerServiceResult; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -53,4 +54,12 @@ public interface ScreenPartyBranchDataDao { List selectBranchDataByTypeAndTimeZone(@Param("agencyId") String agencyId , @Param("type") String type, @Param("category") String category, @Param("bottomMonthId") String bottomMonthId); List selectBranchDataByTypeOrder(String agencyId,String category,String monthId,String bottomMonthId); + + /** + * @Description 查询党员志愿服务 + * @param agencyId + * @author zxc + * @date 2020/8/20 3:30 下午 + */ + List selectVolunteerServiceResult(@Param("agencyId")String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java index 637f4bf604..dfa5c1f6d2 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java @@ -17,7 +17,11 @@ package com.epmet.datareport.dao.screen; +import com.epmet.screen.dto.result.ContactMassLineChartResult; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 党建引领-党员联系群众数据 @@ -27,5 +31,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ScreenPartyLinkMassesDataDao { + + /** + * @Description 查询党员联系群众 + * @param agencyId + * @author zxc + * @date 2020/8/20 2:48 下午 + */ + List selectContactMassLineChart(@Param("agencyId")String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.java index e2c01f7f9f..4b477689c3 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.java @@ -17,7 +17,9 @@ package com.epmet.datareport.dao.screen; +import com.epmet.screen.dto.result.FineExampleResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 党建引领-先锋模范数据 @@ -27,5 +29,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ScreenPioneerDataDao{ - + + /** + * @Description 查询先锋模范 + * @param agencyId + * @author zxc + * @date 2020/8/20 5:22 下午 + */ + FineExampleResultDTO selectFineExample(@Param("agencyId")String agencyId); + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java index 61276a3c74..85c25ec9eb 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java @@ -1,5 +1,12 @@ package com.epmet.datareport.service.screen; +import com.epmet.screen.dto.form.ContactMassLineChartFormDTO; +import com.epmet.screen.dto.form.FineExampleFormDTO; +import com.epmet.screen.dto.form.VolunteerServiceFormDTO; +import com.epmet.screen.dto.result.ContactMassLineChartResultDTO; +import com.epmet.screen.dto.result.FineExampleResultDTO; +import com.epmet.screen.dto.result.VolunteerServiceResultDTO; + /** * 党建引领相关各指标查询 * @@ -7,4 +14,29 @@ package com.epmet.datareport.service.screen; * @date 2020/8/18 10:22 */ public interface PartyMemberLeadService { + + /** + * @Description 1、先锋模范 + * @param fineExampleFormDTO + * @author zxc + * @date 2020/8/20 1:56 下午 + */ + FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO); + + /** + * @Description 2、党员联系群众 + * @param contactMassLineChartFormDTO + * @author zxc + * @date 2020/8/20 2:35 下午 + */ + ContactMassLineChartResultDTO contactMassLineChart(ContactMassLineChartFormDTO contactMassLineChartFormDTO); + + /** + * @Description 3、党员志愿服务 + * @param volunteerServiceFormDTO + * @author zxc + * @date 2020/8/20 3:19 下午 + */ + VolunteerServiceResultDTO volunteerService(VolunteerServiceFormDTO volunteerServiceFormDTO); + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java index 7ad1c645b4..b739d2551b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java @@ -34,7 +34,7 @@ public class IndexServiceImpl implements IndexService { @Autowired private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; @Autowired - private GrassrootsPartyDevServiceImpl grassrootsPartyDevServiceImpl; + private PartyMemberLeadServiceImpl partyMemberLeadServiceImpl; /** * @Description 1、年度平均指数 @@ -81,8 +81,7 @@ public class IndexServiceImpl implements IndexService { List governAbilityData = new ArrayList<>(); List totalIndexData = new ArrayList<>(); // 1. x轴 - Map x = grassrootsPartyDevServiceImpl.getX(); - result.setXAxis(x.values().stream().collect(Collectors.toList())); + result.setXAxis(partyMemberLeadServiceImpl.getXPro()); // 2. 查询近一年的指数值【不包括本月】 List monthBarchartResults = screenIndexDataMonthlyDao.selectMonthBarchart(customerId, monthBarchartFormDTO.getAgencyId()); if (monthBarchartResults.size() == NumConstant.ZERO){ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java index 33903007a5..f5d2704990 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java @@ -1,8 +1,26 @@ package com.epmet.datareport.service.screen.impl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.datareport.dao.screen.ScreenPartyBranchDataDao; +import com.epmet.datareport.dao.screen.ScreenPartyLinkMassesDataDao; +import com.epmet.datareport.dao.screen.ScreenPioneerDataDao; import com.epmet.datareport.service.screen.PartyMemberLeadService; +import com.epmet.screen.dto.form.ContactMassLineChartFormDTO; +import com.epmet.screen.dto.form.FineExampleFormDTO; +import com.epmet.screen.dto.form.VolunteerServiceFormDTO; +import com.epmet.screen.dto.result.*; +import com.epmet.screen.constant.*; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + /** * 党建引领相关各指标查询 * @@ -11,4 +29,125 @@ import org.springframework.stereotype.Service; */ @Service public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { + + @Autowired + private ScreenPartyLinkMassesDataDao screenPartyLinkMassesDataDao; + @Autowired + private ScreenPartyBranchDataDao screenPartyBranchDataDao; + @Autowired + private ScreenPioneerDataDao screenPioneerDataDao; + + /** + * @Description 1、先锋模范 + * @param fineExampleFormDTO + * @author zxc + * @date 2020/8/20 1:56 下午 + */ + @Override + public FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO) { + FineExampleResultDTO fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); + if (null == fineExampleResultDTO){ + return new FineExampleResultDTO(); + } + fineExampleResultDTO.setIssueRatio(this.getRatio(fineExampleResultDTO.getIssueRatioA())); + fineExampleResultDTO.setPublishIssueRatio(this.getRatio(fineExampleResultDTO.getPublishIssueRatioA())); + fineExampleResultDTO.setResolvedProjectRatio(this.getRatio(fineExampleResultDTO.getResolvedProjectRatioA())); + fineExampleResultDTO.setTopicRatio(this.getRatio(fineExampleResultDTO.getTopicRatioA())); + fineExampleResultDTO.setShiftProjectRatio(this.getRatio(fineExampleResultDTO.getShiftProjectRatioA())); + return fineExampleResultDTO; + } + + /** + * @Description 小数转换百分比 + * @param d + * @author zxc + * @date 2020/8/20 6:06 下午 + */ + public String getRatio(Double d){ + BigDecimal bigDecimal = new BigDecimal(d * NumConstant.ONE_HUNDRED); + return bigDecimal.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).toPlainString().concat(ScreenConstant.RATIO); + } + + /** + * @Description 2、党员联系群众 + * @param contactMassLineChartFormDTO + * @author zxc + * @date 2020/8/20 2:35 下午 + */ + @Override + public ContactMassLineChartResultDTO contactMassLineChart(ContactMassLineChartFormDTO contactMassLineChartFormDTO) { + ContactMassLineChartResultDTO result = new ContactMassLineChartResultDTO(); + List contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId()); + if (contactMassLineChartResults.size() == NumConstant.ZERO){ + result.setXAxis(new ArrayList<>()); + result.setGroupMemberData(new ArrayList<>()); + result.setGroupData(new ArrayList<>()); + return result; + } + List xAxis = new ArrayList<>(); + List groupData = new ArrayList<>(); + List groupMemberData = new ArrayList<>(); + contactMassLineChartResults.forEach(contact -> { + xAxis.add(contact.getOrgName()); + groupData.add(contact.getGroupTotal()); + groupMemberData.add(contact.getUserTotal()); + }); + result.setXAxis(xAxis); + result.setGroupData(groupData); + result.setGroupMemberData(groupMemberData); + return result; + } + + /** + * @Description 3、党员志愿服务 + * @param volunteerServiceFormDTO + * @author zxc + * @date 2020/8/20 3:19 下午 + */ + @Override + public VolunteerServiceResultDTO volunteerService(VolunteerServiceFormDTO volunteerServiceFormDTO) { + VolunteerServiceResultDTO result = new VolunteerServiceResultDTO(); + List organizeData = new ArrayList<>(); + List joinData = new ArrayList<>(); + List averageJoinUserData = new ArrayList<>(); + result.setXAxis(this.getXPro()); + List volunteerServiceResults = screenPartyBranchDataDao.selectVolunteerServiceResult(volunteerServiceFormDTO.getAgencyId()); + if (volunteerServiceResults.size() == NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { + organizeData.add(NumConstant.ZERO); + joinData.add(NumConstant.ZERO); + averageJoinUserData.add(NumConstant.ZERO); + } + result.setOrganizeData(organizeData); + result.setJoinData(joinData); + result.setAverageJoinUserData(averageJoinUserData); + return result; + } + List collect = volunteerServiceResults.stream().sorted(Comparator.comparing(VolunteerServiceResult::getMonthId)).collect(Collectors.toList()); + collect.forEach(volunteer -> { + organizeData.add(volunteer.getOrganizeData()); + joinData.add(volunteer.getJoinData()); + averageJoinUserData.add(volunteer.getAverageJoinUserData()); + }); + result.setOrganizeData(organizeData); + result.setJoinData(joinData); + result.setAverageJoinUserData(averageJoinUserData); + return result; + } + + /** + * @Description 获取之前的12个月份【不包括当前月】 + * @author zxc + * @date 2020/8/21 10:19 上午 + */ + public List getXPro(){ + List xAxis = new ArrayList<>(); + LocalDate today = LocalDate.now(); + for(int i = NumConstant.TWELVE;i >= NumConstant.ONE; i--){ + LocalDate localDate = today.minusMonths(i); + String s = localDate.getMonth().getValue() + ScreenConstant.MONTH; + xAxis.add(s); + } + return xAxis; + } } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml index 1268f91a2b..e5c4e38f70 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml @@ -67,4 +67,20 @@ joinData DESC + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml index b690a6381d..5643b1e31b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml @@ -3,6 +3,16 @@ - - + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml index b59d02f321..58247ff1e3 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml @@ -3,5 +3,23 @@ - + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java index e289e15a02..ef4efd6a24 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java @@ -55,15 +55,10 @@ public class GridGovrnAbilityFormDTO implements Serializable { */ private Integer projectTotal; - /** - * 网格自治项目数 - */ - private Integer selfSolveProjectRatio; - /** * 网格办结项目数 */ - private Integer resolveProjectTotal; + private Integer resolveProjectCount; /** * 网格吹哨部门准确率 @@ -79,4 +74,9 @@ public class GridGovrnAbilityFormDTO implements Serializable { * 网格议题转项目率 */ private BigDecimal avgShiftProjectRatio; + + /** + * 网格自治项目数 统计期网格自身内办结的项目数目 + */ + private Integer selfSolveProjectCount; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java index 20c6e0c0a6..7993cb2355 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java @@ -86,4 +86,13 @@ public class GridPartyMemberDataFormDTO implements Serializable { */ private Integer issueToProjectCount; + /** + * 用户id + */ + private String userId; + + /** + * 上级组织Id + */ + private String parentId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java index 9b95c02bda..6ef48c6fa4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java @@ -43,7 +43,7 @@ public class OrgServiceAbilityFormDTO implements Serializable { /** * allRegion:全区;community:社区;street:街道 */ - private Integer dataType; + private String dataType; /** * 社区/街道活动组织次数 爱心活动 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java index cdad61be67..0efe2ff448 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.screencoll.form; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; /** * 10、党建引领-先锋模范数据 @@ -35,9 +36,9 @@ public class PioneerDataFormDTO implements Serializable { private String orgName; /** - * 用户总数 + * 党员发布议题 */ - private Integer userTotal; + private Integer publishIssueTotal; /** * 议事数 @@ -58,4 +59,30 @@ public class PioneerDataFormDTO implements Serializable { * 解决项目总数 */ private Integer resolvedProjectTotal; + + + /** + * 议事占比 + */ + private BigDecimal issueRatio; + + /** + * 话题占比 + */ + private BigDecimal topicRatio; + + /** + * 议题转项目占比 + */ + private BigDecimal shiftProjectRatio; + + /** + * 解决项目占比 + */ + private BigDecimal resolvedProjectRatio; + + /** + * 党员发布议题占比 + */ + private BigDecimal publishIssueRatio; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java index 00428efa4d..7c12fec411 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java @@ -1,10 +1,18 @@ package com.epmet.controller; +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.indexcollect.form.*; import com.epmet.service.indexcollect.FactIndexCollectService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * 指标采集相关api * @@ -17,4 +25,132 @@ public class FactIndexCollectController { @Autowired private FactIndexCollectService factIndexCollectService; + + /** + * 1、党建能力-党员相关指标上报(按照月份) + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("gridpartymemberdata") + public Result gridPartyMemberData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridPartyMemberData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 2、党建能力-网格相关指标上报(按照月份) + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("gridpartyability") + public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 3、党建能力-街道及社区相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("orgpartyability") + public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 4、服务能力-网格相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("gridserviceability") + public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 5、服务能力-组织(街道|社区|全区)相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("orgserviceability") + public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 6、治理能力-网格相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("gridgovrnability") + public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 7、治理能力-街道及社区相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("orggovrnability") + public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 8、治理能力-部门相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("deptgovrnability") + public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java index 2e9922e8c4..f56638a3f6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java @@ -17,16 +17,50 @@ package com.epmet.dao.indexcoll; /** import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.DeptGovrnAbilityFormDTO; import com.epmet.entity.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; 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-08-20 */ @Mapper public interface FactIndexGovrnAblityDeptMonthlyDao extends BaseDao { - -} \ No newline at end of file + /** + * 8、治理能力-部门相关指标 + * 据CUSTOMER_ID、AGENCY_ID、DEPT_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param deptId + * @param yearId + * @param monthId + * @param quarterId + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexGovrnAblityDeptMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("deptId") String deptId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 8、治理能力-部门相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexGovrnAblityDeptMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index 1bd3057274..e591ba928d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -18,16 +18,50 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.GridGovrnAbilityFormDTO; import com.epmet.entity.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; 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-08-20 */ @Mapper public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao { - -} \ No newline at end of file + + /** + * 6、治理能力-网格相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param gridId + * @param yearId + * @param monthId + * @param quarterId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexGovrnAblityGridMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 6、治理能力-网格相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexGovrnAblityGridMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java index dcce6fe74d..9013d4f9cf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -18,16 +18,47 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.OrgGovrnAbilityFormDTO; import com.epmet.entity.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; 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-08-20 */ @Mapper public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao { - -} \ No newline at end of file + /** + * 7、治理能力-街道及社区相关指标 + * 据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param quarterId + * @param agencyIds + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexGovrnAblityOrgMonthly(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId, + @Param("agencyIds") String[] agencyIds); + + /** + * 7、治理能力-街道及社区相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexGovrnAblityOrgMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java index 3f8ef7ab22..387a369af1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java @@ -18,16 +18,53 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.GridPartyMemberDataFormDTO; import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; 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-08-20 */ @Mapper public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao { - -} \ No newline at end of file + + /** + * 1、党建能力-党员相关指标上报(按照月份) + * 1) 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、USER_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param gridId + * @param userId + * @param yearId + * @param monthId + * @param quarterId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexPartyAblityCpcMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("userId") String userId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 1、党建能力-党员相关指标上报(按照月份) + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexPartyAblityCpcMonthly(@Param("list") List list, + @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java index dcebc723ce..b5cb8d2c5e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java @@ -18,16 +18,50 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO; import com.epmet.entity.indexcoll.FactIndexPartyAblityGridMonthlyEntity; 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-08-20 */ @Mapper public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao { - -} \ No newline at end of file + + /** + * 2、党建能力-网格相关指标上报(按照月份) + * 1) 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param gridId + * @param yearId + * @param monthId + * @param quarterId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexPartyAblityGridMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 2、党建能力-网格相关指标上报(按照月份) + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexPartyAblityGridMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java index 0817e24f06..73a73a1c50 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java @@ -18,16 +18,48 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.OrgPartyAbilityFormDTO; import com.epmet.entity.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; 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-08-20 */ @Mapper public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao { - -} \ No newline at end of file + + /** + * 3、党建能力-街道及社区相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param quarterId + * @param agencyIds + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexPartyAblityOrgMonthly(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId, + @Param("agencyIds") String[] agencyIds); + + /** + * 3、党建能力-街道及社区相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexPartyAblityOrgMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java index 8beb4263fc..9eb7051762 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java @@ -18,8 +18,12 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.GridServiceAbilityFormDTO; import com.epmet.entity.indexcoll.FactIndexServiceAblityGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 服务能力-网格相关事实表 @@ -29,5 +33,34 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao { - -} \ No newline at end of file + /** + * 4、服务能力-网格相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param gridId + * @param yearId + * @param monthId + * @param quarterId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexServiceAblityGridMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 4、服务能力-网格相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexServiceAblityGridMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java index 3cf7fc6cf7..31c268cd75 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java @@ -18,16 +18,48 @@ package com.epmet.dao.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.OrgServiceAbilityFormDTO; import com.epmet.entity.indexcoll.FactIndexServiceAblityOrgMonthlyEntity; 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-08-20 */ @Mapper public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao { - -} \ No newline at end of file + + /** + * 5、服务能力-组织(街道|社区|全区)相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param quarterId + * @param agencyIds + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexServiceAblityOrgMonthly(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId, + @Param("agencyIds") String[] agencyIds); + + /** + * 5、服务能力-组织(街道|社区|全区)相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexServiceAblityOrgMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java index bf38ebbbda..94eec97d6f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java @@ -27,7 +27,7 @@ import java.math.BigDecimal; import java.util.Date; /** - * 治理能力-街道及社区相关数据 + * 治理能力-街道及社区相关数据 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-20 @@ -72,7 +72,7 @@ public class FactIndexGovrnAblityOrgMonthlyEntity extends BaseEpmetEntity { /** * 数据类型 allRegion:全区;street:街道;community:社区;grid:网格 */ - private Integer dataType; + private String dataType; /** * 被吹哨次数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java index 14ea565482..1bf023f055 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java @@ -26,7 +26,7 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 党建能力-街道及社区相关事实表 + * 党建能力-街道及社区相关事实表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-20 @@ -76,6 +76,6 @@ public class FactIndexPartyAblityOrgMonthlyEntity extends BaseEpmetEntity { /** * 数据类型 allRegion:全区;community:社区;street:街道 */ - private Integer dataType; + private String dataType; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java index 9e590690fa..8abeb1c172 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java @@ -26,7 +26,7 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 服务能力-组织(街道|社区|全区)相关事实表 + * 服务能力-组织(街道|社区|全区)相关事实表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-20 @@ -76,6 +76,6 @@ public class FactIndexServiceAblityOrgMonthlyEntity extends BaseEpmetEntity { /** * 数据类型 allRegion:全区;street:街道;community:社区;grid:网格 */ - private Integer dataType; + private String dataType; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPioneerDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPioneerDataEntity.java index b53561b229..6c5d634ba6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPioneerDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPioneerDataEntity.java @@ -23,7 +23,6 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.math.BigDecimal; import java.util.Date; /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/FactIndexCollectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/FactIndexCollectService.java index fb0cdd71f5..c9d876996b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/FactIndexCollectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/FactIndexCollectService.java @@ -1,5 +1,9 @@ package com.epmet.service.indexcollect; +import com.epmet.dto.indexcollect.form.*; + +import java.util.List; + /** * 大屏数据采集api * @@ -8,5 +12,99 @@ package com.epmet.service.indexcollect; */ public interface FactIndexCollectService { + /** + * 1、党建能力-党员相关指标上报(按照月份) + * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、USER_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertGridPartyMemberData(List formDTO, String customerId); + + /** + * 2、党建能力-网格相关指标上报(按照月份) + * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertGridPartyAbility(List formDTO, String customerId); + + /** + * 3、党建能力-街道及社区相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertOrgPartyAbility(List formDTO, String customerId); + + /** + * 4、服务能力-网格相关指标 + * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertGridServiceAbility(List formDTO, String customerId); + + /** + * 5、服务能力-组织(街道|社区|全区)相关指标 + * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertOrgServiceAbility(List formDTO, String customerId); + + /** + * 6、治理能力-网格相关指标 + * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertGridGovrnAbility(List formDTO, String customerId); + + /** + * 7、治理能力-街道及社区相关指标 + * 据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertOrgGovrnAbility(List formDTO, String customerId); + /** + * 8、治理能力-部门相关指标 + * 据CUSTOMER_ID、AGENCY_ID、DEPT_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertDeptGovrnAbility(List formDTO, String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/impl/FactIndexCollectServiceImpl.java index b030657f68..ced6e555e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/impl/FactIndexCollectServiceImpl.java @@ -1,10 +1,152 @@ package com.epmet.service.indexcollect.impl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dao.indexcoll.*; +import com.epmet.dto.indexcollect.form.*; import com.epmet.service.indexcollect.FactIndexCollectService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; /** * @Auther: zhangyong * @Date: 2020-08-20 10:05 */ +@Service public class FactIndexCollectServiceImpl implements FactIndexCollectService { + + @Autowired + private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; + @Autowired + private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; + @Autowired + private FactIndexPartyAblityOrgMonthlyDao factIndexPartyAblityOrgMonthlyDao; + @Autowired + private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; + @Autowired + private FactIndexServiceAblityOrgMonthlyDao factIndexServiceAblityOrgMonthlyDao; + @Autowired + private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; + @Autowired + private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; + @Autowired + private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; + + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGridPartyMemberData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getUserId(), + formDTO.get(i).getYearId(), formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO, customerId); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGridPartyAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexPartyAblityGridMonthlyDao.deleteFactIndexPartyAblityGridMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), + formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexPartyAblityGridMonthlyDao.batchInsertFactIndexPartyAblityGridMonthly(formDTO, customerId); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void insertOrgPartyAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] agencyIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + agencyIds[i] = formDTO.get(i).getAgencyId(); + } + factIndexPartyAblityOrgMonthlyDao.deleteFactIndexPartyAblityOrgMonthly(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + formDTO.get(NumConstant.ZERO).getQuarterId(), + agencyIds); + factIndexPartyAblityOrgMonthlyDao.batchInsertFactIndexPartyAblityOrgMonthly(formDTO, customerId); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGridServiceAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexServiceAblityGridMonthlyDao.deleteFactIndexServiceAblityGridMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), + formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexServiceAblityGridMonthlyDao.batchInsertFactIndexServiceAblityGridMonthly(formDTO, customerId); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void insertOrgServiceAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] agencyIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + agencyIds[i] = formDTO.get(i).getAgencyId(); + } + factIndexServiceAblityOrgMonthlyDao.deleteFactIndexServiceAblityOrgMonthly(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + formDTO.get(NumConstant.ZERO).getQuarterId(), + agencyIds); + factIndexServiceAblityOrgMonthlyDao.batchInsertFactIndexServiceAblityOrgMonthly(formDTO, customerId); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGridGovrnAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexGovrnAblityGridMonthlyDao.deleteFactIndexGovrnAblityGridMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), + formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexGovrnAblityGridMonthlyDao.batchInsertFactIndexGovrnAblityGridMonthly(formDTO, customerId); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void insertOrgGovrnAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] agencyIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + agencyIds[i] = formDTO.get(i).getAgencyId(); + } + factIndexGovrnAblityOrgMonthlyDao.deleteFactIndexGovrnAblityOrgMonthly(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + formDTO.get(NumConstant.ZERO).getQuarterId(), + agencyIds); + factIndexGovrnAblityOrgMonthlyDao.batchInsertFactIndexGovrnAblityOrgMonthly(formDTO, customerId); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void insertDeptGovrnAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexGovrnAblityDeptMonthlyDao.deleteFactIndexGovrnAblityDeptMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getDeptId(), formDTO.get(i).getYearId(), + formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexGovrnAblityDeptMonthlyDao.batchInsertFactIndexGovrnAblityDeptMonthly(formDTO, customerId); + } + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.3__update_col_data_type.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.3__update_col_data_type.sql new file mode 100644 index 0000000000..05b34b4833 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.3__update_col_data_type.sql @@ -0,0 +1,3 @@ +alter table fact_index_party_ablity_org_monthly MODIFY column DATA_TYPE VARCHAR(100) DEFAULT '' COMMENT '数据类型 allRegion:全区;community:社区;street:街道'; +alter table fact_index_service_ablity_org_monthly MODIFY column DATA_TYPE VARCHAR(100) DEFAULT '' COMMENT '数据类型 allRegion:全区;community:社区;street:街道'; +alter table fact_index_govrn_ablity_org_monthly MODIFY column DATA_TYPE VARCHAR(100) DEFAULT '' COMMENT '数据类型 allRegion:全区;community:社区;street:街道'; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml index f6261e5e6b..107b94abc1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -25,5 +25,58 @@ + + delete from fact_index_govrn_ablity_dept_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND DEPT_ID = #{deptId} + AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + - \ No newline at end of file + + insert into fact_index_govrn_ablity_dept_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + DEPT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + TRANSFERED_COUNT, + CLOSED_PROJECT_COUNT, + RESP_PROJECT_RATIO, + HANDLE_PROJECT_RATIO, + CLOSED_PROJECT_RATIO, + SATISFACTION_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.deptId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.transferedCount}, + #{item.closedProjectCount}, + #{item.respProjectRatio}, + #{item.handleProjectRatio}, + #{item.closedProjectRatio}, + #{item.satisfactionRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index 2b88158a9a..ed0f65cc79 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -27,5 +27,62 @@ + + delete from fact_index_govrn_ablity_grid_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} + AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + - \ No newline at end of file + + insert into fact_index_govrn_ablity_grid_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ISSUE_TOTAL, + AVG_ISSUE_COUNT, + AVG_SHIFT_PROJECT_RATIO, + PROJECT_TOTAL, + SELF_SOLVE_PROJECT_COUNT, + RESOLVE_PROJECT_COUNT, + TRANSFER_RIGHT_RATIO, + SATISFACTION_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.issueTotal}, + #{item.avgIssueCount}, + #{item.avgShiftProjectRatio}, + #{item.projectTotal}, + #{item.selfSolveProjectCount}, + #{item.resolveProjectCount}, + #{item.transferRightRatio}, + #{item.satisfactionRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index 1c5d52a23b..36e4d07b3a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -26,5 +26,63 @@ + + delete from fact_index_govrn_ablity_org_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + AND AGENCY_ID IN + + #{item} + + - \ No newline at end of file + + insert into fact_index_govrn_ablity_org_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + DATA_TYPE, + TRANSFERED_COUNT, + CLOSED_PROJECT_COUNT, + RESP_PROJECT_RATIO, + CLOSED_PROJECT_RATIO, + SATISFACTION_RATIO, + OVERDUE_PROJECT_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.dataType}, + #{item.transferedCount}, + #{item.closedProjectCount}, + #{item.respProjectRatio}, + #{item.closedProjectRatio}, + #{item.satisfactionRatio}, + #{item.overdueProjectRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index b1a6e0d616..836adcdb03 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -1,7 +1,7 @@ - + @@ -30,5 +30,68 @@ + + delete from fact_index_party_ablity_cpc_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} AND USER_ID = #{userId} + AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + - \ No newline at end of file + + insert into fact_index_party_ablity_cpc_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + GRID_ID, + USER_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + CREATE_TOPIC_COUNT, + JOIN__TOPIC_COUNT, + SHIFT_ISSUE_COUNT, + SHIFT_PROJECT_COUNT, + JOIN_THREE_MEETS_COUNT, + GROUP_USER_COUNT, + GROUP_TOPIC_COUNT, + TOPIC_TO_ISSUE_RATIO, + ISSUE_TO_PROJECT_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.gridId}, + #{item.userId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.createTopicCount}, + #{item.joinTopicCount}, + #{item.shiftIssueCount}, + #{item.shiftProjectCount}, + #{item.joinThreeMeetsCount}, + #{item.groupUserCount}, + #{item.groupTopicCount}, + #{item.topicToIssueRatio}, + #{item.issueToProjectCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml index 7f58b377f2..e51a7d4f7f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -1,7 +1,7 @@ - + @@ -32,5 +32,71 @@ + + delete from fact_index_party_ablity_grid_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + - \ No newline at end of file + + insert into fact_index_party_ablity_grid_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + USER_COUNT, + PARTY_COUNT, + ACTIVE_USER_COUNT, + ACTIVE_PARTY_COUNT, + PARTY_AVG_TOPIC_COUNT, + USER_AVG_TOPIC_COUNT, + PARTY_AVG_SHIFT_PROJECT_COUNT, + USER_AVG_SHIFT_PROJECT_COUNT, + CREATE_GROUP_PARTY_COUNT, + PUBLISH_ARTICLE_COUNT, + ISSUE_TO_PROJECT_RATIO, + CREATE_THREE_MEETS_COUNT, + JOIN_THREE_MEETS_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.userCount}, + #{item.partyCount}, + #{item.activeUserCount}, + #{item.activePartyCount}, + #{item.partyAvgTopicCount}, + #{item.userAvgTopicCount}, + #{item.partyAvgShiftProjectCount}, + #{item.userAvgShiftProjectCount}, + #{item.createGroupPartyCount}, + #{item.publishArticleCount}, + #{item.issueToProjectRatio}, + #{item.createThreeMeetsCount}, + #{item.joinThreeMeetsCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml index 1b3299d367..758a686052 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -1,7 +1,7 @@ - + @@ -21,5 +21,54 @@ + + delete from fact_index_party_ablity_org_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + AND AGENCY_ID IN + + #{item} + + - \ No newline at end of file + + insert into fact_index_party_ablity_org_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + PUBLISH_ARTICLE_COUNT, + DATA_TYPE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.publishArticleCount}, + #{item.dataType}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml index 8b7c42b41d..bc4348ea56 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml @@ -1,7 +1,7 @@ - + @@ -22,5 +22,51 @@ + + delete from fact_index_service_ablity_grid_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + - \ No newline at end of file + + insert into fact_index_service_ablity_grid_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ACTIVITY_COUNT, + VOLUNTEER_RATIO, + PARTY_VOLUNTEER_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.activityCount}, + #{item.volunteerRatio}, + #{item.partyVolunteerRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml index 24556d1dd4..c475e2aca1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml @@ -1,7 +1,7 @@ - + @@ -21,5 +21,53 @@ + + delete from fact_index_service_ablity_org_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + AND AGENCY_ID IN + + #{item} + + - \ No newline at end of file + + insert into fact_index_service_ablity_org_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ACTIVITY_COUNT, + DATA_TYPE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.activityCount}, + #{item.dataType}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml index 73e703ae25..c140b7d3f3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml @@ -21,11 +21,16 @@ ORG_ID, PARENT_ID, ORG_NAME, - USER_TOTAL, + PUBLISH_ISSUE_TOTAL, ISSUE_TOTAL, TOPIC_TOTAL, SHIFT_PROJECT_TOTAL, RESOLVED_PROJECT_TOTAL, + PUBLISH_ISSUE_RATIO, + ISSUE_RATIO, + TOPIC_RATIO, + SHIFT_PROJECT_RATIO, + RESOLVED_PROJECT_TOTAL_RATIO, DEL_FLAG, REVISION, CREATED_BY, @@ -41,11 +46,17 @@ #{item.orgId}, #{item.parentId}, #{item.orgName}, - #{item.userTotal}, + #{item.publishIssueTotal}, #{item.issueTotal}, #{item.topicTotal}, #{item.shiftProjectTotal}, #{item.resolvedProjectTotal}, + + #{item.issueRatio}, + #{item.topicRatio}, + #{item.shiftProjectRatio}, + #{item.resolvedProjectRatio}, + #{item.publishIssueRatio}, 0, 0, 'APP_USER',