From 638481baf17965767f2574beba80f1a1c5116761 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 24 Sep 2020 09:36:48 +0800 Subject: [PATCH 01/23] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E6=83=85=E5=86=B5=E6=8A=BD=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PartyBaseInfoServiceImpl.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java index 050b8df4ce..f3c758df72 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java @@ -63,24 +63,30 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { public Boolean statsPartyMemberBaseInfoToScreen(String customerId, String dateId) { List agencyIdList = agencyService.selectAllAgencyId(customerId); if (!CollectionUtils.isEmpty(agencyIdList)){ + // 根据组织级别分组 Map> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel)); if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){ + // 社区级别 List customerGridInfoList = groupByLevel.get(ScreenConstant.COMMUNITY); disPose(customerGridInfoList,true,customerId,dateId); } if (groupByLevel.containsKey(ScreenConstant.STREET)){ + // 街道级别 List customerGridInfoList = groupByLevel.get(ScreenConstant.STREET); disPose(customerGridInfoList,false,customerId,dateId); } if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){ + // 区级 List customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT); disPose(customerGridInfoList,false,customerId,dateId); } if (groupByLevel.containsKey(ScreenConstant.CITY)){ + // 市级 List customerGridInfoList = groupByLevel.get(ScreenConstant.CITY); disPose(customerGridInfoList,false,customerId,dateId); } if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){ + // 省级 List customerGridInfoList = groupByLevel.get(ScreenConstant.PROVINCE); disPose(customerGridInfoList,false,customerId,dateId); } @@ -96,13 +102,16 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { */ public void disPose(List agencyIdList, Boolean isGrid, String customerId, String dateId){ if (!CollectionUtils.isEmpty(agencyIdList)){ + // 网格ID或机关Id List orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); List result = new ArrayList<>(); if (isGrid == true){ + // 是 community 级别,子级为gridId List userCountList = userGridDailyService.selectUserCount(customerId, dateId); agencyIdList.forEach(agency -> { // 1. 处理社区下的所有网格中的党员信息 String agencyId = agency.getAgencyId(); + // 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId) Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); List gridIds = (List) agencyMap.get(agencyId); orgIds.addAll(gridIds); @@ -140,7 +149,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { }); } }); - // 2. 处理社区级别的党员信息 + // 2. 处理社区级别的党员信息(因为网格级别的已算出,社区级别直接累加) Map> groupByAgency = result.stream().collect(Collectors.groupingBy(PartyBaseInfoFormDTO::getParentId)); groupByAgency.forEach((commAgencyId,party) -> { PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); @@ -163,8 +172,10 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { }); delAndInsert(result,customerId,dateId,orgIds); }else { + // 级别为 street,district,city,province agencyIdList.forEach(agency -> { String agencyId = agency.getAgencyId(); + // 查询下级机关的党员信息,直接累加 List partyInfoList = cpcBaseDataService.selectPartyInfo(customerId, dateId, agencyId); if (!CollectionUtils.isEmpty(partyInfoList)){ PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); @@ -207,6 +218,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { int birthDayMonth = birth.getMonthValue(); int birthDayOfMonth = birth.getDayOfMonth(); int age = nowYear - birthDayYear; + // 当前月小于出生年的月份 或者 当前月等于出生年的月 并且 当前日小于出生年的日,就是不满一岁 if (nowMonth < birthDayMonth || (nowMonth == birthDayMonth && nowDayOfMonth < birthDayOfMonth)) { age--; } @@ -223,6 +235,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { */ public Integer disposeAgeArea(List partyMemberInfoList, Integer startAge,Integer endAge ){ if (!CollectionUtils.isEmpty(partyMemberInfoList)){ + // 计算大于多少岁并小于多少岁的人 List collect = partyMemberInfoList.stream().filter(p -> p.getAge() >= startAge).filter(p -> p.getAge() <= endAge).collect(Collectors.toList()); return collect.size(); } @@ -241,8 +254,10 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { if (!CollectionUtils.isEmpty(partyMemberInfoList)){ List collect = new ArrayList<>(); if (isGreater == true){ + // 大于 collect = partyMemberInfoList.stream().filter(p -> p.getAge() > age).collect(Collectors.toList()); }else { + // 小于 collect = partyMemberInfoList.stream().filter(p -> p.getAge() < age).collect(Collectors.toList()); } return collect.size(); @@ -260,10 +275,13 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { */ @Transactional(rollbackFor = Exception.class) public void delAndInsert(List result, String customerId, String dateId, List orgIds){ + // 查询客户下所有的agency List partyBaseInfoList = agencyService.selectAllAgencyIdToParty(customerId,dateId); + // 查询客户下所有的grid List resultList = gridService.selectAllGridIdToParty(customerId, dateId); resultList.addAll(partyBaseInfoList); List finalResult = new ArrayList<>(); + // 因为是根据级别来删除,插入,所以把需要操作的orgIds单独出来 resultList.forEach(rl -> { orgIds.forEach(orgId -> { if (rl.getOrgId().equals(orgId)){ From 42c7b6fd079a187ed8e060c8d434bc8f623bd4d7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 24 Sep 2020 10:33:13 +0800 Subject: [PATCH 02/23] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E6=83=85=E5=86=B5=E6=8A=BD=E5=8F=96=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/DataStatisticalOpenFeignClient.java | 9 ++ ...ataStatisticalOpenFeignClientFallBack.java | 5 ++ .../ScreenExtractDailyController.java | 35 ++++++++ .../toscreen/ScreenExtractDailyService.java | 19 +++++ .../impl/ScreenExtractDailyServiceImpl.java | 85 +++++++++++++++++++ .../service/ScreenExtractTaskService.java | 13 +++ .../impl/ScreenExtractTaskServiceImpl.java | 33 +++++++ .../epmet/task/ScreenExtractDailyTask.java | 33 +++++++ 8 files changed, 232 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractDailyServiceImpl.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ScreenExtractTaskService.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ScreenExtractDailyTask.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 72de92dd19..520b6bee09 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -220,4 +220,13 @@ public interface DataStatisticalOpenFeignClient { */ @PostMapping("/data/stats/eidim/init-all") Result initAllEIDims(); + + /** + * @Description 抽取数据到大屏【天】 + * @param extractFormDTO + * @author zxc + * @date 2020/9/24 10:15 上午 + */ + @PostMapping(value = "/data/stats/screenextract/extractdailyall") + Result extractDailyAll(@RequestBody(required = false) ExtractFormDTO extractFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index d33250bbab..8c5e2eafff 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -212,4 +212,9 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result initAllEIDims() { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "initAllEIDims"); } + + @Override + public Result extractDailyAll(ExtractFormDTO extractFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractDailyAll",extractFormDTO); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java new file mode 100644 index 0000000000..22da2fb578 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java @@ -0,0 +1,35 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractDailyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author zxc + * @DateTime 2020/9/24 9:42 上午 + */ +@RestController +@RequestMapping("screenextract") +public class ScreenExtractDailyController { + + @Autowired + private ScreenExtractDailyService screenExtractDailyService; + + /** + * @Description 抽取数据到大屏【天】 + * @param extractFormDTO + * @author zxc + * @date 2020/9/24 10:15 上午 + */ + @PostMapping("extractdailyall") + public Result screenExtractDaily(@RequestBody ExtractFormDTO extractFormDTO){ + screenExtractDailyService.extractAll(extractFormDTO); + return new Result(); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractDailyService.java new file mode 100644 index 0000000000..3545461a59 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractDailyService.java @@ -0,0 +1,19 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +import com.epmet.dto.extract.form.ExtractFormDTO; + +/** + * @Author zxc + * @DateTime 2020/9/24 9:57 上午 + */ +public interface ScreenExtractDailyService { + + /** + * @Description 抽取数据到大屏【天】 + * @param extractFormDTO + * @author zxc + * @date 2020/9/24 10:15 上午 + */ + void extractAll(ExtractFormDTO extractFormDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractDailyServiceImpl.java new file mode 100644 index 0000000000..13a00e2506 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractDailyServiceImpl.java @@ -0,0 +1,85 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; +import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractDailyService; +import com.epmet.service.stats.DimCustomerService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/24 9:57 上午 + */ +@Service +@Slf4j +public class ScreenExtractDailyServiceImpl implements ScreenExtractDailyService { + + @Autowired + private DimCustomerService dimCustomerService; + @Autowired + private PartyBaseInfoService partyBaseInfoService; + @Autowired + private PioneerDataExtractService pioneerDataExtractService; + + /** + * @Description 抽取数据到大屏【天】 + * @param extractFormDTO + * @author zxc + * @date 2020/9/24 10:15 上午 + */ + @Override + public void extractAll(ExtractFormDTO extractFormDTO) { + List customerIds = new ArrayList<>(); + if (StringUtils.isNotBlank(extractFormDTO.getCustomerId())){ + customerIds.add(extractFormDTO.getCustomerId()); + }else { + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); + } + if (!CollectionUtils.isEmpty(customerIds)){ + customerIds.forEach(customerId -> { + if (StringUtils.isNotBlank(extractFormDTO.getStartDate()) && StringUtils.isNotBlank(extractFormDTO.getEndDate())){ + List daysBetween = DateUtils.getDaysBetween(extractFormDTO.getStartDate(), extractFormDTO.getEndDate()); + daysBetween.forEach(dateId -> { + extractDaily(customerId,dateId); + }); + }else if (StringUtils.isNotBlank(extractFormDTO.getDateId())){ + extractDaily(customerId,extractFormDTO.getDateId()); + }else { + String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", ""); + extractDaily(customerId,dateId); + } + }); + } + + } + + /** + * @Description 按天计算 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/24 10:16 上午 + */ + public void extractDaily(String customerId,String dateId){ + partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId); + pioneerDataExtractService.extractGridPioneerData(customerId,dateId); + pioneerDataExtractService.extractCommunityPioneerData(customerId,dateId); + pioneerDataExtractService.extractStreetPioneerData(customerId,dateId); + pioneerDataExtractService.extractDistrictPioneerData(customerId,dateId); + pioneerDataExtractService.extractCityPioneerData(customerId,dateId); + pioneerDataExtractService.extractProvincePioneerData(customerId,dateId); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ScreenExtractTaskService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ScreenExtractTaskService.java new file mode 100644 index 0000000000..5e144642ed --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ScreenExtractTaskService.java @@ -0,0 +1,13 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +/** + * @Author zxc + * @DateTime 2020/9/24 10:21 上午 + */ +public interface ScreenExtractTaskService { + + Result screenExtractDaily(String params); + +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java new file mode 100644 index 0000000000..0566277dc5 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ScreenExtractTaskServiceImpl.java @@ -0,0 +1,33 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.ScreenExtractTaskService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Author zxc + * @DateTime 2020/9/24 10:22 上午 + */ +@Service +@Slf4j +public class ScreenExtractTaskServiceImpl implements ScreenExtractTaskService { + + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + + @Override + public Result screenExtractDaily(String params) { + ExtractFormDTO extractFormDTO = new ExtractFormDTO(); + if (StringUtils.isNotBlank(params)) { + extractFormDTO = JSON.parseObject(params, ExtractFormDTO.class); + } + return dataStatisticalOpenFeignClient.extractDailyAll(extractFormDTO); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ScreenExtractDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ScreenExtractDailyTask.java new file mode 100644 index 0000000000..3e5c130e1a --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ScreenExtractDailyTask.java @@ -0,0 +1,33 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.ScreenExtractTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @DateTime 2020/9/24 10:26 上午 + */ +@Component("screenExtractDailyTask") +public class ScreenExtractDailyTask implements ITask{ + + @Autowired + private ScreenExtractTaskService screenExtractTaskService; + + private Logger logger = LoggerFactory.getLogger(getClass()); + + + @Override + public void run(String params) { + logger.info("ScreenExtractDailyTask定时任务正在执行,参数为:{}", params); + Result result = screenExtractTaskService.screenExtractDaily(params); + if (result.success()){ + logger.info("ScreenExtractDailyTask定时任务执行成功"); + }else { + logger.error("ScreenExtractDailyTask定时任务执行失败:" + result.getMsg()); + } + } +} From 51c6fe5afc6f11498338c9150825b4d92e2472e5 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 24 Sep 2020 10:45:11 +0800 Subject: [PATCH 03/23] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E6=83=85=E5=86=B5=E6=8A=BD=E5=8F=96=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/ScreenExtractDailyController.java | 6 +++--- ...enExtractDailyService.java => ScreenExtractService.java} | 4 ++-- .../toscreen/impl/PioneerDataExtractServiceImpl.java | 2 ++ ...tDailyServiceImpl.java => ScreenExtractServiceImpl.java} | 6 +++--- 4 files changed, 10 insertions(+), 8 deletions(-) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/{ScreenExtractDailyService.java => ScreenExtractService.java} (77%) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/{ScreenExtractDailyServiceImpl.java => ScreenExtractServiceImpl.java} (95%) 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 22da2fb578..2f81eeadc2 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 @@ -2,7 +2,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.extract.form.ExtractFormDTO; -import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractDailyService; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController; public class ScreenExtractDailyController { @Autowired - private ScreenExtractDailyService screenExtractDailyService; + private ScreenExtractService screenExtractService; /** * @Description 抽取数据到大屏【天】 @@ -28,7 +28,7 @@ public class ScreenExtractDailyController { */ @PostMapping("extractdailyall") public Result screenExtractDaily(@RequestBody ExtractFormDTO extractFormDTO){ - screenExtractDailyService.extractAll(extractFormDTO); + screenExtractService.extractDailyAll(extractFormDTO); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java similarity index 77% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractDailyService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java index 3545461a59..70ff60bff3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java @@ -6,7 +6,7 @@ import com.epmet.dto.extract.form.ExtractFormDTO; * @Author zxc * @DateTime 2020/9/24 9:57 上午 */ -public interface ScreenExtractDailyService { +public interface ScreenExtractService { /** * @Description 抽取数据到大屏【天】 @@ -14,6 +14,6 @@ public interface ScreenExtractDailyService { * @author zxc * @date 2020/9/24 10:15 上午 */ - void extractAll(ExtractFormDTO extractFormDTO); + void extractDailyAll(ExtractFormDTO extractFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java index e363b39646..9f81e5df72 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 @@ -11,6 +11,7 @@ import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractServ import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService; import com.epmet.service.stats.DimCustomerPartymemberService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; @@ -23,6 +24,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/9/22 11:25 */ +@Service public class PioneerDataExtractServiceImpl implements PioneerDataExtractService { @Autowired diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java similarity index 95% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractDailyServiceImpl.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 13a00e2506..a46d3d0d58 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -5,7 +5,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.extract.form.ExtractFormDTO; import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService; -import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractDailyService; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService; import com.epmet.service.stats.DimCustomerService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -23,7 +23,7 @@ import java.util.List; */ @Service @Slf4j -public class ScreenExtractDailyServiceImpl implements ScreenExtractDailyService { +public class ScreenExtractServiceImpl implements ScreenExtractService { @Autowired private DimCustomerService dimCustomerService; @@ -39,7 +39,7 @@ public class ScreenExtractDailyServiceImpl implements ScreenExtractDailyService * @date 2020/9/24 10:15 上午 */ @Override - public void extractAll(ExtractFormDTO extractFormDTO) { + public void extractDailyAll(ExtractFormDTO extractFormDTO) { List customerIds = new ArrayList<>(); if (StringUtils.isNotBlank(extractFormDTO.getCustomerId())){ customerIds.add(extractFormDTO.getCustomerId()); From 99e6d6b6653cf8310bb4025c82004c2d7a21ad9f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 24 Sep 2020 11:08:48 +0800 Subject: [PATCH 04/23] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E6=83=85=E5=86=B5=E6=8A=BD=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stats/impl/DimCustomerPartymemberServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java index a6b02ff384..539524e174 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java @@ -49,6 +49,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -185,7 +186,10 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl selectPartyMemberInfo(String customerId, List gridIds) { - return baseDao.selectPartyMemberInfo(customerId, gridIds); + if (!CollectionUtils.isEmpty(gridIds)){ + return baseDao.selectPartyMemberInfo(customerId, gridIds); + } + return new ArrayList<>(); } /** From 463a9bbbd22f54731d588ac84a443564b0ab8504 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 24 Sep 2020 11:11:46 +0800 Subject: [PATCH 05/23] =?UTF-8?q?=E6=94=BE=E5=BC=80=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml index 0772838230..ccb02b714f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml @@ -189,7 +189,7 @@ thread: queueCapacity: @thread.pool.queue-capacity@ keepAlive: @thread.pool.keep-alive@ -#dingTalk: -# robot: -# webHook: @dingTalk.robot.webHook@ -# secret: @dingTalk.robot.secret@ +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ From 044799cf0ecc03f5f2850fb54b6e81f98613ca5d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 24 Sep 2020 13:13:10 +0800 Subject: [PATCH 06/23] =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=A8=A1=E8=8C=83?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8A=BD=E5=8F=96=E5=88=B0=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E8=A1=A8screen=5Fpioneer=5FdataV0.4=E7=A4=BE=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/org/GridInfoDTO.java | 1 + .../extract/FactOriginIssueMainDailyDao.java | 9 +- .../FactOriginProjectMainDailyDao.java | 8 +- .../extract/FactOriginTopicMainDailyDao.java | 4 +- .../screen/ScreenPioneerDataDao.java | 6 +- .../dao/stats/DimCustomerPartymemberDao.java | 12 +- .../FactOriginIssueMainDailyService.java | 19 +-- .../FactOriginProjectMainDailyService.java | 2 +- .../FactOriginTopicMainDailyService.java | 5 +- .../FactOriginIssueMainDailyServiceImpl.java | 22 +-- ...FactOriginProjectMainDailyServiceImpl.java | 4 +- .../FactOriginTopicMainDailyServiceImpl.java | 7 +- .../toscreen/PioneerDataExtractService.java | 8 +- .../impl/PioneerDataExtractServiceImpl.java | 142 +++++++++++++----- .../impl/ScreenPioneerDataServiceImpl.java | 10 +- .../impl/ShiBeiScreenCollServiceImpl.java | 2 +- .../stats/DimCustomerPartymemberService.java | 3 +- .../DimCustomerPartymemberServiceImpl.java | 18 ++- .../extract/FactOriginIssueMainDailyDao.xml | 24 ++- .../extract/FactOriginProjectMainDailyDao.xml | 11 +- .../extract/FactOriginTopicMainDailyDao.xml | 11 +- .../screen/ScreenPioneerDataDao.xml | 20 ++- .../resources/mapper/org/CustomerGridDao.xml | 5 +- .../stats/DimCustomerPartymemberDao.xml | 11 ++ 24 files changed, 257 insertions(+), 107 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java index 991a132d09..06bc4d9cca 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java @@ -35,6 +35,7 @@ public class GridInfoDTO implements Serializable { /** * 所有上级组织ID,英文:隔开 + * agencyId的pids */ private String pids; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index 10be6f5bb3..52c6e71da3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -135,18 +135,19 @@ public interface FactOriginIssueMainDailyDao extends BaseDao partyMemberUserIds); /** - * @return int * @param customerId * @param gridId + * @return int * @author yinzuomei * @description 具体某个网格的话题数 * @Date 2020/9/23 14:23 **/ - int selectGridTopicTotalByGrid(@Param("customerId")String customerId, @Param("gridId")String gridId); + int selectGridOrCommunityTopicTotal(@Param("customerId") String customerId, @Param("gridId") String gridId, @Param("agencyId") String agencyId); /** * @return void diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java index becb9d1034..85d2777802 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java @@ -34,6 +34,9 @@ import java.util.List; @Mapper public interface ScreenPioneerDataDao extends BaseDao { + Integer deletePioneerDataByCustomerId(@Param("customerId") String customerId, + @Param("deleteSize") Integer deleteSize); + /** * 10、党建引领-先锋模范数据 * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 @@ -46,7 +49,8 @@ public interface ScreenPioneerDataDao extends BaseDao { Integer deletePioneerData(@Param("customerId") String customerId, @Param("orgType") String orgType, @Param("dataEndTime")String dataEndTime, - @Param("deleteSize") Integer deleteSize); + @Param("deleteSize") Integer deleteSize, + @Param("orgIds")List orgIds); /** * 10、党建引领-先锋模范数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java index 22129567a5..47d73efe9f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java @@ -76,8 +76,18 @@ public interface DimCustomerPartymemberDao extends BaseDao selectGridPartyMemberUserIds(@Param("customerId") String customerId, @Param("gridId")String gridId); + + /** + * @return java.util.List + * @param customerId + * @param communityId + * @author yinzuomei + * @description 社区内注册的党员 + * @Date 2020/9/24 10:22 + **/ + List selectCommunityPartyMemberUserIds(@Param("customerId") String customerId, @Param("communityId")String communityId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java index 7061178362..feaa5d6729 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java @@ -39,23 +39,24 @@ public interface FactOriginIssueMainDailyService extends BaseService partyMemberUserIds); + /** - * @return int + * @return java.lang.Integer * @param customerId * @param gridId * @author yinzuomei - * @description 具体某个网格的议题总数 - * @Date 2020/9/23 15:22 + * @description 网格内议题转项目数 + * @Date 2020/9/23 15:39 **/ - int getGridIssueTotalByGrid(String customerId, String gridId); + Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId,String communityId); /** - * @return java.lang.Integer + * @return int * @param customerId - * @param gridId + * @param communityId * @author yinzuomei - * @description 网格内议题转项目数 - * @Date 2020/9/23 15:39 + * @description 某个网格内或者社区内议题总数 + * @Date 2020/9/24 10:45 **/ - Integer getShiftProjectTotalByGrid(String customerId, String gridId); + int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index ea2679c372..95d0440870 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -173,5 +173,5 @@ public interface FactOriginProjectMainDailyService extends BaseService partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, gridId); + List partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "grid",gridId); //3、党员发布话题: @@ -71,12 +71,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setTopicRatio(BigDecimal.ZERO); } else { //当前网格内所有话题总数 - int gridTopicTotal = getGridTopicTotal(customerId, gridId); + int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId,null); entity.setTopicRatio(gridTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / gridTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } //当前网格内所有议题总数 - int gridIssueTotal = getGridIssueTotal(customerId, gridId); + int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId,null); if (gridIssueTotal != NumConstant.ZERO) { //5、党员发布议题 entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds)); @@ -87,36 +87,103 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setPublishIssueRatio(gridIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); //7、议题转项目数 - entity.setShiftProjectTotal(getGridShiftProjectTotal(customerId, gridId)); + entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId,null)); //8、议题转项目占比 : 占网格内议题总数的比率 entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } // 9、已解决项目 - entity.setResolvedProjectTotal(getGridClosedProjectTotal(customerId,gridId,"resolved")); + entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId,gridId,null,"resolved")); if(entity.getResolvedProjectTotal()==NumConstant.ZERO){ entity.setResolvedProjectRatio(BigDecimal.ZERO); }else{ // 10、占总结项目 - int closedProjectTotal=getGridClosedProjectTotal(customerId,gridId,null); + int closedProjectTotal=getGridOrCommunityClosedProjectTotal(customerId,gridId,null,null); entity.setResolvedProjectRatio(closedProjectTotal==NumConstant.ZERO?BigDecimal.ZERO:new BigDecimal(entity.getResolvedProjectTotal()/closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } }); screenPioneerDataService.delAndSavePioneerData(customerId, "grid", dateId, IndexCalConstant.DELETE_SIZE, gridList); } + @Override + public void extractCommunityPioneerData(String customerId, String dateId) { + //查询客户下所有的社区,初始数据值为0 + List communityList = screenPioneerDataService.initPioneerDataList(customerId, "agency", "community"); + if (CollectionUtils.isEmpty(communityList)) { + return; + } + communityList.forEach(entity -> { + entity.setDataEndTime(dateId); + String communityId = entity.getOrgId(); + //1、党员参与议事 todo + entity.setIssueTotal(NumConstant.ZERO); + //2、党员参与议事占比 todo + entity.setIssueRatio(BigDecimal.ZERO); + + //社区内的党员集合 + List partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "community",communityId); + + + //3、党员发布话题: + entity.setTopicTotal(getTopicTotal(customerId, partyMemberUserIds)); + //4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率 + if (entity.getTopicTotal() == NumConstant.ZERO) { + entity.setTopicRatio(BigDecimal.ZERO); + } else { + //当前社区内所有话题总数 + int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null,communityId); + entity.setTopicRatio(communityTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / communityTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + + //当前社区内所有议题总数 + int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null,communityId); + if (communityIssueTotal != NumConstant.ZERO) { + //5、党员发布议题 + entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds)); + //6、党员发布议题占比 : 占社区内所有议题的比率 + if (entity.getPublishIssueTotal() == NumConstant.ZERO) { + entity.setPublishIssueRatio(BigDecimal.ZERO); + } + entity.setPublishIssueRatio(communityIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + + //7、议题转项目数 + entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId,null, communityId)); + //8、议题转项目占比 : 占网格内议题总数的比率 + entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + + + // 9、已解决项目 + entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId,null,communityId,"resolved")); + if(entity.getResolvedProjectTotal()==NumConstant.ZERO){ + entity.setResolvedProjectRatio(BigDecimal.ZERO); + }else{ + // 10、占总结项目 + int closedProjectTotal=getGridOrCommunityClosedProjectTotal(customerId,null,communityId,null); + entity.setResolvedProjectRatio(closedProjectTotal==NumConstant.ZERO?BigDecimal.ZERO:new BigDecimal(entity.getResolvedProjectTotal()/closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + }); + screenPioneerDataService.delAndSavePioneerData(customerId, "agency", dateId, IndexCalConstant.DELETE_SIZE, communityList); + } + + @Override + public void extractexceptCommunityPioneerData(String customerId, String dateId) { + //todo + } + /** * @return java.lang.Integer * @param customerId * @param gridId + * @param communityId * @param closedStatus 结案状态:已解决 resolved,未解决 unresolved * @author yinzuomei * @description 网格内已解决项目 * @Date 2020/9/23 16:24 **/ - private Integer getGridClosedProjectTotal(String customerId, String gridId,String closedStatus) { - return factOriginProjectMainDailyService.getGridClosedProjectTotal(customerId,gridId,closedStatus); + private Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId,String communityId,String closedStatus) { + return factOriginProjectMainDailyService.getGridOrCommunityClosedProjectTotal(customerId,gridId,communityId,closedStatus); } /** @@ -135,18 +202,6 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, partyMemberUserIds); } - /** - * @param customerId - * @param gridId - * @return int - * @author yinzuomei - * @description 当前网格内,发布的话题总数 - * @Date 2020/9/23 14:18 - **/ - private int getGridTopicTotal(String customerId, String gridId) { - return factOriginTopicMainDailyService.calGridTopicTotalByGrid(customerId, gridId); - } - /** * @param customerId * @param partyMemberUserIds @@ -165,50 +220,55 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService /** * @param customerId * @param gridId - * @return int + * @return java.lang.Integer * @author yinzuomei - * @description 当前网格内所有议题总数 - * @Date 2020/9/23 15:21 + * @description 网格内议题转项目数 + * @Date 2020/9/23 15:38 **/ - private int getGridIssueTotal(String customerId, String gridId) { - return factOriginIssueMainDailyService.getGridIssueTotalByGrid(customerId, gridId); + private Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId, String communityId) { + return factOriginIssueMainDailyService.getGridOrCommunityShiftProjectTotal(customerId, gridId, communityId); } + + + /** + * @return int * @param customerId - * @param gridId - * @return java.lang.Integer + * @param communityId * @author yinzuomei - * @description 网格内议题转项目数 - * @Date 2020/9/23 15:38 + * @description + * @Date 2020/9/24 10:44 **/ - private Integer getGridShiftProjectTotal(String customerId, String gridId) { - return factOriginIssueMainDailyService.getShiftProjectTotalByGrid(customerId, gridId); + private int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId) { + return factOriginIssueMainDailyService.getGridOrCommunityIssueTotal(customerId, gridId,communityId); } - - @Override - public void extractCommunityPioneerData(String customerId, String dateId) { - + /** + * @param customerId + * @param communityId + * @return int + * @author yinzuomei + * @description 当前社区内所有话题总数 + * @Date 2020/9/24 10:32 + **/ + private int getGridOrCommunityTopicTotal(String customerId, String gridId, String communityId) { + return factOriginTopicMainDailyService.calGridOrCommunityTopicTotal(customerId, gridId, communityId); } - @Override + /*@Override public void extractStreetPioneerData(String customerId, String dateId) { - } @Override public void extractDistrictPioneerData(String customerId, String dateId) { - } @Override public void extractCityPioneerData(String customerId, String dateId) { - } @Override public void extractProvincePioneerData(String customerId, String dateId) { - - } + }*/ } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java index da031da750..d1ba5e11ef 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java @@ -27,6 +27,7 @@ import com.epmet.dao.evaluationindex.screen.ScreenPioneerDataDao; import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.ListUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -82,9 +83,16 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl entityList) { + if(CollectionUtils.isEmpty(entityList)){ + return; + } + List orgIds=new ArrayList<>(); + for(ScreenPioneerDataEntity entity:entityList){ + orgIds.add(entity.getOrgId()); + } int deleteNum; do { - deleteNum = baseDao.deletePioneerData(customerId, orgType, dataEndTime, deleteSize); + deleteNum = baseDao.deletePioneerData(customerId, orgType, dataEndTime, deleteSize,orgIds); } while (deleteNum != NumConstant.ZERO); List> partition = ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java index 3608048a66..4a5e9697fb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java @@ -448,7 +448,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenPioneerDataDao.deletePioneerData(customerId,null,null, IndexCalConstant.DELETE_SIZE); + deleteNum = screenPioneerDataDao.deletePioneerDataByCustomerId(customerId,IndexCalConstant.DELETE_SIZE); } while (deleteNum != NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java index 5dda2848cc..914ef6ead1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java @@ -125,9 +125,10 @@ public interface DimCustomerPartymemberService extends BaseService * @param customerId * @param gridId + * @type grid,community, agency * @author yinzuomei * @description 查询在本网格注册的党员id * @Date 2020/9/23 14:18 **/ - List getPartyMemberUserIds(String customerId, String gridId); + List getPartyMemberUserIds(String customerId, String type,String gridId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java index a6b02ff384..26480757da 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java @@ -49,6 +49,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -205,10 +206,10 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl * @author yinzuomei * @description 查询在本网格注册的党员id @@ -216,7 +217,16 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl getPartyMemberUserIds(String customerId, String gridId) { - return baseDao.selectGridPartyMemberUserIds(customerId,gridId); + public List getPartyMemberUserIds(String customerId, String type, String orgId) { + List partyMemberUserIds = new ArrayList<>(); + if ("grid".equals(type)) { + partyMemberUserIds = baseDao.selectGridPartyMemberUserIds(customerId, orgId); + } else if ("community".equals(type)) { + partyMemberUserIds = baseDao.selectCommunityPartyMemberUserIds(customerId, orgId); + } else if ("agency".equals(type)) { + //TODO + + } + return partyMemberUserIds; } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index f3e69ac3c8..11aef10958 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -190,8 +190,8 @@ t1.CREATE_TOPIC_USER_ID=#{userId} - - SELECT count( ID ) AS total FROM @@ -199,11 +199,16 @@ WHERE t1.DEL_FLAG = '0' AND t1.CUSTOMER_ID = #{customerId} - and t1.GRID_ID=#{gridId} + + and t1.GRID_ID=#{gridId} + + + and t1.AGENCY_ID=#{communityId} + - - SELECT count( ID ) AS total FROM @@ -211,7 +216,12 @@ WHERE t1.DEL_FLAG = '0' AND t1.CUSTOMER_ID = #{customerId} - and t1.GRID_ID=#{gridId} - AND T1.ISSUE_STATUS='shift_project' + AND T1.ISSUE_STATUS='shift_project' + + and t1.GRID_ID=#{gridId} + + + and t1.AGENCY_ID=#{communityId} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index a6aa5a8078..987eeed62b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -144,8 +144,8 @@ - - SELECT COUNT( 1 ) AS TOTAL FROM @@ -153,7 +153,12 @@ WHERE T1.DEL_FLAG = '0' AND T1.CUSTOMER_ID = #{customerId} - and t1.GRID_ID=#{gridId} + + and t1.GRID_ID=#{gridId} + + + and t1.AGENCY_ID=#{communityId} + and t1.CLOSED_STATUS=#{closedStatus} 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 3975a34a4c..8b332419f2 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 @@ -111,8 +111,8 @@ T1.CREATE_TOPIC_USER_ID=#{userId} - - SELECT count(T1.ID) AS TOTAL FROM @@ -120,7 +120,12 @@ WHERE T1.DEL_FLAG = '0' AND T1.CUSTOMER_ID = #{customerId} - AND T1.GRID_ID=#{gridId} + + AND T1.GRID_ID=#{gridId} + + + AND T1.AGENCY_ID=#{agencyId} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml index 64f19416a9..0902f55135 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml @@ -3,6 +3,12 @@ + + delete from screen_pioneer_data + where CUSTOMER_ID = #{customerId} + limit #{deleteSize} + + delete from screen_pioneer_data where CUSTOMER_ID = #{customerId} @@ -12,6 +18,14 @@ and DATA_END_TIME=#{dataEndTime} + + and + ( + + ORG_ID = #{orgId} + + ) + limit #{deleteSize} @@ -103,7 +117,7 @@ SELECT sca.CUSTOMER_ID, 'agency' AS ORG_TYPE, - sca.AGENCY_NAME AS ORG_ID, + sca.AGENCY_ID AS ORG_ID, sca.PID AS PARENT_ID, sca.AGENCY_NAME AS ORG_NAME, 0 as ISSUE_TOTAL, @@ -120,7 +134,9 @@ screen_customer_agency sca WHERE sca.DEL_FLAG = '0' - and sca.`LEVEL`=#{agencyLevel} + + and sca.`LEVEL`=#{agencyLevel} + AND sca.CUSTOMER_ID = #{customerId} 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 d1d1b9c5f4..7731b0ff6f 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 @@ -75,7 +75,10 @@ cg.PID as AGENCY_ID, ca.PID AS PID, CG.CUSTOMER_ID, - cg.PIDS + (case ca.PIDS WHEN CA.PIDS IS NULL THEN 0 + when length(CA.PIDS) <1 then 0 + ELSE CA.PIDS + END ) as PIDS 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/stats/DimCustomerPartymemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml index fd2a4713a1..8d5f3dc840 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml @@ -125,4 +125,15 @@ AND dcp.CUSTOMER_ID =#{customerId} and dcp.GRID_ID=#{gridId} + + + \ No newline at end of file From 6ec26edad96f47a47e76433712dc8946bec99056 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 24 Sep 2020 14:10:59 +0800 Subject: [PATCH 07/23] =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=A8=A1=E8=8C=83?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8A=BD=E5=8F=96=E5=88=B0=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E8=A1=A8screen=5Fpioneer=5FdataV0.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 2 +- .../screen/ScreenPioneerDataDao.java | 14 +++-- .../screen/ScreenPioneerDataEntity.java | 7 +++ .../screen/ScreenPioneerDataDao.xml | 52 ++++++++++++++----- 4 files changed, 58 insertions(+), 17 deletions(-) diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index 49dbbb94d5..76cfc7865d 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/epmet-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://192.168.1.130:3306/epmet_evaluation_index?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://192.168.1.130:3306/epmet_data_statistical?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: epmet_dba password: EpmEt-dbA-UsEr #oracle配置 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java index 85d2777802..14ffbe7c6e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java @@ -75,12 +75,20 @@ public interface ScreenPioneerDataDao extends BaseDao { /** * @return java.util.List * @param customerId - * @param agencyLevel * @author yinzuomei - * @description 初始化好orgType="agency"的插入对象 + * @description 初始化好社区, orgType="agency"的插入对象 * @Date 2020/9/22 15:03 **/ - List initAgencyPioneerDataList(@Param("customerId")String customerId, @Param("agencyLevel")String agencyLevel); + List initCommunityPioneerDataList(@Param("customerId")String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 初始化好非社区的, orgType="agency"的插入对象 + * @Date 2020/9/24 13:45 + **/ + List initExceptCommunityPioneerDataList(@Param("customerId")String customerId); /** * @return void diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java index a51b8b6449..c03d32f1df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java @@ -117,4 +117,11 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity { */ private String dataEndTime; + + /** + * + */ + private String pid; + private String agencyPids; + private String agencyPath; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml index 0902f55135..27a201b331 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml @@ -113,7 +113,7 @@ - SELECT sca.CUSTOMER_ID, 'agency' AS ORG_TYPE, @@ -121,22 +121,48 @@ sca.PID AS PARENT_ID, sca.AGENCY_NAME AS ORG_NAME, 0 as ISSUE_TOTAL, - 0 asISSUE_RATIO, - 0 asTOPIC_TOTAL, - 0 asTOPIC_RATIO, - 0 asPUBLISH_ISSUE_TOTAL, - 0 asPUBLISH_ISSUE_RATIO, - 0 asSHIFT_PROJECT_TOTAL, - 0 asSHIFT_PROJECT_RATIO, - 0 asRESOLVED_PROJECT_TOTAL, - 0 asRESOLVED_PROJECT_RATIO + 0 as ISSUE_RATIO, + 0 as TOPIC_TOTAL, + 0 as TOPIC_RATIO, + 0 as PUBLISH_ISSUE_TOTAL, + 0 as PUBLISH_ISSUE_RATIO, + 0 as SHIFT_PROJECT_TOTAL, + 0 as SHIFT_PROJECT_RATIO, + 0 as RESOLVED_PROJECT_TOTAL, + 0 as RESOLVED_PROJECT_RATIO + FROM + screen_customer_agency sca + WHERE + sca.DEL_FLAG = '0' + and sca.`LEVEL`='community' + AND sca.CUSTOMER_ID = #{customerId} + + + + From 2a73d876b0762cac38cf84dcd33e0bf1c4d3f46a Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 24 Sep 2020 14:34:27 +0800 Subject: [PATCH 08/23] =?UTF-8?q?=E8=87=AA=E8=BA=AB=E5=92=8C=E4=B8=8B?= =?UTF-8?q?=E7=BA=A7=E5=88=86=E6=95=B0=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/AgencySelfSubScoreDao.java | 2 +- .../indexcal/AgencySubScoreDao.java | 3 +- .../indexcal/CommunitySelfSubScoreDao.java | 2 +- .../indexcal/CommunitySubScoreDao.java | 2 +- .../indexcal/DeptSelfSubScoreDao.java | 39 +++++++ .../indexcal/DeptSubScoreDao.java | 9 +- .../indexcal/AgencySubScoreEntity.java | 5 + .../indexcal/DeptSelfSubScoreEntity.java | 100 ++++++++++++++++++ .../indexcal/impl/DeptScoreServiceImpl.java | 88 +++++++++++++-- .../IndexCalculateDistrictServiceImpl.java | 7 +- .../impl/IndexCalculateStreetServiceImpl.java | 5 +- .../indexcal/AgencySelfSubScoreDao.xml | 1 + .../indexcal/AgencySubScoreDao.xml | 1 + .../indexcal/CommunitySelfSubScoreDao.xml | 2 +- .../indexcal/CommunitySubScoreDao.xml | 2 +- .../indexcal/DeptSelfSubScoreDao.xml | 61 +++++++++++ .../indexcal/DeptSubScoreDao.xml | 22 ++++ 17 files changed, 330 insertions(+), 21 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSelfSubScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSelfSubScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSelfSubScoreDao.xml diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java index 9adf9fc179..366b23af58 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySelfSubScoreDao.java @@ -35,5 +35,5 @@ public interface AgencySelfSubScoreDao extends BaseDao int insertBatch(@Param("list") List list); - int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode); + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType, @Param("parentIndexCode") String parentIndexCode); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java index 3a28e2d908..be812e2ca4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java @@ -52,5 +52,6 @@ public interface AgencySubScoreDao extends BaseDao { */ Integer deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType, @Param("delNum") Integer delNum); - List selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("levelIndexPath") String levelIndexPath); + List selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("dataType") String dataType, @Param("allIndexCodePath") String allIndexCodePath); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java index 9827dbaa64..12e8631a77 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySelfSubScoreDao.java @@ -33,7 +33,7 @@ import java.util.List; @Mapper public interface CommunitySelfSubScoreDao extends BaseDao { - int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode); int insertBatch(@Param("list") List communitySelfSubScoreEntities); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java index ac850fc317..c9f7ca35b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java @@ -52,5 +52,5 @@ public interface CommunitySubScoreDao extends BaseDao selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("levelIndexPath") String levelIndexPath); + List selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allIndexCodePath") String allIndexCodePath); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSelfSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSelfSubScoreDao.java new file mode 100644 index 0000000000..a8b5b90a2b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSelfSubScoreDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.indexcal.DeptSelfSubScoreEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 社区相关 自身/下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-21 + */ +@Mapper +public interface DeptSelfSubScoreDao extends BaseDao { + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode); + + int insertBatch(@Param("list") List deptSelfSubScoreEntities); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java index fe388c6b6b..c9ec728209 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java @@ -22,7 +22,6 @@ import com.epmet.entity.evaluationindex.indexcal.DeptSubScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import javax.annotation.security.PermitAll; import java.util.List; /** @@ -54,7 +53,9 @@ public interface DeptSubScoreDao extends BaseDao { * @Date 2020/9/10 12:28 **/ int deleteBatches(@Param("customerId") String customerId, - @Param("monthId") String monthId, - @Param("allParentIndexCode") String allParentIndexCode, - @Param("deleteSize") Integer deleteSize); + @Param("monthId") String monthId, + @Param("allParentIndexCode") String allParentIndexCode, + @Param("deleteSize") Integer deleteSize); + + List selectSubListByPath(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allIndexCodePath") String allIndexCodePath); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java index 8b87b26a4e..3fc2a5888b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java @@ -96,4 +96,9 @@ public class AgencySubScoreEntity extends BaseEpmetEntity { * 权重(同一组权重总和=1) */ private BigDecimal weight; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSelfSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSelfSubScoreEntity.java new file mode 100644 index 0000000000..7e5395450f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSelfSubScoreEntity.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 区直部门相关 自身/下级分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-23 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_dept_self_sub_score") +public class DeptSelfSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 部门id + */ + private String deptId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 自身指标得分 + */ + private BigDecimal selfScore; + + /** + * 下级指标得分 + */ + private BigDecimal subScore; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; + */ + private String parentIndexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 自身指标权重 + */ + private BigDecimal selfWeight; + + /** + * 下级指标权重 + */ + private BigDecimal subWeight; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java index c9e0411462..483194cc01 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -27,13 +27,16 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; +import com.epmet.dao.evaluationindex.indexcal.DeptSelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.DeptSubScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyDao; +import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerDeptDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.DeotScore; import com.epmet.dto.indexcal.DeptScoreDetailDTO; import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.DeptSelfSubScoreEntity; import com.epmet.entity.evaluationindex.indexcal.DeptSubScoreEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; @@ -59,10 +62,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -91,6 +91,10 @@ public class DeptScoreServiceImpl extends BaseServiceImpl indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.QU_ZHI_BU_MEN.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关】指标权重信息不存在"); + } + indexList.forEach(index -> { + String levelIndexPath = index.getAllParentIndexCode().concat(StrConstant.COLON).concat(index.getIndexCode()); + //获取出指标之间的关系 + List selfSubIndexList = indexGroupDetailDao.selectSelfSubIndex(formDTO.getCustomerId(), levelIndexPath); + if (CollectionUtils.isEmpty(selfSubIndexList)) { + log.error("calculateSelfSubScore indexGroupDetailDao.selectSelfSubIndex return empty,customerId:{}", formDTO.getCustomerId()); + return; + } + //获取该能力下的分数 + List subScore = deptSubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath); + if (CollectionUtils.isEmpty(subScore)) { + log.error("calculateSelfSubScore communitySubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId()); + return; + } + Map> selfSubParentMap = new HashMap<>(); + selfSubParentMap.put("zishen", new HashSet<>()); + selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubIndexList.forEach(o -> { + //找出自身 和下级的指标 + if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { + selfSubParentMap.get("xiaji").add(o.getIndexCode()); + } else { + selfSubParentMap.get("zishen").add(o.getIndexCode()); + } + }); + Map insertMap = new HashMap<>(); + subScore.forEach(score -> { + String key = score.getAgencyId().concat(index.getIndexCode()); + DeptSelfSubScoreEntity scoreEntity = insertMap.get(key); + if (scoreEntity == null) { + scoreEntity = ConvertUtils.sourceToTarget(score, DeptSelfSubScoreEntity.class); + insertMap.put(key, scoreEntity); + scoreEntity.setSelfScore(new BigDecimal(0)); + scoreEntity.setSubScore(new BigDecimal(0)); + scoreEntity.setParentIndexCode(index.getIndexCode()); + scoreEntity.setSelfWeight(new BigDecimal(0)); + scoreEntity.setSubWeight(new BigDecimal(0)); + } + BigDecimal partScore = score.getScore().multiply(score.getWeight()); + if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) { + scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); + scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); + } else { + scoreEntity.setSelfScore(scoreEntity.getSelfScore().add(partScore)); + scoreEntity.setSelfWeight(scoreEntity.getSelfWeight().add(score.getWeight())); + } + log.debug("=====key" + key + ",grid:{},originScore:{},weight:{},finalScore:{},total", score.getAgencyId(), score.getScore(), score.getWeight(), partScore); + }); + deleteAndInsertSelfSubScore(formDTO, index.getIndexCode(), insertMap); + }); + } + + @Transactional(rollbackFor = Exception.class) + public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map insertMap) { + int effectRow = 0; + do { + deptSelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); + } while (effectRow > 0); + + deptSelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values())); + } + /** - * @return void * @param formDTO + * @return void * @author yinzuomei * @description 区直部门-党建能力分值计算 - * @Date 2020/9/10 17:21 + * @Date 2020/9/10 17:21 **/ private void calculateZhiLiNengLiScore(CalculateCommonFormDTO formDTO) { //获取区直部门的治理能力下,五级指标权重 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 0c5ecca06c..80b55fe7ad 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao; @@ -112,7 +113,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict private void calculateSelfSubScore(CalculateCommonFormDTO formDTO) { //todo 指标添加缓存 List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), - IndexCodeEnum.QU_ZHI_BU_MEN.getCode()); + IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); if (CollectionUtils.isEmpty(indexList)) { log.error("calculateSelfSubScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关】指标权重信息不存在"); @@ -126,7 +127,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return; } //获取该能力下的分数 - List subScore = agencySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath); + List subScore = agencySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.DISTRICT, levelIndexPath); if (CollectionUtils.isEmpty(subScore)) { log.error("calculateSelfSubScore communitySubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId()); return; @@ -173,7 +174,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map insertMap) { int effectRow = 0; do { - agencySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); + agencySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.DISTRICT, indexCode); } while (effectRow > 0); agencySelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values())); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index c5099fe557..3e77e7289b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao; @@ -129,7 +130,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return; } //获取该能力下的分数 - List subScore = agencySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), levelIndexPath); + List subScore = agencySubScoreDao.selectSubListByPath(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.STREET, levelIndexPath); if (CollectionUtils.isEmpty(subScore)) { log.error("calculateSelfSubScore communitySubScoreDao.selectSubListByPath return empty,customerId:{} ", formDTO.getCustomerId()); return; @@ -176,7 +177,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ public void deleteAndInsertSelfSubScore(CalculateCommonFormDTO formDTO, String indexCode, Map insertMap) { int effectRow = 0; do { - agencySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); + agencySelfSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.STREET, indexCode); } while (effectRow > 0); agencySelfSubScoreDao.insertBatch(new ArrayList<>(insertMap.values())); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySelfSubScoreDao.xml index 6ae6d742ef..4504a7fe6c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySelfSubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySelfSubScoreDao.xml @@ -6,6 +6,7 @@ delete from fact_index_agency_self_sub_score where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + and DATA_TYPE = #{dataType,jdbcType=VARCHAR} and MONTH_ID = #{monthId,jdbcType=VARCHAR} and PARENT_INDEX_CODE = #{parentIndexCode,jdbcType=VARCHAR} limit 1000 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml index bc3f151ff8..b142e7349d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml @@ -54,6 +54,7 @@ fact_index_agency_sub_score WHERE DEL_FLAG = '0' + AND data_type = #{dataType} AND CUSTOMER_ID = #{customerId} AND ALL_PARENT_INDEX_CODE = #{allIndexCodePath,jdbcType=VARCHAR} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySelfSubScoreDao.xml index f077cb0f13..f9fa8c6d9b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySelfSubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySelfSubScoreDao.xml @@ -12,7 +12,7 @@ - INSERT INTO `fact_index_grid_self_sub_score` ( + INSERT INTO `fact_index_community_self_sub_score` ( `ID`, `CUSTOMER_ID`, `AGENCY_ID`, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml index b4a245a758..d3e94036f2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml @@ -50,7 +50,7 @@ ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, ORIGIN_VALUE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, WEIGHT FROM - fact_index_grid_sub_score + fact_index_community_sub_score WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSelfSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSelfSubScoreDao.xml new file mode 100644 index 0000000000..b9d9c4ff14 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSelfSubScoreDao.xml @@ -0,0 +1,61 @@ + + + + + + + delete from fact_index_dept_self_sub_score + where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + AND PARENT_INDEX_CODE = #{parentIndexCode,jdbcType=VARCHAR} + limit 1000 + + + + INSERT INTO `fact_index_dept_self_sub_score` ( + `ID`, + `CUSTOMER_ID`, + `AGENCY_ID`, + `DEPT_ID`, + `QUARTER_ID`, + `YEAR_ID`, + `MONTH_ID`, + `SELF_SCORE`, + `SUB_SCORE`, + `PARENT_INDEX_CODE`, + `ALL_PARENT_INDEX_CODE`, + `SELF_WEIGHT`, + `SUB_WEIGHT`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME` + ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.agencyId}, + #{item.deptId}, + #{item.quarterId}, + #{item.yearId}, + #{item.monthId}, + #{item.selfScore}, + #{item.subScore}, + #{item.parentIndexCode}, + #{item.allParentIndexCode}, + #{item.selfWeight}, + #{item.subWeight}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml index 8a035e4d2e..df3ac417d6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml @@ -59,4 +59,26 @@ limit #{deleteSize} + + From d6831e581592b2833d134a31634cce2636c6bcb0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 24 Sep 2020 15:06:10 +0800 Subject: [PATCH 09/23] =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=A8=A1=E8=8C=83?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8A=BD=E5=8F=96=E5=88=B0=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E8=A1=A8screen=5Fpioneer=5FdataV0.5=20louti?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginIssueMainDailyDao.java | 5 +- .../extract/FactOriginTopicMainDailyDao.java | 5 +- .../screen/ScreenPioneerDataDao.java | 18 +- .../dao/stats/DimCustomerPartymemberDao.java | 10 + .../FactOriginIssueMainDailyService.java | 2 +- .../FactOriginTopicMainDailyService.java | 2 +- .../FactOriginIssueMainDailyServiceImpl.java | 4 +- .../FactOriginTopicMainDailyServiceImpl.java | 4 +- .../toscreen/PioneerDataExtractService.java | 6 +- .../impl/PioneerDataExtractServiceImpl.java | 189 ++++++++++++------ .../impl/ScreenExtractServiceImpl.java | 5 +- .../screen/ScreenPioneerDataService.java | 6 +- .../impl/ScreenPioneerDataServiceImpl.java | 18 +- .../stats/DimCustomerPartymemberService.java | 8 +- .../DimCustomerPartymemberServiceImpl.java | 9 +- .../extract/FactOriginIssueMainDailyDao.xml | 6 + .../extract/FactOriginTopicMainDailyDao.xml | 6 + .../screen/ScreenPioneerDataDao.xml | 3 - .../stats/DimCustomerPartymemberDao.xml | 10 + 19 files changed, 215 insertions(+), 101 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index 52c6e71da3..6ad257a55c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -128,7 +128,10 @@ public interface FactOriginIssueMainDailyDao extends BaseDao partyMemberUserIds); + int getParyPublishIssueTotal(@Param("customerId") String customerId, + @Param("list")List partyMemberUserIds, + @Param("gridId")String gridId, + @Param("agencyId")String agencyId); /** * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java index 5ff934c8b4..3d80e4a4ab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java @@ -85,7 +85,10 @@ public interface FactOriginTopicMainDailyDao extends BaseDao partyMemberUserIds); + int selectPublishedByPartyTopicCount(@Param("customerId") String customerId, + @Param("list") List partyMemberUserIds, + @Param("gridId")String gridId, + @Param("agencyId")String agencyId); /** * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java index 14ffbe7c6e..daeb4c7443 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java @@ -34,9 +34,6 @@ import java.util.List; @Mapper public interface ScreenPioneerDataDao extends BaseDao { - Integer deletePioneerDataByCustomerId(@Param("customerId") String customerId, - @Param("deleteSize") Integer deleteSize); - /** * 10、党建引领-先锋模范数据 * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 @@ -46,9 +43,22 @@ public interface ScreenPioneerDataDao extends BaseDao { * @Author zhangyong * @Date 10:52 2020-08-18 **/ + Integer deletePioneerDataByCustomerId(@Param("customerId") String customerId, + @Param("deleteSize") Integer deleteSize); + + + /** + * @return java.lang.Integer + * @param customerId + * @param orgType + * @param deleteSize + * @param orgIds + * @author yinzuomei + * @description 产品客户采集用删除方法 + * @Date 2020/9/24 14:59 + **/ Integer deletePioneerData(@Param("customerId") String customerId, @Param("orgType") String orgType, - @Param("dataEndTime")String dataEndTime, @Param("deleteSize") Integer deleteSize, @Param("orgIds")List orgIds); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java index 47d73efe9f..0d614b2e4a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java @@ -90,4 +90,14 @@ public interface DimCustomerPartymemberDao extends BaseDao selectCommunityPartyMemberUserIds(@Param("customerId") String customerId, @Param("communityId")String communityId); + + /** + * @return java.util.List + * @param customerId + * @param pids + * @author yinzuomei + * @description 根据pids查询党员 + * @Date 2020/9/24 14:31 + **/ + List selectPartyMemberUserIdsByPids(@Param("customerId") String customerId, @Param("pids")String pids); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java index feaa5d6729..adc0768887 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java @@ -38,7 +38,7 @@ public interface FactOriginIssueMainDailyService extends BaseService partyMemberUserIds); + int getParyPublishIssueTotal(String customerId, List partyMemberUserIds,String gridId,String agencyId); /** * @return java.lang.Integer 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 6b1beefa08..fe942d34a7 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 @@ -70,7 +70,7 @@ public interface FactOriginTopicMainDailyService extends BaseService partyMemberUserIds); + int calPublishedByPartyTopicCount(String customerId,List partyMemberUserIds,String gridId,String agencyId); /** * @return int * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java index c255cc223a..8b6ae1a80a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java @@ -51,11 +51,11 @@ public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl partyMemberUserIds) { + public int getParyPublishIssueTotal(String customerId, List partyMemberUserIds,String gridId,String agencyId) { if(CollectionUtils.isEmpty(partyMemberUserIds)){ return NumConstant.ZERO; } - return baseDao.getParyPublishIssueTotal(customerId,partyMemberUserIds); + return baseDao.getParyPublishIssueTotal(customerId,partyMemberUserIds,gridId,agencyId); } /** 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 93619f865a..2043cf51f0 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 @@ -284,11 +284,11 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl partyMemberUserIds) { + public int calPublishedByPartyTopicCount(String customerId,List partyMemberUserIds,String gridId,String agencyId) { if(CollectionUtils.isEmpty(partyMemberUserIds)){ return NumConstant.ZERO; } - return baseDao.selectPublishedByPartyTopicCount(customerId,partyMemberUserIds); + return baseDao.selectPublishedByPartyTopicCount(customerId,partyMemberUserIds,gridId,agencyId); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java index e4b1769c41..0b8384a024 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java @@ -26,9 +26,5 @@ public interface PioneerDataExtractService { // 社区、街道、区县、市级别、省级 void extractCommunityPioneerData(String customerId, String dateId); - void extractexceptCommunityPioneerData(String customerId, String dateId); - /*void extractStreetPioneerData(String customerId, String dateId); - void extractDistrictPioneerData(String customerId, String dateId); - void extractCityPioneerData(String customerId, String dateId); - void extractProvincePioneerData(String customerId, String dateId);*/ + void extractExceptCommunityPioneerData(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java index 0971f22372..a2b178e292 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 @@ -13,6 +13,7 @@ import com.epmet.service.stats.DimCustomerPartymemberService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import java.math.BigDecimal; import java.math.RoundingMode; @@ -49,7 +50,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService @Override public void extractGridPioneerData(String customerId, String dateId) { //查询客户下所有的网格,初始数据值为0 - List gridList = screenPioneerDataService.initPioneerDataList(customerId, "grid", StrConstant.EPMETY_STR); + List gridList = screenPioneerDataService.initPioneerDataList(customerId, "grid"); if (CollectionUtils.isEmpty(gridList)) { return; } @@ -63,25 +64,25 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService //网格内的党员集合 - List partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "grid",gridId); + List partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "grid", gridId); //3、党员发布话题: - entity.setTopicTotal(getTopicTotal(customerId, partyMemberUserIds)); + entity.setTopicTotal(getTopicTotal(customerId, partyMemberUserIds, gridId, null)); //4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率 if (entity.getTopicTotal() == NumConstant.ZERO) { entity.setTopicRatio(BigDecimal.ZERO); } else { //当前网格内所有话题总数 - int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId,null); + int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId, null); entity.setTopicRatio(gridTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / gridTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } //当前网格内所有议题总数 - int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId,null); + int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId, null); if (gridIssueTotal != NumConstant.ZERO) { //5、党员发布议题 - entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds)); + entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds, gridId, null)); //6、党员发布议题占比 : 占网格内所有议题的比率 if (entity.getPublishIssueTotal() == NumConstant.ZERO) { entity.setPublishIssueRatio(BigDecimal.ZERO); @@ -89,29 +90,29 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setPublishIssueRatio(gridIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); //7、议题转项目数 - entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId,null)); + entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null)); //8、议题转项目占比 : 占网格内议题总数的比率 entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } // 9、已解决项目 - entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId,gridId,null,"resolved")); - if(entity.getResolvedProjectTotal()==NumConstant.ZERO){ + entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, "resolved")); + if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { entity.setResolvedProjectRatio(BigDecimal.ZERO); - }else{ + } else { // 10、占总结项目 - int closedProjectTotal=getGridOrCommunityClosedProjectTotal(customerId,gridId,null,null); - entity.setResolvedProjectRatio(closedProjectTotal==NumConstant.ZERO?BigDecimal.ZERO:new BigDecimal(entity.getResolvedProjectTotal()/closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, gridId, null, null); + entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } }); - screenPioneerDataService.delAndSavePioneerData(customerId, "grid", dateId, IndexCalConstant.DELETE_SIZE, gridList); + screenPioneerDataService.delAndSavePioneerData(customerId, "grid", IndexCalConstant.DELETE_SIZE, gridList); } @Override public void extractCommunityPioneerData(String customerId, String dateId) { //查询客户下所有的社区,初始数据值为0 - List communityList = screenPioneerDataService.initPioneerDataList(customerId, "agency", "community"); + List communityList = screenPioneerDataService.initPioneerDataList(customerId, "community"); if (CollectionUtils.isEmpty(communityList)) { return; } @@ -124,25 +125,25 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setIssueRatio(BigDecimal.ZERO); //社区内的党员集合 - List partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "community",communityId); + List partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "community", communityId); //3、党员发布话题: - entity.setTopicTotal(getTopicTotal(customerId, partyMemberUserIds)); - //4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率 + entity.setTopicTotal(getTopicTotal(customerId, partyMemberUserIds, null, communityId)); + //4、党员发布话题占比: 社区内注册党员发布的话题总数占 社区内话题总数的 比率 if (entity.getTopicTotal() == NumConstant.ZERO) { entity.setTopicRatio(BigDecimal.ZERO); } else { //当前社区内所有话题总数 - int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null,communityId); + int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null, communityId); entity.setTopicRatio(communityTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / communityTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } //当前社区内所有议题总数 - int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null,communityId); + int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null, communityId); if (communityIssueTotal != NumConstant.ZERO) { //5、党员发布议题 - entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds)); + entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds, null, communityId)); //6、党员发布议题占比 : 占社区内所有议题的比率 if (entity.getPublishIssueTotal() == NumConstant.ZERO) { entity.setPublishIssueRatio(BigDecimal.ZERO); @@ -150,42 +151,135 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setPublishIssueRatio(communityIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); //7、议题转项目数 - entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId,null, communityId)); - //8、议题转项目占比 : 占网格内议题总数的比率 + entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, null, communityId)); + //8、议题转项目占比 : 占社区内议题总数的比率 entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } // 9、已解决项目 - entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId,null,communityId,"resolved")); - if(entity.getResolvedProjectTotal()==NumConstant.ZERO){ + entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, "resolved")); + if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { entity.setResolvedProjectRatio(BigDecimal.ZERO); - }else{ + } else { // 10、占总结项目 - int closedProjectTotal=getGridOrCommunityClosedProjectTotal(customerId,null,communityId,null); - entity.setResolvedProjectRatio(closedProjectTotal==NumConstant.ZERO?BigDecimal.ZERO:new BigDecimal(entity.getResolvedProjectTotal()/closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, null, communityId, null); + entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } }); - screenPioneerDataService.delAndSavePioneerData(customerId, "agency", dateId, IndexCalConstant.DELETE_SIZE, communityList); + screenPioneerDataService.delAndSavePioneerData(customerId, "agency", IndexCalConstant.DELETE_SIZE, communityList); } + @Override - public void extractexceptCommunityPioneerData(String customerId, String dateId) { + public void extractExceptCommunityPioneerData(String customerId, String dateId) { + //查询客户下所有的社区,初始数据值为0 + List agencyList = screenPioneerDataService.initPioneerDataList(customerId, "agency"); + if (CollectionUtils.isEmpty(agencyList)) { + return; + } + agencyList.forEach(entity -> { + entity.setDataEndTime(dateId); + String agencyId = entity.getOrgId(); + //1、党员参与议事 todo + entity.setIssueTotal(NumConstant.ZERO); + //2、党员参与议事占比 todo + entity.setIssueRatio(BigDecimal.ZERO); + if (StringUtils.isEmpty(entity.getPid()) || NumConstant.ZERO_STR.equals(entity.getPid())) { + entity.setAgencyPath(entity.getOrgId()); + } else { + entity.setAgencyPath(entity.getAgencyPids().concat(StrConstant.COLON).concat(entity.getOrgId())); + } + //组织内党员集合 + List partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "agency", entity.getAgencyPath()); + + + //3、党员发布话题: + entity.setTopicTotal(getAgencyPartyTopicTotal(customerId, partyMemberUserIds, entity.getAgencyPath())); + //4、党员发布话题占比: 组织内注册党员发布的话题总数占 组织内话题总数的 比率 + if (entity.getTopicTotal() == NumConstant.ZERO) { + entity.setTopicRatio(BigDecimal.ZERO); + } else { + //当前组织内所有话题总数 + int agencyTopicTotal = getAgencyTopicTotal(customerId, entity.getAgencyPath()); + entity.setTopicRatio(agencyTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / agencyTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + + //当前组织内所有议题总数 + int agencyIssueTotal = getAgencyIssueTotal(customerId, entity.getAgencyPath()); + if (agencyIssueTotal != NumConstant.ZERO) { + //5、党员发布议题 + entity.setPublishIssueTotal(getAgencyParyPublishIssueTotal(customerId, partyMemberUserIds, entity.getAgencyPath())); + //6、党员发布议题占比 : 占社区内所有议题的比率 + if (entity.getPublishIssueTotal() == NumConstant.ZERO) { + entity.setPublishIssueRatio(BigDecimal.ZERO); + } + entity.setPublishIssueRatio(agencyIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + + //7、议题转项目数 + entity.setShiftProjectTotal(getAgencyShiftProjectTotal(customerId, entity.getAgencyPath())); + //8、议题转项目占比 : 占网格内议题总数的比率 + entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + + + // 9、已解决项目 + entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), "resolved")); + if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { + entity.setResolvedProjectRatio(BigDecimal.ZERO); + } else { + // 10、占总结项目 + int closedProjectTotal = getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), null); + entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + }); + screenPioneerDataService.delAndSavePioneerData(customerId, "agency", IndexCalConstant.DELETE_SIZE, agencyList); + + } + + private int getAgencyClosedProjectTotal(String customerId, String agencyPath, String resolved) { //todo + return 0; } + private Integer getAgencyShiftProjectTotal(String customerId, String agencyPath) { + //todo + return 0; + } + + private Integer getAgencyParyPublishIssueTotal(String customerId, List partyMemberUserIds, String agencyPath) { + //todo + return 0; + } + + private int getAgencyIssueTotal(String customerId, String agencyPath) { + //todo + return 0; + } + + private int getAgencyTopicTotal(String customerId, String agencyPath) { + //todo + return 0; + } + + private Integer getAgencyPartyTopicTotal(String customerId, List partyMemberUserIds, String agencyPath) { + //todo + return 0; + } + + /** - * @return java.lang.Integer * @param customerId * @param gridId * @param communityId * @param closedStatus 结案状态:已解决 resolved,未解决 unresolved + * @return java.lang.Integer * @author yinzuomei * @description 网格内已解决项目 * @Date 2020/9/23 16:24 **/ - private Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId,String communityId,String closedStatus) { - return factOriginProjectMainDailyService.getGridOrCommunityClosedProjectTotal(customerId,gridId,communityId,closedStatus); + private Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId, String closedStatus) { + return factOriginProjectMainDailyService.getGridOrCommunityClosedProjectTotal(customerId, gridId, communityId, closedStatus); } /** @@ -196,12 +290,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService * @description 党员发布的话题总数 * @Date 2020/9/23 13:44 **/ - private int getTopicTotal(String customerId, List partyMemberUserIds) { + private int getTopicTotal(String customerId, List partyMemberUserIds, String gridId, String agencyId) { if (CollectionUtils.isEmpty(partyMemberUserIds)) { //如果网格内没有党员,直接返回0 return NumConstant.ZERO; } - return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, partyMemberUserIds); + return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, partyMemberUserIds, gridId, agencyId); } /** @@ -212,11 +306,11 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService * @description 党员发布的议题总数 * @Date 2020/9/23 14:39 **/ - private int getParyPublishIssueTotal(String customerId, List partyMemberUserIds) { + private int getParyPublishIssueTotal(String customerId, List partyMemberUserIds, String gridId, String agencyId) { if (CollectionUtils.isEmpty(partyMemberUserIds)) { return NumConstant.ZERO; } - return factOriginIssueMainDailyService.getParyPublishIssueTotal(customerId, partyMemberUserIds); + return factOriginIssueMainDailyService.getParyPublishIssueTotal(customerId, partyMemberUserIds, gridId, agencyId); } /** @@ -232,18 +326,16 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService } - - /** - * @return int * @param customerId * @param communityId + * @return int * @author yinzuomei * @description * @Date 2020/9/24 10:44 **/ - private int getGridOrCommunityIssueTotal(String customerId, String gridId,String communityId) { - return factOriginIssueMainDailyService.getGridOrCommunityIssueTotal(customerId, gridId,communityId); + private int getGridOrCommunityIssueTotal(String customerId, String gridId, String communityId) { + return factOriginIssueMainDailyService.getGridOrCommunityIssueTotal(customerId, gridId, communityId); } /** @@ -258,19 +350,4 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService return factOriginTopicMainDailyService.calGridOrCommunityTopicTotal(customerId, gridId, communityId); } - /*@Override - public void extractStreetPioneerData(String customerId, String dateId) { - } - - @Override - public void extractDistrictPioneerData(String customerId, String dateId) { - } - - @Override - public void extractCityPioneerData(String customerId, String dateId) { - } - - @Override - public void extractProvincePioneerData(String customerId, String dateId) { - }*/ } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index a46d3d0d58..bab236a466 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 @@ -77,9 +77,6 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId); pioneerDataExtractService.extractGridPioneerData(customerId,dateId); pioneerDataExtractService.extractCommunityPioneerData(customerId,dateId); - pioneerDataExtractService.extractStreetPioneerData(customerId,dateId); - pioneerDataExtractService.extractDistrictPioneerData(customerId,dateId); - pioneerDataExtractService.extractCityPioneerData(customerId,dateId); - pioneerDataExtractService.extractProvincePioneerData(customerId,dateId); + pioneerDataExtractService.extractExceptCommunityPioneerData(customerId,dateId); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java index 1e42747a4a..99196d9950 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPioneerDataService.java @@ -34,23 +34,21 @@ public interface ScreenPioneerDataService extends BaseService * @param customerId * @param orgType :grid,agency - * @param agencyLevel : 机关级别(社区级:community, 乡(镇、街道)级:street,区县级: district,市级: city 省级:province) * @author yinzuomei * @description 构造screen_pioneer_data 初始数据,先赋值为0 * @Date 2020/9/22 14:41 **/ - List initPioneerDataList(String customerId, String orgType,String agencyLevel); + List initPioneerDataList(String customerId, String orgType); /** * @return void * @param customerId * @param orgType grid, agency - * @param dataEndTime * @param deleteSize * @param entityList 待插入的数据 * @author yinzuomei * @description 保存抽取结果 * @Date 2020/9/22 15:54 **/ - void delAndSavePioneerData(String customerId, String orgType, String dataEndTime, Integer deleteSize, List entityList); + void delAndSavePioneerData(String customerId, String orgType, Integer deleteSize, List entityList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java index d1ba5e11ef..0ae80e0b0c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java @@ -48,8 +48,7 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl * @author yinzuomei * @description 构造screen_pioneer_data 初始数据,先赋值为0 @@ -57,12 +56,16 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl initPioneerDataList(String customerId, String orgType, String agencyLevel) { + public List initPioneerDataList(String customerId, String orgType) { List list = new ArrayList<>(); if ("grid".equals(orgType)) { + //按网格构造 list = baseDao.initGridPioneerDataList(customerId); - } else if ("agency".equals(orgType)) { - list = baseDao.initAgencyPioneerDataList(customerId, agencyLevel); + } else if ("community".equals(orgType)) { + //按社构造 + list = baseDao.initCommunityPioneerDataList(customerId); + }else if("agency".equals(orgType)){ + list = baseDao.initExceptCommunityPioneerDataList(customerId); } return list; } @@ -71,7 +74,6 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl entityList) { + public void delAndSavePioneerData(String customerId, String orgType, Integer deleteSize, List entityList) { if(CollectionUtils.isEmpty(entityList)){ return; } @@ -92,7 +94,7 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl> partition = ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java index 914ef6ead1..d7410071ff 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java @@ -124,11 +124,11 @@ public interface DimCustomerPartymemberService extends BaseService * @param customerId - * @param gridId - * @type grid,community, agency + * @param orgId: 网格id 或者社区id + * @type grid,community * @author yinzuomei - * @description 查询在本网格注册的党员id + * @description 查询在本网格或者社区注册 或者 组织下 的党员id * @Date 2020/9/23 14:18 **/ - List getPartyMemberUserIds(String customerId, String type,String gridId); + List getPartyMemberUserIds(String customerId, String type,String orgId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java index 65b04efc11..0b0e1fa1ae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java @@ -212,10 +212,10 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl * @author yinzuomei - * @description 查询在本网格注册的党员id + * @description 查询在本网格注册的党员id,或者社区下的党员, 或者组织下的 * @Date 2020/9/23 14:18 **/ @DataSource(value = DataSourceConstant.STATS) @@ -226,9 +226,8 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl + and t1.GRID_ID=#{gridId} + + + and t1.AGENCY_ID=#{agencyId} + AND t1.CREATE_TOPIC_USER_ID=#{userId} 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 8b332419f2..d02debf93b 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,6 +106,12 @@ WHERE T1.DEL_FLAG = '0' AND T1.CUSTOMER_ID = #{customerId} + + AND T1.GRID_ID=#{gridId} + + + AND T1.AGENCY_ID=#{agencyId} + AND T1.CREATE_TOPIC_USER_ID=#{userId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml index 27a201b331..c2ad6b5722 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml @@ -15,9 +15,6 @@ and ORG_TYPE=#{orgType} - - and DATA_END_TIME=#{dataEndTime} - and ( diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml index 8d5f3dc840..ba50d19701 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml @@ -136,4 +136,14 @@ AND dcp.CUSTOMER_ID =#{customerId} and dcp.AGENCY_ID=#{communityId} + + \ No newline at end of file From e0930812914afc64410cddb8c973d4e6aee72957 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 24 Sep 2020 15:07:20 +0800 Subject: [PATCH 10/23] =?UTF-8?q?=E8=87=AA=E8=BA=AB=E5=92=8C=E4=B8=8B?= =?UTF-8?q?=E7=BA=A7=E6=8A=BD=E5=8F=96=E5=B8=B8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/constant/ProjectConstant.java | 9 +++++++++ .../indexcal/impl/DeptScoreServiceImpl.java | 15 ++++++++------- .../impl/GridCorreLationServiceImpl.java | 16 ++++++++-------- .../impl/IndexCalculateCommunityServiceImpl.java | 15 ++++++++------- .../impl/IndexCalculateDistrictServiceImpl.java | 15 ++++++++------- .../impl/IndexCalculateStreetServiceImpl.java | 15 ++++++++------- 6 files changed, 49 insertions(+), 36 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index 3758d966f1..ff2c4558c5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -53,4 +53,13 @@ public interface ProjectConstant { */ String STATS_FAILED_PREFIX = "统计数据执行失败:%s 客户ID:%s,统计日期:%s"; + /** + * 自身 + */ + String ZI_SHEN = "zishen"; + + /** + * 下级 + */ + String XIA_JI = "xiaji"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java index 483194cc01..8f4a1f1ef8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; import com.epmet.dao.evaluationindex.indexcal.DeptSelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.DeptSubScoreDao; @@ -137,14 +138,14 @@ public class DeptScoreServiceImpl extends BaseServiceImpl> selfSubParentMap = new HashMap<>(); - selfSubParentMap.put("zishen", new HashSet<>()); - selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { - selfSubParentMap.get("xiaji").add(o.getIndexCode()); + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); } else { - selfSubParentMap.get("zishen").add(o.getIndexCode()); + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); } }); Map insertMap = new HashMap<>(); @@ -160,8 +161,8 @@ public class DeptScoreServiceImpl extends BaseServiceImpl> selfSubParentMap = new HashMap<>(); - selfSubParentMap.put("zishen", new HashSet<>()); - selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { - selfSubParentMap.get("xiaji").add(o.getIndexCode()); + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); } else { - selfSubParentMap.get("zishen").add(o.getIndexCode()); + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); } }); Map insertMap = new HashMap<>(); @@ -150,9 +151,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { scoreEntity.setSelfWeight(new BigDecimal(0)); scoreEntity.setSubWeight(new BigDecimal(0)); } - BigDecimal partScore = score.getScore().multiply(score.getWeight()); - BigDecimal partWeight = score.getScore().multiply(score.getWeight()); - if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) { + BigDecimal partScore = score.getScore(); + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); } else { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java index 9fee142586..07db8a8822 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; import com.epmet.dao.evaluationindex.indexcal.CommunitySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.CommunitySubScoreDao; @@ -135,14 +136,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return; } Map> selfSubParentMap = new HashMap<>(); - selfSubParentMap.put("zishen", new HashSet<>()); - selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { - selfSubParentMap.get("xiaji").add(o.getIndexCode()); + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); } else { - selfSubParentMap.get("zishen").add(o.getIndexCode()); + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); } }); Map insertMap = new HashMap<>(); @@ -158,8 +159,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni scoreEntity.setSelfWeight(new BigDecimal(0)); scoreEntity.setSubWeight(new BigDecimal(0)); } - BigDecimal partScore = score.getScore().multiply(score.getWeight()); - if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) { + BigDecimal partScore = score.getScore(); + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); } else { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 80b55fe7ad..a7e1fac331 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao; @@ -133,14 +134,14 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return; } Map> selfSubParentMap = new HashMap<>(); - selfSubParentMap.put("zishen", new HashSet<>()); - selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { - selfSubParentMap.get("xiaji").add(o.getIndexCode()); + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); } else { - selfSubParentMap.get("zishen").add(o.getIndexCode()); + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); } }); Map insertMap = new HashMap<>(); @@ -156,8 +157,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict scoreEntity.setSelfWeight(new BigDecimal(0)); scoreEntity.setSubWeight(new BigDecimal(0)); } - BigDecimal partScore = score.getScore().multiply(score.getWeight()); - if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) { + BigDecimal partScore = score.getScore(); + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); } else { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index 3e77e7289b..b4808fabee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao; @@ -136,14 +137,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return; } Map> selfSubParentMap = new HashMap<>(); - selfSubParentMap.put("zishen", new HashSet<>()); - selfSubParentMap.put("xiaji", new HashSet<>()); + selfSubParentMap.put(ProjectConstant.ZI_SHEN, new HashSet<>()); + selfSubParentMap.put(ProjectConstant.XIA_JI, new HashSet<>()); selfSubIndexList.forEach(o -> { //找出自身 和下级的指标 - if (o.getAllIndexCodePath().indexOf("xiaji") > -1) { - selfSubParentMap.get("xiaji").add(o.getIndexCode()); + if (o.getAllIndexCodePath().indexOf(ProjectConstant.XIA_JI) > -1) { + selfSubParentMap.get(ProjectConstant.XIA_JI).add(o.getIndexCode()); } else { - selfSubParentMap.get("zishen").add(o.getIndexCode()); + selfSubParentMap.get(ProjectConstant.ZI_SHEN).add(o.getIndexCode()); } }); Map insertMap = new HashMap<>(); @@ -159,8 +160,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ scoreEntity.setSelfWeight(new BigDecimal(0)); scoreEntity.setSubWeight(new BigDecimal(0)); } - BigDecimal partScore = score.getScore().multiply(score.getWeight()); - if (selfSubParentMap.get("xiaji").contains(score.getIndexCode())) { + BigDecimal partScore = score.getScore(); + if (selfSubParentMap.get(ProjectConstant.XIA_JI).contains(score.getIndexCode())) { scoreEntity.setSubScore(scoreEntity.getSubScore().add(partScore)); scoreEntity.setSubWeight(scoreEntity.getSubWeight().add(score.getWeight())); } else { From 97de867306c7ac775a3ef97c88ad55fe4c32ff94 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 24 Sep 2020 15:38:54 +0800 Subject: [PATCH 11/23] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E5=8E=9F=E5=A7=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8A=BD=E5=8F=96=E6=B7=BB=E5=8A=A0pids:?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E7=BD=91=E6=A0=BC=E7=9A=84pids?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginTopicMainDailyDao.java | 4 +--- .../todata/impl/FactOriginTopicMainDailyServiceImpl.java | 8 ++++---- .../extract/FactOriginTopicMainDailyDao.xml | 8 +++----- .../src/main/resources/mapper/org/CustomerGridDao.xml | 5 +---- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java index 3d80e4a4ab..23f1b1810b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java @@ -19,7 +19,6 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.result.CreateTopicCountResultDTO; -import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -102,10 +101,9 @@ public interface FactOriginTopicMainDailyDao extends BaseDao list); + void updateFactOriginTopicMain(@Param("topicId")String topicId,@Param("topicStatus")String topicStatus,@Param("closedStatus")String closedStatus); } \ 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 2043cf51f0..ee0cd0311a 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 @@ -108,10 +108,10 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl updateTopicOriginInfoList) { - //批量更新 - List> partition = ListUtils.partition(updateTopicOriginInfoList, IndexCalConstant.INSERT_SIZE); - partition.forEach(list -> { - baseDao.updateFactOriginTopicMain(list); + updateTopicOriginInfoList.forEach(topicOriginInfoDTO -> { + baseDao.updateFactOriginTopicMain(topicOriginInfoDTO.getTopicId(), + topicOriginInfoDTO.getTopicStatus(), + topicOriginInfoDTO.getClosedStatus()); }); } 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 d02debf93b..53d917949a 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 @@ -135,12 +135,10 @@ - update fact_origin_topic_main_daily - set TOPIC_STATUS=#{item.topicStatus}, - CLOSED_STATUS=#{item.closedStatus}, + set TOPIC_STATUS=#{topicStatus}, + CLOSED_STATUS=#{closedStatus}, UPDATED_TIME=NOW() - where id = ${item.topicId} - + where id = #{topicId} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml index 7731b0ff6f..41ce69835f 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 @@ -75,10 +75,7 @@ cg.PID as AGENCY_ID, ca.PID AS PID, CG.CUSTOMER_ID, - (case ca.PIDS WHEN CA.PIDS IS NULL THEN 0 - when length(CA.PIDS) <1 then 0 - ELSE CA.PIDS - END ) as PIDS + cg.PIDS as PIDS FROM customer_grid cg LEFT JOIN customer_agency ca ON ( cg.PID = CA.ID ) From e7258961d61679a19bc2f4ba531a987c97d298ce Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 24 Sep 2020 15:49:51 +0800 Subject: [PATCH 12/23] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E6=83=85=E5=86=B5=E6=8A=BD=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/extract/result/GridInfoResultDTO.java | 19 ++ .../dto/extract/result/GridPartyDTO.java | 23 +++ .../dto/extract/result/OrgNameResultDTO.java | 25 +++ .../screen/ScreenCpcBaseDataDao.java | 8 + .../screen/ScreenCustomerAgencyDao.java | 9 + .../screen/ScreenCustomerGridDao.java | 18 ++ .../impl/PartyBaseInfoServiceImpl.java | 169 +++++++++++++----- .../screen/ScreenCpcBaseDataService.java | 8 + .../screen/ScreenCustomerAgencyService.java | 18 ++ .../screen/ScreenCustomerGridService.java | 9 + .../impl/ScreenCpcBaseDataServiceImpl.java | 16 ++ .../impl/ScreenCustomerAgencyServiceImpl.java | 34 ++++ .../impl/ScreenCustomerGridServiceImpl.java | 17 ++ .../screen/ScreenCpcBaseDataDao.xml | 34 ++++ .../screen/ScreenCustomerAgencyDao.xml | 18 ++ .../screen/ScreenCustomerGridDao.xml | 37 ++++ .../stats/DimCustomerPartymemberDao.xml | 8 +- 17 files changed, 417 insertions(+), 53 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgNameResultDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java new file mode 100644 index 0000000000..9555ea578c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridInfoResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/24 2:59 下午 + */ +@Data +public class GridInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -8146474744340303247L; + + private String agencyId; + + private String gridId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java new file mode 100644 index 0000000000..910ea4759a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.extract.result; + +import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/24 2:45 下午 + */ +@Data +@AllArgsConstructor +public class GridPartyDTO implements Serializable { + + private static final long serialVersionUID = -6699064424253966688L; + + private List orgIds; + + private List result; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgNameResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgNameResultDTO.java new file mode 100644 index 0000000000..66764c2674 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgNameResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/24 1:23 下午 + */ +@Data +public class OrgNameResultDTO implements Serializable { + + private static final long serialVersionUID = -4815327768546033428L; + + private String gridId; + + private String agencyId; + + private String gridName; + + private String agencyName; + + private String parentId; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java index c27f8b8857..716d9b2cfb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java @@ -85,4 +85,12 @@ public interface ScreenCpcBaseDataDao extends BaseDao { * @date 2020/9/23 2:01 下午 */ List selectPartyInfo(@Param("customerId") String customerId,@Param("dateId") String dateId, String agencyId); + + /** + * @Description 查询党员信息【直属网格的】 + * @param gridIds + * @author zxc + * @date 2020/9/24 3:23 下午 + */ + List selectDirectGridPartyInfo(@Param("gridIds") List gridIds,@Param("customerId") String customerId,@Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 65f2faf3b1..bf64ec0495 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 @@ -20,6 +20,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.result.CustomerAgencyInfoResultDTO; +import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.screen.result.TreeResultDTO; import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; @@ -152,4 +153,12 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAllAgencyIdToParty(@Param("customerId")String customerId,@Param("dateId")String dateId); + + /** + * @Description 查询org名称【机关】 + * @param agencyIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgNameAgency(@Param("agencyIds") List agencyIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java index 28338f0da7..7d6c8b7280 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 @@ -20,6 +20,8 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.result.GridInfoResultDTO; +import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.screencoll.form.CustomerGridFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; @@ -138,4 +140,20 @@ public interface ScreenCustomerGridDao extends BaseDao * @date 2020/9/23 3:10 下午 */ List selectAllGridIdToParty(String customerId, String dateId); + + /** + * @Description 查询org名称 + * @param gridIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgName(@Param("gridIds") List gridIds); + + /** + * @Description 查询机关的直属网格 + * @param agencyIds + * @author zxc + * @date 2020/9/24 2:33 下午 + */ + List selectDirectGrid(@Param("agencyIds") List agencyIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java index f3c758df72..6dcfe74f8c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java @@ -2,10 +2,7 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; -import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; -import com.epmet.dto.extract.result.PartyInfoResultDTO; -import com.epmet.dto.extract.result.PartyMemberInfoResultDTO; -import com.epmet.dto.extract.result.UserCountResultDTO; +import com.epmet.dto.extract.result.*; import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; import com.epmet.service.evaluationindex.screen.ScreenCpcBaseDataService; import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; @@ -109,56 +106,27 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { // 是 community 级别,子级为gridId List userCountList = userGridDailyService.selectUserCount(customerId, dateId); agencyIdList.forEach(agency -> { - // 1. 处理社区下的所有网格中的党员信息 - String agencyId = agency.getAgencyId(); - // 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId) - Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); - List gridIds = (List) agencyMap.get(agencyId); - orgIds.addAll(gridIds); - List partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, gridIds); - if (!CollectionUtils.isEmpty(partyMemberInfoList)){ - // 为每个人赋值年龄 - partyMemberInfoList.forEach(party -> { - party.setAge(getAge(party.getBirthday())); - }); - Map> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId)); - groupByGridId.forEach((gridId,partyInfos) -> { - PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); - form.setOrgType(ScreenConstant.GRID); - form.setOrgId(gridId); - form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName()); - form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false)); - form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY)); - form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY)); - form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY)); - form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY)); - form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true)); - form.setCustomerId(customerId); - form.setDataEndTime(dateId); - form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId()); - if (!CollectionUtils.isEmpty(userCountList)){ - userCountList.forEach(user -> { - if (gridId.equals(user.getOrgId())){ - form.setResiTotal(user.getResiTotal()); - form.setRegisterUserCount(user.getRegisterUserCount()); - form.setPartyMemberCount(user.getPartyMemberCount()); - } - }); - } - result.add(form); - }); - } + GridPartyDTO gridPartyDTO = gridParty(customerId, dateId, agency); + result.addAll(gridPartyDTO.getResult()); + orgIds.addAll(gridPartyDTO.getOrgIds()); }); // 2. 处理社区级别的党员信息(因为网格级别的已算出,社区级别直接累加) Map> groupByAgency = result.stream().collect(Collectors.groupingBy(PartyBaseInfoFormDTO::getParentId)); + List orgNameAgencyList = agencyService.selectOrgNameAgency(result.stream().map(m -> m.getParentId()).distinct().collect(Collectors.toList())); groupByAgency.forEach((commAgencyId,party) -> { PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); - form.setOrgName(party.get(NumConstant.ZERO).getOrgName()); + if (!CollectionUtils.isEmpty(orgNameAgencyList)){ + orgNameAgencyList.forEach(name -> { + if (commAgencyId.equals(name.getAgencyId())){ + form.setOrgName(name.getAgencyName()); + form.setParentId(name.getParentId()); + } + }); + } form.setOrgId(commAgencyId); form.setCustomerId(customerId); form.setDataEndTime(dateId); form.setOrgType(ScreenConstant.AGENCY); - form.setParentId(party.get(NumConstant.ZERO).getParentId()); form.setAgeLevel1(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel1))); form.setAgeLevel2(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel2))); form.setAgeLevel3(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel3))); @@ -173,10 +141,66 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { delAndInsert(result,customerId,dateId,orgIds); }else { // 级别为 street,district,city,province + List agencyIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); + List directGridIds = gridService.selectDirectGrid(agencyIds); + List userCountList = userGridDailyService.selectUserCount(customerId, dateId); agencyIdList.forEach(agency -> { String agencyId = agency.getAgencyId(); - // 查询下级机关的党员信息,直接累加 + List dGridId = new ArrayList<>(); + directGridIds.forEach(grid -> { + if (agencyId.equals(grid.getAgencyId())){ + dGridId.add(grid.getGridId()); + } + }); + // 不为空 存在直属网格 + if (!CollectionUtils.isEmpty(dGridId)){ + List disGrid = new ArrayList<>(); + List partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, dGridId); + List orgNameList = agencyService.selectOrgNameGrid(partyMemberInfoList.stream().map(m -> m.getGridId()).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(partyMemberInfoList)){ + // 为每个人赋值年龄 + partyMemberInfoList.forEach(party -> { + party.setAge(getAge(party.getBirthday())); + orgNameList.forEach(orgName -> { + if (party.getGridId().equals(orgName.getGridId())){ + party.setGridName(orgName.getGridName()); + party.setAgencyName(orgName.getAgencyName()); + } + }); + }); + Map> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId)); + groupByGridId.forEach((gridId,partyInfos) -> { + PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); + form.setOrgType(ScreenConstant.GRID); + form.setOrgId(gridId); + form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName()); + form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false)); + form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY)); + form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY)); + form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY)); + form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY)); + form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true)); + form.setCustomerId(customerId); + form.setDataEndTime(dateId); + form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId()); + if (!CollectionUtils.isEmpty(userCountList)){ + userCountList.forEach(user -> { + if (gridId.equals(user.getOrgId())){ + form.setResiTotal(user.getResiTotal()); + form.setRegisterUserCount(user.getRegisterUserCount()); + form.setPartyMemberCount(user.getPartyMemberCount()); + } + }); + } + disGrid.add(form); + }); + } + delAndInsert(disGrid,customerId,dateId,dGridId); + } + // 查询下级机关的党员信息,直接累加 【包括直属网格】 + List directGridList = cpcBaseDataService.selectDirectGridPartyInfo(dGridId, customerId, dateId); List partyInfoList = cpcBaseDataService.selectPartyInfo(customerId, dateId, agencyId); + partyInfoList.addAll(directGridList); if (!CollectionUtils.isEmpty(partyInfoList)){ PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); form.setOrgName(partyInfoList.get(NumConstant.ZERO).getOrgName()); @@ -307,4 +331,57 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { cpcBaseDataService.insertPartyBaseInfo(p); }); } + + public GridPartyDTO gridParty(String customerId,String dateId,CustomerAgencyInfoResultDTO agency){ + List result = new ArrayList<>(); + List orgIds = new ArrayList<>(); + List userCountList = userGridDailyService.selectUserCount(customerId, dateId); + // 1. 处理社区下的所有网格中的党员信息 + String agencyId = agency.getAgencyId(); + // 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId) + Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); + List gridIds = (List) agencyMap.get(agencyId); + orgIds.addAll(gridIds); + List partyMemberInfoList = partyMemberService.selectPartyMemberInfo(customerId, gridIds); + List orgNameList = agencyService.selectOrgNameGrid(partyMemberInfoList.stream().map(m -> m.getGridId()).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(partyMemberInfoList)){ + // 为每个人赋值年龄 + partyMemberInfoList.forEach(party -> { + party.setAge(getAge(party.getBirthday())); + orgNameList.forEach(orgName -> { + if (party.getGridId().equals(orgName.getGridId())){ + party.setGridName(orgName.getGridName()); + party.setAgencyName(orgName.getAgencyName()); + } + }); + }); + Map> groupByGridId = partyMemberInfoList.stream().collect(Collectors.groupingBy(PartyMemberInfoResultDTO::getGridId)); + groupByGridId.forEach((gridId,partyInfos) -> { + PartyBaseInfoFormDTO form = new PartyBaseInfoFormDTO(); + form.setOrgType(ScreenConstant.GRID); + form.setOrgId(gridId); + form.setOrgName(partyInfos.get(NumConstant.ZERO).getGridName()); + form.setAgeLevel1(disposeAge(partyInfos,NumConstant.TWENTY,false)); + form.setAgeLevel2(disposeAgeArea(partyInfos,NumConstant.TWENTY,NumConstant.THIRTY)); + form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY)); + form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY)); + form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY)); + form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true)); + form.setCustomerId(customerId); + form.setDataEndTime(dateId); + form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId()); + if (!CollectionUtils.isEmpty(userCountList)){ + userCountList.forEach(user -> { + if (gridId.equals(user.getOrgId())){ + form.setResiTotal(user.getResiTotal()); + form.setRegisterUserCount(user.getRegisterUserCount()); + form.setPartyMemberCount(user.getPartyMemberCount()); + } + }); + } + result.add(form); + }); + } + return new GridPartyDTO(orgIds, result); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java index d6fc5828cc..314bd3181a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java @@ -60,4 +60,12 @@ public interface ScreenCpcBaseDataService extends BaseService selectPartyInfo(String customerId, String dateId,String agencyId); + /** + * @Description 查询党员信息【直属网格的】 + * @param gridIds + * @author zxc + * @date 2020/9/24 3:23 下午 + */ + List selectDirectGridPartyInfo(List gridIds,String customerId,String dateId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java index 6d955563f7..9d74cc81e7 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 @@ -21,6 +21,8 @@ import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import java.util.List; + +import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.org.CustomerAgencyEntity; @@ -75,4 +77,20 @@ public interface ScreenCustomerAgencyService{ * @date 2020/9/23 3:10 下午 */ List selectAllAgencyIdToParty(String customerId,String dateId); + + /** + * @Description 查询org名称【网格】 + * @param gridIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgNameGrid(List gridIds); + + /** + * @Description 查询org名称【机关】 + * @param agencyIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + List selectOrgNameAgency(List agencyIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java index 504af8521d..2819d07347 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 @@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; @@ -46,4 +47,12 @@ public interface ScreenCustomerGridService extends BaseService selectAllGridIdToParty(String customerId, String dateId); + + /** + * @Description 查询机关的直属网格 + * @param agencyIds + * @author zxc + * @date 2020/9/24 2:33 下午 + */ + List selectDirectGrid(List agencyIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java index ab1e25f294..7505476087 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java @@ -26,7 +26,9 @@ import com.epmet.dto.extract.result.PartyInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCpcBaseDataEntity; import com.epmet.service.evaluationindex.screen.ScreenCpcBaseDataService; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.List; @@ -71,4 +73,18 @@ public class ScreenCpcBaseDataServiceImpl extends BaseServiceImpl selectPartyInfo(String customerId, String dateId, String agencyId) { return baseDao.selectPartyInfo(customerId, dateId, agencyId); } + + /** + * @Description 查询党员信息【直属网格的】 + * @param gridIds + * @author zxc + * @date 2020/9/24 3:23 下午 + */ + @Override + public List selectDirectGridPartyInfo(List gridIds,String customerId,String dateId) { + if (!CollectionUtils.isEmpty(gridIds)){ + return baseDao.selectDirectGridPartyInfo(gridIds, customerId, dateId); + } + return new ArrayList<>(); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java index cf159bae2f..13d056ced5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java @@ -17,13 +17,16 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgSourceTypeConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; +import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.screen.result.TreeResultDTO; import com.epmet.constant.ScreenConstant; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; @@ -50,6 +53,7 @@ import java.util.stream.Collectors; */ @Service @Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyService { @Autowired @@ -159,6 +163,34 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ return screenCustomerAgencyDao.selectAllAgencyIdToParty(customerId,dateId); } + /** + * @Description 查询org名称 + * @param gridIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + @Override + public List selectOrgNameGrid(List gridIds) { + if (!CollectionUtils.isEmpty(gridIds)){ + return screenCustomerGridDao.selectOrgName(gridIds); + } + return new ArrayList<>(); + } + + /** + * @Description 查询org名称【机关】 + * @param agencyIds + * @author zxc + * @date 2020/9/24 1:27 下午 + */ + @Override + public List selectOrgNameAgency(List agencyIds) { + if (!CollectionUtils.isEmpty(agencyIds)){ + return screenCustomerAgencyDao.selectOrgNameAgency(agencyIds); + } + return new ArrayList<>(); + } + private void updateAgency(ScreenCustomerAgencyEntity exists) { screenCustomerAgencyDao.updateById(exists); } @@ -193,4 +225,6 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ public List selectAllAgencyId(String customerId) { return screenCustomerAgencyDao.selectAllAgencyId(customerId); } + + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index 2d25673a50..a0e280aa3a 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 @@ -25,13 +25,16 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgSourceTypeConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -102,4 +105,18 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl selectAllGridIdToParty(String customerId, String dateId) { return screenCustomerGridDao.selectAllGridIdToParty(customerId, dateId); } + + /** + * @Description 查询机关的直属网格 + * @param agencyIds + * @author zxc + * @date 2020/9/24 2:33 下午 + */ + @Override + public List selectDirectGrid(List agencyIds) { + if (!CollectionUtils.isEmpty(agencyIds)){ + return screenCustomerGridDao.selectDirectGrid(agencyIds); + } + return new ArrayList<>(); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml index 7700490255..343deb4dd1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml @@ -38,6 +38,40 @@ AND PARENT_ID = #{agencyId} + + + insert into screen_cpc_base_data ( diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index 1a66ff709b..e5d5305639 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -286,4 +286,22 @@ del_flag = '0' AND CUSTOMER_ID = #{customerId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml index 419674a89d..bbf5e68d1f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml @@ -233,4 +233,41 @@ del_flag = '0' AND CUSTOMER_ID = #{customerId} + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml index ba50d19701..2d92d5d61b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml @@ -96,16 +96,10 @@ dcp.GRID_ID, dcp.AGENCY_ID, dcp.PARENT_ID, - dcp.BIRTHDAY, - scg.GRID_NAME, - sca.AGENCY_NAME + dcp.BIRTHDAY FROM dim_customer_partymember dcp - LEFT JOIN screen_customer_grid scg ON scg.GRID_ID = dcp.GRID_ID - LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = dcp.AGENCY_ID WHERE dcp.DEL_FLAG = '0' - AND scg.DEL_FLAG = 0 - AND sca.DEL_FLAG = 0 AND dcp.CUSTOMER_ID = #{customerId} AND ( From 38176bc886d68f460e09f4e52e72333803605b35 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 24 Sep 2020 15:59:18 +0800 Subject: [PATCH 13/23] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=85=9A=E5=BB=BA?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E6=9F=A5=E8=AF=A2=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactIndexGovrnAblityGridMonthlyDao.java | 7 ------- .../screen/ScreenCustomerGridDao.java | 9 +++++++++ .../dataToIndex/impl/CalGridIndexServiceImpl.java | 5 ++++- .../screen/ScreenCustomerGridService.java | 9 +++++++++ .../screen/impl/ScreenCustomerGridServiceImpl.java | 12 ++++++++++++ .../FactIndexGovrnAblityGridMonthlyDao.xml | 13 ------------- .../screen/ScreenCustomerGridDao.xml | 13 +++++++++++++ 7 files changed, 47 insertions(+), 21 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index 927e157db0..d07c037e6c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -111,13 +111,6 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao selectAllGridInfo(String customerId); - /** - * @Description 查询全部网格信息 - * @param customerId - * @author zxc - * @date 2020/9/19 10:50 上午 - */ - List selectAllGridInfoToParty(String customerId); /** * @Description 批量插入治理能力 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 7d6c8b7280..2bc928424f 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,6 +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.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; @@ -156,4 +157,12 @@ public interface ScreenCustomerGridDao extends BaseDao * @date 2020/9/24 2:33 下午 */ List selectDirectGrid(@Param("agencyIds") List agencyIds); + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/19 10:50 上午 + */ + List selectAllGridInfoToParty(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index 5e69ff1c2d..2174315e32 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -15,6 +15,7 @@ import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; import com.epmet.service.heart.ActInfoService; import com.epmet.service.partymember.PartyMemberService; import com.epmet.service.stats.FactArticlePublishedGridDailyService; @@ -74,6 +75,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { private UserService userService; @Autowired private PartyMemberService partyMemberService; + @Autowired + private ScreenCustomerGridService gridService; /** * @Description 计算网格指标党建能力 @@ -84,7 +87,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { */ @Override public Boolean calGridIndexPartyAbility(String customerId, String monthId) { - List result = governAbilityDao.selectAllGridInfoToParty(customerId); + List result = gridService.selectAllGridInfoToParty(customerId); if (CollectionUtils.isEmpty(result)){ log.warn(String.format(ExtractConstant.CUSTOMER_INFO_NULL,customerId)); return true; 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 2819d07347..52945ce4e2 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,6 +19,7 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; @@ -55,4 +56,12 @@ public interface ScreenCustomerGridService extends BaseService selectDirectGrid(List agencyIds); + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/19 10:50 上午 + */ + List selectAllGridInfoToParty(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index a0e280aa3a..84a4c6fdbe 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,6 +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.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; @@ -119,4 +120,15 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl(); } + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/19 10:50 上午 + */ + @Override + public List selectAllGridInfoToParty(String customerId) { + return screenCustomerGridDao.selectAllGridInfoToParty(customerId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index c0a7c1d8f1..bdc9ea953e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -175,19 +175,6 @@ AND CUSTOMER_ID = #{customerId} - - - INSERT INTO fact_index_govrn_ablity_grid_monthly ( 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 bbf5e68d1f..0b2f0b9485 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 @@ -270,4 +270,17 @@ ) + + + From 3b851866bae85fd1f3737c3321c504b97a0e98a7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 24 Sep 2020 16:06:48 +0800 Subject: [PATCH 14/23] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E6=B2=BB=E7=90=86?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E6=9F=A5=E8=AF=A2=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactIndexGovrnAblityGridMonthlyDao.java | 8 -------- .../screen/ScreenCustomerGridDao.java | 9 +++++++++ .../dataToIndex/impl/CalGridIndexServiceImpl.java | 2 +- .../screen/ScreenCustomerGridService.java | 9 +++++++++ .../screen/impl/ScreenCustomerGridServiceImpl.java | 13 +++++++++++++ .../FactIndexGovrnAblityGridMonthlyDao.xml | 13 ------------- .../screen/ScreenCustomerGridDao.xml | 13 +++++++++++++ 7 files changed, 45 insertions(+), 22 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index d07c037e6c..fe85ae528c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -104,14 +104,6 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao selectAllGridInfo(String customerId); - /** * @Description 批量插入治理能力 * @param lists 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 2bc928424f..658b7c4126 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,6 +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.result.GridInfoResultDTO; @@ -165,4 +166,12 @@ public interface ScreenCustomerGridDao extends BaseDao * @date 2020/9/19 10:50 上午 */ List selectAllGridInfoToParty(String customerId); + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/18 10:47 上午 + */ + List selectAllGridInfo(@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index 2174315e32..9a9b0c0aa1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -242,7 +242,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { @Override public Boolean calGridIndexGovernAbility(String customerId, String monthId) { - List result = governAbilityDao.selectAllGridInfo(customerId); + List result = gridService.selectAllGridInfo(customerId); if (CollectionUtils.isEmpty(result)){ log.warn(String.format(ExtractConstant.CUSTOMER_INFO_NULL,customerId)); return true; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java index 52945ce4e2..e8a39967e2 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,6 +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.result.GridInfoResultDTO; @@ -64,4 +65,12 @@ public interface ScreenCustomerGridService extends BaseService selectAllGridInfoToParty(String customerId); + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/18 10:47 上午 + */ + List selectAllGridInfo(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index 84a4c6fdbe..344fe266e4 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,12 +24,14 @@ 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.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -131,4 +133,15 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl selectAllGridInfoToParty(String customerId) { return screenCustomerGridDao.selectAllGridInfoToParty(customerId); } + + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/18 10:47 上午 + */ + @Override + public List selectAllGridInfo(String customerId) { + return screenCustomerGridDao.selectAllGridInfo(customerId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index bdc9ea953e..4bdb08e82c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -162,19 +162,6 @@ AND m.MONTH_ID =#{monthId} - - - INSERT INTO fact_index_govrn_ablity_grid_monthly ( 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 0b2f0b9485..19d1947e11 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 @@ -283,4 +283,17 @@ DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} + + + From 3bb87f91ce6afabe0cb91256924f42d96fd9d1c4 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 24 Sep 2020 16:12:21 +0800 Subject: [PATCH 15/23] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E4=B8=BB=E8=A1=A8pids?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/todata/impl/IssueExtractServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 22e33b1503..cd765f9199 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 @@ -128,7 +128,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { agencyInfoList.forEach(pid -> { if (r.getAgencyId().equals(pid.getAgencyId())){ r.setPid(pid.getPid()); - r.setPids(pid.getPids()); + r.setPids(pid.getPids().concat(":").concat(pid.getPid())); } }); }); From da15e9662a5bfec87608f020eeb51f639da974a3 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 24 Sep 2020 17:02:44 +0800 Subject: [PATCH 16/23] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=94=B9=E7=89=88?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/form/AblityIndexFormDTO.java | 16 +- .../screen/dto/form/AblityListFormDTO.java | 15 +- .../dto/form/MonthAblityListFormDTO.java | 16 +- .../dto/form/MonthScoreListFormDTO.java | 19 +- .../dto/form/PeerComparisonFormDTO.java | 15 +- .../screen/dto/form/RootAgencyFormDTO.java | 5 +- .../screen/dto/form/ScoreListFormDTO.java | 14 +- .../dto/result/AblityIndexResultDTO.java | 8 - .../dto/result/PeerComparisonResultDTO.java | 8 +- .../datareport/constant/FactConstant.java | 12 + .../controller/fact/FactIndexController.java | 29 +- .../screen/ScreenIndexDataMonthlyDao.java | 2 +- .../dao/fact/FactIndexAgencyScoreDao.java | 13 +- .../dao/fact/FactIndexCommunityScoreDao.java | 18 + .../dao/fact/FactIndexGridScoreDao.java | 28 ++ .../dao/fact/FactIndexGridSubScoreDao.java | 20 ++ .../fact/impl/FactIndexServiceImpl.java | 338 +++++++++++++----- .../mapper/fact/FactIndexAgencyScoreDao.xml | 41 ++- .../fact/FactIndexAgencySubScoreDao.xml | 8 +- .../fact/FactIndexCommunityScoreDao.xml | 41 ++- .../fact/FactIndexCommunitySubScoreDao.xml | 8 +- .../mapper/fact/FactIndexGridScoreDao.xml | 61 ++++ .../mapper/fact/FactIndexGridSubScoreDao.xml | 35 ++ .../screen/ScreenIndexDataMonthlyDao.xml | 10 +- 24 files changed, 610 insertions(+), 170 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java index bdf6aa34c5..4db977d5b4 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java @@ -3,7 +3,6 @@ package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; -import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -15,19 +14,24 @@ import java.io.Serializable; public class AblityIndexFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; /** - * 查询月份的前12个月对应的monthId + * 组织或网格Id */ - private String startMonthId; + @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgId; /** * 组织Id */ @NotBlank(message = "客户ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) private String customerId; /** - * 组织Id + * 组织或网格类型 */ - @NotBlank(message = "组织ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) - private String agencyId; + @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 查询月份的前12个月对应的monthId + */ + private String startMonthId; /** * 月份Id(格式:202009) */ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java index f1c4221482..ab4a4696c6 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java @@ -14,15 +14,21 @@ import java.io.Serializable; public class AblityListFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; /** - * 组织Id + * 客户Id */ @NotBlank(message = "客户ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) private String customerId; /** - * 组织Id + * 组织或网格Id */ - @NotBlank(message = "组织ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) - private String agencyId; + @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 组织或网格类型 + */ + @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgType; + public interface AddUserInternalGroup {} /** * 月份Id(格式:202009) */ @@ -37,6 +43,5 @@ public class AblityListFormDTO implements Serializable { * 所有有权重的指标code拼接的字符串 冒号隔开 */ private String allParentIndexCode; - public interface AddUserInternalGroup {} } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthAblityListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthAblityListFormDTO.java index 365fdb2000..8289173d9e 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthAblityListFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthAblityListFormDTO.java @@ -14,15 +14,21 @@ import java.io.Serializable; public class MonthAblityListFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; /** - * 组织Id + * 客户Id */ @NotBlank(message = "客户ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) private String customerId; /** - * 组织Id + * 组织或网格Id */ - @NotBlank(message = "组织ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) - private String agencyId; + @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 组织或网格类型 + */ + @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgType; + public interface AddUserInternalGroup {} /** * 月份Id(格式:202009) */ @@ -37,7 +43,5 @@ public class MonthAblityListFormDTO implements Serializable { * 查询月份的前12个月对应的monthId */ private String startMonthId; - public interface AddUserInternalGroup {} - } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java index 3efeee665f..805495b293 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java @@ -13,21 +13,34 @@ import java.io.Serializable; @Data public class MonthScoreListFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgId; /** * 组织Id */ @NotBlank(message = "客户ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) private String customerId; /** - * 组织Id + * 组织或网格类型 */ - @NotBlank(message = "组织ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) - private String agencyId; + @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) + */ + private String indexCode; /** * 月份Id(格式:202009) */ @NotBlank(message = "月份ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) private String monthId; + /** + * 查询月份的前12个月对应的monthId + */ + private String startMonthId; public interface AddUserInternalGroup {} } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java index 2d0b69bd2f..aff83eca85 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java @@ -15,15 +15,21 @@ import java.io.Serializable; public class PeerComparisonFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; /** - * 组织Id + * 客户Id */ @NotBlank(message = "客户ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) private String customerId; /** - * 组织Id + * 组织或网格Id */ - @NotBlank(message = "组织ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) - private String agencyId; + @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 组织或网格类型 + */ + @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgType; + public interface AddUserInternalGroup {} /** * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) */ @@ -34,6 +40,5 @@ public class PeerComparisonFormDTO implements Serializable { */ @Min(value = 1, message = "查询条数必须大于0", groups = {PeerComparisonFormDTO.AddUserInternalGroup.class }) private Integer pageSize; - public interface AddUserInternalGroup {} } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java index 97355373a3..42a67c936f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java @@ -3,7 +3,6 @@ package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; -import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -14,12 +13,12 @@ import java.io.Serializable; @Data public class RootAgencyFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; + public interface AddUserInternalGroup {} + /** * 组织Id */ @NotBlank(message = "组织ID不能为空",groups = {RootAgencyFormDTO.AddUserInternalGroup.class}) private String agencyId; - public interface AddUserInternalGroup {} - } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java index ea430fa0a7..5070202432 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java @@ -13,16 +13,22 @@ import java.io.Serializable; @Data public class ScoreListFormDTO implements Serializable { private static final long serialVersionUID = -2880432640584616651L; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgId; /** * 组织Id */ @NotBlank(message = "客户ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) private String customerId; /** - * 组织Id + * 组织或网格类型 */ - @NotBlank(message = "组织ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) - private String agencyId; + @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) + private String orgType; + public interface AddUserInternalGroup {} /** * 月份Id(格式:202009) */ @@ -33,6 +39,4 @@ public class ScoreListFormDTO implements Serializable { */ private String indexCode; - public interface AddUserInternalGroup {} - } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java index d50bcdc137..b93016bca3 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java @@ -29,14 +29,6 @@ public class AblityIndexResultDTO implements Serializable { * 能力总分 */ private Double indexTotal; - /** - * 本级能力分 - */ - private Double agencyScore; - /** - * 下级能力分 - */ - private Double subAgencyScore; /** * 横坐标(202009) */ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java index 95e9545a8c..9a89c5daa8 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java @@ -14,13 +14,13 @@ public class PeerComparisonResultDTO implements Serializable { private static final long serialVersionUID = 3860268744336541373L; /** - * 组织Id + * 组织或网格Id */ - private String agencyId; + private String orgId; /** - * 组织名称 + * 组织或网格名称 */ - private String agencyName; + private String orgName; /** * 能力分值(保留一位小数) */ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java index 529563feb2..70c5614f65 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java @@ -5,6 +5,14 @@ package com.epmet.datareport.constant; * @dscription 数据 */ public interface FactConstant { + /** + * 组织类型 + */ + String AGENCY = "agency"; + /** + * 网格类型 + */ + String GRID = "grid"; /** * 能力指标 */ @@ -33,4 +41,8 @@ public interface FactConstant { * 社区相关 */ String SHE_QU_XIANG_GUAN = "shequxiangguan"; + /** + * 网格相关 + */ + String WANG_GE_XIANG_GUAN = "wanggexiangguan"; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java index 4399756545..fbf0e78748 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java @@ -17,6 +17,7 @@ import java.util.List; /** * 数据改版api + * * @author sun */ @RestController @@ -28,77 +29,77 @@ public class FactIndexController { /** * @param tokenDTO - * @Description 能力指数 + * @Description 能力指数 * @author sun */ @PostMapping("index/ablityindex") - public Result> ablityIndex(@LoginUser TokenDto tokenDTO, @RequestBody AblityIndexFormDTO formDTO){ + public Result> ablityIndex(@LoginUser TokenDto tokenDTO, @RequestBody AblityIndexFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AblityIndexFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.ablityIndex(formDTO)); } /** * @param tokenDTO - * @Description 按月份查询各项能力分数 + * @Description 按月份查询各项能力分数 * @author sun */ @PostMapping("index/scorelist") - public Result> scoreList(@LoginUser TokenDto tokenDTO, @RequestBody ScoreListFormDTO formDTO){ + public Result> scoreList(@LoginUser TokenDto tokenDTO, @RequestBody ScoreListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ScoreListFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.scoreList(formDTO)); } /** * @param tokenDTO - * @Description 按月份查询各项能力最近12个月得分 + * @Description 按月份查询各项能力最近12个月得分 * @author sun */ @PostMapping("index/monthscorelist") - public Result> monthScoreList(@LoginUser TokenDto tokenDTO, @RequestBody MonthScoreListFormDTO formDTO){ + public Result> monthScoreList(@LoginUser TokenDto tokenDTO, @RequestBody MonthScoreListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, MonthScoreListFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.monthScoreList(formDTO)); } /** * @param tokenDTO - * @Description 按月查询各项指标数据 + * @Description 按月查询各项指标数据 * @author sun */ @PostMapping("index/ablitylist") - public Result> ablityList(@LoginUser TokenDto tokenDTO, @RequestBody AblityListFormDTO formDTO){ + public Result> ablityList(@LoginUser TokenDto tokenDTO, @RequestBody AblityListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AblityListFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.ablityList(formDTO)); } /** * @param tokenDTO - * @Description 按月查询各项指标最近12个月数据 + * @Description 按月查询各项指标最近12个月数据 * @author sun */ @PostMapping("index/monthablitylist") - public Result> monthAblityList(@LoginUser TokenDto tokenDTO, @RequestBody MonthAblityListFormDTO formDTO){ + public Result> monthAblityList(@LoginUser TokenDto tokenDTO, @RequestBody MonthAblityListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, MonthAblityListFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.monthAblityList(formDTO)); } /** * @param tokenDTO - * @Description 同级对比各项数据查询 + * @Description 同级对比各项数据查询 * @author sun */ @PostMapping("index/peercomparison") - public Result> peerComparison(@LoginUser TokenDto tokenDTO, @RequestBody PeerComparisonFormDTO formDTO){ + public Result> peerComparison(@LoginUser TokenDto tokenDTO, @RequestBody PeerComparisonFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, PeerComparisonFormDTO.AddUserInternalGroup.class); return new Result>().ok(factIndexService.peerComparison(formDTO)); } /** * @param tokenDTO - * @Description 是否根组织 + * @Description 是否根组织 * @author sun */ @PostMapping("index/rootagency") - public Result rootAgency(@LoginUser TokenDto tokenDTO, @RequestBody RootAgencyFormDTO formDTO){ + public Result rootAgency(@LoginUser TokenDto tokenDTO, @RequestBody RootAgencyFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class); return new Result().ok(factIndexService.rootAgency(formDTO)); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 3374c24026..9025780837 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -80,7 +80,7 @@ public interface ScreenIndexDataMonthlyDao{ /** * @param formDTO - * @Description 同级对比--根据组织Id的上级组织Id查询同级组织对应类型的得分排名(查询最近一个月数据) + * @Description 同级对比--根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名(查询最近一个月数据) * @author sun */ List selectScoreList(PeerComparisonFormDTO formDTO); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java index b57cb76571..062465f3a7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java @@ -18,8 +18,10 @@ package com.epmet.datareport.dao.fact; import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; import org.apache.ibatis.annotations.Mapper; @@ -34,17 +36,24 @@ import java.util.LinkedList; @Mapper public interface FactIndexAgencyScoreDao { + /** + * @param formDTO + * @Description 分别查询区县、乡镇街道过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + * @author sun + */ + LinkedList selectAblityIndex(AblityIndexFormDTO formDTO); + /** * @param formDTO * @Description 分别查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 * @author sun */ - ScoreListResultDTO selectScore(ScoreListFormDTO formDTO); + ScoreListResultDTO selectScoreList(ScoreListFormDTO formDTO); /** * @param formDTO * @Description 分别查询区县、乡镇街道过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 * @author sun */ - LinkedList selectAblityIndex(AblityIndexFormDTO formDTO); + LinkedList selectMonthScoreList(MonthScoreListFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java index ed9be12d6d..f0f381e156 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java @@ -18,7 +18,11 @@ package com.epmet.datareport.dao.fact; import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; import org.apache.ibatis.annotations.Mapper; import java.util.LinkedList; @@ -38,4 +42,18 @@ public interface FactIndexCommunityScoreDao { * @author sun */ LinkedList selectCommunityAblityIndex(AblityIndexFormDTO formDTO); + + /** + * @param formDTO + * @Description 分别查询社区级组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 + * @author sun + */ + ScoreListResultDTO selectCommunityScoreList(ScoreListFormDTO formDTO); + + /** + * @param formDTO + * @Description 分别查询社区过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + * @author sun + */ + LinkedList selectCommunityMonthScoreList(MonthScoreListFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java index 7944793f56..a70efe0ce6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java @@ -17,8 +17,16 @@ package com.epmet.datareport.dao.fact; +import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; import org.apache.ibatis.annotations.Mapper; +import java.util.LinkedList; + /** * 网格相关分值记录表 * @@ -28,4 +36,24 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface FactIndexGridScoreDao { + /** + * @param formDTO + * @Description 分别查网格过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + * @author sun + */ + LinkedList selectGridAblityIndex(AblityIndexFormDTO formDTO); + + /** + * @param formDTO + * @Description 分别查网格某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 + * @author sun + */ + ScoreListResultDTO selectGridScoreList(ScoreListFormDTO formDTO); + + /** + * @param formDTO + * @Description 分别查网格过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + * @author sun + */ + LinkedList selectGridMonthScoreList(MonthScoreListFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java index 2edc0a1965..8900171322 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java @@ -17,8 +17,15 @@ package com.epmet.datareport.dao.fact; +import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO; import org.apache.ibatis.annotations.Mapper; +import java.util.LinkedList; +import java.util.List; + /** * 网格相关分值记录表 * @@ -28,4 +35,17 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface FactIndexGridSubScoreDao { + /** + * @param formDTO + * @Description 查询网格某月份某项能力对应的各项指标 + * @author sun + */ + List selectGridAblityList(AblityListFormDTO formDTO); + + /** + * @param formDTO + * @Description 查询网格层级某项能力对应的一项指标过去12个月份数据 + * @author sun + */ + LinkedList selectGridMonthAblityList(MonthAblityListFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java index 0ee79681fb..523bf3a7e5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java @@ -7,16 +7,14 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.constant.FactConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; -import com.epmet.datareport.dao.fact.FactIndexAgencyScoreDao; -import com.epmet.datareport.dao.fact.FactIndexAgencySubScoreDao; -import com.epmet.datareport.dao.fact.FactIndexCommunityScoreDao; -import com.epmet.datareport.dao.fact.FactIndexCommunitySubScoreDao; +import com.epmet.datareport.dao.fact.*; import com.epmet.datareport.service.fact.FactIndexService; import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -45,6 +43,10 @@ public class FactIndexServiceImpl implements FactIndexService { private FactIndexCommunityScoreDao factIndexCommunityScoreDao; @Autowired private FactIndexCommunitySubScoreDao factIndexCommunitySubScoreDao; + @Autowired + private FactIndexGridScoreDao factIndexGridScoreDao; + @Autowired + private FactIndexGridSubScoreDao factIndexGridSubScoreDao; /** * @param formDTO @@ -53,76 +55,91 @@ public class FactIndexServiceImpl implements FactIndexService { */ @Override public List ablityIndex(AblityIndexFormDTO formDTO) { - LinkedList resultDTO = new LinkedList<>(); + LinkedList resultList = new LinkedList<>(); LinkedList djList = null; LinkedList zlList = null; LinkedList fwList = null; - //分别查询过去12个月党建能力、治理能力、服务能力各自总分乘权重后的分值,每个月份三个分值的加和就是当月的能力指数的分值 fact_index_agency_score 按月份升序 //1.计算所查月份前12个月的monthId formDTO.setStartMonthId(getDate(formDTO.getMonthId())); - //2.根据组织Id查询组织信息 - CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); - if (null == agency) { - throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId())); - } - //1.根据组织级别判断查询哪类数据表 - //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { - //2-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union) - formDTO.setIndexCode(FactConstant.DJNL); - djList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); - //2-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据 - formDTO.setIndexCode(FactConstant.ZLNL); - zlList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); - //2-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据 - formDTO.setIndexCode(FactConstant.FWNL); - fwList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); + //2.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //3.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + if (null == agency) { + throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); + } + //4.根据组织级别判断查询哪类数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + //4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union) + formDTO.setIndexCode(FactConstant.DJNL); + djList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); + //4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.ZLNL); + zlList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); + //4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.FWNL); + fwList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); - //社区级 - } else if ("community".equals(agency.getLevel())) { - //2-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据 + //社区级 + } else if ("community".equals(agency.getLevel())) { + //4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.DJNL); + djList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); + //4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.ZLNL); + zlList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); + //4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.FWNL); + fwList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); + } else { + throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + } + //网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //5.查询过去12个月网格层级各项能力对应的各项得分数据 + //5-1.查询网格过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union) formDTO.setIndexCode(FactConstant.DJNL); - djList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); - //2-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据 + djList = factIndexGridScoreDao.selectGridAblityIndex(formDTO); + //5-2.查询网格过去12个月治理能力每月总分、本级得分、下级得分数据 formDTO.setIndexCode(FactConstant.ZLNL); - zlList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); - //2-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据 + zlList = factIndexGridScoreDao.selectGridAblityIndex(formDTO); + //5-3.查询网格过去12个月服务能力每月总分、本级得分、下级得分数据 formDTO.setIndexCode(FactConstant.FWNL); - fwList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); - + fwList = factIndexGridScoreDao.selectGridAblityIndex(formDTO); } else { - throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); + throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); } - //3.遍历计算每个月能力指数 + //6.遍历计算每个月能力指数 LinkedList nlList = new LinkedList<>(); for (int i = 0; i < djList.size(); i++) { AblityIndexResultDTO.ScoreListResultDTO nldto = new AblityIndexResultDTO.ScoreListResultDTO(); - nldto.setIndexTotal(djList.get(i).getIndexTotal() + zlList.get(i).getIndexTotal() + fwList.get(i).getIndexTotal()); - nldto.setAgencyScore(djList.get(i).getAgencyScore() + zlList.get(i).getAgencyScore() + fwList.get(i).getAgencyScore()); - nldto.setSubAgencyScore(djList.get(i).getSubAgencyScore() + zlList.get(i).getSubAgencyScore() + fwList.get(i).getSubAgencyScore()); + double num1 = new BigDecimal((djList.get(i).getIndexTotal() + zlList.get(i).getIndexTotal() + fwList.get(i).getIndexTotal())).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); + nldto.setIndexTotal(num1); nldto.setMonthId(djList.get(i).getMonthId()); nlList.add(nldto); } //5.封装数据并返回 AblityIndexResultDTO nl = new AblityIndexResultDTO(); nl.setIndexCode(FactConstant.NLZB); - nl.setScoreList(djList); - resultDTO.add(nl); + nl.setScoreList(nlList); + if(null != nlList){resultList.add(nl);} AblityIndexResultDTO dj = new AblityIndexResultDTO(); dj.setIndexCode(FactConstant.DJNL); dj.setScoreList(djList); - resultDTO.add(dj); + if(null != djList){resultList.add(dj);} AblityIndexResultDTO zl = new AblityIndexResultDTO(); zl.setIndexCode(FactConstant.ZLNL); - zl.setScoreList(djList); - resultDTO.add(zl); + zl.setScoreList(zlList); + if(null != zlList){resultList.add(zl);} AblityIndexResultDTO fw = new AblityIndexResultDTO(); fw.setIndexCode(FactConstant.FWNL); - fw.setScoreList(djList); - resultDTO.add(fw); + fw.setScoreList(fwList); + if(null != fwList){resultList.add(fw);} - return resultDTO; + return resultList; } /** @@ -132,13 +149,65 @@ public class FactIndexServiceImpl implements FactIndexService { */ @Override public List scoreList(ScoreListFormDTO formDTO) { - //1.查询当前组织某一月份党建能力对应的总分、本级分、下级分 - formDTO.setIndexCode(FactConstant.DJNL); - ScoreListResultDTO dj = factIndexAgencyScoreDao.selectScore(formDTO); - //2.查询当前组织某一月份治理能力对应的总分、本级分、下级分 - //3.查询当前组织某一月份服务能力对应的总分、本级分、下级分 + LinkedList resultList = new LinkedList<>(); + ScoreListResultDTO dj = new ScoreListResultDTO(); + ScoreListResultDTO zl = new ScoreListResultDTO(); + ScoreListResultDTO fw = new ScoreListResultDTO(); + //1.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //2.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + if (null == agency) { + throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); + } + //3.根据组织级别判断查询哪类数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + //3-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.DJNL); + dj = factIndexAgencyScoreDao.selectScoreList(formDTO); + //3-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.ZLNL); + zl = factIndexAgencyScoreDao.selectScoreList(formDTO); + //3-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.FWNL); + fw = factIndexAgencyScoreDao.selectScoreList(formDTO); + //社区级 + } else if ("community".equals(agency.getLevel())) { + //3-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.DJNL); + dj = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO); + //3-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.ZLNL); + zl = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO); + //3-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.FWNL); + fw = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO); + } else { + throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + } - return null; + //4.网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //4-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.DJNL); + dj = factIndexGridScoreDao.selectGridScoreList(formDTO); + //4-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.ZLNL); + zl = factIndexGridScoreDao.selectGridScoreList(formDTO); + //4-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分 + formDTO.setIndexCode(FactConstant.FWNL); + fw = factIndexGridScoreDao.selectGridScoreList(formDTO); + } else { + throw new RenException(String.format("按月份查询各项能力分数,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); + } + //5.封装数据并返回 + if(null != dj){resultList.add(dj);} + if(null != zl){resultList.add(zl);} + if(null != fw){resultList.add(fw);} + + return resultList; } /** @@ -148,7 +217,78 @@ public class FactIndexServiceImpl implements FactIndexService { */ @Override public List monthScoreList(MonthScoreListFormDTO formDTO) { - return null; + LinkedList resultList = new LinkedList<>(); + LinkedList djList = new LinkedList<>(); + LinkedList zlList = new LinkedList<>(); + LinkedList fwList = new LinkedList<>(); + //1.计算所查月份前12个月的monthId + formDTO.setStartMonthId(getDate(formDTO.getMonthId())); + //2.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //3.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + if (null == agency) { + throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); + } + //4.根据组织级别判断查询哪类数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + //4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.DJNL); + djList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO); + //4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.ZLNL); + zlList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO); + //4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.FWNL); + fwList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO); + + //社区级 + } else if ("community".equals(agency.getLevel())) { + //4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.DJNL); + djList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO); + //4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.ZLNL); + zlList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO); + //4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.FWNL); + fwList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO); + } else { + throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + } + //网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //5.查询过去12个月网格层级各项能力对应的各项得分数据 + //5-1.查询网格过去12个月党建能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.DJNL); + djList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO); + //5-2.查询网格过去12个月治理能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.ZLNL); + zlList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO); + //5-3.查询网格过去12个月服务能力每月总分、本级得分、下级得分数据 + formDTO.setIndexCode(FactConstant.FWNL); + fwList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO); + } else { + throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); + } + + //5.封装数据并返回 + MonthScoreListResultDTO dj = new MonthScoreListResultDTO(); + dj.setIndexCode(FactConstant.DJNL); + dj.setScoreList(djList); + if(null != djList){resultList.add(dj);} + MonthScoreListResultDTO zl = new MonthScoreListResultDTO(); + zl.setIndexCode(FactConstant.ZLNL); + zl.setScoreList(zlList); + if(null != zlList){resultList.add(zl);} + MonthScoreListResultDTO fw = new MonthScoreListResultDTO(); + fw.setIndexCode(FactConstant.FWNL); + fw.setScoreList(fwList); + if(null != fwList){resultList.add(fw);} + + return resultList; } /** @@ -159,30 +299,41 @@ public class FactIndexServiceImpl implements FactIndexService { @Override public List ablityList(AblityListFormDTO formDTO) { List resultList = new ArrayList<>(); - //按月份查询当前组织各项指标数据 fact_index_agency_sub_score - //1.根据组织Id查询组织信息 - CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); - if (null == agency) { - throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId())); - } - //2.根据组织级别拼接查询条件,判断查询不同数据表 - //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { - if ("district".equals(agency.getLevel())) { - formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); - } else { - formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode()); + //1.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //2.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + if (null == agency) { + throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); } - resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO); + //3.根据组织级别拼接查询条件,判断查询不同数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + if ("district".equals(agency.getLevel())) { + formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); + } else { + formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode()); + } + resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO); - //社区级 - } else if ("community".equals(agency.getLevel())) { - formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); - resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO); + //社区级 + } else if ("community".equals(agency.getLevel())) { + formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); + resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO); + } else { + throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + } + //网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //4.查询网格层级各项能力对应指标数据 + formDTO.setAllParentIndexCode(FactConstant.WANG_GE_XIANG_GUAN + ":" + formDTO.getIndexCode()); + resultList = factIndexGridSubScoreDao.selectGridAblityList(formDTO); } else { - throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); + throw new RenException(String.format("按月查询各项指标数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); } - //3.调用方法判断各项指标是数字指标还是百分比指标 //TODO + + //4.调用方法判断各项指标是数字指标还是百分比指标 //TODO 记得value值保留一位小数 是数的保留零位小数 是百分比的保留一位小数 return resultList; } @@ -196,24 +347,33 @@ public class FactIndexServiceImpl implements FactIndexService { LinkedList resultList = new LinkedList<>(); //1.计算所查月份前12个月的monthId formDTO.setStartMonthId(getDate(formDTO.getMonthId())); - //2.根据组织Id查询组织信息 - CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); - if (null == agency) { - throw new RenException(String.format("查询到组织信息失败,组织Id:%s", formDTO.getAgencyId())); - } - - //3.根据组织级别拼接查询条件,判断查询不同数据表 - //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { - resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO); - - //社区级 - } else if ("community".equals(agency.getLevel())) { - resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO); + //2.根据类型判断是查询组织数据还是网格数据 + //组织层级数据 + if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { + //3.根据组织Id查询组织信息 + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + if (null == agency) { + throw new RenException(String.format("查询到组织信息失败,组织Id:%s", formDTO.getOrgId())); + } + //4.根据组织级别拼接查询条件,判断查询不同数据表 + //区县级、乡镇街道级 + if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO); + //社区级 + } else if ("community".equals(agency.getLevel())) { + resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO); + } else { + throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + } + //网格层级数据 + } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { + //5.查询网格层级某项能力对应的一项指标过去12个月份数据 + resultList = factIndexGridSubScoreDao.selectGridMonthAblityList(formDTO); } else { - throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); + throw new RenException(String.format("按月查询各项指标最近12个月数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); } - //3.调用方法判断各项指标是数字指标还是百分比指标//TODO + + //6.调用方法判断各项指标是数字指标还是百分比指标//TODO 记得value值保留一位小数 是数的保留零位小数 是百分比的保留一位小数 return resultList; } @@ -243,7 +403,7 @@ public class FactIndexServiceImpl implements FactIndexService { */ @Override public List peerComparison(PeerComparisonFormDTO formDTO) { - //1.根据组织Id的上级组织Id查询同级组织对应类型的得分排名(查询最近一个月数据) + //1.根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名(查询最近一个月数据) List resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO); return resultList; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml index 87a08ed389..e1d744940e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml @@ -3,14 +3,47 @@ - + SELECT + fact.month_id AS "monthId", + ROUND(fact.score, 1) AS "indexTotal" + FROM + fact_index_agency_score fact + WHERE + fact.del_flag = '0' + AND fact.customer_id = #{customerId} + AND fact.agency_id = #{orgId} + AND fact.month_id > #{startMonthId} + AND fact.month_id <= #{monthId} + AND fact.index_code = #{indexCode} + ORDER BY + fact.month_id ASC + + - SELECT fact.month_id AS "monthId", - ROUND(fact.score * fact.weight, 1) AS "indexTotal", + ROUND(fact.score, 1) AS "indexTotal", ROUND(self.self_score * self.self_weight,1) AS "agencyScore", ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore" FROM @@ -22,7 +55,7 @@ fact.del_flag = '0' AND self.del_flag = '0' AND fact.customer_id = #{customerId} - AND fact.agency_id = #{agencyId} + AND fact.agency_id = #{orgId} AND fact.month_id > #{startMonthId} AND fact.month_id <= #{monthId} AND fact.index_code = #{indexCode} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml index db62b6c918..879d8b521e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml @@ -6,7 +6,7 @@ SELECT fact.month_id AS "monthId", - ROUND(fact.score * fact.weight, 1) AS "indexTotal", + ROUND(fact.score, 1) AS "indexTotal" + FROM + fact_index_community_score fact + WHERE + fact.del_flag = '0' + AND fact.customer_id = #{customerId} + AND fact.agency_id = #{orgId} + AND fact.month_id > #{startMonthId} + AND fact.month_id <= #{monthId} + AND fact.index_code = #{indexCode} + ORDER BY + fact.month_id ASC + + + + + SELECT fact.index_code AS "key", - IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", + IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "value", dict.index_name AS "name" FROM fact_index_community_sub_score fact @@ -16,14 +16,14 @@ AND dict.del_flag = '0' AND fact.all_parent_index_code = #{allParentIndexCode} AND customer_id = #{customerId} - AND agency_id = #{agencyId} + AND agency_id = #{orgId} AND month_id = #{monthId} + SELECT + fact.month_id AS "monthId", + ROUND(fact.score, 1) AS "indexTotal" + FROM + fact_index_grid_score fact + WHERE + fact.del_flag = '0' + AND fact.customer_id = #{customerId} + AND fact.grid_id = #{orgId} + AND fact.month_id > #{startMonthId} + AND fact.month_id <= #{monthId} + AND fact.index_code = #{indexCode} + ORDER BY + fact.month_id ASC + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml index ff7c0031c7..d48f24966e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml @@ -3,5 +3,40 @@ + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 0676fb2177..f84ce8c28d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -110,8 +110,8 @@ SELECT ID AS issueId, - (case when RESOLVE_TYPE = 'resolved' then 'closed_resolved' - when RESOLVE_TYPE = 'unresolved' then 'closed_unresolved' - else ISSUE_STATUS end ) AS ISSUE_STATUS, + ISSUE_STATUS, + RESOLVE_TYPE as resolveType, SOURCE_ID AS topicId, CUSTOMER_ID, GRID_ID, From c2750298476ff828ef6fbcfcb910f19867bec1d2 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 24 Sep 2020 17:39:34 +0800 Subject: [PATCH 19/23] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datareport/controller/fact/FactIndexController.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java index fbf0e78748..12eb550d99 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java @@ -1,5 +1,6 @@ package com.epmet.datareport.controller.fact; +import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -32,6 +33,7 @@ public class FactIndexController { * @Description 能力指数 * @author sun */ + @InternalAppRequestAuth @PostMapping("index/ablityindex") public Result> ablityIndex(@LoginUser TokenDto tokenDTO, @RequestBody AblityIndexFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AblityIndexFormDTO.AddUserInternalGroup.class); @@ -43,6 +45,7 @@ public class FactIndexController { * @Description 按月份查询各项能力分数 * @author sun */ + @InternalAppRequestAuth @PostMapping("index/scorelist") public Result> scoreList(@LoginUser TokenDto tokenDTO, @RequestBody ScoreListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ScoreListFormDTO.AddUserInternalGroup.class); @@ -54,6 +57,7 @@ public class FactIndexController { * @Description 按月份查询各项能力最近12个月得分 * @author sun */ + @InternalAppRequestAuth @PostMapping("index/monthscorelist") public Result> monthScoreList(@LoginUser TokenDto tokenDTO, @RequestBody MonthScoreListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, MonthScoreListFormDTO.AddUserInternalGroup.class); @@ -65,6 +69,7 @@ public class FactIndexController { * @Description 按月查询各项指标数据 * @author sun */ + @InternalAppRequestAuth @PostMapping("index/ablitylist") public Result> ablityList(@LoginUser TokenDto tokenDTO, @RequestBody AblityListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AblityListFormDTO.AddUserInternalGroup.class); @@ -76,6 +81,7 @@ public class FactIndexController { * @Description 按月查询各项指标最近12个月数据 * @author sun */ + @InternalAppRequestAuth @PostMapping("index/monthablitylist") public Result> monthAblityList(@LoginUser TokenDto tokenDTO, @RequestBody MonthAblityListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, MonthAblityListFormDTO.AddUserInternalGroup.class); @@ -87,6 +93,7 @@ public class FactIndexController { * @Description 同级对比各项数据查询 * @author sun */ + @InternalAppRequestAuth @PostMapping("index/peercomparison") public Result> peerComparison(@LoginUser TokenDto tokenDTO, @RequestBody PeerComparisonFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, PeerComparisonFormDTO.AddUserInternalGroup.class); @@ -98,6 +105,7 @@ public class FactIndexController { * @Description 是否根组织 * @author sun */ + @InternalAppRequestAuth @PostMapping("index/rootagency") public Result rootAgency(@LoginUser TokenDto tokenDTO, @RequestBody RootAgencyFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class); From 9df5611c7c55e7b832aa13acfaa5aeddf257aebc Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 24 Sep 2020 17:50:57 +0800 Subject: [PATCH 20/23] =?UTF-8?q?=E9=99=A4=E5=90=8C=E7=BA=A7=E5=AF=B9?= =?UTF-8?q?=E6=AF=94=E5=85=B6=E4=BB=96=E5=90=84=E9=A1=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8D=E4=B9=98=E6=9D=83=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/fact/FactIndexAgencyScoreDao.xml | 8 ++++---- .../resources/mapper/fact/FactIndexCommunityScoreDao.xml | 8 ++++---- .../main/resources/mapper/fact/FactIndexGridScoreDao.xml | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml index e1d744940e..374814375d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml @@ -24,8 +24,8 @@ SELECT #{indexCode} AS "indexCode", ROUND(fact.score, 1) AS "indexTotal", - ROUND(self.self_score * self.self_weight,1) AS "agencyScore", - ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore" + ROUND(self.self_score, 1) AS "agencyScore", + ROUND(self.sub_score, 1) AS "subAgencyScore" FROM fact_index_agency_score fact INNER JOIN fact_index_agency_self_sub_score self ON fact.agency_id = self.agency_id @@ -44,8 +44,8 @@ SELECT fact.month_id AS "monthId", ROUND(fact.score, 1) AS "indexTotal", - ROUND(self.self_score * self.self_weight,1) AS "agencyScore", - ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore" + ROUND(self.self_score, 1) AS "agencyScore", + ROUND(self.sub_score, 1) AS "subAgencyScore" FROM fact_index_agency_score fact INNER JOIN fact_index_agency_self_sub_score self ON fact.agency_id = self.agency_id diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml index 3e4f7ed0d5..31c051f887 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml @@ -24,8 +24,8 @@ SELECT #{indexCode} AS "indexCode", ROUND(fact.score, 1) AS "indexTotal", - ROUND(self.self_score * self.self_weight,1) AS "agencyScore", - ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore" + ROUND(self.self_score, 1) AS "agencyScore", + ROUND(self.sub_score, 1) AS "subAgencyScore" FROM fact_index_community_score fact INNER JOIN fact_index_community_self_sub_score self ON fact.agency_id = self.agency_id @@ -44,8 +44,8 @@ SELECT fact.month_id AS "monthId", ROUND(fact.score, 1) AS "indexTotal", - ROUND(self.self_score * self.self_weight,1) AS "agencyScore", - ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore" + ROUND(self.self_score, 1) AS "agencyScore", + ROUND(self.sub_score, 1) AS "subAgencyScore" FROM fact_index_community_score fact INNER JOIN fact_index_community_self_sub_score self ON fact.agency_id = self.agency_id diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml index 20752058bd..47d5ad74a0 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml @@ -24,8 +24,8 @@ SELECT #{indexCode} AS "indexCode", ROUND(fact.score, 1) AS "indexTotal", - ROUND(self.self_score * self.self_weight,1) AS "agencyScore", - ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore" + ROUND(self.self_score, 1) AS "agencyScore", + ROUND(self.sub_score, 1) AS "subAgencyScore" FROM fact_index_grid_score fact INNER JOIN fact_index_grid_self_sub_score self ON fact.grid_id = self.grid_id @@ -45,8 +45,8 @@ SELECT fact.month_id AS "monthId", ROUND(fact.score, 1) AS "indexTotal", - ROUND(self.self_score * self.self_weight,1) AS "agencyScore", - ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore" + ROUND(self.self_score, 1) AS "agencyScore", + ROUND(self.sub_score, 1) AS "subAgencyScore" FROM fact_index_grid_score fact INNER JOIN fact_index_grid_self_sub_score self ON fact.grid_id = self.grid_id From 9f967e449f7f84d8d41f91416a5bbe2b40c812c5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 24 Sep 2020 18:09:35 +0800 Subject: [PATCH 21/23] =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=A8=A1=E8=8C=83-?= =?UTF-8?q?=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginIssueMainDailyDao.java | 36 ++++- .../FactOriginProjectMainDailyDao.java | 13 ++ .../extract/FactOriginTopicMainDailyDao.java | 14 +- .../FactOriginIssueMainDailyService.java | 35 ++++- .../FactOriginProjectMainDailyService.java | 11 ++ .../FactOriginTopicMainDailyService.java | 15 +- .../FactOriginIssueMainDailyServiceImpl.java | 51 +++++-- ...FactOriginProjectMainDailyServiceImpl.java | 14 ++ .../FactOriginTopicMainDailyServiceImpl.java | 21 ++- .../impl/PioneerDataExtractServiceImpl.java | 144 +++++++----------- .../stats/DimCustomerPartymemberService.java | 2 +- .../extract/FactOriginIssueMainDailyDao.xml | 45 +++++- .../extract/FactOriginProjectMainDailyDao.xml | 15 ++ .../extract/FactOriginTopicMainDailyDao.xml | 20 ++- 14 files changed, 310 insertions(+), 126 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index 6ad257a55c..79a1487328 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -123,13 +123,11 @@ public interface FactOriginIssueMainDailyDao extends BaseDao partyMemberUserIds, @Param("gridId")String gridId, @Param("agencyId")String agencyId); @@ -153,4 +151,36 @@ public interface FactOriginIssueMainDailyDao extends BaseDao partyMemberUserIds, @Param("gridId")String gridId, @Param("agencyId")String agencyId); @@ -106,4 +104,16 @@ public interface FactOriginTopicMainDailyDao extends BaseDao partyMemberUserIds,String gridId,String agencyId); + int getParyPublishIssueTotal(String customerId,String gridId,String agencyId); /** * @return java.lang.Integer @@ -59,4 +56,34 @@ public interface FactOriginIssueMainDailyService extends BaseService partyMemberUserIds,String gridId,String agencyId); + int calPublishedByPartyTopicCount(String customerId,String gridId,String agencyId); /** * @return int * @param customerId @@ -80,5 +79,15 @@ public interface FactOriginTopicMainDailyService extends BaseService partyMemberUserIds,String gridId,String agencyId) { - if(CollectionUtils.isEmpty(partyMemberUserIds)){ - return NumConstant.ZERO; - } - return baseDao.getParyPublishIssueTotal(customerId,partyMemberUserIds,gridId,agencyId); + public int getParyPublishIssueTotal(String customerId,String gridId,String agencyId) { + return baseDao.getParyPublishIssueTotal(customerId,gridId,agencyId); } /** @@ -83,4 +75,43 @@ public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl partyMemberUserIds,String gridId,String agencyId) { - if(CollectionUtils.isEmpty(partyMemberUserIds)){ - return NumConstant.ZERO; - } - return baseDao.selectPublishedByPartyTopicCount(customerId,partyMemberUserIds,gridId,agencyId); + public int calPublishedByPartyTopicCount(String customerId,String gridId,String agencyId) { + return baseDao.selectPublishedByPartyTopicCount(customerId,gridId,agencyId); } /** @@ -304,4 +300,17 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "grid", gridId); - - //3、党员发布话题: - entity.setTopicTotal(getTopicTotal(customerId, partyMemberUserIds, gridId, null)); + entity.setTopicTotal(getTopicTotal(customerId, gridId, null)); //4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率 if (entity.getTopicTotal() == NumConstant.ZERO) { entity.setTopicRatio(BigDecimal.ZERO); @@ -82,7 +75,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId, null); if (gridIssueTotal != NumConstant.ZERO) { //5、党员发布议题 - entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds, gridId, null)); + entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, gridId, null)); //6、党员发布议题占比 : 占网格内所有议题的比率 if (entity.getPublishIssueTotal() == NumConstant.ZERO) { entity.setPublishIssueRatio(BigDecimal.ZERO); @@ -124,12 +117,9 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService //2、党员参与议事占比 todo entity.setIssueRatio(BigDecimal.ZERO); - //社区内的党员集合 - List partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "community", communityId); - //3、党员发布话题: - entity.setTopicTotal(getTopicTotal(customerId, partyMemberUserIds, null, communityId)); + entity.setTopicTotal(getTopicTotal(customerId, null, communityId)); //4、党员发布话题占比: 社区内注册党员发布的话题总数占 社区内话题总数的 比率 if (entity.getTopicTotal() == NumConstant.ZERO) { entity.setTopicRatio(BigDecimal.ZERO); @@ -143,7 +133,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null, communityId); if (communityIssueTotal != NumConstant.ZERO) { //5、党员发布议题 - entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds, null, communityId)); + entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, null, communityId)); //6、党员发布议题占比 : 占社区内所有议题的比率 if (entity.getPublishIssueTotal() == NumConstant.ZERO) { entity.setPublishIssueRatio(BigDecimal.ZERO); @@ -173,7 +163,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService @Override public void extractExceptCommunityPioneerData(String customerId, String dateId) { - //查询客户下所有的社区,初始数据值为0 + //查询客户下所有的组织(社区除外),初始数据值为0 List agencyList = screenPioneerDataService.initPioneerDataList(customerId, "agency"); if (CollectionUtils.isEmpty(agencyList)) { return; @@ -190,18 +180,16 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService } else { entity.setAgencyPath(entity.getAgencyPids().concat(StrConstant.COLON).concat(entity.getOrgId())); } - //组织内党员集合 - List partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, "agency", entity.getAgencyPath()); //3、党员发布话题: - entity.setTopicTotal(getAgencyPartyTopicTotal(customerId, partyMemberUserIds, entity.getAgencyPath())); + entity.setTopicTotal(getAgencyTopicTotal(customerId, entity.getAgencyPath(),NumConstant.ONE_STR)); //4、党员发布话题占比: 组织内注册党员发布的话题总数占 组织内话题总数的 比率 if (entity.getTopicTotal() == NumConstant.ZERO) { entity.setTopicRatio(BigDecimal.ZERO); } else { //当前组织内所有话题总数 - int agencyTopicTotal = getAgencyTopicTotal(customerId, entity.getAgencyPath()); + int agencyTopicTotal = getAgencyTopicTotal(customerId, entity.getAgencyPath(),null); entity.setTopicRatio(agencyTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / agencyTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } @@ -209,7 +197,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService int agencyIssueTotal = getAgencyIssueTotal(customerId, entity.getAgencyPath()); if (agencyIssueTotal != NumConstant.ZERO) { //5、党员发布议题 - entity.setPublishIssueTotal(getAgencyParyPublishIssueTotal(customerId, partyMemberUserIds, entity.getAgencyPath())); + entity.setPublishIssueTotal(getAgencyParyPublishIssueTotal(customerId, entity.getAgencyPath())); //6、党员发布议题占比 : 占社区内所有议题的比率 if (entity.getPublishIssueTotal() == NumConstant.ZERO) { entity.setPublishIssueRatio(BigDecimal.ZERO); @@ -237,117 +225,97 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService } - private int getAgencyClosedProjectTotal(String customerId, String agencyPath, String resolved) { - //todo - return 0; + //组织下:已解决项目 or 已结案项目总数 + private int getAgencyClosedProjectTotal(String customerId, String agencyPath, String closedStatus) { + return factOriginProjectMainDailyService.getAgencyClosedProjectTotal(customerId,agencyPath,closedStatus); } + //组织下:议题转项目数 private Integer getAgencyShiftProjectTotal(String customerId, String agencyPath) { - //todo - return 0; + return factOriginIssueMainDailyService.getAgencyShiftProjectTotal(customerId,agencyPath); } - private Integer getAgencyParyPublishIssueTotal(String customerId, List partyMemberUserIds, String agencyPath) { - //todo - return 0; + //组织内: 党员发布议题 + private Integer getAgencyParyPublishIssueTotal(String customerId, String agencyPath) { + return factOriginIssueMainDailyService.getAgencyParyPublishIssueTotal(customerId,agencyPath); } + //组织内:所有议题总数 private int getAgencyIssueTotal(String customerId, String agencyPath) { - //todo - return 0; + return factOriginIssueMainDailyService.getAgencyIssueTotal(customerId,agencyPath); } - private int getAgencyTopicTotal(String customerId, String agencyPath) { - //todo - return 0; - } - private Integer getAgencyPartyTopicTotal(String customerId, List partyMemberUserIds, String agencyPath) { - //todo - return 0; + //在当前组织下,话题总数(createTopicUserIsParty=1时查询党员发布的话题总数) + private Integer getAgencyTopicTotal(String customerId, String agencyPath,String createTopicUserIsParty) { + return factOriginTopicMainDailyService.getAgencyPartyTopicTotal(customerId,agencyPath,createTopicUserIsParty); } /** - * @param customerId - * @param gridId - * @param communityId + * @param customerId 客户id + * @param gridId 网格id + * @param communityId 社区的agencyId * @param closedStatus 结案状态:已解决 resolved,未解决 unresolved - * @return java.lang.Integer - * @author yinzuomei - * @description 网格内已解决项目 - * @Date 2020/9/23 16:24 + * @description 网格或者社区下: 已解决项目 **/ private Integer getGridOrCommunityClosedProjectTotal(String customerId, String gridId, String communityId, String closedStatus) { return factOriginProjectMainDailyService.getGridOrCommunityClosedProjectTotal(customerId, gridId, communityId, closedStatus); } /** - * @param customerId - * @param partyMemberUserIds * @return int - * @author yinzuomei - * @description 党员发布的话题总数 - * @Date 2020/9/23 13:44 + * @param customerId 客户id + * @param gridId 网格id + * @param agencyId 社区的agencyId + * @description 网格或者社区下: 党员发布的话题总数 **/ - private int getTopicTotal(String customerId, List partyMemberUserIds, String gridId, String agencyId) { - if (CollectionUtils.isEmpty(partyMemberUserIds)) { - //如果网格内没有党员,直接返回0 - return NumConstant.ZERO; - } - return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, partyMemberUserIds, gridId, agencyId); + private int getTopicTotal(String customerId, String gridId, String agencyId) { + return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, gridId, agencyId); } /** - * @param customerId - * @param partyMemberUserIds - * @return java.lang.Integer - * @author yinzuomei - * @description 党员发布的议题总数 - * @Date 2020/9/23 14:39 + * @return int + * @param customerId 客户id + * @param gridId 网格id + * @param communityId 社区的agencyId + * @description 网格或者社区下 :话题总数 **/ - private int getParyPublishIssueTotal(String customerId, List partyMemberUserIds, String gridId, String agencyId) { - if (CollectionUtils.isEmpty(partyMemberUserIds)) { - return NumConstant.ZERO; - } - return factOriginIssueMainDailyService.getParyPublishIssueTotal(customerId, partyMemberUserIds, gridId, agencyId); + private int getGridOrCommunityTopicTotal(String customerId, String gridId, String communityId) { + return factOriginTopicMainDailyService.calGridOrCommunityTopicTotal(customerId, gridId, communityId); } /** - * @param customerId - * @param gridId - * @return java.lang.Integer - * @author yinzuomei - * @description 网格内议题转项目数 - * @Date 2020/9/23 15:38 + * @return int + * @param customerId 客户id + * @param gridId 网格id + * @param agencyId 社区的agencyId + * @description 网格或者社区下: 党员发布的议题总数 **/ - private Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId, String communityId) { - return factOriginIssueMainDailyService.getGridOrCommunityShiftProjectTotal(customerId, gridId, communityId); + private int getParyPublishIssueTotal(String customerId, String gridId, String agencyId) { + return factOriginIssueMainDailyService.getParyPublishIssueTotal(customerId, gridId, agencyId); } - /** - * @param customerId - * @param communityId * @return int - * @author yinzuomei - * @description - * @Date 2020/9/24 10:44 + * @param customerId 客户id + * @param gridId 网格id + * @param communityId 社区的agencyId + * @description 网格或者社区下 :议题总数 **/ private int getGridOrCommunityIssueTotal(String customerId, String gridId, String communityId) { return factOriginIssueMainDailyService.getGridOrCommunityIssueTotal(customerId, gridId, communityId); } /** - * @param customerId - * @param communityId - * @return int - * @author yinzuomei - * @description 当前社区内所有话题总数 - * @Date 2020/9/24 10:32 + * @return java.lang.Integer + * @param customerId 客户id + * @param gridId 网格id + * @param communityId 社区的agencyId + * @description 网格或者社区下: 议题转项目数 **/ - private int getGridOrCommunityTopicTotal(String customerId, String gridId, String communityId) { - return factOriginTopicMainDailyService.calGridOrCommunityTopicTotal(customerId, gridId, communityId); + private Integer getGridOrCommunityShiftProjectTotal(String customerId, String gridId, String communityId) { + return factOriginIssueMainDailyService.getGridOrCommunityShiftProjectTotal(customerId, gridId, communityId); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java index d7410071ff..d231065d66 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java @@ -126,7 +126,7 @@ public interface DimCustomerPartymemberService extends BaseService - + + + + + + + + + + \ 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 987eeed62b..6129ab0f2f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -163,4 +163,19 @@ 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/FactOriginTopicMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml index 53d917949a..31b2bc1772 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,16 +106,13 @@ WHERE T1.DEL_FLAG = '0' AND T1.CUSTOMER_ID = #{customerId} + AND m.CREATE_TOPIC_USER_IS_PARTY='1' AND T1.GRID_ID=#{gridId} AND T1.AGENCY_ID=#{agencyId} - AND - - T1.CREATE_TOPIC_USER_ID=#{userId} - + SELECT + count( 1 ) AS total + FROM + fact_origin_topic_main_daily m + WHERE + m.DEL_FLAG = '0' + + AND m.CREATE_TOPIC_USER_IS_PARTY = #{createTopicUserIsParty} + + AND m.CUSTOMER_ID = #{customerId} + AND m.PIDS LIKE CONCAT(#{agencyPath},'%') + \ No newline at end of file From 95358d3653135ee69e771270f3858068f42ce8a2 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 24 Sep 2020 18:45:09 +0800 Subject: [PATCH 22/23] =?UTF-8?q?=E6=B2=BB=E7=90=86=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactIndexGovrnAblityGridMonthlyDao.java | 10 +++ .../screen/ScreenGovernRankDataDao.java | 19 ++++++ .../GovernRankDataExtractService.java | 41 ++++++++++++ .../GovernRankDataExtractServiceImpl.java | 64 +++++++++++++++++++ ...actIndexGovrnAblityGridMonthlyService.java | 24 +++++++ ...ndexGovrnAblityGridMonthlyServiceImpl.java | 20 ++++++ .../screen/ScreenGovernRankDataService.java | 13 +++- .../impl/ScreenGovernRankDataServiceImpl.java | 24 +++++++ .../FactIndexGovrnAblityGridMonthlyDao.xml | 41 ++++++++++++ .../screen/ScreenGovernRankDataDao.xml | 33 ++++++++++ 10 files changed, 288 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index fe85ae528c..2e047268de 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -120,4 +120,14 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao + */ + List selectGridByCustomer(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java index 24e3d65a09..d40a702dbe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java @@ -56,4 +56,23 @@ public interface ScreenGovernRankDataDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * 组织级别初始化数据 + * @author zhaoqifeng + * @date 2020/9/24 14:52 + * @param customerId + * @param level + * @return java.util.List + */ + List initAgencyDataList(@Param("customerId") String customerId, @Param("level") String level); + + /** + * 网格级别初始化数据 + * @author zhaoqifeng + * @date 2020/9/24 14:52 + * @param customerId + * @return java.util.List + */ + List initGridDataList(@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java new file mode 100644 index 0000000000..0d44c2143e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java @@ -0,0 +1,41 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/24 14:28 + */ +public interface GovernRankDataExtractService { + /** + * 网格治理能力 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:16 + */ + void extractGridData(String customerId, String monthId); + + /** + * 社区治理能力 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractCommunityData(String customerId, String monthId); + + /** + * 街道治理能力 + * + * @param customerId + * @param monthId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractStreetData(String customerId, String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java new file mode 100644 index 0000000000..58e149d6fd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java @@ -0,0 +1,64 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; +import com.epmet.service.evaluationindex.extract.toscreen.GovernRankDataExtractService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/24 14:31 + */ +public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractService { + @Autowired + private ScreenGovernRankDataService screenGovernRankDataService; + @Autowired + private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; + @Autowired + private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService; + + @Override + public void extractGridData(String customerId, String monthId) { + List list = screenGovernRankDataService.initList(customerId, OrgTypeConstant.GRID, null); + if (CollectionUtils.isEmpty(list)) { + return; + } + List gridList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId); + list.forEach(entity -> gridList.stream().filter(gridAblity -> entity.getOrgId().equals(gridAblity.getGridId())).forEach(grid -> { + BigDecimal total = new BigDecimal(grid.getProjectTotal()); + entity.setYearId(grid.getYearId()); + entity.setMonthId(grid.getMonthId()); + //TODO 响应率 + //解决率 + BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount()); + entity.setResolvedRatio(resolveCount.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + //自治率 + BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount()); + entity.setGovernRatio(selfCount.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + //满意率 + entity.setSatisfactionRatio(grid.getSatisfactionRatio()); + })); + } + + @Override + public void extractCommunityData(String customerId, String monthId) { + + } + + @Override + public void extractStreetData(String customerId, String monthId) { + + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java new file mode 100644 index 0000000000..8010a566d2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java @@ -0,0 +1,24 @@ +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/24 14:34 + */ +public interface FactIndexGovrnAblityGridMonthlyService extends BaseService { + /** + * 查询客户下网格治理能力 + * + * @param customerId + * @param monthId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 15:41 + */ + List getGridByCustomer(String customerId, String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..5143882c49 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java @@ -0,0 +1,20 @@ +package com.epmet.service.evaluationindex.indexcoll.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/24 14:36 + */ +public class FactIndexGovrnAblityGridMonthlyServiceImpl extends BaseServiceImpl implements FactIndexGovrnAblityGridMonthlyService { + @Override + public List getGridByCustomer(String customerId, String monthId) { + return baseDao.selectGridByCustomer(customerId, monthId); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java index a707ea1dec..5c5fb96844 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataService.java @@ -21,6 +21,8 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; +import java.util.List; + /** * 基层治理-治理能力排行数据(按月统计) * @@ -28,5 +30,14 @@ import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; * @since v1.0.0 2020-09-22 */ public interface ScreenGovernRankDataService extends BaseService { - + /** + * 构造screen_govern_rank_data 初始数据,先赋值为0 + * @author zhaoqifeng + * @date 2020/9/24 14:41 + * @param customerId + * @param orgType + * @param agencyLevel + * @return java.util.List + */ + List initList(String customerId, String orgType, String agencyLevel); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java index c500c767ad..e4fea260dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataServiceImpl.java @@ -19,11 +19,16 @@ package com.epmet.service.evaluationindex.screen.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDao; import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; + /** * 基层治理-治理能力排行数据(按月统计) * @@ -31,7 +36,26 @@ import org.springframework.stereotype.Service; * @since v1.0.0 2020-09-22 */ @Service +@Slf4j public class ScreenGovernRankDataServiceImpl extends BaseServiceImpl implements ScreenGovernRankDataService { + @Override + public List initList(String customerId, String orgType, String agencyLevel) { + List list = new ArrayList<>(); + switch (orgType) { + case OrgTypeConstant.AGENCY: + log.info("组织级别统计"); + list = baseDao.initAgencyDataList(customerId, agencyLevel); + break; + case OrgTypeConstant.GRID: + log.info("网格级别统计"); + list = baseDao.initGridDataList(customerId); + break; + default: + log.info("部门级别统计"); + break; + } + return list; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index 4bdb08e82c..e30d52c675 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -162,6 +162,47 @@ AND m.MONTH_ID =#{monthId} + + + + + + + INSERT INTO fact_index_govrn_ablity_grid_monthly ( diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml index f569cb89a9..a85df25770 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml @@ -8,6 +8,39 @@ where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} limit 1000; + + insert into screen_govern_rank_data From 7144c93e87cde08437d6201c702407256a386ad7 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 24 Sep 2020 21:12:00 +0800 Subject: [PATCH 23/23] =?UTF-8?q?=E8=87=AA=E8=BA=AB=E5=92=8C=E4=B8=8B?= =?UTF-8?q?=E7=BA=A7=E5=88=86=E6=95=B0=E9=9C=80=E8=A6=81=E6=9D=83=E9=87=8D?= =?UTF-8?q?=20=E6=B2=A1=E6=9C=89=E5=8E=9F=E5=A7=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/indexcal/impl/DeptScoreServiceImpl.java | 2 +- .../indexcal/impl/GridCorreLationServiceImpl.java | 2 +- .../indexcal/impl/IndexCalculateCommunityServiceImpl.java | 2 +- .../indexcal/impl/IndexCalculateDistrictServiceImpl.java | 2 +- .../indexcal/impl/IndexCalculateStreetServiceImpl.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java index 8f4a1f1ef8..33246cad86 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -161,7 +161,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl