diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractOriginFormDTO.java similarity index 87% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractOriginFormDTO.java index 0b392c0053..2eb18b8a35 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractOriginFormDTO.java @@ -7,11 +7,13 @@ import javax.validation.constraints.NotBlank; import java.io.Serializable; /** + * desc: 从业务数据抽取到统计库 dto + * * @Author zxc * @DateTime 2020/9/16 6:01 下午 */ @Data -public class ExtractFormDTO implements Serializable { +public class ExtractOriginFormDTO implements Serializable { private static final long serialVersionUID = -6180252151765854242L; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractScreenFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractScreenFormDTO.java new file mode 100644 index 0000000000..4bcd4fce65 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractScreenFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc: 抽取大屏数据dto + * + * @author LiuJanJun + * @date 2020/9/25 2:32 下午 + */ +@Data +public class ExtractScreenFormDTO implements Serializable { + + private static final long serialVersionUID = 7659170440875719461L; + private String customerId; + private String monthId; + private String dateId; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenExtractFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenExtractFormDTO.java new file mode 100644 index 0000000000..9766aabc42 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenExtractFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/25 4:17 下午 + */ +@Data +public class ScreenExtractFormDTO implements Serializable { + + private static final long serialVersionUID = -6092830982601961936L; + + private String customerId; + + private String monthId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ActInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ActInfoResultDTO.java new file mode 100644 index 0000000000..0fdff371a6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ActInfoResultDTO.java @@ -0,0 +1,90 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/25 3:38 下午 + */ +@Data +public class ActInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 2322961372193392320L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID【gridId或agencyId】 + */ + private String orgId; + + /** + * 组织类型【agency,grid】 + */ + private String orgType; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 年度ID + */ + private String yearId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 父级ID + */ + private String parentId; + + /** + * 组织次数 + */ + private Integer organizeCount; + + /** + * 会议分类Id + */ + private String meetCategoryId; + + /** + * 会议分类名称(三会党课、主题党日.....等等) + */ + private String meetCategoryName; + + /** + * 平均参加人数 + */ + private Integer averageJoinUserCount; + + /** + * 删除状态 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/JoinUserCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/JoinUserCountResultDTO.java new file mode 100644 index 0000000000..fcaa28d970 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/JoinUserCountResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/25 5:14 下午 + */ +@Data +public class JoinUserCountResultDTO implements Serializable { + + private static final long serialVersionUID = 3961393565082322770L; + + private String orgId; + + /** + * 参与人数 + */ + private Integer joinUserCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CpcScoreResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CpcScoreResultDTO.java new file mode 100644 index 0000000000..31b115caab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CpcScoreResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 党员指标得分查询DTO + * @ClassName CpcScoreResultDTO + * @Auth wangc + * @Date 2020-09-25 16:52 + */ +@Data +public class CpcScoreResultDTO implements Serializable { + private static final long serialVersionUID = -7129757727997430029L; + + /** + * 用户Id + * */ + private String userId; + + /** + * 党员指标得分 + * */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java index 06bc4d9cca..993c4ef354 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java @@ -38,4 +38,14 @@ public class GridInfoDTO implements Serializable { * agencyId的pids */ private String pids; + + /** + * 网格名称 + * */ + private String gridName; + + /** + * 机关名称 + * */ + private String orgName; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/point/UserPointDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/point/UserPointDTO.java new file mode 100644 index 0000000000..067ebbf254 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/point/UserPointDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.point; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 用户积分DTO + * @ClassName UserPointDTO + * @Auth wangc + * @Date 2020-09-25 15:42 + */ +@Data +public class UserPointDTO implements Serializable { + private static final long serialVersionUID = 6976982699085437418L; + + /** + * 用户Id + * */ + private String userId; + + /** + * 用户累计积分 + * */ + private Integer pointTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java index 9abd6012d6..b160224471 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.screencoll.form; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; /** * 11、基层治理-公众参与 入参 @@ -47,7 +48,7 @@ public class UserJoinFormDTO implements Serializable { /** * 人均议题 */ - private Integer avgIssue; + private BigDecimal avgIssue; /** * 总的参与次数 @@ -57,5 +58,5 @@ public class UserJoinFormDTO implements Serializable { /** * 平均参与度 */ - private Integer avgJoin; + private BigDecimal avgJoin; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 520b6bee09..166ffc241d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -3,8 +3,8 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; -import com.epmet.dto.extract.form.ExtractFormDTO; import com.epmet.dto.extract.form.ExtractIndexFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.issue.form.IssueJobFromDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; @@ -202,7 +202,7 @@ public interface DataStatisticalOpenFeignClient { * @author: jianjun liu */ @PostMapping(value = "/data/stats/factorigin/extractall") - Result factOriginExtractAll(@RequestBody(required = false) ExtractFormDTO formDTO); + Result factOriginExtractAll(@RequestBody(required = false) ExtractOriginFormDTO formDTO); /** * ˚ @@ -222,11 +222,11 @@ public interface DataStatisticalOpenFeignClient { Result initAllEIDims(); /** - * @Description 抽取数据到大屏【天】 - * @param extractFormDTO + * @param extractOriginFormDTO + * @Description 抽取数据到大屏【天】 * @author zxc * @date 2020/9/24 10:15 上午 */ @PostMapping(value = "/data/stats/screenextract/extractdailyall") - Result extractDailyAll(@RequestBody(required = false) ExtractFormDTO extractFormDTO); + Result extractDailyAll(@RequestBody(required = false) ExtractOriginFormDTO extractOriginFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index d56296bf42..5b3dd039b5 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -4,8 +4,8 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; -import com.epmet.dto.extract.form.ExtractFormDTO; import com.epmet.dto.extract.form.ExtractIndexFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.issue.form.IssueJobFromDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; @@ -192,7 +192,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp * @author: jianjun liu */ @Override - public Result factOriginExtractAll(ExtractFormDTO formDTO) { + public Result factOriginExtractAll(ExtractOriginFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "factOriginExtractAll", formDTO); } @@ -214,7 +214,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp } @Override - public Result extractDailyAll(ExtractFormDTO extractFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractDailyAll",extractFormDTO); + public Result extractDailyAll(ExtractOriginFormDTO extractOriginFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractDailyAll", extractOriginFormDTO); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 010b6ed47c..8b0dc2156a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -16,7 +16,8 @@ import com.epmet.dao.stats.DimCustomerDao; import com.epmet.dao.stats.DimDateDao; import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.AgencySubTreeDto; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.extract.form.ScreenExtractFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; @@ -35,15 +36,12 @@ import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollCommunityS import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollStreetService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; -import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; -import com.epmet.service.evaluationindex.extract.toscreen.ScreenCentralZoneDataAbsorptionService; -import com.epmet.service.evaluationindex.extract.toscreen.PartyGuideService; +import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimCustomerPartymemberService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -105,6 +103,8 @@ public class DemoController { private IndexCollStreetService indexCollStreetService; @Autowired private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService; + @Autowired + private GovernRankDataExtractService governRankDataExtractService; @GetMapping("testAlarm") public void testAlarm() { @@ -527,7 +527,7 @@ public class DemoController { @PostMapping("inserttopicorigin") public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) { if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { - ExtractFormDTO param = new ExtractFormDTO(); + ExtractOriginFormDTO param = new ExtractOriginFormDTO(); param.setDateId(dateId); param.setCustomerId(customerId); Boolean aBoolean = factOriginTopicMainDailyService.topicCleaning(param); @@ -538,7 +538,7 @@ public class DemoController { List dimDateEntityList= dimDateDao.selectList(wrapper); for(DimCustomerEntity customerEntity:customerEntityList){ for(DimDateEntity dateEntity:dimDateEntityList) { - ExtractFormDTO param = new ExtractFormDTO(); + ExtractOriginFormDTO param = new ExtractOriginFormDTO(); param.setDateId(dateEntity.getId()); param.setCustomerId(customerEntity.getId()); factOriginTopicMainDailyService.topicCleaning(param); @@ -652,8 +652,8 @@ public class DemoController { private PartyGuideService partyGuideService; @PostMapping("zxczxc") - public Result getZxcZxc(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ - partyGuideService.partyGuideExtract(formDTO.getCustomerId(),formDTO.getDateId()); + public Result getZxcZxc(@RequestBody ScreenExtractFormDTO formDTO){ + partyGuideService.partyGuideExtract(formDTO); return new Result(); } @@ -662,4 +662,36 @@ public class DemoController { screenCentralZoneDataAbsorptionService.centralZoneDataHub(param); return new Result(); } + + @PostMapping("governRank") + public Result governRank(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ + governRankDataExtractService.extractGridData(formDTO.getCustomerId(), formDTO.getDateId()); + governRankDataExtractService.extractCommunityData(formDTO.getCustomerId(), formDTO.getDateId()); + governRankDataExtractService.extractStreetData(formDTO.getCustomerId(), formDTO.getDateId()); + return new Result(); + } + + @Autowired + private PioneerDataExtractService pioneerDataExtractService; + + @PostMapping("insertScreenPioneerData") + public Result insertScreenPioneerData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { + pioneerDataExtractService.extractGridPioneerData(customerId, dateId); + pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId); + pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId); + } else { + QueryWrapper customerEntityQueryWrapper = new QueryWrapper<>(); + List customerEntityList = dimCustomerDao.selectList(customerEntityQueryWrapper); + for (DimCustomerEntity customerEntity : customerEntityList) { + pioneerDataExtractService.extractGridPioneerData(customerEntity.getId(), "20200926"); + pioneerDataExtractService.extractCommunityPioneerData(customerEntity.getId(), "20200926"); + pioneerDataExtractService.extractExceptCommunityPioneerData(customerEntity.getId(), "20200926"); + } + } + return new Result(); + } + + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java index 10a938fb7a..643a909604 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java @@ -3,7 +3,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.service.evaluationindex.extract.todata.*; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -38,69 +38,69 @@ public class FactOriginExtractController { /** * desc:抽取业务数据到统计库 * - * @param extractFormDTO 默认统计前一天 + * @param extractOriginFormDTO 默认统计前一天 * @return */ @PostMapping("extractall") - public Result extractAll(@RequestBody ExtractFormDTO extractFormDTO) { - if (StringUtils.isNotBlank(extractFormDTO.getStartDate()) && StringUtils.isNotBlank(extractFormDTO.getEndDate())) { - List daysBetween = DateUtils.getDaysBetween(extractFormDTO.getStartDate(), extractFormDTO.getEndDate()); + public Result extractAll(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + if (StringUtils.isNotBlank(extractOriginFormDTO.getStartDate()) && StringUtils.isNotBlank(extractOriginFormDTO.getEndDate())) { + List daysBetween = DateUtils.getDaysBetween(extractOriginFormDTO.getStartDate(), extractOriginFormDTO.getEndDate()); for (int i = 0; i < daysBetween.size(); i++) { String dateDimId = daysBetween.get(i); - extractFormDTO.setDateId(dateDimId); - factOriginExtractService.extractAll(extractFormDTO); + extractOriginFormDTO.setDateId(dateDimId); + factOriginExtractService.extractAll(extractOriginFormDTO); } } else { - factOriginExtractService.extractAll(extractFormDTO); + factOriginExtractService.extractAll(extractOriginFormDTO); } return new Result(); } /** - * @param extractFormDTO + * @param extractOriginFormDTO * @Description 议题抽取(main) * @author zxc * @date 2020/9/15 2:02 下午 */ @PostMapping("issueextractmain") - public Result issueExtractMain(@RequestBody ExtractFormDTO extractFormDTO) { - ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class); - issueExtractService.issueExtractMain(extractFormDTO); + public Result issueExtractMain(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + ValidatorUtils.validateEntity(extractOriginFormDTO, ExtractOriginFormDTO.ExtractForm.class); + issueExtractService.issueExtractMain(extractOriginFormDTO); return new Result(); } /** - * @param extractFormDTO + * @param extractOriginFormDTO * @Description 议题抽取(log) * @author zxc * @date 2020/9/16 9:41 上午 */ @PostMapping("issueextractlog") - public Result issueExtractLog(@RequestBody ExtractFormDTO extractFormDTO) { - ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class); - issueExtractService.issueExtractLog(extractFormDTO); + public Result issueExtractLog(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + ValidatorUtils.validateEntity(extractOriginFormDTO, ExtractOriginFormDTO.ExtractForm.class); + issueExtractService.issueExtractLog(extractOriginFormDTO); return new Result(); } /** - * @param extractFormDTO + * @param extractOriginFormDTO * @return com.epmet.commons.tools.utils.Result * @author yinzuomei * @description 话题 (fact_origin_topic_main_daily 话题主表_日统计 fact_origin_topic_log_daily 话题明细_日统计) * @Date 2020/9/15 13:39 **/ @PostMapping("topic") - public Result topicDataCleaning(@RequestBody ExtractFormDTO extractFormDTO) { - if (StringUtils.isNotBlank(extractFormDTO.getCustomerId()) && StringUtils.isNotBlank(extractFormDTO.getDateId())) { - factOriginTopicMainDailyService.topicCleaning(extractFormDTO); + public Result topicDataCleaning(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + if (StringUtils.isNotBlank(extractOriginFormDTO.getCustomerId()) && StringUtils.isNotBlank(extractOriginFormDTO.getDateId())) { + factOriginTopicMainDailyService.topicCleaning(extractOriginFormDTO); } return new Result(); } @PostMapping("project") - public Result projectData(@RequestBody ExtractFormDTO extractFormDTO) { - projectExtractService.saveOriginProjectDaily(extractFormDTO); + public Result projectData(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + projectExtractService.saveOriginProjectDaily(extractOriginFormDTO); return new Result(); } @@ -112,7 +112,7 @@ public class FactOriginExtractController { * @date 2020.09.20 16:11 **/ @PostMapping("projectorgperiodcleanning") - public Result projectOrgPeriodCleaning(@RequestBody ExtractFormDTO param) { + public Result projectOrgPeriodCleaning(@RequestBody ExtractOriginFormDTO param) { projectExtractService.extractProjectPeriodData(param); return new Result(); } @@ -125,7 +125,7 @@ public class FactOriginExtractController { * @date 2020.09.20 16:11 **/ @PostMapping("groupdatacleaning") - public Result groupDataCleaning(@RequestBody ExtractFormDTO param) { + public Result groupDataCleaning(@RequestBody ExtractOriginFormDTO param) { groupExtractService.extractGroupData(param); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java index 2f81eeadc2..34e8c7ccde 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java @@ -1,7 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -21,14 +21,14 @@ public class ScreenExtractDailyController { private ScreenExtractService screenExtractService; /** - * @Description 抽取数据到大屏【天】 - * @param extractFormDTO + * @param extractOriginFormDTO + * @Description 抽取数据到大屏【天】 * @author zxc * @date 2020/9/24 10:15 上午 */ @PostMapping("extractdailyall") - public Result screenExtractDaily(@RequestBody ExtractFormDTO extractFormDTO){ - screenExtractService.extractDailyAll(extractFormDTO); + public Result screenExtractDaily(@RequestBody ExtractOriginFormDTO extractOriginFormDTO) { + screenExtractService.extractDailyAll(extractOriginFormDTO); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java index 1e4ab97477..9ac027b1fa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java @@ -72,4 +72,21 @@ public interface FactOriginIssueLogDailyDao extends BaseDao selectPartyActiveIssueVote(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty); + + /** + * @return int + * @param customerId + * @param gridId + * @param communityId + * @param agencyPath + * @param isParty + * @author yinzuomei + * @description 党员参与议事:支持或者反对的次数 + * @Date 2020/9/26 18:05 + **/ + int calPartyPartiIssueTotal(@Param("customerId")String customerId, + @Param("gridId")String gridId, + @Param("communityId")String communityId, + @Param("agencyPath")String agencyPath, + @Param("isParty")String isParty); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java index d57370166e..422c9f83ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java @@ -115,4 +115,25 @@ public interface FactOriginProjectLogDailyDao extends BaseDao selectProjectParticipatedAgency(@Param("customerId") String customerId, @Param("dimId") String dimId, @Param("dateType")String dateType); + + /** + * 网格项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 10:01 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectGridResponse(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 组织项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 10:01 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List selectOrgResponse(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level")String level); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index 2b5c16dc5e..01bf423d48 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -134,4 +134,39 @@ public interface FactOriginProjectMainDailyDao extends BaseDao + */ + List getSelfProject(@Param("customerId") String customerId, @Param("monthId")String monthId, + @Param("level") String level); + + + /** + * 组织解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId, + @Param("level") String level); + + /** + * 网格解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java index c03786ecfe..c1b8e5b479 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.CpcScoreResultDTO; import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -83,4 +84,13 @@ public interface CpcScoreDao extends BaseDao { List getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allParentCode") String allParentCode, @Param("offset") int offset, @Param("pageSize") int pageSize); int insertBatch(@Param("list") Collection values); + + /** + * @Description 查询客户下的党员指标得分 + * @param customerId + * @return + * @author wangc + * @date 2020.09.25 17:13 + **/ + List selectCpcScore(@Param("customerId") String customerId,@Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java index c3c85c1ffd..5d172d1e06 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -77,4 +77,16 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao + */ + List selectOrgByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("type") String type); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 62ba836b5c..f7ea7ddb79 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; @@ -162,7 +163,9 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAllAgencyIdToPartyLinkMessage(String customerId, String monthId); + List selectAllAgencyIdToPartyLinkMessage(@Param("customerId") String customerId,@Param("monthId") String monthId); + + List selectAllAgencyIdToOrganize(@Param("customerId") String customerId,@Param("monthId") String monthId); /** * @Description 查询org名称【机关】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java index d917f62ffb..b0e405eace 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -19,10 +19,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ScreenCustomerGridDTO; -import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; -import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; -import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; -import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; @@ -152,6 +149,7 @@ public interface ScreenCustomerGridDao extends BaseDao * @date 2020/9/25 10:43 上午 */ List selectAllGridIdToPartyLinkMessage(@Param("customerId") String customerId,@Param("monthId") String monthId); + List selectAllGridIdToOrganize(@Param("customerId") String customerId,@Param("monthId") String monthId); /** * @Description 查询org名称 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java index d40a702dbe..da8d5ea7ef 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java @@ -75,4 +75,19 @@ public interface ScreenGovernRankDataDao extends BaseDao */ List initGridDataList(@Param("customerId") String customerId); + + + /** + * 删除旧数据 + * @author zhaoqifeng + * @date 2020/9/25 10:38 + * @param customerId + * @param orgType + * @param deleteSize + * @param orgIds + * @return java.lang.Integer + */ + Integer deleteRankData(@Param("customerId") String customerId, @Param("orgType") String orgType, @Param("monthId") String monthId, + @Param("deleteSize") Integer deleteSize, + @Param("orgIds")List orgIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java index 8c5211cefc..9911306d4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java @@ -65,4 +65,34 @@ public interface ScreenPartyBranchDataDao extends BaseDao lists); + + /** + * @Description 删除旧的建设情况数据 + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/27 9:04 上午 + */ + Integer deleteOldScreenPartyBranchData(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("orgIds") List orgIds); + + /** + * @Description 根据orgId查询建设情况数据 + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/27 9:38 上午 + */ + List selectScreenPartyBranchDataByOrgId(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("orgIds") List orgIds); + + /** + * @Description 根据parentId查询建设情况数据 + * @Param customerId + * @Param monthId + * @Param parentId + * @author zxc + * @date 2020/9/27 9:38 上午 + */ + List selectScreenPartyBranchDataByParentId(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("parentId") String parentId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java index 586ab1d0a8..14e2e781bc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java @@ -68,12 +68,11 @@ public interface ScreenPartyLinkMassesDataDao extends BaseDao orgIds); + Integer deleteOldPartyLinkInfo(@Param("customerId") String customerId, @Param("orgIds") List orgIds); /** * @Description 查询党员联系群众信息 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java index 518c3fa795..35132261cc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java @@ -45,6 +45,15 @@ public interface ScreenPartyUserRankDataDao extends BaseDao list,@Param("customerId")String customerId); + + /** + * @Description 批量插入 + * @param list + * @return void + * @author wangc + * @date 2020.09.27 10:06 + */ + void insertBatch(List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java index 1381898f01..b8276891d2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java @@ -17,6 +17,7 @@ package com.epmet.dao.heart; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -50,4 +51,14 @@ public interface ActInfoDao{ * @Date 2020/9/21 13:55 **/ List selectGridRegUserVolunteer(@Param("list") List regUserIds); + + /** + * @Description 查询组织次数 + * @Param customerId + * @Param monthId + * @Param orgType + * @author zxc + * @date 2020/9/25 4:00 下午 + */ + List selectActInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("orgType") String orgType,@Param("orgIds") List orgIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java new file mode 100644 index 0000000000..32cbbaf408 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java @@ -0,0 +1,25 @@ +package com.epmet.dao.heart; + +import com.epmet.dto.extract.result.JoinUserCountResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/25 5:21 下午 + */ +@Mapper +public interface ActUserRelationDao { + + /** + * @Description 查询参与人数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 5:19 下午 + */ + List selectJoinUserCount(@Param("customerId") String customerId,@Param("monthId") String monthId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/point/PointDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/point/PointDao.java new file mode 100644 index 0000000000..fe777344aa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/point/PointDao.java @@ -0,0 +1,27 @@ +package com.epmet.dao.point; + +import com.epmet.dto.point.UserPointDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 积分查询DAO + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface PointDao { + + /** + * @Description 查询客户下的用户积分 + * @param customerId + * @return + * @author wangc + * @date 2020.09.25 15:51 + **/ + List selectUserPointByCustomerId(@Param("customerId") String customerId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java index 502363d1b0..2a2fc36ed9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java @@ -26,7 +26,7 @@ import org.apache.ibatis.annotations.Param; import java.util.List; /** - * 网格议题数量(按月) + * 网格议题数量(按月) * * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-17 @@ -35,21 +35,25 @@ import java.util.List; public interface FactIssueGridMonthlyDao extends BaseDao { /** * 统计网格议题各个指标月度增量 - * @author zhaoqifeng - * @date 2020/6/19 10:41 + * * @param customerId * @param monthId * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/19 10:41 */ List selectGridMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId); /** * 删除 - * @author zhaoqifeng - * @date 2020/6/23 14:02 + * * @param customerId * @param monthId * @return void + * @author zhaoqifeng + * @date 2020/6/23 14:02 */ void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + List getIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java index cd84b6d3b0..fd0b7d2a86 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java @@ -48,13 +48,4 @@ public interface FactParticipationUserGridDailyDao extends BaseDao selectUserCount(String customerId, String dateId); - - /** - * @Description 根据机构级别查询用户数与党员数 - * @param orgLevel - * @return - * @author wangc - * @date 2020.09.24 14:59 - **/ - List selectUserAndPartymemberByOrgLevel(@Param("orgLevel") String orgLevel,@Param("customerId") String customerId, @Param("dateId")String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java index f06c4c1179..ba2c53eb2c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.stats.user.FactRegUserGridDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.user.FactRegUserGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -38,4 +39,12 @@ public interface FactRegUserGridDailyDao extends BaseDao selectUserAndPartymemberByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index 28c0a2c389..b9162c30a2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -3,6 +3,7 @@ package com.epmet.dao.user; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -121,4 +122,13 @@ public interface UserDao { * @Date 2020/9/21 13:46 **/ List selectGridRegUserIds(@Param("customerId") String customerId, @Param("gridId") String gridId); + + /** + * @Description 获取客户下的网格注册居民 + * @param customerId + * @return + * @author wangc + * @date 2020.09.25 13:54 + **/ + List selectRegisteredUserByCustomerId(@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java index 149c4c128c..d05a586f76 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java @@ -59,4 +59,9 @@ public class IndexDictEntity extends BaseEpmetEntity { * 正相关:positive;负相关:negative */ private String correlation; + + /** + * 指标值类型 无:none;整数:integer;小数: decimal;百分比:percent + */ + private String valueType; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.java index 4d70bf29ff..93b3a98577 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.java @@ -22,6 +22,8 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + /** * 党建引领|基层治理-市民(党员)积分排行榜 * @@ -90,6 +92,10 @@ public class ScreenPartyUserRankDataEntity extends BaseEpmetEntity { */ private Integer pointTotal; + /** + * 党员指标得分 + * */ + private BigDecimal indexScore; /** * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java index 75668a1215..138e19cd30 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java @@ -90,7 +90,7 @@ public class ScreenUserJoinEntity extends BaseEpmetEntity { /** * 人均议题 */ - private Integer avgIssue; + private BigDecimal avgIssue; /** * 人均议题较上月增长率(采集的时候后台自己计算) @@ -105,7 +105,7 @@ public class ScreenUserJoinEntity extends BaseEpmetEntity { /** * 平均参与度 */ - private Integer avgJoin; + private BigDecimal avgJoin; /** * 平均参与度较上月增长率(采集的时候后台自己计算) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java index 28b471f0a2..411c633990 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java @@ -18,7 +18,6 @@ package com.epmet.entity.stats; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -69,12 +68,12 @@ public class DimAgencyEntity extends BaseEpmetEntity { private String allParentName; /** - * 机关级别(社区级:community, -乡(镇、街道)级:street, -区县级: district, -市级: city -省级:province) - */ + * 机关级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) + */ private String level; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java index fc8ec41c57..ea56c96a37 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java @@ -42,7 +42,6 @@ public class IndexExcelDataListener extends AnalysisEventListener { List indexModelList = new ArrayList<>(); private String preWheight; - private Integer wheightSum = 0; /** * 假设这个是一个DAO,当然有业务逻辑这个也可以是一个service。当然如果不用存储这个对象没用。 */ @@ -104,6 +103,17 @@ public class IndexExcelDataListener extends AnalysisEventListener { } } + //指标值类型 无:none;整数:integer;小数: decimal;百分比:percent + if (StringUtils.isNotBlank(data.getValueType())) { + if ("整数".equals(data.getValueType())) { + data.setValueType("integer"); + } else if ("小数".equals(data.getValueType())) { + data.setValueType("decimal"); + } else if ("百分比".equals(data.getValueType())) { + data.setValueType("percent"); + } + } + IndexDictEntity entity = new IndexDictEntity(); IndexDictEntity entity2 = new IndexDictEntity(); IndexDictEntity entity3 = new IndexDictEntity(); @@ -306,6 +316,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity5.setCorrelation(data.getCorrelation()); entity5.setLevel("5"); entity5.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel5Index(), false, 4)); + entity.setValueType(data.getValueType()); indexDicMap.put(data.getLevel5Index(), entity5); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java index b2e124ff09..cc1aed7759 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java @@ -26,6 +26,11 @@ public class IndexModel { //没有阈值:无,有就是百分数 @ExcelProperty(value = "阈值") private String threshold; + /** + * 指标值类型 无:none;整数:integer;小数: decimal;百分比:percent + */ + @ExcelProperty(value = "五级指标值类型") + private String valueType; /** * 正相关:positive;负相关:negative */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalCpcIndexService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalCpcIndexService.java index af4b583eec..cb9552dd4d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalCpcIndexService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/CalCpcIndexService.java @@ -1,5 +1,7 @@ package com.epmet.service.evaluationindex.extract.dataToIndex; +import java.util.Map; + /** * 党员相关 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java index a837550337..41c21e6b68 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.indexcal.CpcScoreResultDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService; import com.epmet.service.evaluationindex.extract.todata.*; @@ -126,7 +127,6 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { factIndexPartyAblityCpcMonthlyService.delAndSavePartyAblityCpcMonthly(customerId,monthId,indexPartyAblityCpcList); } - /** * @param customerId * @param partyMemberList @@ -400,4 +400,6 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java index 8391e684b7..6cd619a2fd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java @@ -134,18 +134,18 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService BigDecimal element = new BigDecimal(entity.getClosedProjectCount()); //分母,即机关参与过的项目数(去重) Integer denominator = agencyParticipatedCount.get(entity.getAgencyId()); - if (agencyParticipatedCount.get(entity.getAgencyId()) != NumConstant.ZERO) { + if (null != denominator && denominator != NumConstant.ZERO) { //办结率 entity.setClosedProjectRatio( element.divide(new BigDecimal(denominator), NumConstant.SIX, RoundingMode.HALF_UP) ); + }else{ + entity.setClosedProjectRatio(BigDecimal.ZERO); } //办结效率 entity.setHandleProjectRatio(efficiencyMap.get(entity.getAgencyId())); }); - - factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); factIndexGovrnAblityOrgMonthlyService.saveList(list); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginExtractService.java index 9966b96619..807fb5067f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginExtractService.java @@ -1,6 +1,6 @@ package com.epmet.service.evaluationindex.extract.todata; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; /** * @author zhaoqifeng @@ -12,7 +12,7 @@ public interface FactOriginExtractService { /** * desc:抽取所有业务数据到统计库 * - * @param extractFormDTO + * @param extractOriginFormDTO */ - void extractAll(ExtractFormDTO extractFormDTO); + void extractAll(ExtractOriginFormDTO extractOriginFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java index 625804fff9..671888fb14 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java @@ -28,4 +28,16 @@ import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; */ public interface FactOriginIssueLogDailyService extends BaseService { + /** + * @return int + * @param customerId + * @param gridId + * @param communityId + * @param agencyPath + * @param isParty + * @author yinzuomei + * @description 党员参与议事:支持或者反对的次数 + * @Date 2020/9/26 17:57 + **/ + int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty); } \ 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/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java index d5364a836f..f95de230b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java @@ -197,4 +197,25 @@ public interface FactOriginProjectLogDailyService extends BaseService getAgencyWorkPieceRatio(String customerId, String dimId,String dateType); + /** + * 网格项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 9:56 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridResponse(String customerId, String monthId); + + /** + * 组织项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 9:56 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getOrgResponse(String customerId, String monthId, String level); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 9440cf9bc8..bc061d6064 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -185,4 +185,35 @@ public interface FactOriginProjectMainDailyService extends BaseService + */ + List getSelfProject(String customerId, String monthId, String level); + /** + * 已解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:34 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getResolveProject(String customerId, String monthId, String level); + + /** + * 网格已解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:34 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridResolveProject(String customerId, String monthId); } \ 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/FactOriginTopicMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java index df34ed1249..d217e4d3eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java @@ -18,7 +18,7 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.result.CreateTopicCountResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; @@ -40,7 +40,7 @@ public interface FactOriginTopicMainDailyService extends BaseService> diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/GroupExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/GroupExtractService.java index 092402fd8c..f4d59942e4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/GroupExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/GroupExtractService.java @@ -1,11 +1,10 @@ package com.epmet.service.evaluationindex.extract.todata; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; import java.util.List; -import com.epmet.dto.extract.form.ExtractFormDTO; - /** * @Desc 业务数据抽取 - 组相关 * @Author wangc @@ -24,11 +23,11 @@ public interface GroupExtractService { /** - * @Description 业务抽取 - 小组数据 * @param param * @return + * @Description 业务抽取 - 小组数据 * @author wangc * @date 2020.09.18 21:07 - **/ - void extractGroupData(ExtractFormDTO param); + **/ + void extractGroupData(ExtractOriginFormDTO param); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java index 24bf2ddfce..b169556f73 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java @@ -1,13 +1,11 @@ package com.epmet.service.evaluationindex.extract.todata; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.result.GridProjectCountResultDTO; import com.epmet.dto.extract.result.PartyActiveResultDTO; import com.epmet.dto.extract.result.ShiftProjectCountResultDTO; -import java.util.List; - import java.util.List; import java.util.Map; @@ -18,20 +16,20 @@ import java.util.Map; public interface IssueExtractService { /** - * @Description 议题抽取(main) - * @param extractFormDTO + * @param extractOriginFormDTO + * @Description 议题抽取(main) * @author zxc * @date 2020/9/15 2:02 下午 */ - Boolean issueExtractMain(ExtractFormDTO extractFormDTO); + Boolean issueExtractMain(ExtractOriginFormDTO extractOriginFormDTO); /** - * @Description 议题抽取(log) - * @param extractFormDTO + * @Description 议题抽取(log) + * @param extractOriginFormDTO * @author zxc * @date 2020/9/16 9:41 上午 */ - Boolean issueExtractLog(ExtractFormDTO extractFormDTO); + Boolean issueExtractLog(ExtractOriginFormDTO extractOriginFormDTO); /** * @Description 查询网格议题总数,网格人均议题数目 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java index 972914d5fc..f21e8b3976 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java @@ -1,9 +1,7 @@ package com.epmet.service.evaluationindex.extract.todata; -import com.epmet.dto.extract.form.ExtractFormDTO; - -import java.util.Date; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; /** * @author zhaoqifeng @@ -16,19 +14,19 @@ public interface ProjectExtractService { /** * 项目主表、明细日统计 * - * @param extractFormDTO + * @param extractOriginFormDTO * @return * @author zhaoqifeng * @date 2020/9/15 14:38 */ - void saveOriginProjectDaily(ExtractFormDTO extractFormDTO); + void saveOriginProjectDaily(ExtractOriginFormDTO extractOriginFormDTO); - /** - * @Description 抽取项目节点历时逻辑 - * @param param - * @return - * @author wangc - * @date 2020.09.17 14:05 - **/ - void extractProjectPeriodData(ExtractFormDTO param); + /** + * @param param + * @return + * @Description 抽取项目节点历时逻辑 + * @author wangc + * @date 2020.09.17 14:05 + **/ + void extractProjectPeriodData(ExtractOriginFormDTO param); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectPeriodExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectPeriodExtractService.java index f3117a7e40..b30c421b53 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectPeriodExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectPeriodExtractService.java @@ -1,6 +1,6 @@ package com.epmet.service.evaluationindex.extract.todata; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; /** * @Desc 业务数据抽取 - 项目节点历时 @@ -8,14 +8,14 @@ import com.epmet.dto.extract.form.ExtractFormDTO; * @DateTime 2020/9/14 5:07 下午 */ public interface ProjectPeriodExtractService { - + /** - * @Description 抽取项目节点历时逻辑 * @param param * @return + * @Description 抽取项目节点历时逻辑 * @author wangc * @date 2020.09.17 14:05 - **/ - void extractProjectPeriodData(ExtractFormDTO param); + **/ + void extractProjectPeriodData(ExtractOriginFormDTO param); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java index 14a2b1c351..381f6d230d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java @@ -3,7 +3,7 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.stats.DimCustomerService; import com.epmet.util.DimIdGenerator; @@ -44,9 +44,9 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { @Override - public void extractAll(ExtractFormDTO extractFormDTO) { - String dateId = extractFormDTO.getDateId(); - String customerId = extractFormDTO.getCustomerId(); + public void extractAll(ExtractOriginFormDTO extractOriginFormDTO) { + String dateId = extractOriginFormDTO.getDateId(); + String customerId = extractOriginFormDTO.getCustomerId(); if (StringUtils.isBlank(dateId)) { dateId = DimIdGenerator.getDateDimId(DateUtils.addDateDays(new Date(), -1)); } @@ -65,7 +65,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { String finalDateId = dateId; customerIds.forEach(cId -> { - ExtractFormDTO param = new ExtractFormDTO(); + ExtractOriginFormDTO param = new ExtractOriginFormDTO(); param.setCustomerId(cId); param.setDateId(finalDateId); log.debug("extractAll param:{}", JSON.toJSONString(param)); @@ -74,7 +74,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { } - private void submitJob(ExtractFormDTO param) { + private void submitJob(ExtractOriginFormDTO param) { threadPool.submit(() -> { try { groupExtractService.extractGroupData(param); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java index df81cee703..af081dfef5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java @@ -36,4 +36,19 @@ import org.springframework.stereotype.Service; public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl implements FactOriginIssueLogDailyService { + /** + * @param customerId + * @param gridId + * @param communityId + * @param agencyPath + * @param isParty + * @return int + * @author yinzuomei + * @description 党员参与议事:支持或者反对的次数 + * @Date 2020/9/26 17:57 + **/ + @Override + public int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty) { + return baseDao.calPartyPartiIssueTotal(customerId,gridId,communityId,agencyPath,isParty); + } } \ 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/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index 4808614df1..f966247b6e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -267,5 +267,15 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl getGridResponse(String customerId, String monthId) { + return baseDao.selectGridResponse(customerId, monthId); + } + + @Override + public List getOrgResponse(String customerId, String monthId, String level) { + return baseDao.selectOrgResponse(customerId, monthId, level); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 68bea2819d..6e8c7124e8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -198,4 +198,19 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl getSelfProject(String customerId, String monthId, String level) { + return baseDao.getSelfProject(customerId, monthId, level); + } + + @Override + public List getResolveProject(String customerId, String monthId, String level) { + return baseDao.getResolveProject(customerId, monthId, level); + } + + @Override + public List getGridResolveProject(String customerId, String monthId) { + return baseDao.getGridResolveProject(customerId, monthId); + } } \ 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/FactOriginTopicMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java index 5d87cc5afc..e55104f01c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java @@ -28,7 +28,7 @@ import com.epmet.constant.DimObjectActionConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.result.CreateTopicCountResultDTO; import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.topic.TopicOriginInfoDTO; @@ -77,9 +77,9 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl topicOriginInfoList = topicService.queryTopicOriginInfoList(customerId, dateId); if (CollectionUtils.isEmpty(topicOriginInfoList)) { log.info(String.format("customerId%s,dateId%s,doesn't have any topic operation record", customerId, dateId)); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java index 0545cb5345..00e277e27d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java @@ -4,7 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; @@ -66,17 +66,17 @@ public class GroupExtractServiceImpl implements GroupExtractService { /** - * @Description 业务抽取 - 小组祥光 * @param param * @return + * @Description 业务抽取 - 小组祥光 * @author wangc * @date 2020.09.18 21:07 **/ @Override - public void extractGroupData(ExtractFormDTO param) { + public void extractGroupData(ExtractOriginFormDTO param) { int count = factOriginGroupMainDailyDao.selectIfExist(param.getCustomerId()); - if(StringUtils.isBlank(param.getDateId())){ + if (StringUtils.isBlank(param.getDateId())) { Date yesterday = DateUtils.addDateDays(new Date(), -1); SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); param.setDateId(format.format(yesterday)); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java index cd765f9199..a222e22cbb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java @@ -11,7 +11,7 @@ import com.epmet.constant.ExtractConstant; import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; import com.epmet.dao.stats.DimAgencyDao; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.IssueLogDailyFormDTO; import com.epmet.dto.extract.form.IssueMainDailyFormDTO; @@ -54,19 +54,19 @@ public class IssueExtractServiceImpl implements IssueExtractService { private FactOriginIssueLogDailyDao issueLogDailyDao; /** - * @Description 议题抽取 - * @param extractFormDTO + * @param extractOriginFormDTO + * @Description 议题抽取 * @author zxc * @date 2020/9/15 2:02 下午 */ @Override - public Boolean issueExtractMain(ExtractFormDTO extractFormDTO) { - String customerId = extractFormDTO.getCustomerId(); - String dateId = extractFormDTO.getDateId(); + public Boolean issueExtractMain(ExtractOriginFormDTO extractOriginFormDTO) { + String customerId = extractOriginFormDTO.getCustomerId(); + String dateId = extractOriginFormDTO.getDateId(); // 1. 议题信息查询 List listResult = issueService.selectIssueInfo(customerId, dateId); List result = new ArrayList<>(); - if (CollectionUtils.isEmpty(listResult)){ + if (CollectionUtils.isEmpty(listResult)) { log.warn("issueExtractMain selectIssueInfo return empty,customerId:{},dateId:{}", customerId, dateId); return true; } @@ -151,24 +151,24 @@ public class IssueExtractServiceImpl implements IssueExtractService { } /** - * @Description 议题抽取(log) - * @param extractFormDTO + * @Description 议题抽取(log) + * @param extractOriginFormDTO * @author zxc * @date 2020/9/16 9:41 上午 */ @Override - public Boolean issueExtractLog(ExtractFormDTO extractFormDTO) { - String customerId = extractFormDTO.getCustomerId(); - String dateId = extractFormDTO.getDateId(); + public Boolean issueExtractLog(ExtractOriginFormDTO extractOriginFormDTO) { + String customerId = extractOriginFormDTO.getCustomerId(); + String dateId = extractOriginFormDTO.getDateId(); List result = new ArrayList<>(); // 1. 查询议题process List listResult = issueService.selectIssueProcessInfo(customerId, dateId); - if (CollectionUtils.isEmpty(listResult)){ + if (CollectionUtils.isEmpty(listResult)) { log.warn("issueExtractMain issueExtractLog return empty,customerId:{},dateId:{}", customerId, dateId); return true; } Map> groupByIssue = listResult.stream().collect(Collectors.groupingBy(IssueProcessInfoResultDTO::getIssueId)); - groupByIssue.forEach((issueId,process) -> { + groupByIssue.forEach((issueId, process) -> { List descByCreateTime = process.stream().sorted(Comparator.comparing(IssueProcessInfoResultDTO::getCreateTime).reversed()).collect(Collectors.toList()); issueMainDailyDao.updateIssueStatus(issueId,descByCreateTime.get(NumConstant.ZERO).getActionCode()); }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java index f526570e9f..a9552ed3b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java @@ -7,7 +7,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dto.ProjectDTO; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.form.WorkDayFormDTO; import com.epmet.dto.issue.IssueDTO; import com.epmet.dto.party.PartyMemberDTO; @@ -71,20 +71,20 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { @Autowired private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; - @Override - public void saveOriginProjectDaily(ExtractFormDTO extractFormDTO) { - String dateString = extractFormDTO.getDateId(); - String customerId = extractFormDTO.getCustomerId(); - List list = new LinkedList<>(); - //获取已关闭项目列表 - List closedList = projectProcessService.getClosedProjectList(customerId, dateString); - List pendingList = factOriginProjectMainDailyService.getPendingList(customerId); - List finishOrgList= projectProcessService.getFinishOrg(customerId, dateString); - if (null != closedList && !closedList.isEmpty()) { - List closeProjects = - pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { - FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); - entity.setId(process.getId()); + @Override + public void saveOriginProjectDaily(ExtractOriginFormDTO extractOriginFormDTO) { + String dateString = extractOriginFormDTO.getDateId(); + String customerId = extractOriginFormDTO.getCustomerId(); + List list = new LinkedList<>(); + //获取已关闭项目列表 + List closedList = projectProcessService.getClosedProjectList(customerId, dateString); + List pendingList = factOriginProjectMainDailyService.getPendingList(customerId); + List finishOrgList = projectProcessService.getFinishOrg(customerId, dateString); + if (null != closedList && !closedList.isEmpty()) { + List closeProjects = + pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { + FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); + entity.setId(process.getId()); entity.setProjectStatus("close"); entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD)); entity.setUpdatedTime(process.getUpdatedTime()); @@ -312,25 +312,25 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { } } - /** - * @Description 抽取项目节点历时逻辑 - * @param param - * @return - * @author wangc - * @date 2020.09.17 14:05 - **/ - @Override - public void extractProjectPeriodData(ExtractFormDTO param) { - int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId()); - Boolean isFirst = trace <= NumConstant.ZERO ? true : false; - if(StringUtils.isBlank(param.getDateId())){ - Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24); - SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); - param.setDateId(format.format(yesterday)); - } - List extractData = - projectProcessService.getProjectPeriod(isFirst,param.getCustomerId(),param.getDateId()); - List formattingData = new LinkedList<>(); + /** + * @param param + * @return + * @Description 抽取项目节点历时逻辑 + * @author wangc + * @date 2020.09.17 14:05 + **/ + @Override + public void extractProjectPeriodData(ExtractOriginFormDTO param) { + int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId()); + Boolean isFirst = trace <= NumConstant.ZERO ? true : false; + if (StringUtils.isBlank(param.getDateId())) { + Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + param.setDateId(format.format(yesterday)); + } + List extractData = + projectProcessService.getProjectPeriod(isFirst, param.getCustomerId(), param.getDateId()); + List formattingData = new LinkedList<>(); extractData.forEach(original -> { FactOriginProjectOrgPeriodDailyEntity dest = ConvertUtils.sourceToTarget(original,FactOriginProjectOrgPeriodDailyEntity.class); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectPeriodExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectPeriodExtractServiceImpl.java index a99f2a5937..dbf1130893 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectPeriodExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectPeriodExtractServiceImpl.java @@ -4,7 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import com.epmet.service.evaluationindex.extract.todata.ProjectPeriodExtractService; @@ -37,23 +37,23 @@ public class ProjectPeriodExtractServiceImpl implements ProjectPeriodExtractServ private ProjectProcessService projectProcessService; /** - * @Description 抽取项目节点历时逻辑 * @param param * @return + * @Description 抽取项目节点历时逻辑 * @author wangc * @date 2020.09.17 14:05 **/ @Override - public void extractProjectPeriodData(ExtractFormDTO param) { + public void extractProjectPeriodData(ExtractOriginFormDTO param) { int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId()); Boolean isFirst = trace <= NumConstant.ZERO ? true : false; - if(StringUtils.isBlank(param.getDateId())){ + if (StringUtils.isBlank(param.getDateId())) { Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24); SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); param.setDateId(format.format(yesterday)); } List extractData = - projectProcessService.getProjectPeriod(isFirst,param.getCustomerId(),param.getDateId()); + projectProcessService.getProjectPeriod(isFirst, param.getCustomerId(), param.getDateId()); List formattingData = new LinkedList<>(); extractData.forEach(original -> { FactOriginProjectOrgPeriodDailyEntity dest diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java index 8700a2b7e2..2628a50ced 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java @@ -1,5 +1,7 @@ package com.epmet.service.evaluationindex.extract.toscreen; +import com.epmet.dto.extract.form.ScreenExtractFormDTO; + /** * @Author zxc * @DateTime 2020/9/24 5:05 下午 @@ -8,11 +10,10 @@ public interface PartyGuideService { /** * @Description 党建引领抽取 - * @param customerId - * @param monthId + * @param screenExtractFormDTO * @author zxc * @date 2020/9/24 5:10 下午 */ - Boolean partyGuideExtract(String customerId,String monthId); + Boolean partyGuideExtract(ScreenExtractFormDTO screenExtractFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java index 388559649d..efde08faf8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java @@ -1,5 +1,7 @@ package com.epmet.service.evaluationindex.extract.toscreen; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; + /** * @desc: 大屏 公众参与抽取服务接口 * @Author: LiuJanJun @@ -17,7 +19,7 @@ public interface PublicPartExtractService { * @author LiuJanJun * @date 2020/9/25 10:24 上午 */ - Boolean extractTotalDataMonthly(); + Boolean extractTotalDataMonthly(ExtractScreenFormDTO formDTO); /** * desc: 抽取公众参与 各类总数 @@ -28,5 +30,5 @@ public interface PublicPartExtractService { * @author LiuJanJun * @date 2020/9/25 10:24 上午 */ - Boolean extractPerTotalDataDaily(); + Boolean extractPerTotalDataDaily(ExtractScreenFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java index 70ff60bff3..f61b933bf4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java @@ -1,6 +1,6 @@ package com.epmet.service.evaluationindex.extract.toscreen; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; /** * @Author zxc @@ -9,11 +9,11 @@ import com.epmet.dto.extract.form.ExtractFormDTO; public interface ScreenExtractService { /** - * @Description 抽取数据到大屏【天】 - * @param extractFormDTO + * @param extractOriginFormDTO + * @Description 抽取数据到大屏【天】 * @author zxc * @date 2020/9/24 10:15 上午 */ - void extractDailyAll(ExtractFormDTO extractFormDTO); + void extractDailyAll(ExtractOriginFormDTO extractOriginFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenGrassrootsGovernDataAbsorptionService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenGrassrootsGovernDataAbsorptionService.java new file mode 100644 index 0000000000..56c73b2de5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenGrassrootsGovernDataAbsorptionService.java @@ -0,0 +1,29 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; + +/** + * 基层治理 + * 热心市民积分 党员能力值 + * 难点赌点 + * */ +public interface ScreenGrassrootsGovernDataAbsorptionService { + + /** + * @Description 用户积分、党员分值数据中转站 + * @param param + * @return + * @author wangc + * @date 2020.09.25 09:53 + **/ + void userScoreDataHub(ScreenCentralZoneDataFormDTO param); + + /** + * @Description 难点赌点数据中转站 + * @param param + * @return + * @author wangc + * @date 2020.09.25 10:00 + **/ + void difficultyDataHub(ScreenCentralZoneDataFormDTO param); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java index 58e149d6fd..05f90029d5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java @@ -1,15 +1,21 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.IndexCalConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.GovernRankDataExtractService; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; @@ -21,6 +27,7 @@ import java.util.List; * @dscription * @date 2020/9/24 14:31 */ +@Service public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractService { @Autowired private ScreenGovernRankDataService screenGovernRankDataService; @@ -28,37 +35,138 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; @Autowired private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService; + @Autowired + private FactOriginProjectLogDailyService factOriginProjectLogDailyService; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + public static void main(String[] args) { + String monthId = "202006"; + System.out.println(monthId.substring(0,4)); + } @Override public void extractGridData(String customerId, String monthId) { List list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.GRID, null); if (CollectionUtils.isEmpty(list)) { return; } + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); List gridList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId); - list.forEach(entity -> gridList.stream().filter(gridAblity -> entity.getOrgId().equals(gridAblity.getGridId())).forEach(grid -> { - BigDecimal total = new BigDecimal(grid.getProjectTotal()); - entity.setYearId(grid.getYearId()); - entity.setMonthId(grid.getMonthId()); - //TODO 响应率 - //解决率 + list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getGridId())).forEach(grid -> { + BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount()); - entity.setResolvedRatio(resolveCount.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); //自治率 BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount()); - entity.setGovernRatio(selfCount.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + if(grid.getResolveProjectCount()!= NumConstant.ZERO) { + entity.setGovernRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + } //满意率 entity.setSatisfactionRatio(grid.getSatisfactionRatio()); })); + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getGridResponse(customerId, monthId); + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getOrgId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getGridResolveProject(customerId, monthId); + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getOrgId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + + screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.GRID, monthId, IndexCalConstant.DELETE_SIZE, list); } @Override public void extractCommunityData(String customerId, String monthId) { + List list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isEmpty(list)) { + return; + } + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); + List orgList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, + OrgTypeConstant.COMMUNITY); + list.forEach(entity -> orgList.stream().filter(orgAbility -> entity.getOrgId().equals(orgAbility.getAgencyId())).forEach(org -> { + //满意率 + entity.setSatisfactionRatio(org.getSatisfactionRatio()); + })); + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.COMMUNITY); + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.COMMUNITY); + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId, + OrgTypeConstant.COMMUNITY); + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list); } @Override public void extractStreetData(String customerId, String monthId) { + List list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.STREET); + if (CollectionUtils.isEmpty(list)) { + return; + } + list.forEach(entity -> { + entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(monthId); + }); + List orgList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, + OrgTypeConstant.STREET); + list.forEach(entity -> orgList.stream().filter(orgAbility -> entity.getOrgId().equals(orgAbility.getAgencyId())).forEach(org -> { + //满意率 + entity.setSatisfactionRatio(org.getSatisfactionRatio()); + })); + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.STREET); + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.STREET); + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId, + OrgTypeConstant.STREET); + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + })); + screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java index 19b0eaa9d4..aac1f632bf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java @@ -2,8 +2,10 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.ScreenConstant; -import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenExtractFormDTO; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.*; import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; @@ -12,6 +14,9 @@ import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; import com.epmet.service.evaluationindex.screen.ScreenPartyBranchDataService; import com.epmet.service.evaluationindex.screen.ScreenPartyLinkMassesDataService; +import com.epmet.service.heart.ActInfoService; +import com.epmet.service.heart.ActUserRelationService; +import com.epmet.service.stats.DimCustomerService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.ListUtils; import org.springframework.beans.BeanUtils; @@ -19,7 +24,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; +import java.time.LocalDate; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -43,16 +50,52 @@ public class PartyGuideServiceImpl implements PartyGuideService { private ScreenCustomerAgencyService agencyService; @Autowired private ScreenCustomerGridService gridService; + @Autowired + private ActInfoService actInfoService; + @Autowired + private DimCustomerService dimCustomerService; + @Autowired + private ActUserRelationService actUserRelationService; /** * @Description 党建引领抽取 - * @param customerId - * @param monthId + * @param screenExtractFormDTO * @author zxc * @date 2020/9/24 5:10 下午 */ @Override - public Boolean partyGuideExtract(String customerId, String monthId) { + public Boolean partyGuideExtract(ScreenExtractFormDTO screenExtractFormDTO) { + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + List customerIds = new ArrayList<>(); + String customerId = screenExtractFormDTO.getCustomerId(); + if (!StringUtils.isEmpty(customerId)){ + customerIds.add(customerId); + }else { + customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); + } + String monthId = screenExtractFormDTO.getMonthId(); + if (StringUtils.isEmpty(monthId)){ + monthId = LocalDate.now().toString().replace("-","").substring(NumConstant.ZERO,NumConstant.SIX); + } + if (!CollectionUtils.isEmpty(customerIds)){ + String finalMonthId = monthId; + customerIds.forEach(oneCustomerId -> { + partyGuideExtractParty(oneCustomerId, finalMonthId); + partyGuideExtractOrganize(oneCustomerId,finalMonthId); + }); + } + return true; + } + + /** + * @Description 【党员建群数,群成员数】 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 4:26 下午 + */ + public void partyGuideExtractParty(String customerId, String monthId){ //【党员建群数,群成员数】 List agencyIdList = agencyService.selectAllAgencyId(customerId); if (!CollectionUtils.isEmpty(agencyIdList)){ @@ -61,34 +104,74 @@ public class PartyGuideServiceImpl implements PartyGuideService { if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){ // 社区级别 List customerGridInfoList = groupByLevel.get(ScreenConstant.COMMUNITY); - disPose(customerGridInfoList,true,customerId,monthId); + disPoseParty(customerGridInfoList,true,customerId,monthId); } if (groupByLevel.containsKey(ScreenConstant.STREET)){ // 街道级别 List customerGridInfoList = groupByLevel.get(ScreenConstant.STREET); - disPose(customerGridInfoList,false,customerId,monthId); + disPoseParty(customerGridInfoList,false,customerId,monthId); } if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){ // 区级 List customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT); - disPose(customerGridInfoList,false,customerId,monthId); + disPoseParty(customerGridInfoList,false,customerId,monthId); } if (groupByLevel.containsKey(ScreenConstant.CITY)){ // 市级 List customerGridInfoList = groupByLevel.get(ScreenConstant.CITY); - disPose(customerGridInfoList,false,customerId,monthId); + disPoseParty(customerGridInfoList,false,customerId,monthId); } if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){ // 省级 List customerGridInfoList = groupByLevel.get(ScreenConstant.PROVINCE); - disPose(customerGridInfoList,false,customerId,monthId); + disPoseParty(customerGridInfoList,false,customerId,monthId); + } + } + } + + /** + * @Description 【参与人数,组织次数】 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 4:26 下午 + */ + public void partyGuideExtractOrganize(String customerId, String monthId){ + //【参与人数,组织次数】 + List agencyIdList = agencyService.selectAllAgencyId(customerId); + if (!CollectionUtils.isEmpty(agencyIdList)){ + // 根据组织级别分组 + Map> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel)); + if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){ + // 社区级别 + List customerGridInfoList = groupByLevel.get(ScreenConstant.COMMUNITY); + disPoseOrganize(customerGridInfoList,true,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.STREET)){ + // 街道级别 + List customerGridInfoList = groupByLevel.get(ScreenConstant.STREET); + disPoseOrganize(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){ + // 区级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT); + disPoseOrganize(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.CITY)){ + // 市级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.CITY); + disPoseOrganize(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){ + // 省级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.PROVINCE); + disPoseOrganize(customerGridInfoList,false,customerId,monthId); } } - return true; } /** - * @Description 处理 + * @Description 处理【党员建群数,群成员数】 * @Param agencyIdList * @Param isGrid * @Param customerId @@ -96,7 +179,7 @@ public class PartyGuideServiceImpl implements PartyGuideService { * @author zxc * @date 2020/9/25 2:57 下午 */ - public void disPose(List agencyIdList, Boolean isGrid, String customerId, String monthId) { + public void disPoseParty(List agencyIdList, Boolean isGrid, String customerId, String monthId) { List result = new ArrayList<>(); if (!CollectionUtils.isEmpty(agencyIdList)){ List orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); @@ -109,7 +192,7 @@ public class PartyGuideServiceImpl implements PartyGuideService { Map> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyLinkMassesDataFormDTO::getParentId)); groupByAgency.forEach((agencyId,gridList) -> { ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO(); - List orgNameAgencyList = agencyService.selectOrgNameAgency(result.stream().map(m -> m.getParentId()).distinct().collect(Collectors.toList())); + List orgNameAgencyList = agencyService.selectOrgNameAgency(orgIds); if (!CollectionUtils.isEmpty(orgNameAgencyList)){ orgNameAgencyList.forEach(name -> { if (agencyId.equals(name.getAgencyId())){ @@ -177,6 +260,115 @@ public class PartyGuideServiceImpl implements PartyGuideService { } } + /** + * @Description 处理【参与人数,组织次数】 + * @Param agencyIdList + * @Param isGrid + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 4:28 下午 + */ + public void disPoseOrganize(List agencyIdList, Boolean isGrid, String customerId, String monthId){ + if (!CollectionUtils.isEmpty(agencyIdList)){ + List result = new ArrayList<>(); + List orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); + if (isGrid == true){ + List joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId); + agencyIdList.forEach(agency -> { + String agencyId = agency.getAgencyId(); + Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); + List gridIds = (List) agencyMap.get(agencyId); + orgIds.addAll(gridIds); + List screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, gridIds); + if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){ + screenPartyBranchDataList.forEach(party -> { + joinUserCountList.forEach(join -> { + if (party.getOrgId().equals(join.getOrgId())){ + party.setAverageJoinUserCount(join.getJoinUserCount()); + party.setAverageJoinUserCount(party.getJoinUserCount() / party.getOrganizeCount()); + party.setYearId(DateUtils.getYearId(monthId)); + } + }); + }); + } + result.addAll(screenPartyBranchDataList); + }); + // 社区级别的 + Map> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyBranchDataFormDTO::getParentId)); + List orgNameAgencyList = agencyService.selectOrgNameAgency(orgIds); + groupByAgency.forEach((agencyId,actList) -> { + ScreenPartyBranchDataFormDTO form = new ScreenPartyBranchDataFormDTO(); + if (!CollectionUtils.isEmpty(orgNameAgencyList)){ + orgNameAgencyList.forEach(name -> { + if (agencyId.equals(name.getAgencyId())){ + form.setOrgName(name.getAgencyName()); + form.setParentId(name.getParentId()); + } + }); + } + form.setOrgId(agencyId); + form.setCustomerId(customerId); + form.setOrgType(ScreenConstant.AGENCY); + form.setMonthId(monthId); + form.setYearId(DateUtils.getYearId(monthId)); + form.setOrganizeCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))); + form.setJoinUserCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))); + form.setAverageJoinUserCount(form.getJoinUserCount() / form.getOrganizeCount()); + result.add(form); + }); + delAndInsertOrganize(result,customerId,monthId,orgIds); + }else { + List directGridIds = gridService.selectDirectGrid(orgIds); + agencyIdList.forEach(agency -> { + String agencyId = agency.getAgencyId(); + List disGridIds = new ArrayList<>(); + directGridIds.forEach(grid -> { + if (agencyId.equals(grid.getAgencyId())){ + disGridIds.add(grid.getGridId()); + } + }); + // 存在直属网格 + if (!CollectionUtils.isEmpty(disGridIds)){ + List gridResult = new ArrayList<>(); + List joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId); + List orgNameList = agencyService.selectOrgNameGrid(disGridIds); + List screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, disGridIds); + if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){ + screenPartyBranchDataList.forEach(party -> { + orgNameList.forEach(org -> { + if (party.getOrgId().equals(org.getGridId())){ + party.setOrgName(org.getGridName()); + } + }); + ScreenPartyBranchDataFormDTO copyParty = ConvertUtils.sourceToTarget(party, ScreenPartyBranchDataFormDTO.class); + gridResult.add(copyParty); + }); + } + } + List disPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByOrgId(customerId, monthId, disGridIds); + List screenPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByParentId(customerId, monthId, agencyId); + screenPartyBranchDataList.addAll(disPartyBranchDataList); + if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){ + ScreenPartyBranchDataFormDTO form = new ScreenPartyBranchDataFormDTO(); + form.setOrgId(agencyId); + form.setOrgType(ScreenConstant.AGENCY); + form.setOrgName(screenPartyBranchDataList.get(NumConstant.ZERO).getOrgName()); + form.setCustomerId(customerId); + form.setMonthId(monthId); + form.setYearId(DateUtils.getYearId(monthId)); + form.setParentId(screenPartyBranchDataList.get(NumConstant.ZERO).getParentId()); + form.setJoinUserCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))); + form.setOrganizeCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))); + form.setAverageJoinUserCount(form.getJoinUserCount() / form.getOrganizeCount()); + result.add(form); + } + }); + delAndInsertOrganize(result,customerId,monthId,orgIds); + } + } + } + /** * @Description 社区级别的处理 * @Param customerId @@ -237,7 +429,7 @@ public class PartyGuideServiceImpl implements PartyGuideService { } Integer delNum; do { - delNum = linkMassesDataService.deleteOldPartyLinkInfo(customerId, monthId, orgIds); + delNum = linkMassesDataService.deleteOldPartyLinkInfo(customerId, orgIds); }while (delNum > NumConstant.ZERO); List> partition = ListUtils.partition(finalResult, NumConstant.ONE_HUNDRED); partition.forEach(p -> { @@ -245,9 +437,45 @@ public class PartyGuideServiceImpl implements PartyGuideService { }); } + /** + * @Description + * @Param result + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/25 5:50 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsertOrganize(List result,String customerId, String monthId, List orgIds){ + List screenPartyBranchData = agencyService.selectAllAgencyIdToOrganize(customerId, monthId); + List screenPartyBranchDataList = gridService.selectAllGridIdToOrganize(customerId, monthId); + screenPartyBranchDataList.addAll(screenPartyBranchData); + List finalResult = new ArrayList<>(); + screenPartyBranchDataList.forEach(rl -> { + orgIds.forEach(orgId -> { + if (rl.getOrgId().equals(orgId)){ + finalResult.add(rl); + } + }); + }); + if (!CollectionUtils.isEmpty(result)){ + finalResult.forEach(fr -> { + result.forEach(r -> { + if (fr.getOrgId().equals(r.getOrgId())){ + BeanUtils.copyProperties(r,fr); + } + }); + }); + } + Integer delNum; + do { + delNum = partyBranchDataService.deleteOldScreenPartyBranchData(customerId, monthId, orgIds); + }while (delNum > NumConstant.ZERO); + List> partition = ListUtils.partition(finalResult, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + partyBranchDataService.insertScreenPartyBranchData(p); + }); + } - - - - // TODO 党员志愿服务【参与人数,组织次数】 } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java index df9d7ab3c8..c4b5964404 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java @@ -4,11 +4,13 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService; import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -24,6 +26,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/9/22 11:25 */ +@Slf4j @Service public class PioneerDataExtractServiceImpl implements PioneerDataExtractService { @@ -35,6 +38,9 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService private FactOriginIssueMainDailyService factOriginIssueMainDailyService; @Autowired private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private FactOriginIssueLogDailyService factOriginIssueLogDailyService; + /** * @param customerId @@ -54,11 +60,15 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService gridList.forEach(entity -> { entity.setDataEndTime(dateId); String gridId = entity.getOrgId(); - //1、党员参与议事 todo - entity.setIssueTotal(NumConstant.ZERO); - //2、党员参与议事占比 todo - entity.setIssueRatio(BigDecimal.ZERO); - + //1、党员参与议事 + entity.setIssueTotal(calPartyPartiIssueTotal(customerId,gridId,null,null,NumConstant.ONE_STR)); + if(entity.getIssueTotal()==0){ + entity.setIssueRatio(BigDecimal.ZERO); + }else{ + //2、党员参与议事占比 + int issueTotal=calPartyPartiIssueTotal(customerId,gridId,null,null,null); + entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP)); + } //3、党员发布话题: entity.setTopicTotal(getTopicTotal(customerId, gridId, null)); @@ -86,6 +96,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null)); //8、议题转项目占比 : 占网格内议题总数的比率 entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + }else{ +// log.info("当前网格内所有议题总数="+gridIssueTotal); + entity.setPublishIssueTotal(NumConstant.ZERO); + entity.setPublishIssueRatio(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectRatio(BigDecimal.ZERO); } @@ -102,6 +118,25 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService screenPioneerDataService.delAndSavePioneerData(customerId, "grid", IndexCalConstant.DELETE_SIZE, gridList); } + /** + * @return int + * @param customerId + * @param gridId 网格id + * @param communityId 社区的id + * @param agencyPath 组织的pids包含自己 + * @param isParty 1党员 + * @author yinzuomei + * @description + * @Date 2020/9/26 17:41 + **/ + private int calPartyPartiIssueTotal(String customerId, + String gridId, + String communityId, + String agencyPath, + String isParty) { + return factOriginIssueLogDailyService.calPartyPartiIssueTotal(customerId,gridId,communityId,agencyPath,isParty); + } + @Override public void extractCommunityPioneerData(String customerId, String dateId) { //查询客户下所有的社区,初始数据值为0 @@ -112,11 +147,15 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService communityList.forEach(entity -> { entity.setDataEndTime(dateId); String communityId = entity.getOrgId(); - //1、党员参与议事 todo - entity.setIssueTotal(NumConstant.ZERO); - //2、党员参与议事占比 todo - entity.setIssueRatio(BigDecimal.ZERO); - + //1、党员参与议事 + entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,communityId,null,NumConstant.ONE_STR)); + if(entity.getIssueTotal()==0){ + entity.setIssueRatio(BigDecimal.ZERO); + }else{ + //2、党员参与议事占比 + int issueTotal=calPartyPartiIssueTotal(customerId,null,communityId,null,null); + entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP)); + } //3、党员发布话题: entity.setTopicTotal(getTopicTotal(customerId, null, communityId)); @@ -144,6 +183,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, null, communityId)); //8、议题转项目占比 : 占社区内议题总数的比率 entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + }else{ +// log.info("当前社区内所有议题总数="+communityIssueTotal); + entity.setPublishIssueTotal(NumConstant.ZERO); + entity.setPublishIssueRatio(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectRatio(BigDecimal.ZERO); } @@ -170,17 +215,20 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService } agencyList.forEach(entity -> { entity.setDataEndTime(dateId); - String agencyId = entity.getOrgId(); - //1、党员参与议事 todo - entity.setIssueTotal(NumConstant.ZERO); - //2、党员参与议事占比 todo - entity.setIssueRatio(BigDecimal.ZERO); if (StringUtils.isEmpty(entity.getPid()) || NumConstant.ZERO_STR.equals(entity.getPid())) { entity.setAgencyPath(entity.getOrgId()); } else { entity.setAgencyPath(entity.getAgencyPids().concat(StrConstant.COLON).concat(entity.getOrgId())); } - + //1、党员参与议事 + entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),NumConstant.ONE_STR)); + if(entity.getIssueTotal()==0){ + entity.setIssueRatio(BigDecimal.ZERO); + }else{ + //2、党员参与议事占比 + int issueTotal=calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),null); + entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP)); + } //3、党员发布话题: entity.setTopicTotal(getAgencyTopicTotal(customerId, entity.getAgencyPath(),NumConstant.ONE_STR)); @@ -208,6 +256,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setShiftProjectTotal(getAgencyShiftProjectTotal(customerId, entity.getAgencyPath())); //8、议题转项目占比 : 占网格内议题总数的比率 entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + }else{ +// log.info("当前组织内所有议题总数="+agencyIssueTotal); + entity.setPublishIssueTotal(NumConstant.ZERO); + entity.setPublishIssueRatio(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectRatio(BigDecimal.ZERO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java index ae0aab7fa0..bb94830ba1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java @@ -1,11 +1,34 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; -import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dto.extract.form.ExtractScreenFormDTO; +import com.epmet.dto.extract.result.GridUserCountResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; +import com.epmet.entity.stats.DimAgencyEntity; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.FactIssueGridMonthlyEntity; import com.epmet.service.evaluationindex.extract.toscreen.PublicPartExtractService; -import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; -import com.epmet.service.evaluationindex.screen.ScreenPublicPartiTotalDataService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.DimGridService; +import com.epmet.service.stats.FactIssueGridMonthlyService; +import com.epmet.service.stats.user.FactRegUserGridMonthlyService; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * desc:公众参与抽取到大屏的接口实现类 @@ -14,33 +37,129 @@ import org.springframework.stereotype.Service; * @date: 2020/9/25 10:46 上午 * @version: 1.0 */ +@Slf4j @Service public class PublicPartExtractServiceImpl implements PublicPartExtractService { - @Autowired - private ScreenPublicPartiTotalDataService screenPublicPartiTotalDataService; + private DimAgencyService dimAgencyService; @Autowired - private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + private DimGridService dimGridService; @Autowired - private ScreenCustomerAgencyService agencyService; + private FactIssueGridMonthlyService factIssueGridMonthlyService; + @Autowired + private FactRegUserGridMonthlyService factRegUserGridMonthlyService; /** * desc: 【月】抽取公众参与 人均议题 总次数和平均参与度 * target:screen_user_join + * 总参与:统计周期内议题表决(虽然可以评价 但是只有表决的人可以评价 所以按表决人数算)的人数 + * 百人人均议题:统计周期内总的议题数/(注册用户数/100) + * 百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 + * 不考虑市北:人均议题:统计周期内议题总数/发过议题的人数 参与度:各个行为(表决)的总数/发生行为的人数 * * @return java.lang.Boolean * @author LiuJanJun * @date 2020/9/25 10:24 上午 */ @Override - public Boolean extractTotalDataMonthly() { - //agencyService.initAgencies(); + public Boolean extractTotalDataMonthly(ExtractScreenFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getCustomerId()) || StringUtils.isBlank(formDTO.getMonthId())) { + log.warn("extractTotalDataMonthly param is error,param:{}", JSON.toJSONString(formDTO)); + return false; + } + extractGridUserJoin(formDTO); + extractAgencyUserJoin(formDTO); return null; } + private void extractGridUserJoin(ExtractScreenFormDTO formDTO) { + List orgList = dimGridService.getGridListByCustomerId(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(orgList)) { + log.warn("抽取【公众参与-人均议题】,获取组织数据失败"); + throw new RenException("抽取【公众参与-人均议题】,获取组织数据失败"); + } + //构建组织数据 + Map insertMap = new HashMap<>(); + orgList.forEach(org -> buildUserJoinEntity(formDTO, org, insertMap)); + //获取议题月份增量 + List issueTotal = factIssueGridMonthlyService.getIssueCount(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(issueTotal)) { + log.error("抽取【公众参与-人均议题】,获取议题增量为空"); + return; + } + List userCountList = factRegUserGridMonthlyService.selectGridUserCount(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(issueTotal)) { + log.error("抽取【公众参与-人均议题】,获取注册用户数为空"); + return; + } + Map userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getGridId, o -> o)); + issueTotal.forEach(issue -> { + String gridId = issue.getGridId(); + ScreenUserJoinEntity entity = insertMap.get(gridId); + entity.setJoinTotal(issue.getIssueIncr()); + GridUserCountResultDTO user = userCountMap.get(gridId); + //百人人均议题:统计周期内总的议题数/(注册用户数/100) + BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getUserCount()).divide(new BigDecimal(NumConstant.ONE_HUNDRED))); + // 需要修改字段类型 + entity.setAvgIssue(avgIssueCount); + + //百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 + + + entity.setAvgJoin(new BigDecimal(0)); + }); + + + } + + private void extractAgencyUserJoin(ExtractScreenFormDTO formDTO) { + List orgList = dimAgencyService.getAgencyListByCustomerId(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(orgList)) { + log.warn("抽取【公众参与-人均议题】,获取组织数据失败"); + throw new RenException("抽取【公众参与-人均议题】,获取组织数据失败"); + } + //构建组织数据 + Map insertMap = new HashMap<>(); + orgList.forEach(org -> { + buildUserJoinEntity(formDTO, org, insertMap); + }); + List issueTotal = factIssueGridMonthlyService.getIssueCount(formDTO.getCustomerId(), formDTO.getMonthId()); + } + + private void buildUserJoinEntity(ExtractScreenFormDTO formDTO, Object org, Map result) { + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(DateUtils.stringToDate(formDTO.getMonthId(), DateUtils.DATE_PATTERN_YYYYMMDD)); + ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(dimIdBean, ScreenUserJoinEntity.class); + if (org instanceof DimGridEntity) { + DimGridEntity grid = (DimGridEntity) org; + entity.setCustomerId(grid.getCustomerId()); + entity.setOrgType(OrgTypeConstant.GRID); + entity.setOrgId(grid.getId()); + entity.setParentId(grid.getAgencyId()); + entity.setOrgName(grid.getGridName()); + } else if (org instanceof DimAgencyEntity) { + DimAgencyEntity agency = (DimAgencyEntity) org; + entity.setCustomerId(agency.getCustomerId()); + entity.setOrgType(agency.getLevel()); + entity.setOrgId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setOrgName(agency.getAgencyName()); + } + + entity.setJoinTotal(0); + entity.setJoinTotalUpRate(new BigDecimal("0")); + entity.setJoinTotalUpFlag(""); + entity.setAvgIssue(new BigDecimal(0)); + entity.setAvgIssueUpRate(new BigDecimal("0")); + entity.setAvgIssueUpFlag(""); + entity.setAvgJoin(new BigDecimal(0)); + entity.setAgvgJoinUpRate(new BigDecimal("0")); + entity.setAgvgJoinUpFlag(""); + result.put(entity.getOrgId(), entity); + } + /** - * desc: 【日】抽取公众参与 各类总数 + * desc: 【日】抽取公众参与 各类总数 累计值 * target:screen_public_parti_total_data * * @return java.lang.Boolean @@ -48,7 +167,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { * @date 2020/9/25 10:24 上午 */ @Override - public Boolean extractPerTotalDataDaily() { + public Boolean extractPerTotalDataDaily(ExtractScreenFormDTO formDTO) { return null; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index bab236a466..9c8b73e49e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -2,7 +2,7 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService; import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService; @@ -33,33 +33,33 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { private PioneerDataExtractService pioneerDataExtractService; /** - * @Description 抽取数据到大屏【天】 - * @param extractFormDTO + * @param extractOriginFormDTO + * @Description 抽取数据到大屏【天】 * @author zxc * @date 2020/9/24 10:15 上午 */ @Override - public void extractDailyAll(ExtractFormDTO extractFormDTO) { + public void extractDailyAll(ExtractOriginFormDTO extractOriginFormDTO) { List customerIds = new ArrayList<>(); - if (StringUtils.isNotBlank(extractFormDTO.getCustomerId())){ - customerIds.add(extractFormDTO.getCustomerId()); - }else { + if (StringUtils.isNotBlank(extractOriginFormDTO.getCustomerId())) { + customerIds.add(extractOriginFormDTO.getCustomerId()); + } else { int pageNo = NumConstant.ONE; int pageSize = NumConstant.ONE_HUNDRED; customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); } - if (!CollectionUtils.isEmpty(customerIds)){ + if (!CollectionUtils.isEmpty(customerIds)) { customerIds.forEach(customerId -> { - if (StringUtils.isNotBlank(extractFormDTO.getStartDate()) && StringUtils.isNotBlank(extractFormDTO.getEndDate())){ - List daysBetween = DateUtils.getDaysBetween(extractFormDTO.getStartDate(), extractFormDTO.getEndDate()); + if (StringUtils.isNotBlank(extractOriginFormDTO.getStartDate()) && StringUtils.isNotBlank(extractOriginFormDTO.getEndDate())) { + List daysBetween = DateUtils.getDaysBetween(extractOriginFormDTO.getStartDate(), extractOriginFormDTO.getEndDate()); daysBetween.forEach(dateId -> { - extractDaily(customerId,dateId); + extractDaily(customerId, dateId); }); - }else if (StringUtils.isNotBlank(extractFormDTO.getDateId())){ - extractDaily(customerId,extractFormDTO.getDateId()); - }else { + } else if (StringUtils.isNotBlank(extractOriginFormDTO.getDateId())) { + extractDaily(customerId, extractOriginFormDTO.getDateId()); + } else { String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", ""); - extractDaily(customerId,dateId); + extractDaily(customerId, dateId); } }); } @@ -74,7 +74,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { * @date 2020/9/24 10:16 上午 */ public void extractDaily(String customerId,String dateId){ - partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId); +// partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId); pioneerDataExtractService.extractGridPioneerData(customerId,dateId); pioneerDataExtractService.extractCommunityPioneerData(customerId,dateId); pioneerDataExtractService.extractExceptCommunityPioneerData(customerId,dateId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java new file mode 100644 index 0000000000..563a8c65cc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -0,0 +1,119 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.org.GridInfoDTO; +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenGrassrootsGovernDataAbsorptionService; +import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; +import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService; +import com.epmet.service.org.CustomerGridService; +import com.epmet.service.point.UserPointService; +import com.epmet.service.user.UserService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * @Description 基层治理数据 + * @ClassName ScreenGrassrootsGovernDataAbsorptionServiceImpl + * @Auth wangc + * @Date 2020-09-25 09:48 + */ + +@Service +@Slf4j +public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGrassrootsGovernDataAbsorptionService { + + @Autowired + private UserService userService; + @Autowired + private CustomerGridService customerGridService; + @Autowired + private UserPointService userPointService; + @Autowired + private CpcIndexCalculateService cpcIndexCalculateService; + @Autowired + private ScreenPartyUserRankDataService screenPartyUserRankDataService; + /** + * @Description 用户积分、党员分值数据中转站 + * @param param + * @return + * @author wangc + * @date 2020.09.25 09:53 + **/ + @Override + public void userScoreDataHub(ScreenCentralZoneDataFormDTO param) { + //1.查询出客户下的网格注册用户 + List registeredUsers = userService.getRegisteredUserList(param.getCustomerId()); + + //2.查询出客户下网格的相关信息 + List gridList = customerGridService.queryGridInfoList(param.getCustomerId()); + Map gridMap = new HashMap<>(); + gridList.forEach(grid -> {gridMap.put(grid.getGridId(),grid);}); + + //3.查询出客户下用户的累计积分(累计值,没有时间概念,否则需要查询积分明细计算出评价周期末的得分) + Map pointMap = userPointService.getUserPointMap(param.getCustomerId()); + //4.查询出客户下党员的分值 + String dateId = param.getDateId(); + if(StringUtils.isEmpty(dateId)){ + //如果没有传月份,则使用当前时间的上一个月 + dateId = DateUtils.getBeforeNMonth(NumConstant.ONE); + }else{ + String dateType = DateUtils.identifyTimeDimension(dateId); + if(StringUtils.isEmpty(dateType) || !org.apache.commons.lang3.StringUtils.equalsAny(dateType,"date","month")){ + dateId = DateUtils.getBeforeNMonth(NumConstant.ONE); + }else if(org.apache.commons.lang3.StringUtils.equals(dateType,"date")){ + dateId = dateId.substring(NumConstant.ZERO,dateId.length() - NumConstant.TWO); + } + } + final String finalDateId = dateId; + + Map scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(),dateId); + + //5.整合数据 + if(!CollectionUtils.isEmpty(registeredUsers)){ + registeredUsers.forEach(user -> { + GridInfoDTO gridInfo = gridMap.get(user.getGridId()); + if(null != gridInfo){ + user.setGridName(gridInfo.getGridName()); + user.setOrgId(gridInfo.getAgencyId()); + user.setOrgName(gridInfo.getOrgName()); + user.setAllParentIds(gridInfo.getPids()); + } + Integer point = pointMap.get(user.getUserId()); + BigDecimal score = scoreMap.get(user.getUserId()); + + user.setPointTotal(null == point ? NumConstant.ZERO : point); + user.setIndexScore(null == score ? new BigDecimal(NumConstant.ZERO) : score); + + user.setDataEndTime(finalDateId); + }); + + } + + //6.存入数据库 + screenPartyUserRankDataService.dataClean(registeredUsers,param.getCustomerId(),dateId); + } + + /** + * @Description 难点赌点数据中转站 + * @param param + * @return + * @author wangc + * @date 2020.09.25 10:00 + **/ + @Override + public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) { + + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java index 3cd66eccf5..29acca93a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java @@ -2,6 +2,9 @@ package com.epmet.service.evaluationindex.indexcal; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import java.math.BigDecimal; +import java.util.Map; + /** * 党员指标计算service * @@ -15,4 +18,14 @@ public interface CpcIndexCalculateService { * @return */ Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO); + + /** + * @Description 获取党员指标得分 + * @param customerId + * @param monthId + * @return + * @author wangc + * @date 2020.09.25 16:48 + **/ + Map getCpcScore(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java index a4aaf10692..278c4a2236 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao; import com.epmet.dao.evaluationindex.indexcal.CpcSubScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.CpcScoreResultDTO; import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; import com.epmet.entity.evaluationindex.indexcal.CpcSubScoreEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; @@ -66,6 +67,24 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { return true; } + /** + * @Description 获取党员指标得分 + * @param customerId + * @param monthId + * @return + * @author wangc + * @date 2020.09.25 16:48 + **/ + @Override + public Map getCpcScore(String customerId, String monthId) { + List scores = cpcScoreDao.selectCpcScore(customerId,monthId); + Map map = new HashMap<>(); + if(!CollectionUtils.isEmpty(scores)){ + scores.forEach(score -> {map.put(score.getUserId(),score.getScore());}); + } + return map; + } + /** * desc: 计算总分 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java index 6e709fa4fb..4c38049785 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java @@ -49,4 +49,15 @@ public interface FactIndexGovrnAblityOrgMonthlyService extends BaseService list); + + /** + * 根据客户查询组织治理能力 + * @author zhaoqifeng + * @date 2020/9/25 13:56 + * @param customerId + * @param monthId + * @param type + * @return java.util.List + */ + List getOrgByCustomer(String customerId, String monthId, String type); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java index 5143882c49..3f9c73afb3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java @@ -1,9 +1,12 @@ package com.epmet.service.evaluationindex.indexcoll.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService; +import org.springframework.stereotype.Service; import java.util.List; @@ -12,6 +15,8 @@ import java.util.List; * @dscription * @date 2020/9/24 14:36 */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class FactIndexGovrnAblityGridMonthlyServiceImpl extends BaseServiceImpl implements FactIndexGovrnAblityGridMonthlyService { @Override public List getGridByCustomer(String customerId, String monthId) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java index 6f6d5f15a5..a19669e39d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java @@ -46,4 +46,9 @@ public class FactIndexGovrnAblityOrgMonthlyServiceImpl extends BaseServiceImpl list) { insertBatch(list); } + + @Override + public List getOrgByCustomer(String customerId, String monthId, String type) { + return baseDao.selectOrgByCustomer(customerId, monthId, type); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java index 0b2ee8e93e..5ff8fdf050 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java @@ -18,6 +18,7 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; @@ -86,7 +87,9 @@ public interface ScreenCustomerAgencyService{ * @author zxc * @date 2020/9/25 10:39 上午 */ - List selectAllAgencyIdToPartyLinkMessage(String customerId, String dateId); + List selectAllAgencyIdToPartyLinkMessage(String customerId, String monthId); + + List selectAllAgencyIdToOrganize(String customerId, String monthId); /** * @Description 查询org名称【网格】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java index 02e3b21f67..82a00909a5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java @@ -19,10 +19,7 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; -import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; -import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; -import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; @@ -59,6 +56,7 @@ public interface ScreenCustomerGridService extends BaseService selectAllGridIdToPartyLinkMessage(String customerId, String monthId); + List selectAllGridIdToOrganize(String customerId, String monthId); /** * @Description 查询机关的直属网格 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java index 5c5fb96844..0f9b23b166 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java @@ -32,12 +32,27 @@ import java.util.List; public interface ScreenGovernRankDataService extends BaseService { /** * 构造screen_govern_rank_data 初始数据,先赋值为0 - * @author zhaoqifeng - * @date 2020/9/24 14:41 + * * @param customerId * @param orgType * @param agencyLevel * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 14:41 */ List initList(String customerId, String orgType, String agencyLevel); + + /** + * 保存抽取结果 + * + * @param customerId + * @param orgType + * @param monthId + * @param deleteSize + * @param entityList + * @return void + * @author zhaoqifeng + * @date 2020/9/25 10:32 + */ + void delAndSaveRankData(String customerId, String orgType, String monthId, Integer deleteSize, List entityList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java index 68197d665c..1fc80f30ca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java @@ -39,4 +39,34 @@ public interface ScreenPartyBranchDataService extends BaseService lists); + /** + * @Description 删除旧的建设情况数据 + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/27 9:04 上午 + */ + Integer deleteOldScreenPartyBranchData(String customerId, String monthId, List orgIds); + + /** + * @Description 根据orgId查询建设情况数据 + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/27 9:38 上午 + */ + List selectScreenPartyBranchDataByOrgId(String customerId, String monthId, List orgIds); + + /** + * @Description 根据parentId查询建设情况数据 + * @Param customerId + * @Param monthId + * @Param parentId + * @author zxc + * @date 2020/9/27 9:38 上午 + */ + List selectScreenPartyBranchDataByParentId(String customerId, String monthId, String parentId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java index f03255904a..77b8cdb3eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java @@ -42,12 +42,11 @@ public interface ScreenPartyLinkMassesDataService extends BaseService orgIds); + Integer deleteOldPartyLinkInfo(String customerId, List orgIds); /** * @Description 查询党员联系群众信息 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyUserRankDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyUserRankDataService.java index 41cda44da2..a454c51734 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyUserRankDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyUserRankDataService.java @@ -20,6 +20,8 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; +import java.util.List; + /** * 党建引领|基层治理-市民(党员)积分排行榜 * @@ -28,4 +30,15 @@ import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; */ public interface ScreenPartyUserRankDataService extends BaseService { + + /** + * @Description 用户参与排行数据清洗 + * @param dataList + * @param customerId + * @return + * @author wangc + * @date 2020.09.27 09:44 + **/ + void dataClean(List dataList,String customerId,String dateId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java index 9b7d925e05..d506856d0e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.constant.ScreenConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; @@ -172,6 +173,11 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ return screenCustomerAgencyDao.selectAllAgencyIdToPartyLinkMessage(customerId, monthId); } + @Override + public List selectAllAgencyIdToOrganize(String customerId, String monthId) { + return screenCustomerAgencyDao.selectAllAgencyIdToOrganize(customerId, monthId); + } + /** * @Description 查询org名称 * @param gridIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index f1ac5f0d71..f0a47885ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java @@ -24,10 +24,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgSourceTypeConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; -import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; -import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; -import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; -import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; @@ -122,6 +119,11 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl selectAllGridIdToOrganize(String customerId, String monthId) { + return screenCustomerGridDao.selectAllGridIdToOrganize(customerId, monthId); + } + /** * @Description 查询机关的直属网格 * @param agencyIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java index e4fea260dc..4679187995 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java @@ -18,13 +18,19 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDao; import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -37,6 +43,7 @@ import java.util.List; */ @Service @Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenGovernRankDataServiceImpl extends BaseServiceImpl implements ScreenGovernRankDataService { @@ -58,4 +65,23 @@ public class ScreenGovernRankDataServiceImpl extends BaseServiceImpl entityList) { + if (CollectionUtils.isEmpty(entityList)) { + return; + } + List orgIds = new ArrayList<>(); + for (ScreenGovernRankDataEntity entity : entityList) { + orgIds.add(entity.getOrgId()); + } + int deleteNum; + do { + deleteNum = baseDao.deleteRankData(customerId, orgType, monthId, deleteSize, orgIds); + } while (deleteNum != NumConstant.ZERO); + + insertBatch(entityList); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java index 271ac60c71..afd2e8aee3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java @@ -18,7 +18,10 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.ScreenPartyBranchDataDao; import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; @@ -26,6 +29,7 @@ import com.epmet.service.evaluationindex.screen.ScreenPartyBranchDataService; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.List; /** @@ -35,6 +39,7 @@ import java.util.List; * @since v1.0.0 2020-09-22 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenPartyBranchDataServiceImpl extends BaseServiceImpl implements ScreenPartyBranchDataService { /** @@ -49,4 +54,49 @@ public class ScreenPartyBranchDataServiceImpl extends BaseServiceImpl orgIds) { + if (!CollectionUtils.isEmpty(orgIds)){ + return baseDao.deleteOldScreenPartyBranchData(customerId, monthId, orgIds); + } + return NumConstant.ZERO; + } + + /** + * @Description 根据orgId查询建设情况数据 + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/27 9:38 上午 + */ + @Override + public List selectScreenPartyBranchDataByOrgId(String customerId, String monthId, List orgIds) { + if (!CollectionUtils.isEmpty(orgIds)){ + return baseDao.selectScreenPartyBranchDataByOrgId(customerId, monthId, orgIds); + } + return new ArrayList<>(); + } + + /** + * @Description 根据parentId查询建设情况数据 + * @Param customerId + * @Param monthId + * @Param parentId + * @author zxc + * @date 2020/9/27 9:38 上午 + */ + @Override + public List selectScreenPartyBranchDataByParentId(String customerId, String monthId, String parentId) { + return baseDao.selectScreenPartyBranchDataByParentId(customerId, monthId, parentId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java index 2aec948249..2915297086 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java @@ -57,14 +57,13 @@ public class ScreenPartyLinkMassesDataServiceImpl extends BaseServiceImpl orgIds) { - return baseDao.deleteOldPartyLinkInfo(customerId, monthId, orgIds); + public Integer deleteOldPartyLinkInfo(String customerId, List orgIds) { + return baseDao.deleteOldPartyLinkInfo(customerId, orgIds); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyUserRankDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyUserRankDataServiceImpl.java index 6e171bbe80..a543e07fff 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyUserRankDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyUserRankDataServiceImpl.java @@ -19,11 +19,15 @@ package com.epmet.service.evaluationindex.screen.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dao.evaluationindex.screen.ScreenPartyUserRankDataDao; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** * 党建引领|基层治理-市民(党员)积分排行榜 * @@ -33,5 +37,23 @@ import org.springframework.stereotype.Service; @Service public class ScreenPartyUserRankDataServiceImpl extends BaseServiceImpl implements ScreenPartyUserRankDataService { + @Autowired + ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + /** + * @Description 用户参与排行数据清洗 + * @param dataList + * @param customerId + * @return + * @author wangc + * @date 2020.09.27 09:44 + **/ + @Override + public void dataClean(List dataList, String customerId, String dateId) { + int affectedRows; + do{ + affectedRows = baseDao.deleteBatchByCustomerIdAndDateId(customerId,dateId); + }while (affectedRows > NumConstant.ZERO); + baseDao.insertBatch(dataList); + } } \ 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/ScreenUserTotalDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java index a1b21beced..2ab95df738 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java @@ -18,13 +18,16 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.ScreenUserTotalDataDao; import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.List; @@ -36,6 +39,7 @@ import java.util.List; * @since v1.0.0 2020-09-22 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenUserTotalDataServiceImpl extends BaseServiceImpl implements ScreenUserTotalDataService { /** @@ -46,11 +50,12 @@ public class ScreenUserTotalDataServiceImpl extends BaseServiceImpl list,String customerId) { int deleteNum; do { deleteNum = baseDao.deleteUserTotalData(customerId); - } while (deleteNum <= NumConstant.ZERO); + } while (deleteNum > NumConstant.ZERO); if(!CollectionUtils.isEmpty(list)){ baseDao.insertBatch(list); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java index 4a5e9697fb..9438f4c3ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java @@ -413,15 +413,35 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { * @Author zhangyong * @Date 15:38 2020-08-21 **/ - private BigDecimal calculateGrowthRateNumber(Integer old, Integer now){ - if (NumConstant.ZERO == old){ + private BigDecimal calculateGrowthRateNumber(Integer old, Integer now) { + if (NumConstant.ZERO == old) { return new BigDecimal(now * NumConstant.ONE_HUNDRED); } BigDecimal bignum1 = new BigDecimal((now - old) * NumConstant.ONE_HUNDRED); - BigDecimal bignum2 = bignum1.divide(new BigDecimal(old),2,BigDecimal.ROUND_HALF_UP); + BigDecimal bignum2 = bignum1.divide(new BigDecimal(old), 2, BigDecimal.ROUND_HALF_UP); return bignum2; } + /** + * 计算 本月数值 相较于 上月数值,的增长率 + * + * @param old 上月数值 + * @param now 本月数值 + * @return java.math.BigDecimal + * @Author zhangyong + * @Date 15:38 2020-08-21 + **/ + private BigDecimal calculateGrowthRateNumber(BigDecimal old, BigDecimal now) { + BigDecimal oneHundred = new BigDecimal(NumConstant.ONE_HUNDRED); + if (old.compareTo(new BigDecimal(NumConstant.ZERO)) == NumConstant.ZERO) { + return now.multiply(oneHundred); + } + BigDecimal bignum1 = now.subtract(old).multiply(oneHundred); + BigDecimal bignum2 = bignum1.divide(old, 2, BigDecimal.ROUND_HALF_UP); + return bignum2; + } + + /** * 计算 本月数值 相较于 上月数值,的增长率, 得出标识 * @@ -431,10 +451,29 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { * @Author zhangyong * @Date 15:38 2020-08-21 **/ - private String calculateGrowthRateFlag(Integer old, Integer now){ - if (old > now){ + private String calculateGrowthRateFlag(Integer old, Integer now) { + if (old > now) { + return CompareConstant.DECR_STR; + } else if (old < now) { + return CompareConstant.INCR_STR; + } else { + return CompareConstant.EQ_STR; + } + } + + /** + * 计算 本月数值 相较于 上月数值,的增长率, 得出标识 + * + * @param old 上月数值 + * @param now 本月数值 + * @return java.util.String + * @Author zhangyong + * @Date 15:38 2020-08-21 + **/ + private String calculateGrowthRateFlag(BigDecimal old, BigDecimal now) { + if (old.compareTo(now) == 1) { return CompareConstant.DECR_STR; - } else if (old < now){ + } else if (old.compareTo(now) == -1) { return CompareConstant.INCR_STR; } else { return CompareConstant.EQ_STR; @@ -448,7 +487,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenPioneerDataDao.deletePioneerDataByCustomerId(customerId,IndexCalConstant.DELETE_SIZE); + deleteNum = screenPioneerDataDao.deletePioneerDataByCustomerId(customerId, IndexCalConstant.DELETE_SIZE); } while (deleteNum != NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java index 4caa64828f..959b237c75 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java @@ -1,5 +1,7 @@ package com.epmet.service.heart; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; + import java.util.List; import java.util.Map; @@ -28,4 +30,14 @@ public interface ActInfoService { * @Date 2020/9/21 16:43 **/ Map calActivityCountMap(String customerId, String monthId); + + /** + * @Description 查询组织次数 + * @Param customerId + * @Param monthId + * @Param orgType + * @author zxc + * @date 2020/9/25 4:00 下午 + */ + List selectActInfo(String customerId, String monthId, String orgType, List orgIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActUserRelationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActUserRelationService.java new file mode 100644 index 0000000000..7875323b3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActUserRelationService.java @@ -0,0 +1,22 @@ +package com.epmet.service.heart; + +import com.epmet.dto.extract.result.JoinUserCountResultDTO; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/25 5:17 下午 + */ +public interface ActUserRelationService { + + /** + * @Description 查询参与人数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 5:19 下午 + */ + List selectJoinUserCount(String customerId,String monthId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java index f56ecc918c..7e65f078e3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java @@ -3,11 +3,14 @@ package com.epmet.service.heart.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.heart.ActInfoDao; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.service.heart.ActInfoService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -58,4 +61,20 @@ public class ActInfoServiceImpl implements ActInfoService { } return resultMap; } + + /** + * @Description 查询组织次数 + * @Param customerId + * @Param monthId + * @Param orgType + * @author zxc + * @date 2020/9/25 4:00 下午 + */ + @Override + public List selectActInfo(String customerId, String monthId, String orgType, List orgIds) { + if (!CollectionUtils.isEmpty(orgIds)){ + return baseDao.selectActInfo(customerId, monthId, orgType, orgIds); + } + return new ArrayList<>(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActUserRelationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActUserRelationServiceImpl.java new file mode 100644 index 0000000000..570967a3c0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActUserRelationServiceImpl.java @@ -0,0 +1,35 @@ +package com.epmet.service.heart.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.heart.ActUserRelationDao; +import com.epmet.dto.extract.result.JoinUserCountResultDTO; +import com.epmet.service.heart.ActUserRelationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/25 5:17 下午 + */ +@Service +@DataSource(DataSourceConstant.EPMET_HEART) +public class ActUserRelationServiceImpl implements ActUserRelationService { + + @Autowired + private ActUserRelationDao actUserRelationDao; + + /** + * @Description 查询参与人数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 5:19 下午 + */ + @Override + public List selectJoinUserCount(String customerId, String monthId) { + return actUserRelationDao.selectJoinUserCount(customerId, monthId); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/UserPointService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/UserPointService.java new file mode 100644 index 0000000000..ce185cad6a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/UserPointService.java @@ -0,0 +1,18 @@ +package com.epmet.service.point; + +import java.util.Map; + +/** + * 用户积分库 + * */ +public interface UserPointService { + + /** + * @Description 根据客户Id查询用户积分Map + * @param customerId + * @return + * @author wangc + * @date 2020.09.25 16:00 + **/ + Map getUserPointMap(String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/impl/UserPointServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/impl/UserPointServiceImpl.java new file mode 100644 index 0000000000..0402afe418 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/point/impl/UserPointServiceImpl.java @@ -0,0 +1,46 @@ +package com.epmet.service.point.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.point.PointDao; +import com.epmet.dto.point.UserPointDTO; +import com.epmet.service.point.UserPointService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description + * @ClassName UserPointServiceImpl + * @Auth wangc + * @Date 2020-09-25 15:54 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EPMET_POINT) +public class UserPointServiceImpl implements UserPointService { + + @Autowired + private PointDao pointDao; + /** + * @Description 根据客户Id查询用户积分Map + * @param customerId + * @return + * @author wangc + * @date 2020.09.25 16:00 + **/ + @Override + public Map getUserPointMap(String customerId) { + List points = pointDao.selectUserPointByCustomerId(customerId); + Map map = new HashMap<>(); + if(!CollectionUtils.isEmpty(points)){ + points.forEach(point -> {map.put(point.getUserId(),point.getPointTotal());}); + } + return map; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java index a40b8c7236..736a6e348c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java @@ -18,12 +18,10 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; import com.epmet.dto.stats.FactIssueGridMonthlyDTO; import com.epmet.entity.stats.FactIssueGridMonthlyEntity; import java.util.List; -import java.util.Map; /** * 网格议题数量(按月) @@ -32,57 +30,6 @@ import java.util.Map; * @since v1.0.0 2020-06-17 */ public interface FactIssueGridMonthlyService extends BaseService { - - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-06-17 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-06-17 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return FactIssueGridMonthlyDTO - * @author generator - * @date 2020-06-17 - */ - FactIssueGridMonthlyDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-06-17 - */ - void save(FactIssueGridMonthlyDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-06-17 - */ - void update(FactIssueGridMonthlyDTO dto); - /** * 批量删除 * @@ -115,10 +62,22 @@ public interface FactIssueGridMonthlyService extends BaseService list); + + /** + * desc: 获取该客户下某月的 议题数量 + * + * @param customerId + * @param monthId + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/25 5:00 下午 + */ + List getIssueCount(String customerId, String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java index 97d6f29242..c002e0e3ca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java @@ -17,25 +17,18 @@ package com.epmet.service.stats.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactIssueGridMonthlyDao; import com.epmet.dto.stats.FactIssueGridMonthlyDTO; import com.epmet.entity.stats.FactIssueGridMonthlyEntity; import com.epmet.service.stats.FactIssueGridMonthlyService; -import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.List; -import java.util.Map; /** * 网格议题数量(按月) @@ -47,51 +40,6 @@ import java.util.Map; @DataSource(DataSourceConstant.STATS) public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl implements FactIssueGridMonthlyService { - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, FactIssueGridMonthlyDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, FactIssueGridMonthlyDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public FactIssueGridMonthlyDTO get(String id) { - FactIssueGridMonthlyEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, FactIssueGridMonthlyDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(FactIssueGridMonthlyDTO dto) { - FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(FactIssueGridMonthlyDTO dto) { - FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class); - updateById(entity); - } - @Override @Transactional(rollbackFor = Exception.class) public void delete(String[] ids) { @@ -116,4 +64,18 @@ public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl + * @author LiuJanJun + * @date 2020/9/25 5:00 下午 + */ + @Override + public List getIssueCount(String customerId, String monthId) { + return baseDao.getIssueCount(customerId, monthId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java index a36695b6b0..24811db736 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java @@ -5,12 +5,11 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.*; -import com.epmet.dao.stats.topic.FactTopicTotalAgencyDailyDao; import com.epmet.dao.stats.topic.FactTopicTotalGridDailyDao; -import com.epmet.dao.stats.user.FactParticipationUserGridDailyDao; +import com.epmet.dao.stats.user.FactRegUserGridDailyDao; import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.service.stats.ScreenCentralZoneDataExtractService; import lombok.extern.slf4j.Slf4j; @@ -35,7 +34,7 @@ import java.util.stream.Collectors; public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZoneDataExtractService { @Autowired - private FactParticipationUserGridDailyDao factParticipationUserGridDailyDao; + private FactRegUserGridDailyDao factRegUserGridDailyDao; @Autowired private FactGroupGridDailyDao factGroupGridDailyDao; @Autowired @@ -63,20 +62,22 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon //1.查询用户与党员数据,判断dimId是否为昨天,如果根据这个dimId没有查询出结果,则取前天的数据 //如果还是查不出数据,继续向下执行,这部分数据设置默认值 + + //注册用户数 List result = - factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); if(CollectionUtils.isEmpty(result)){ if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ - result = factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + result = factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); } if(null == result) result = new LinkedList<>(); } List gridUserResult = - factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); if(CollectionUtils.isEmpty(gridUserResult)){ if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ - gridUserResult = factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + gridUserResult = factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); } } if(!CollectionUtils.isEmpty(gridUserResult)){ @@ -145,15 +146,22 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon gridProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); } } - Map projectMap = agencyProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal)); - projectMap.putAll(gridProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal))); + Map projectMap = agencyProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getProjectTotal)); + projectMap.putAll(gridProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getProjectTotal))); result.forEach(o -> { String orgId = o.getOrgId(); - o.setGroupTotal(groupMap.get(orgId)); - o.setTopicTotal(topicMap.get(orgId)); - o.setIssueTotal(issueMap.get(orgId)); - o.setProjectTotal(projectMap.get(orgId)); + Integer count = groupMap.get(orgId); + o.setGroupTotal(null == count ? NumConstant.ZERO : count); + + count = topicMap.get(orgId); + o.setTopicTotal(null == count ? NumConstant.ZERO : count); + + count = issueMap.get(orgId); + o.setIssueTotal(null == count ? NumConstant.ZERO : count); + + count = projectMap.get(orgId); + o.setProjectTotal(null == count ? NumConstant.ZERO : count); o.setDataEndTime(dimId); }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java index 29521f2f2c..767af842b0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -3,6 +3,7 @@ package com.epmet.service.user; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.stats.user.result.UserStatisticalData; +import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -65,4 +66,13 @@ public interface UserService { * @Date 2020/9/21 16:44 **/ List getGridRegUserIds(String customerId, String gridId); + + /** + * @Description 获取客户下的网格注册居民 + * @param customerId + * @return + * @author wangc + * @date 2020.09.25 13:54 + **/ + List getRegisteredUserList(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index 12616b584c..faf43458cd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.dto.extract.result.UserPartyResultDTO; import com.epmet.dto.stats.user.*; import com.epmet.dto.stats.user.result.UserStatisticalData; import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.service.user.UserService; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; @@ -23,7 +24,6 @@ import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.text.NumberFormat; -import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -357,10 +357,6 @@ public class UserServiceImpl implements UserService { dataPacket.setPartiAgencyDailyList(list); } - - - - FactRegUserAgencyMonthlyDTO regAgencyM = new FactRegUserAgencyMonthlyDTO(); regAgencyM.setCustomerId(customerId); regAgencyM.setAgencyId(agencyId); @@ -695,32 +691,9 @@ public class UserServiceImpl implements UserService { } - } - public static void main(String[] args) { - - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(new Date()); - //calendar.set(Calendar.DAY_OF_MONTH, 1); - calendar.set(Calendar.HOUR_OF_DAY, 0); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - System.out.println(format.format(calendar.getTime())); - - - - calendar.setTime(calendar.getTime()); - calendar.add(Calendar.DATE, -1); - System.out.println(calendar.getTime()); - System.out.println(format.format(calendar.getTime())); - System.out.println(format2.format(calendar.getTime())); - } - - /** * @return java.util.List * @param customerId @@ -735,4 +708,25 @@ public class UserServiceImpl implements UserService { return userDao.selectGridRegUserIds(customerId,gridId); } + /** + * @Description 获取客户下的网格注册居民 + * @param customerId + * @return + * @author wangc + * @date 2020.09.25 13:54 + **/ + @Override + public List getRegisteredUserList(String customerId) { + List userList = userDao.selectRegisteredUserByCustomerId(customerId); + List partyList = userDao.selectPartymembersByCustomerId(customerId); + if(!CollectionUtils.isEmpty(userList)){ + userList.forEach(user -> { + if(partyList.contains(user.getUserId())){ + user.setPartyFlag(NumConstant.ONE); + } + }); + } + return userList; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml index 23659b879a..734f088d09 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml @@ -93,4 +93,30 @@ AND CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 00e1e590bb..38fa735f61 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -187,4 +187,69 @@ ORDER BY project.ID,score DESC + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 6129ab0f2f..5b9c58b5ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -178,4 +178,108 @@ and t1.CLOSED_STATUS=#{closedStatus} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml index e29b35bfb5..0c1010e48c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml @@ -48,7 +48,8 @@ SELECT f.CUSTOMER_ID, f.ORG_ID AS "agencyId", - SUM( TOTAL_PERIOD ) AS "sum", + SUM( TIMESTAMPDIFF( MINUTE, ( DATE_FORMAT( f.INFORMED_DATE, '%Y-%m-%d %H:%i' )), + ( DATE_FORMAT( f.PERIOD_TILL_REPLY_FIRSTLY, '%Y-%m-%d %H:%i' )) ) ) AS "sum", COUNT( f.ID ) AS "count" FROM fact_origin_project_org_period_daily f @@ -57,7 +58,7 @@ WHERE f.ORG_TYPE = #{orgType} AND DATE_FORMAT(INFORMED_DATE, '%Y%m') = #{monthId} - AND TOTAL_PERIOD != 0 + AND PERIOD_TILL_REPLY_FIRSTLY IS NOT NULL AND f.CUSTOMER_ID = #{customerId} GROUP BY f.CUSTOMER_ID, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml index 31b2bc1772..4e6dd8a925 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml @@ -106,7 +106,7 @@ WHERE T1.DEL_FLAG = '0' AND T1.CUSTOMER_ID = #{customerId} - AND m.CREATE_TOPIC_USER_IS_PARTY='1' + AND t1.CREATE_TOPIC_USER_IS_PARTY='1' AND T1.GRID_ID=#{gridId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml index 8fbb50a81d..bf0cfd3d51 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml @@ -148,4 +148,18 @@ ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index 4644c01b11..dfdf6c3b59 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -115,4 +115,17 @@ AND customer_id = #{customerId} AND month_id = #{monthId} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index df9a6fd514..1c1907e4a7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -320,4 +320,20 @@ del_flag = '0' AND CUSTOMER_ID = #{customerId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml index 459e873378..ae09cefb52 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml @@ -312,4 +312,19 @@ del_flag = '0' AND CUSTOMER_ID = #{customerId} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml index a85df25770..2b70609ca3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml @@ -8,6 +8,23 @@ where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} limit 1000; + + delete from screen_govern_rank_data + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + + and ORG_TYPE=#{orgType} + + + and + ( + + ORG_ID = #{orgId} + + ) + + limit #{deleteSize} + + SELECT + ORG_ID, + ORGANIZE_COUNT, + JOIN_USER_COUNT + FROM + screen_party_branch_data + WHERE + DEL_FLAG = '0' + AND TYPE = 'voluntaryservice' + AND CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + AND + ( + + ORG_ID = #{gridId} + + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml index 20d7c3f7e7..f2c7adcb3d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml @@ -13,7 +13,6 @@ delete from screen_party_link_masses_data where CUSTOMER_ID = #{customerId} - and DATA_END_TIME = #{monthId} and ( diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml index d4089fcc30..6ca1f5da66 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml @@ -9,6 +9,13 @@ limit 1000; + + delete from screen_party_user_rank_data + where CUSTOMER_ID = #{customerId} + AND DATA_END_TIME = #{dateId} + limit 1000; + + insert into screen_party_user_rank_data ( @@ -59,4 +66,56 @@ + + insert into screen_party_user_rank_data + ( + ID, + CUSTOMER_ID, + GRID_ID, + GRID_NAME, + ORG_ID, + ORG_NAME, + PARTY_FLAG, + USER_ID, + SURNAME, + `NAME`, + USER_NAME, + POINT_TOTAL, + INDEX_SCORE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME, + ALL_PARENT_IDS + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.gridId}, + #{item.gridName}, + #{item.orgId}, + #{item.orgName}, + #{item.partyFlag}, + #{item.userId}, + #{item.surname}, + #{item.name}, + #{item.userName}, + #{item.pointTotal}, + #{item.indexScore}, + '0', + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now(), + #{item.dataEndTime}, + #{item.allParentIds} + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml index ea26569ba8..3b5bc0edcf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml @@ -32,4 +32,32 @@ vi.USER_ID =#{userId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml new file mode 100644 index 0000000000..ae81f1cbe2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml @@ -0,0 +1,24 @@ + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml index 41ce69835f..ea0d0fc48b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml @@ -74,8 +74,10 @@ cg.ID as GRID_ID, cg.PID as AGENCY_ID, ca.PID AS PID, - CG.CUSTOMER_ID, - cg.PIDS as PIDS + cg.CUSTOMER_ID, + cg.PIDS as PIDS, + cg.GRID_NAME, + ca.ORGANIZATION_NAME as ORG_NAME FROM customer_grid cg LEFT JOIN customer_agency ca ON ( cg.PID = CA.ID ) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/point/UserPointDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/point/UserPointDao.xml new file mode 100644 index 0000000000..418d4dd49f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/point/UserPointDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml index c8e631ed88..7b4c669324 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml @@ -80,11 +80,10 @@ + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml index 2837f9c4a1..96e16db5be 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml @@ -121,42 +121,5 @@ AND DATE_ID = #{dateId} - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml index f8d85b7ab9..855007785a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml @@ -106,4 +106,47 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 03f525d12d..55bc599470 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -459,6 +459,8 @@ + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx index 592e740466..7f624f10bb 100644 Binary files a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx and b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx differ diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/FactOriginExtractTaskService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/FactOriginExtractTaskService.java index 59ce874166..b41295af10 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/FactOriginExtractTaskService.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/FactOriginExtractTaskService.java @@ -2,7 +2,7 @@ package com.epmet.service; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; /** * desc: 业务数据抽取到统计库服务类 @@ -19,5 +19,5 @@ public interface FactOriginExtractTaskService { * @date: 2020/6/22 9:09 * @author: jianjun liu */ - Result factOriginExtractJob(ExtractFormDTO formDTO); + Result factOriginExtractJob(ExtractOriginFormDTO formDTO); } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/FactOriginExtractTaskServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/FactOriginExtractTaskServiceImpl.java index 9dfed79a57..41244194c0 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/FactOriginExtractTaskServiceImpl.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/FactOriginExtractTaskServiceImpl.java @@ -1,7 +1,7 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.feign.DataStatisticalOpenFeignClient; import com.epmet.service.FactOriginExtractTaskService; import org.springframework.beans.factory.annotation.Autowired; @@ -24,7 +24,7 @@ public class FactOriginExtractTaskServiceImpl implements FactOriginExtractTaskSe * @author: jianjun liu */ @Override - public Result factOriginExtractJob(ExtractFormDTO formDTO) { + public Result factOriginExtractJob(ExtractOriginFormDTO formDTO) { return dataStatisticalOpenFeignClient.factOriginExtractAll(formDTO); } } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java index 0566277dc5..963045ec79 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java @@ -2,7 +2,7 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.feign.DataStatisticalOpenFeignClient; import com.epmet.service.ScreenExtractTaskService; import lombok.extern.slf4j.Slf4j; @@ -24,10 +24,10 @@ public class ScreenExtractTaskServiceImpl implements ScreenExtractTaskService { @Override public Result screenExtractDaily(String params) { - ExtractFormDTO extractFormDTO = new ExtractFormDTO(); + ExtractOriginFormDTO extractOriginFormDTO = new ExtractOriginFormDTO(); if (StringUtils.isNotBlank(params)) { - extractFormDTO = JSON.parseObject(params, ExtractFormDTO.class); + extractOriginFormDTO = JSON.parseObject(params, ExtractOriginFormDTO.class); } - return dataStatisticalOpenFeignClient.extractDailyAll(extractFormDTO); + return dataStatisticalOpenFeignClient.extractDailyAll(extractOriginFormDTO); } } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/FactOriginExtractTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/FactOriginExtractTask.java index 51d4a847bc..92f58cf22b 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/FactOriginExtractTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/FactOriginExtractTask.java @@ -3,7 +3,7 @@ package com.epmet.task; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; -import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.service.FactOriginExtractTaskService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -24,18 +24,18 @@ public class FactOriginExtractTask implements ITask { @Override public void run(String params) { - logger.info("FactOriginExtractTask定时任务正在执行,参数为:{}", params); - ExtractFormDTO formDTO = new ExtractFormDTO(); - if (StringUtils.isNotBlank(params)) { - formDTO = JSON.parseObject(params, ExtractFormDTO.class); - } - Result result = factOriginExtractTaskService.factOriginExtractJob(formDTO); - if (result.success()) { - logger.info("FactOriginExtractTask定时任务执行成功"); - } else { - logger.error("FactOriginExtractTask定时任务执行失败:" + result.getMsg()); - } - } + logger.info("FactOriginExtractTask定时任务正在执行,参数为:{}", params); + ExtractOriginFormDTO formDTO = new ExtractOriginFormDTO(); + if (StringUtils.isNotBlank(params)) { + formDTO = JSON.parseObject(params, ExtractOriginFormDTO.class); + } + Result result = factOriginExtractTaskService.factOriginExtractJob(formDTO); + if (result.success()) { + logger.info("FactOriginExtractTask定时任务执行成功"); + } else { + logger.error("FactOriginExtractTask定时任务执行失败:" + result.getMsg()); + } + } public static void main(String[] args) { StatsFormDTO formDTO = new StatsFormDTO();