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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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/31] =?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 Date: Fri, 25 Sep 2020 09:35:52 +0800 Subject: [PATCH 24/31] =?UTF-8?q?toScreen=20=20=E4=B8=AD=E5=A4=AE=E5=8C=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 41 +++++ .../form/ScreenCentralZoneDataFormDTO.java | 26 +++ .../com/epmet/controller/DemoController.java | 10 ++ .../screen/ScreenUserTotalDataDao.java | 2 + .../dao/stats/FactAgencyProjectDailyDao.java | 14 ++ .../dao/stats/FactGroupGridDailyDao.java | 14 +- .../dao/stats/FactIssueGridDailyDao.java | 14 ++ .../topic/FactTopicTotalGridDailyDao.java | 12 ++ .../FactParticipationUserGridDailyDao.java | 9 + ...creenCentralZoneDataAbsorptionService.java | 19 ++ ...nCentralZoneDataAbsorptionServiceImpl.java | 50 ++++++ .../screen/ScreenUserTotalDataService.java | 13 +- .../impl/ScreenUserTotalDataServiceImpl.java | 23 +++ .../ScreenCentralZoneDataExtractService.java | 22 +++ ...reenCentralZoneDataExtractServiceImpl.java | 164 ++++++++++++++++++ .../screen/ScreenUserTotalDataDao.xml | 48 +++++ .../stats/FactAgencyProjectDailyDao.xml | 20 +++ .../mapper/stats/FactGroupGridDailyDao.xml | 21 +++ .../mapper/stats/FactIssueGridDailyDao.xml | 20 +++ .../topic/FactTopicTotalGridDailyDao.xml | 18 ++ .../FactParticipationUserGridDailyDao.xml | 37 ++++ 21 files changed, 595 insertions(+), 2 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenCentralZoneDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenCentralZoneDataAbsorptionService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenCentralZoneDataAbsorptionServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/ScreenCentralZoneDataExtractService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index b618bd54d1..a7a768b095 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -19,8 +19,11 @@ import org.joda.time.format.DateTimeFormatter; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.time.DateTimeException; import java.time.ZoneId; import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * 日期处理工具类 @@ -640,4 +643,42 @@ public class DateUtils { } return minusMonthId; } + + /** + * @Description 根据传入的时间维度判断格式,日、周、月、季、年 + * @param dimension + * @return + * @author wangc + * @date 2020.09.24 10:11 + **/ + public static String identifyTimeDimension(String dimension){ + //yyyyMMdd DATE_PATTERN_YYYYMMDD + //yyyyMM DATE_PATTERN_YYYYMM + //yyyy DATE_PATTERN_YYYY + //yyyyWcc + //yyyyQc + if(dimension.length() == NumConstant.EIGHT){ + + SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYYMMDD); + try{ df.parse(dimension); }catch (ParseException e){ return null; } + return "date"; + + }else if(dimension.length() == NumConstant.FOUR){ + SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYY); + try{df.parse(dimension);}catch (ParseException e){return null;} + return "year"; + }else if(dimension.length() == NumConstant.SEVEN){ + if(dimension.contains("W")){ + return "week"; + }else return null; + }else if(dimension.length() == NumConstant.SIX){ + if(dimension.contains("Q")){ + return "quarter"; + }else{ + SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYYMM); + try{df.parse(dimension);}catch (ParseException e){return null;} + return "month"; + } + }else return null; + } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenCentralZoneDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenCentralZoneDataFormDTO.java new file mode 100644 index 0000000000..6eb609fc5d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenCentralZoneDataFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 大屏中央区数据写入传参DTO + * @ClassName ScreenCentralZoneDataFormDTO + * @Auth wangc + * @Date 2020-09-24 10:02 + */ +@Data +public class ScreenCentralZoneDataFormDTO implements Serializable { + private static final long serialVersionUID = -6621150245370746092L; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 时间维度 不一定是dateId 需要根据其格式进行判断维度的类型 + * */ + private String dateId; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index ce10359a47..4f136ffc56 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -18,6 +18,7 @@ import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.ExtractFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity; @@ -35,11 +36,13 @@ import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollStreetServ import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenCentralZoneDataAbsorptionService; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimCustomerPartymemberService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -99,6 +102,8 @@ public class DemoController { private IndexCollCommunityService indexCollCommunityService; @Autowired private IndexCollStreetService indexCollStreetService; + @Autowired + private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService; @GetMapping("testAlarm") public void testAlarm() { @@ -642,4 +647,9 @@ public class DemoController { return new Result(); } + @PostMapping("centralzonedatacleaning") + public Result centralZoneDataCleaning(@RequestBody ScreenCentralZoneDataFormDTO param){ + screenCentralZoneDataAbsorptionService.centralZoneDataHub(param); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java index f09189dce0..2456d0d93a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java @@ -55,4 +55,6 @@ public interface ScreenUserTotalDataDao extends BaseDao list, @Param("customerId")String customerId); + + void insertBatch(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java index 2fbabdec6c..87409a6607 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java @@ -19,8 +19,10 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.project.form.MonthProjectListFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.FactAgencyProjectDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -46,4 +48,16 @@ public interface FactAgencyProjectDailyDao extends BaseDao selectProjectCountByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId ); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java index c97f5c8120..5dfd4bc79d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java @@ -19,11 +19,13 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.group.result.GroupGridDailyResultDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.FactGroupGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 组-网格日统计数据 @@ -47,5 +49,15 @@ public interface FactGroupGridDailyDao extends BaseDao * @author zxc */ void deleteInsertDateId(@Param("dateId")String dateId,@Param("customerId")String customerId); - + + /** + * @Description 根据机关级别查询小组数据 + * @param orgLevel + * @param customerId + * @param dateId + * @return + * @author wangc + * @date 2020.09.24 16:19 + **/ + List selectGroupCountByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java index 595131257d..c26edcd375 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java @@ -18,10 +18,13 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.FactIssueGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 网格议题数量(按日) * @@ -39,5 +42,16 @@ public interface FactIssueGridDailyDao extends BaseDao * @return void */ void deleteByCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 根据机关类型查询议题数据 + * @param orgLevel + * @param customerId + * @param dateId + * @return + * @author wangc + * @date 2020.09.24 17:19 + **/ + List selectIssueCountByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId ); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java index 7276945b90..7a0e6439df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.stats.topic; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.stats.topic.FactTopicTotalGridDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.topic.FactTopicTotalGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -36,4 +37,15 @@ public interface FactTopicTotalGridDailyDao extends BaseDao list); void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); + + /** + * @Description 根据机关类型查询话题数据 + * @param orgLevel + * @param customerId + * @param dateId + * @return + * @author wangc + * @date 2020.09.24 17:19 + **/ + List selectTopicCountByOrgLevel(@Param("orgLevel") String orgLevel, @Param("customerId") String customerId, @Param("dateId")String dateId ); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java index 248efe22a6..cd84b6d3b0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.result.UserCountResultDTO; import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -48,4 +49,12 @@ public interface FactParticipationUserGridDailyDao extends BaseDao selectUserCount(String customerId, String dateId); + /** + * @Description 根据机构级别查询用户数与党员数 + * @param orgLevel + * @return + * @author wangc + * @date 2020.09.24 14:59 + **/ + List selectUserAndPartymemberByOrgLevel(@Param("orgLevel") String orgLevel,@Param("customerId") String customerId, @Param("dateId")String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenCentralZoneDataAbsorptionService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenCentralZoneDataAbsorptionService.java new file mode 100644 index 0000000000..7c11d3acb3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenCentralZoneDataAbsorptionService.java @@ -0,0 +1,19 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; + +/** + * 大屏中央区数据写入 + * */ + +public interface ScreenCentralZoneDataAbsorptionService { + + /** + * @Description 中央区数据写入 + * @param param + * @return + * @author wangc + * @date 2020.09.24 10:41 + **/ + void centralZoneDataHub(ScreenCentralZoneDataFormDTO param); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenCentralZoneDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenCentralZoneDataAbsorptionServiceImpl.java new file mode 100644 index 0000000000..40d47d4f91 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenCentralZoneDataAbsorptionServiceImpl.java @@ -0,0 +1,50 @@ +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.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenCentralZoneDataAbsorptionService; +import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService; +import com.epmet.service.stats.ScreenCentralZoneDataExtractService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * @Description + * @ClassName ScreenCentralZoneDataAbsorptionServiceImpl + * @Auth wangc + * @Date 2020-09-24 10:42 + */ +@Service +@Slf4j +public class ScreenCentralZoneDataAbsorptionServiceImpl implements ScreenCentralZoneDataAbsorptionService { + + @Autowired + private ScreenCentralZoneDataExtractService screenCentralZoneDataExtractService; + @Autowired + private ScreenUserTotalDataService screenUserTotalDataService; + + /** + * @Description 中央区数据写入 + * @param param + * @return + * @author wangc + * @date 2020.09.24 10:41 + **/ + @Override + public void centralZoneDataHub(ScreenCentralZoneDataFormDTO param) { + if(StringUtils.isBlank(param.getDateId())){ + //默认前一天 + param.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); + } + List dataList = screenCentralZoneDataExtractService.extractCentralZoneData(param.getCustomerId(),param.getDateId()); + + screenUserTotalDataService.dataClean(dataList,param.getCustomerId()); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java index fd8e5f94e8..3f38a3a683 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java @@ -21,6 +21,8 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; +import java.util.List; + /** * 中央区-各类(用户|党员|党群|话题|议题|项目)总数 * @@ -28,5 +30,14 @@ import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; * @since v1.0.0 2020-09-22 */ public interface ScreenUserTotalDataService extends BaseService { - + + + /** + * @Description 大屏中央区数据清洗 + * @param list + * @return + * @author wangc + * @date 2020.09.24 17:59 + **/ + void dataClean(List list,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/ScreenUserTotalDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java index 308ba90d08..a1b21beced 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java @@ -19,10 +19,15 @@ package com.epmet.service.evaluationindex.screen.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dao.evaluationindex.screen.ScreenUserTotalDataDao; import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; /** * 中央区-各类(用户|党员|党群|话题|议题|项目)总数 @@ -33,4 +38,22 @@ import org.springframework.stereotype.Service; @Service public class ScreenUserTotalDataServiceImpl extends BaseServiceImpl implements ScreenUserTotalDataService { + /** + * @Description 大屏中央区数据清洗 + * @param list + * @return + * @author wangc + * @date 2020.09.24 17:59 + **/ + @Override + public void dataClean(List list,String customerId) { + int deleteNum; + do { + deleteNum = baseDao.deleteUserTotalData(customerId); + } while (deleteNum <= NumConstant.ZERO); + + if(!CollectionUtils.isEmpty(list)){ + baseDao.insertBatch(list); + } + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/ScreenCentralZoneDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/ScreenCentralZoneDataExtractService.java new file mode 100644 index 0000000000..0406c9f42a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/ScreenCentralZoneDataExtractService.java @@ -0,0 +1,22 @@ +package com.epmet.service.stats; + +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; + +import java.util.List; + +/** + * 大屏中央区数据抽取(form : date-statistical) + * */ +public interface ScreenCentralZoneDataExtractService { + + /** + * @Description 抽取中央区数据 + * @param customerId + * @param dimId + * @return + * @author wangc + * @date 2020.09.24 11:13 + **/ + List extractCentralZoneData(String customerId,String dimId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java new file mode 100644 index 0000000000..a36695b6b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java @@ -0,0 +1,164 @@ +package com.epmet.service.stats.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.stats.*; +import com.epmet.dao.stats.topic.FactTopicTotalAgencyDailyDao; +import com.epmet.dao.stats.topic.FactTopicTotalGridDailyDao; + + +import com.epmet.dao.stats.user.FactParticipationUserGridDailyDao; + +import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; +import com.epmet.service.stats.ScreenCentralZoneDataExtractService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Description 大屏中央区数据抽取(form : date-statistical) + * @ClassName ScreenCentralZoneDataExtractServiceImpl + * @Auth wangc + * @Date 2020-09-24 11:15 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.STATS) +public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZoneDataExtractService { + + @Autowired + private FactParticipationUserGridDailyDao factParticipationUserGridDailyDao; + @Autowired + private FactGroupGridDailyDao factGroupGridDailyDao; + @Autowired + private FactTopicTotalGridDailyDao factTopicTotalGridDailyDao; + @Autowired + private FactIssueGridDailyDao factIssueGridDailyDao; + @Autowired + private FactAgencyProjectDailyDao factAgencyProjectDailyDao; + + + private final String ORG_LEVEL_AGENCY = "agency"; + private final String ORG_LEVEL_GRID = "grid"; + + + /** + * @Description 抽取中央区数据 + * @param customerId + * @param dimId + * @return + * @author wangc + * @date 2020.09.24 11:13 + **/ + @Override + public List extractCentralZoneData(String customerId, String dimId) { + + //1.查询用户与党员数据,判断dimId是否为昨天,如果根据这个dimId没有查询出结果,则取前天的数据 + //如果还是查不出数据,继续向下执行,这部分数据设置默认值 + List result = + factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(result)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + result = factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + if(null == result) result = new LinkedList<>(); + } + List gridUserResult = + factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + + if(CollectionUtils.isEmpty(gridUserResult)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridUserResult = factParticipationUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + if(!CollectionUtils.isEmpty(gridUserResult)){ + result.addAll(gridUserResult); + } + + //2.组 + List agencyGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(agencyGroup)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + agencyGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + List gridGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + if(CollectionUtils.isEmpty(gridGroup)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + Map groupMap = agencyGroup.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getGroupTotal)); + groupMap.putAll(gridGroup.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getGroupTotal))); + + + //3.话题 + List agencyTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(agencyTopic)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + agencyTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + List gridTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + if(CollectionUtils.isEmpty(gridTopic)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + Map topicMap = agencyTopic.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getTopicTotal)); + topicMap.putAll(gridTopic.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getTopicTotal))); + + //4.议题 + List agencyIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(agencyIssue)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + agencyIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + List gridIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + if(CollectionUtils.isEmpty(gridIssue)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + Map issueMap = agencyIssue.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal)); + issueMap.putAll(gridIssue.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal))); + + //5.项目 + List agencyProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); + if(CollectionUtils.isEmpty(agencyProject)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + agencyProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + List gridProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); + if(CollectionUtils.isEmpty(gridProject)){ + if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ + gridProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_GRID,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); + } + } + Map projectMap = agencyProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal)); + projectMap.putAll(gridProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal))); + + result.forEach(o -> { + String orgId = o.getOrgId(); + o.setGroupTotal(groupMap.get(orgId)); + o.setTopicTotal(topicMap.get(orgId)); + o.setIssueTotal(issueMap.get(orgId)); + o.setProjectTotal(projectMap.get(orgId)); + o.setDataEndTime(dimId); + }); + + + + return result; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml index ecf0039810..e8c0e8c660 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml @@ -57,4 +57,52 @@ + + insert into screen_user_total_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + DATA_END_TIME, + USER_TOTAL, + PARTY_TOTAL, + GROUP_TOTAL, + TOPIC_TOTAL, + ISSUE_TOTAL, + PROJECT_TOTAL, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.dataEndTime}, + #{item.userTotal}, + #{item.partyTotal}, + #{item.groupTotal}, + #{item.topicTotal}, + #{item.issueTotal}, + #{item.projectTotal}, + 0, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml index 34327672d6..b2333a5451 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml @@ -25,4 +25,24 @@ AND date_id = #{dateId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml index 8c8ab22e50..c8e631ed88 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml @@ -76,4 +76,25 @@ AND customer_id = #{customerId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml index 998f24e343..de8596943f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml @@ -50,4 +50,24 @@ + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml index 537a46cebb..097fb515a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml @@ -90,4 +90,22 @@ + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml index 96e16db5be..2837f9c4a1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml @@ -121,5 +121,42 @@ AND DATE_ID = #{dateId} + + \ No newline at end of file From 121c2a2122a2196042bb4ad59acb5fe916ea154f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 25 Sep 2020 10:37:00 +0800 Subject: [PATCH 25/31] =?UTF-8?q?=E5=AD=94=E6=9D=91=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E3=80=81=E6=95=B0=E6=8D=AE=E6=94=B9=E7=89=88=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99=E6=B3=A8=E8=A7=A3=EF=BC=9B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=94=B9=E7=89=88=E9=83=A8=E5=88=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/PartIndexScroeRankFormDTO.java | 35 +++++++++++ .../screen/dto/form/UserPointRankFormDTO.java | 35 +++++++++++ .../result/PartIndexScroeRankResultDTO.java | 45 ++++++++++++++ .../result/UserPointRankListResultDTO.java | 46 ++++++++++++++ .../controller/fact/FactIndexController.java | 7 --- .../controller/screen/KcScreenController.java | 31 ---------- .../screen/ScreenUserController.java | 59 ++++++++++++++++++ .../screen/ScreenPartyUserRankDataDao.java | 18 ++++++ .../screen/ScreenUserService.java | 30 +++++++++ .../screen/impl/ScreenUserServiceImpl.java | 61 +++++++++++++++++++ .../screen/ScreenPartyUserRankDataDao.xml | 54 ++++++++++++++++ 11 files changed, 383 insertions(+), 38 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartIndexScroeRankFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserPointRankFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartIndexScroeRankResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointRankListResultDTO.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartIndexScroeRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartIndexScroeRankFormDTO.java new file mode 100644 index 0000000000..da2d919c2f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartIndexScroeRankFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 党员(指标得分)排行--接口入参 + * @Author sun + */ +@Data +public class PartIndexScroeRankFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {PartIndexScroeRankFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 类型(组织:agency 网格:grid) + */ + @NotBlank(message = "数据类型不能为空",groups = {PartIndexScroeRankFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 默认显示前5名 + */ + @Min(value = 1, message = "查询条数必须大于0", groups = {PartIndexScroeRankFormDTO.AddUserInternalGroup.class }) + private Integer topNum; + public interface AddUserInternalGroup {} + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserPointRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserPointRankFormDTO.java new file mode 100644 index 0000000000..cc1ad2bd36 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserPointRankFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 热心市民积分排行列表--接口入参 + * @Author sun + */ +@Data +public class UserPointRankFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {UserPointRankFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 类型(组织:agency 网格:grid) + */ + @NotBlank(message = "数据类型不能为空",groups = {UserPointRankFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 默认显示前5名 + */ + @Min(value = 1, message = "查询条数必须大于0", groups = {UserPointRankFormDTO.AddUserInternalGroup.class }) + private Integer topNum; + public interface AddUserInternalGroup {} + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartIndexScroeRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartIndexScroeRankResultDTO.java new file mode 100644 index 0000000000..48472ad581 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartIndexScroeRankResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党员(指标得分)排行--接口返参 + * @Author sun + */ +@Data +public class PartIndexScroeRankResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 组织ID + */ + private String agencyId; + /** + * 组织名称 + */ + private String agencyName; + /** + * 用户Id + */ + private String userId; + /** + * 用户名称 + */ + private String userName; + /** + * 网格Id + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + /** + * 党员指标得分 + */ + private Integer indexScore; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointRankListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointRankListResultDTO.java new file mode 100644 index 0000000000..d2909faffd --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserPointRankListResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 热心市民积分排行列表--接口返参 + * @Author sun + */ +@Data +public class UserPointRankListResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 组织ID + */ + private String agencyId; + /** + * 组织名称 + */ + private String agencyName; + /** + * 用户Id + */ + private String userId; + /** + * 用户名称 + */ + private String userName; + /** + * 网格Id + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + /** + * 用户积分 + */ + private Integer pointTotal; + +} 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 12eb550d99..c7eb8ac820 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 @@ -33,7 +33,6 @@ 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); @@ -45,7 +44,6 @@ 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); @@ -57,7 +55,6 @@ 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); @@ -69,7 +66,6 @@ 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); @@ -81,7 +77,6 @@ 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); @@ -93,7 +88,6 @@ 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); @@ -105,7 +99,6 @@ 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); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java index c56c3e8df8..8e9a3d0bfa 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java @@ -43,7 +43,6 @@ public class KcScreenController { * @Description 首页-平台各类总数 * @author sun */ - @ExternalAppRequestAuth @PostMapping("homepage/summary") public Result homepageSummary(ExternalAppRequestParam externalAppRequestParam){ return new Result().ok(kcScreenService.homepageSummary(externalAppRequestParam)); @@ -54,7 +53,6 @@ public class KcScreenController { * @Description 公益互助-各类总数汇总 * @author sun */ - @ExternalAppRequestAuth @PostMapping("heart/summary") public Result heartSummary(ExternalAppRequestParam externalAppRequestParam){ return new Result().ok(kcScreenService.heartSummary(externalAppRequestParam)); @@ -65,7 +63,6 @@ public class KcScreenController { * @Description 公益互助-公益活动次数 * @author sun */ - @ExternalAppRequestAuth @PostMapping("heart/actcounttrend") public Result heartActcounttrend(ExternalAppRequestParam externalAppRequestParam){ return new Result().ok(kcScreenService.heartActcounttrend(externalAppRequestParam)); @@ -75,8 +72,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth - @InternalAppRequestAuth @PostMapping("issue/summary") public Result getIssueSummary(ExternalAppRequestParam externalAppRequestParam) { String customerId = externalAppRequestParam.getCustomerId(); @@ -90,7 +85,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("issue/partitrend") public Result getIssuePartiTrend(ExternalAppRequestParam externalAppRequestParam) { String customerId = externalAppRequestParam.getCustomerId(); @@ -104,7 +98,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("issue/gridtotalrank") public Result getIssueGridTotalRank(ExternalAppRequestParam externalAppRequestParam) { String customerId = externalAppRequestParam.getCustomerId(); @@ -117,7 +110,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("issue/avgaudittimerank") public Result getAvgAuditTimeRank(ExternalAppRequestParam externalAppRequestParam) { String customerId = externalAppRequestParam.getCustomerId(); @@ -130,7 +122,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("issue/effective") public Result getIssueEffective(ExternalAppRequestParam externalAppRequestParam) { String customerId = externalAppRequestParam.getCustomerId(); @@ -144,7 +135,6 @@ public class KcScreenController { * @Description 公益互助-志愿者画像 * @author sun */ - @ExternalAppRequestAuth @PostMapping("heart/volunteerportrayal") public Result heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam){ return new Result().ok(kcScreenService.heartVolunteerportrayal(externalAppRequestParam)); @@ -155,7 +145,6 @@ public class KcScreenController { * @Description 公益互助-个人(志愿者)公益时长排名 * @author sun */ - @ExternalAppRequestAuth @PostMapping("heart/volunteerrank") public Result> heartVolunteerrank(ExternalAppRequestParam externalAppRequestParam, @RequestBody HeartVolunteerrankFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, HeartVolunteerrankFormDTO.AddUserInternalGroup.class); @@ -169,7 +158,6 @@ public class KcScreenController { * @Description 邻里党群-各类总数 * @author sun */ - @ExternalAppRequestAuth @PostMapping("group/summary") public Result groupSummary(ExternalAppRequestParam externalAppRequestParam){ return new Result().ok(kcScreenService.groupSummary(externalAppRequestParam)); @@ -180,7 +168,6 @@ public class KcScreenController { * @Description 邻里党群-话题参与趋势 * @author sun */ - @ExternalAppRequestAuth @PostMapping("group/partitopictrend") public Result groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam){ return new Result().ok(kcScreenService.groupPartitopictrend(externalAppRequestParam)); @@ -191,7 +178,6 @@ public class KcScreenController { * @Description 邻里党群-社群数量排名 * @author sun */ - @ExternalAppRequestAuth @PostMapping("group/gridgroupcountrank") public Result groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam){ return new Result().ok(kcScreenService.groupGridgroupcountrank(externalAppRequestParam)); @@ -202,7 +188,6 @@ public class KcScreenController { * @Description 邻里党群-社群数量排名 * @author sun */ - @ExternalAppRequestAuth @PostMapping("group/usercountrank") public Result> groupUserCountRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupUserCountRankFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, GroupUserCountRankFormDTO.AddUserInternalGroup.class); @@ -215,7 +200,6 @@ public class KcScreenController { * @Description 邻里党群-话题转化率排名 * @author sun */ - @ExternalAppRequestAuth @PostMapping("group/topicshiftissueratiorank") public Result> groupTopicShiftIssueRatioRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupTopicShiftIssueRatioRankFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, GroupTopicShiftIssueRatioRankFormDTO.AddUserInternalGroup.class); @@ -228,7 +212,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("project/summary") public Result getProjectSummary(ExternalAppRequestParam externalAppRequestParam){ //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; @@ -241,7 +224,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("project/gridcountrank") public Result getProjectGridCountRank(ExternalAppRequestParam externalAppRequestParam){ //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; @@ -254,7 +236,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("project/categoryanalysis") public Result> getProjectCategoryAnalysis(ExternalAppRequestParam externalAppRequestParam){ //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; @@ -267,7 +248,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("project/avgclosedtimeanalysis") public Result> getGridProjectAvgClosedTimeAnalysis(ExternalAppRequestParam externalAppRequestParam){ //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; @@ -280,7 +260,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("project/statis") public Result getProjectSatisfactionAnalyze(ExternalAppRequestParam externalAppRequestParam){ String customerId = externalAppRequestParam.getCustomerId(); @@ -292,7 +271,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("user/summary") public Result getUserSummary(ExternalAppRequestParam externalAppRequestParam){ String customerId = externalAppRequestParam.getCustomerId(); @@ -305,7 +283,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("user/trend") public Result getUserTrend(ExternalAppRequestParam externalAppRequestParam){ String customerId = externalAppRequestParam.getCustomerId(); @@ -317,7 +294,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("user/griduserrank") public Result getUserRank(ExternalAppRequestParam externalAppRequestParam){ String customerId = externalAppRequestParam.getCustomerId(); @@ -329,7 +305,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("user/userportrayal") public Result getUserPortrayal(ExternalAppRequestParam externalAppRequestParam){ String customerId = externalAppRequestParam.getCustomerId(); @@ -341,7 +316,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("user/pointsrank") public Result getUserPointsRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody PageFormDTO form) { @@ -354,7 +328,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("news/summary") public Result getNewsSummary(ExternalAppRequestParam externalAppRequestParam){ String customerId = externalAppRequestParam.getCustomerId(); @@ -366,7 +339,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("news/partitrend") public Result getNewsPartiTrend(ExternalAppRequestParam externalAppRequestParam){ String customerId = externalAppRequestParam.getCustomerId(); @@ -378,7 +350,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("news/category") public Result> getNewsCountGroupByCategory(ExternalAppRequestParam externalAppRequestParam){ String customerId = externalAppRequestParam.getCustomerId(); @@ -390,7 +361,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("news/userparticategoryrank") public Result getNewsPartiCategoryRank(ExternalAppRequestParam externalAppRequestParam){ String customerId = externalAppRequestParam.getCustomerId(); @@ -402,7 +372,6 @@ public class KcScreenController { * @param externalAppRequestParam * @return */ - @ExternalAppRequestAuth @PostMapping("news/hotrank") public Result> listNewsHotRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody PageFormDTO form){ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java new file mode 100644 index 0000000000..5e7c544c38 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java @@ -0,0 +1,59 @@ +package com.epmet.datareport.controller.screen; + +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; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService; +import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 数据改版api + * + * @author sun + */ +@RestController +@RequestMapping("/screen/user") +public class ScreenUserController { + + @Autowired + private ScreenUserService screenUserService; + + /** + * @param tokenDTO + * @Description 热心市民积分排行列表 + * @author sun + */ + @InternalAppRequestAuth + @PostMapping("userpointrank") + public Result> userPointRank(@LoginUser TokenDto tokenDTO, @RequestBody UserPointRankFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UserPointRankFormDTO.AddUserInternalGroup.class); + return new Result>().ok(screenUserService.userPointRank(formDTO)); + } + + /** + * @param tokenDTO + * @Description 党员(指标得分)排行 + * @author sun + */ + @InternalAppRequestAuth + @PostMapping("partindexscroerank") + public Result> partIndexScroeRank(@LoginUser TokenDto tokenDTO, @RequestBody PartIndexScroeRankFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PartIndexScroeRankFormDTO.AddUserInternalGroup.class); + return new Result>().ok(screenUserService.partIndexScroeRank(formDTO)); + } + + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java index bc15ca191f..0f442931b5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java @@ -18,7 +18,11 @@ package com.epmet.datareport.dao.evaluationindex.screen; import com.epmet.dto.result.user.KcUserPointRankResultDTO; +import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.PartyUserPointResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; import com.epmet.evaluationindex.screen.dto.result.UserPointResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -53,4 +57,18 @@ public interface ScreenPartyUserRankDataDao{ List selectPartymemberPointOrder(@Param("agencyId")String agencyId); List listUserPoints(String customerId); + + /** + * @param formDTO + * @Description 查询组织下居民积分排行,按积分值降序 + * @author sun + */ + List selectAgencyUserPointList(UserPointRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 查询组织下党员的积分排行,按积分值降序 + * @author sun + */ + List selectPartymemberPointList(PartIndexScroeRankFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java new file mode 100644 index 0000000000..f5e2428f09 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java @@ -0,0 +1,30 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; + +import java.util.List; + +/** + * 数据改版 + * + * @author sun + */ +public interface ScreenUserService { + + /** + * @param formDTO + * @Description 热心市民积分排行列表 + * @author sun + */ + List userPointRank(UserPointRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 党员(指标得分)排行 + * @author sun + */ + List partIndexScroeRank(PartIndexScroeRankFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java new file mode 100644 index 0000000000..1a92a59d95 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java @@ -0,0 +1,61 @@ +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.constant.FactConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyUserRankDataDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService; +import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 数据改版 + * + * @author sun + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenUserServiceImpl implements ScreenUserService { + + @Autowired + private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + + /** + * @param formDTO + * @Description 热心市民积分排行列表 + * @author sun + */ + @Override + public List userPointRank(UserPointRankFormDTO formDTO) { + //1.参数校验 + if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + //2.查询组织下居民积分排行,按积分值降序 screen_party_user_rank_data + return screenPartyUserRankDataDao.selectAgencyUserPointList(formDTO); + } + + /** + * @param formDTO + * @Description 党员(指标得分)排行 + * @author sun + */ + @Override + public List partIndexScroeRank(PartIndexScroeRankFormDTO formDTO) { + //1.参数校验 + if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + //2.查询组织下党员的积分排行 screen_party_user_rank_data + return screenPartyUserRankDataDao.selectPartymemberPointList(formDTO); + } + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index 9366bc90f7..ff0ccf9630 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -44,4 +44,58 @@ and ur.CUSTOMER_ID = #{customerId} order by ur.POINT_TOTAL desc + + + + + \ No newline at end of file From 95f1a7591627ebd61d4537a7407754efb594a869 Mon Sep 17 00:00:00 2001 From: wangchao Date: Fri, 25 Sep 2020 11:17:36 +0800 Subject: [PATCH 26/31] =?UTF-8?q?data-stats=E6=9C=8D=E5=8A=A1=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=A7=AF=E5=88=86=E6=95=B0=E6=8D=AE=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/constant/DataSourceConstant.java | 1 + .../data-statistical-server/pom.xml | 24 +++++++++++++++++++ .../src/main/resources/bootstrap.yml | 5 ++++ 3 files changed, 30 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java index b20619837c..064104b9b2 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java @@ -14,4 +14,5 @@ public interface DataSourceConstant { String EVALUATION_INDEX = "evaluationIndex"; String PARTY_MEMBER = "partyMember"; String EPMET_HEART="epmetHeart"; + String EPMET_POINT = "epmetPoint"; } diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 9c12e8d5e5..e40e69ed9f 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -216,6 +216,12 @@ epmet_heart_user EpmEt-db-UsEr + + + + epmet_point_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -326,6 +332,12 @@ epmet_heart_user EpmEt-db-UsEr + + + + epmet_point_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -436,6 +448,12 @@ epmet elink@833066 + + + + epmet + elink@833066 + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -542,6 +560,12 @@ epmet_heart_user EpmEt-db-UsEr + + + + epmet_point_user + EpmEt-db-UsEr + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com 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 ccb02b714f..8f22922df8 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 @@ -180,6 +180,11 @@ dynamic: url: @datasource.druid.epmetHeart.url@ username: @datasource.druid.epmetHeart.username@ password: @datasource.druid.epmetHeart.password@ + epmetPoint: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.epmetPoint.url@ + username: @datasource.druid.epmetPoint.username@ + password: @datasource.druid.epmetPoint.password@ thread: # 线程池配置 From 02e2f6c07cf1f530dc826c9326cb94c514c8c835 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 25 Sep 2020 14:06:25 +0800 Subject: [PATCH 27/31] =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=82=E4=B8=8E?= =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toscreen/PublicPartExtractService.java | 32 +++++++++++ .../extract/toscreen/ScreenOrgService.java | 32 +++++++++++ .../impl/PublicPartExtractServiceImpl.java | 54 +++++++++++++++++++ .../impl/ScreenCustomerAgencyServiceImpl.java | 8 +-- 4 files changed, 120 insertions(+), 6 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenOrgService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java new file mode 100644 index 0000000000..388559649d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartExtractService.java @@ -0,0 +1,32 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +/** + * @desc: 大屏 公众参与抽取服务接口 + * @Author: LiuJanJun + * @Date: 2020/9/25 10:03 上午 + * @Version: 1.0 + */ +public interface PublicPartExtractService { + + /** + * desc: 抽取公众参与 人均议题 总次数和平均参与度 + * target:screen_user_join + * + * @param + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + Boolean extractTotalDataMonthly(); + + /** + * desc: 抽取公众参与 各类总数 + * target:screen_public_parti_total_data + * + * @param + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + Boolean extractPerTotalDataDaily(); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenOrgService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenOrgService.java new file mode 100644 index 0000000000..bb177bd877 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenOrgService.java @@ -0,0 +1,32 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +/** + * @desc: 大屏 产品内部客户组织结构数据 + * @Author: LiuJanJun + * @Date: 2020/9/25 10:03 上午 + * @Version: 1.0 + */ +public interface ScreenOrgService { + + /** + * desc: 抽取公众参与 人均议题 总次数和平均参与度 + * target:screen_user_join + * + * @param + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + Boolean getInnerCustomerAgencyTree(); + + /** + * desc: 抽取公众参与 各类总数 + * target:screen_public_parti_total_data + * + * @param + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + Boolean extractPerTotalDataDaily(); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java new file mode 100644 index 0000000000..ae0aab7fa0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java @@ -0,0 +1,54 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.extract.toscreen.PublicPartExtractService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; +import com.epmet.service.evaluationindex.screen.ScreenPublicPartiTotalDataService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * desc:公众参与抽取到大屏的接口实现类 + * + * @author: LiuJanJun + * @date: 2020/9/25 10:46 上午 + * @version: 1.0 + */ +@Service +public class PublicPartExtractServiceImpl implements PublicPartExtractService { + + @Autowired + private ScreenPublicPartiTotalDataService screenPublicPartiTotalDataService; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private ScreenCustomerAgencyService agencyService; + + + /** + * desc: 【月】抽取公众参与 人均议题 总次数和平均参与度 + * target:screen_user_join + * + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + @Override + public Boolean extractTotalDataMonthly() { + //agencyService.initAgencies(); + return null; + } + + /** + * desc: 【日】抽取公众参与 各类总数 + * target:screen_public_parti_total_data + * + * @return java.lang.Boolean + * @author LiuJanJun + * @date 2020/9/25 10:24 上午 + */ + @Override + public Boolean extractPerTotalDataDaily() { + return null; + } +} 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 13d056ced5..404ee7240c 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 @@ -22,13 +22,13 @@ 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.constant.ScreenConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; import com.epmet.dto.extract.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; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; @@ -39,10 +39,6 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import java.util.stream.Collectors; /** @@ -114,7 +110,7 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ @Transactional(rollbackFor = Exception.class) @Override public void initAgencies(List agencies2Add, List agencies2Update) { - String dateEndTime = DateUtils.format(new Date(), "YYYYmmdd"); + String dateEndTime = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); if (!CollectionUtils.isEmpty(agencies2Add)) { // 添加 for (CustomerAgencyEntity e : agencies2Add) { From 043bd045e9c263fb24aba3212b79c63e0b2379b3 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 25 Sep 2020 14:18:21 +0800 Subject: [PATCH 28/31] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=95=B0=20=E6=B7=BB=E5=8A=A0=20=E6=98=AF=E5=90=A6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datareport/controller/screen/AgencyController.java | 2 +- .../service/evaluationindex/screen/AgencyService.java | 2 +- .../evaluationindex/screen/impl/AgencyServiceImpl.java | 6 ------ .../resources/mapper/screen/ScreenCustomerAgencyDao.xml | 2 ++ .../main/resources/mapper/screen/ScreenCustomerGridDao.xml | 1 + 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java index 1828f19ac8..07b6bf2093 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -31,8 +31,8 @@ public class AgencyController { private AgencyService agencyService; /** - * @Description 1、组织机构树 * @param + * @Description 1、组织机构树 只返回 is_display = '1'的 * @author zxc * @date 2020/8/18 2:04 下午 */ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java index d633b94ea2..f881373c1b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java @@ -14,8 +14,8 @@ import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; public interface AgencyService { /** - * @Description 1、组织机构树 * @param + * @Description 1、组织机构树 只返回 is_display = '1'的 * @author zxc * @date 2020/8/18 2:04 下午 */ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index c5bf2bab81..3ecb962cc8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -13,7 +13,6 @@ import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; -import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.exceptions.TooManyResultsException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -48,11 +47,6 @@ public class AgencyServiceImpl implements AgencyService { // 1. 查询客户根组织ID String customerId = externalAppRequestParam.getCustomerId(); - - // 验签关闭,customerId无法获取,暂时写死 - if (StringUtils.isBlank(customerId)) { - customerId = "b09527201c4409e19d1dbc5e3c3429a1"; - } TreeResultDTO rootAgency = null; try { rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 932149d9c5..969bcea847 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -16,6 +16,7 @@ WHERE del_flag = 0 AND pid = '0' + AND IS_DISPLAY = '1' AND customer_id = #{customerId} @@ -31,6 +32,7 @@ screen_customer_agency WHERE del_flag = '0' + AND IS_DISPLAY = '1' AND pids = #{subAgencyPids} ORDER BY created_time DESC diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 6cafd96036..b17fe0f6a8 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -77,6 +77,7 @@ screen_customer_grid WHERE del_flag = '0' + AND IS_DISPLAY = '1' AND parent_agency_id = #{agencyId} ORDER BY created_time DESC From 92304b167f4657eaa2f79c0e770a9722f17ba217 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 25 Sep 2020 15:01:28 +0800 Subject: [PATCH 29/31] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=BC=95=E9=A2=86?= =?UTF-8?q?=E3=80=90=E5=85=9A=E5=91=98=E5=BB=BA=E7=BE=A4=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E7=BE=A4=E6=88=90=E5=91=98=E6=95=B0=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/ScreenPartyBranchDataFormDTO.java | 97 ++++++++ .../ScreenPartyLinkMassesDataFormDTO.java | 73 ++++++ .../dto/extract/result/GridPartyGuideDTO.java | 23 ++ .../com/epmet/controller/DemoController.java | 10 + .../extract/FactOriginGroupMainDailyDao.java | 10 + .../screen/ScreenCustomerAgencyDao.java | 10 + .../screen/ScreenCustomerGridDao.java | 10 + .../screen/ScreenPartyBranchDataDao.java | 9 + .../screen/ScreenPartyLinkMassesDataDao.java | 29 +++ .../FactOriginGroupMainDailyService.java | 10 + .../FactOriginGroupMainDailyServiceImpl.java | 18 ++ .../extract/toscreen/PartyGuideService.java | 4 +- .../impl/PartyBaseInfoServiceImpl.java | 3 +- .../toscreen/impl/PartyGuideServiceImpl.java | 233 +++++++++++++++++- .../screen/ScreenCustomerAgencyService.java | 10 + .../screen/ScreenCustomerGridService.java | 10 + .../screen/ScreenPartyBranchDataService.java | 11 + .../ScreenPartyLinkMassesDataService.java | 31 +++ .../impl/ScreenCustomerAgencyServiceImpl.java | 13 + .../impl/ScreenCustomerGridServiceImpl.java | 13 + .../ScreenPartyBranchDataServiceImpl.java | 17 +- .../ScreenPartyLinkMassesDataServiceImpl.java | 45 ++++ .../extract/FactOriginGroupMainDailyDao.xml | 26 ++ .../screen/ScreenCpcBaseDataDao.xml | 1 + .../screen/ScreenCustomerAgencyDao.xml | 16 ++ .../screen/ScreenCustomerGridDao.xml | 16 ++ .../screen/ScreenPartyBranchDataDao.xml | 51 ++++ .../screen/ScreenPartyLinkMassesDataDao.xml | 60 +++++ 28 files changed, 851 insertions(+), 8 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java new file mode 100644 index 0000000000..06b95d02d2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java @@ -0,0 +1,97 @@ +package com.epmet.dto.extract.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/25 9:07 上午 + */ +@Data +public class ScreenPartyBranchDataFormDTO implements Serializable { + + private static final long serialVersionUID = -5521810726686859779L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice + */ + private String type; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 会议分类Id + */ + private String meetCategoryId; + + /** + * 会议分类名称(三会党课、主题党日.....等等) + */ + private String meetCategoryName; + + /** + * 组织次数 + */ + private Integer organizeCount; + + /** + * 参加人数 + */ + private Integer joinUserCount; + + /** + * 平均参加人数 + */ + private Integer averageJoinUserCount; + + private String delFlag; + + private Integer revision; + + private String createdBy; + + private String updatedBy; + + public ScreenPartyBranchDataFormDTO() { + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + this.type = "voluntaryservice"; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java new file mode 100644 index 0000000000..3ff541a16d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyLinkMassesDataFormDTO.java @@ -0,0 +1,73 @@ +package com.epmet.dto.extract.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/24 6:03 下午 + */ +@Data +public class ScreenPartyLinkMassesDataFormDTO implements Serializable { + + private static final long serialVersionUID = -7534140815638694052L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 党员建群总数 + */ + private Integer createGroupTotal; + + /** + * 群成员总数 + */ + private Integer groupUserTotal; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + private String delFlag; + + private Integer revision; + + private String createdBy; + + private String updatedBy; + + public ScreenPartyLinkMassesDataFormDTO() { + this.createGroupTotal = NumConstant.ZERO; + this.groupUserTotal = NumConstant.ZERO; + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java new file mode 100644 index 0000000000..7646ff9567 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridPartyGuideDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.extract.result; + +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/25 10:10 上午 + */ +@Data +@AllArgsConstructor +public class GridPartyGuideDTO implements Serializable { + + private static final long serialVersionUID = 8986034496647129566L; + + private List orgIds; + + private List result; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 4f136ffc56..010b6ed47c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -37,6 +37,7 @@ import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDail import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService; import com.epmet.service.evaluationindex.extract.toscreen.ScreenCentralZoneDataAbsorptionService; +import com.epmet.service.evaluationindex.extract.toscreen.PartyGuideService; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimCustomerPartymemberService; @@ -647,6 +648,15 @@ public class DemoController { return new Result(); } + @Autowired + private PartyGuideService partyGuideService; + + @PostMapping("zxczxc") + public Result getZxcZxc(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ + partyGuideService.partyGuideExtract(formDTO.getCustomerId(),formDTO.getDateId()); + return new Result(); + } + @PostMapping("centralzonedatacleaning") public Result centralZoneDataCleaning(@RequestBody ScreenCentralZoneDataFormDTO param){ screenCentralZoneDataAbsorptionService.centralZoneDataHub(param); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java index 5844aa19f8..66a156557d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.extract.form.GridHeartedFormDTO; @@ -137,4 +138,13 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectGroupMemberList(@Param("list") List groupIdList); + + /** + * @Description 查询党员建组信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/25 9:46 上午 + */ + List selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("gridIds") List gridIds); } \ No newline at end of file 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 bf64ec0495..62ba836b5c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.screen.result.TreeResultDTO; @@ -154,6 +155,15 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAllAgencyIdToParty(@Param("customerId")String customerId,@Param("dateId")String dateId); + /** + * @Description 查询客户下所有机关ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:39 上午 + */ + List selectAllAgencyIdToPartyLinkMessage(String customerId, String monthId); + /** * @Description 查询org名称【机关】 * @param 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 658b7c4126..d917f62ffb 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 @@ -22,6 +22,7 @@ import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; @@ -143,6 +144,15 @@ public interface ScreenCustomerGridDao extends BaseDao */ List selectAllGridIdToParty(String customerId, String dateId); + /** + * @Description 查询客户下所有网格ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:43 上午 + */ + List selectAllGridIdToPartyLinkMessage(@Param("customerId") String customerId,@Param("monthId") String monthId); + /** * @Description 查询org名称 * @param gridIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java index 385f27d2f9..8c5211cefc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.screencoll.form.PartyBranchDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -56,4 +57,12 @@ public interface ScreenPartyBranchDataDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 插入建设情况数据 + * @param lists + * @author zxc + * @date 2020/9/25 9:16 上午 + */ + void insertScreenPartyBranchData(@Param("lists") List lists); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java index 857958ad1c..586ab1d0a8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.screencoll.form.PartyLinkMassesDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -55,4 +56,32 @@ public interface ScreenPartyLinkMassesDataDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @Description 批量插入党员联系群众数据 + * @param lists + * @author zxc + * @date 2020/9/24 6:06 下午 + */ + void insertScreenPartyLinkMassesData(@Param("lists")List lists); + + /** + * @Description 删除旧的党员联系群众 + * @param customerId + * @param monthId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + Integer deleteOldPartyLinkInfo(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("orgIds") List orgIds); + + /** + * @Description 查询党员联系群众信息 + * @Param customerId + * @Param monthId + * @Param agencyId + * @author zxc + * @date 2020/9/25 1:19 下午 + */ + List selectPartyLinkMassesInfo(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("agencyId") String agencyId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java index bf40ac8388..fdaac9d36e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java @@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; @@ -62,4 +63,13 @@ public interface FactOriginGroupMainDailyService extends BaseService originGroupData,List memberList); + + /** + * @Description 查询党员建组信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/25 9:46 上午 + */ + List selectPartyCreateGroupInfo(String customerId,String monthId,List gridIds); } \ 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/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index ed5aeca1a1..4cc0ebb248 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -21,13 +21,16 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -97,4 +100,19 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl selectPartyCreateGroupInfo(String customerId, String monthId,List gridIds) { + if (!CollectionUtils.isEmpty(gridIds)){ + return baseDao.selectPartyCreateGroupInfo(customerId, monthId, gridIds); + } + 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/extract/toscreen/PartyGuideService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java index 09dafb2a6a..8700a2b7e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PartyGuideService.java @@ -9,10 +9,10 @@ public interface PartyGuideService { /** * @Description 党建引领抽取 * @param customerId - * @param dateId + * @param monthId * @author zxc * @date 2020/9/24 5:10 下午 */ - Boolean partyGuideExtract(String customerId,String dateId); + Boolean partyGuideExtract(String customerId,String monthId); } 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 6dcfe74f8c..f30e987bb9 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 @@ -141,8 +141,7 @@ 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 directGridIds = gridService.selectDirectGrid(orgIds); List userCountList = userGridDailyService.selectUserCount(customerId, dateId); agencyIdList.forEach(agency -> { String agencyId = agency.getAgencyId(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java index e820b39396..19b0eaa9d4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java @@ -1,8 +1,29 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.ScreenConstant; +import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.result.*; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.PartyGuideService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import com.epmet.service.evaluationindex.screen.ScreenPartyBranchDataService; +import com.epmet.service.evaluationindex.screen.ScreenPartyLinkMassesDataService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.springframework.beans.BeanUtils; +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.List; +import java.util.Map; +import java.util.stream.Collectors; /** * @Author zxc @@ -12,15 +33,221 @@ import org.springframework.stereotype.Service; @Slf4j public class PartyGuideServiceImpl implements PartyGuideService { + @Autowired + private ScreenPartyLinkMassesDataService linkMassesDataService; + @Autowired + private ScreenPartyBranchDataService partyBranchDataService; + @Autowired + private FactOriginGroupMainDailyService groupMainService; + @Autowired + private ScreenCustomerAgencyService agencyService; + @Autowired + private ScreenCustomerGridService gridService; + /** * @Description 党建引领抽取 * @param customerId - * @param dateId + * @param monthId * @author zxc * @date 2020/9/24 5:10 下午 */ @Override - public Boolean partyGuideExtract(String customerId, String dateId) { - return null; + public Boolean partyGuideExtract(String customerId, String monthId) { + //【党员建群数,群成员数】 + List agencyIdList = agencyService.selectAllAgencyId(customerId); + if (!CollectionUtils.isEmpty(agencyIdList)){ + // 根据组织级别分组 + Map> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel)); + if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){ + // 社区级别 + List customerGridInfoList = groupByLevel.get(ScreenConstant.COMMUNITY); + disPose(customerGridInfoList,true,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.STREET)){ + // 街道级别 + List customerGridInfoList = groupByLevel.get(ScreenConstant.STREET); + disPose(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){ + // 区级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.DISTRICT); + disPose(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.CITY)){ + // 市级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.CITY); + disPose(customerGridInfoList,false,customerId,monthId); + } + if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){ + // 省级 + List customerGridInfoList = groupByLevel.get(ScreenConstant.PROVINCE); + disPose(customerGridInfoList,false,customerId,monthId); + } + } + return true; + } + + /** + * @Description 处理 + * @Param agencyIdList + * @Param isGrid + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 2:57 下午 + */ + public void disPose(List agencyIdList, Boolean isGrid, String customerId, String monthId) { + List result = new ArrayList<>(); + if (!CollectionUtils.isEmpty(agencyIdList)){ + List orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); + if (isGrid == true){ + agencyIdList.forEach(agency -> { + GridPartyGuideDTO gridPartyGuideDTO = communityLevelSubGrid(customerId, monthId, agency); + orgIds.addAll(gridPartyGuideDTO.getOrgIds()); + result.addAll(gridPartyGuideDTO.getResult()); + }); + Map> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyLinkMassesDataFormDTO::getParentId)); + groupByAgency.forEach((agencyId,gridList) -> { + ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO(); + List orgNameAgencyList = agencyService.selectOrgNameAgency(result.stream().map(m -> m.getParentId()).distinct().collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(orgNameAgencyList)){ + orgNameAgencyList.forEach(name -> { + if (agencyId.equals(name.getAgencyId())){ + form.setOrgName(name.getAgencyName()); + form.setParentId(name.getParentId()); + } + }); + } + form.setOrgId(agencyId); + form.setCustomerId(customerId); + form.setDataEndTime(monthId); + form.setOrgType(ScreenConstant.AGENCY); + form.setCreateGroupTotal(gridList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal))); + form.setGroupUserTotal(gridList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal))); + result.add(form); + }); + delAndInsertLink(result,customerId,monthId,orgIds); + }else { + // 级别为 street,district,city,province + List directGridIds = gridService.selectDirectGrid(orgIds); + agencyIdList.forEach(agency -> { + String agencyId = agency.getAgencyId(); + List disGridIds = new ArrayList<>(); + directGridIds.forEach(grid -> { + if (agencyId.equals(grid.getAgencyId())){ + disGridIds.add(grid.getGridId()); + } + }); + // 不为空 存在直属网格 + if (!CollectionUtils.isEmpty(disGridIds)){ + List gridResult = new ArrayList<>(); + List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds); + List orgNameList = agencyService.selectOrgNameGrid(partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(partyLinkMassesDataList)){ + partyLinkMassesDataList.forEach(party -> { + orgNameList.forEach(org -> { + if (party.getOrgId().equals(org.getGridId())){ + party.setOrgName(org.getGridName()); + } + }); + ScreenPartyLinkMassesDataFormDTO copyParty = ConvertUtils.sourceToTarget(party, ScreenPartyLinkMassesDataFormDTO.class); + gridResult.add(copyParty); + }); + } + delAndInsertLink(gridResult,customerId,monthId,disGridIds); + } + List screenPartyLinkMassesDataGrid = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds); + List screenPartyLinkMassesDataList = linkMassesDataService.selectPartyLinkMassesInfo(customerId, monthId, agencyId); + screenPartyLinkMassesDataList.addAll(screenPartyLinkMassesDataGrid); + if (!CollectionUtils.isEmpty(screenPartyLinkMassesDataList)){ + ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO(); + form.setOrgId(agencyId); + form.setOrgType(ScreenConstant.AGENCY); + form.setOrgName(screenPartyLinkMassesDataList.get(NumConstant.ZERO).getOrgName()); + form.setCustomerId(customerId); + form.setDataEndTime(monthId); + form.setParentId(screenPartyLinkMassesDataList.get(NumConstant.ZERO).getParentId()); + form.setGroupUserTotal(screenPartyLinkMassesDataList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal))); + form.setCreateGroupTotal(screenPartyLinkMassesDataList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal))); + result.add(form); + } + }); + delAndInsertLink(result,customerId,monthId,orgIds); + } + } + } + + /** + * @Description 社区级别的处理 + * @Param customerId + * @Param monthId + * @Param agency + * @author zxc + * @date 2020/9/25 10:06 上午 + */ + public GridPartyGuideDTO communityLevelSubGrid(String customerId, String monthId, CustomerAgencyInfoResultDTO agency){ + String agencyId = agency.getAgencyId(); + // 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId) + Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); + List gridIds = (List) agencyMap.get(agencyId); + List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, gridIds); + List orgIds = partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList()); + List orgNameList = agencyService.selectOrgNameGrid(orgIds); + partyLinkMassesDataList.forEach(party -> { + orgNameList.forEach(orgName -> { + if (party.getOrgId().equals(orgName.getGridId())){ + party.setOrgName(orgName.getGridName()); + } + }); + }); + return new GridPartyGuideDTO(gridIds,partyLinkMassesDataList); + } + + /** + * @Description 删除并插入党员联系群众【党员建群数,群成员数】 + * @Param result + * @Param customerId + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2020/9/25 2:57 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsertLink(List result, String customerId, String monthId, List orgIds){ + List screenPartyLinkMassesAgencyList = agencyService.selectAllAgencyIdToPartyLinkMessage(customerId, monthId); + List resultList = gridService.selectAllGridIdToPartyLinkMessage(customerId, monthId); + resultList.addAll(screenPartyLinkMassesAgencyList); + List finalResult = new ArrayList<>(); + // 因为是根据级别来删除,插入,所以把需要操作的orgIds单独出来 + resultList.forEach(rl -> { + orgIds.forEach(orgId -> { + if (rl.getOrgId().equals(orgId)){ + finalResult.add(rl); + } + }); + }); + if (!CollectionUtils.isEmpty(result)){ + finalResult.forEach(fr -> { + result.forEach(r -> { + if (fr.getOrgId().equals(r.getOrgId())){ + BeanUtils.copyProperties(r,fr); + } + }); + }); + } + Integer delNum; + do { + delNum = linkMassesDataService.deleteOldPartyLinkInfo(customerId, monthId, orgIds); + }while (delNum > NumConstant.ZERO); + List> partition = ListUtils.partition(finalResult, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + linkMassesDataService.insertScreenPartyLinkMassesData(p); + }); } + + + + + + // TODO 党员志愿服务【参与人数,组织次数】 } 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 9d74cc81e7..0b2ee8e93e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java @@ -18,6 +18,7 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import java.util.List; @@ -78,6 +79,15 @@ public interface ScreenCustomerAgencyService{ */ List selectAllAgencyIdToParty(String customerId,String dateId); + /** + * @Description 查询客户下所有机关ID + * @Param customerId + * @Param dateId + * @author zxc + * @date 2020/9/25 10:39 上午 + */ + List selectAllAgencyIdToPartyLinkMessage(String customerId, String dateId); + /** * @Description 查询org名称【网格】 * @param gridIds 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 e8a39967e2..02e3b21f67 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 @@ -22,6 +22,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; @@ -50,6 +51,15 @@ public interface ScreenCustomerGridService extends BaseService selectAllGridIdToParty(String customerId, String dateId); + /** + * @Description 查询客户下所有网格ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:43 上午 + */ + List selectAllGridIdToPartyLinkMessage(String customerId, String monthId); + /** * @Description 查询机关的直属网格 * @param agencyIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java index 657faf457d..68197d665c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyBranchDataService.java @@ -18,8 +18,11 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; +import java.util.List; + /** * 基层党建-建设情况数据(支部,联建,志愿服务)按月 * @@ -28,4 +31,12 @@ import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; */ public interface ScreenPartyBranchDataService extends BaseService { + /** + * @Description 插入建设情况数据 + * @param lists + * @author zxc + * @date 2020/9/25 9:16 上午 + */ + void insertScreenPartyBranchData(List lists); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java index 669e20f18d..f03255904a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPartyLinkMassesDataService.java @@ -18,8 +18,11 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; +import java.util.List; + /** * 党建引领-党员联系群众数据 * @@ -28,4 +31,32 @@ import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; */ public interface ScreenPartyLinkMassesDataService extends BaseService { + /** + * @Description 批量插入党员联系群众数据 + * @param lists + * @author zxc + * @date 2020/9/24 6:06 下午 + */ + void insertScreenPartyLinkMassesData(List lists); + + /** + * @Description 删除旧的党员联系群众 + * @param customerId + * @param monthId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + Integer deleteOldPartyLinkInfo(String customerId, String monthId, List orgIds); + + /** + * @Description 查询党员联系群众信息 + * @Param customerId + * @Param monthId + * @Param agencyId + * @author zxc + * @date 2020/9/25 1:19 下午 + */ + List selectPartyLinkMassesInfo(String customerId, String monthId,String agencyId); + } \ 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 404ee7240c..9b7d925e05 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.constant.ScreenConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.screen.result.TreeResultDTO; @@ -159,6 +160,18 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ return screenCustomerAgencyDao.selectAllAgencyIdToParty(customerId,dateId); } + /** + * @Description 查询客户下所有机关ID + * @Param customerId + * @Param monthId + * @author zxc + * @date 2020/9/25 10:39 上午 + */ + @Override + public List selectAllAgencyIdToPartyLinkMessage(String customerId, String monthId) { + return screenCustomerAgencyDao.selectAllAgencyIdToPartyLinkMessage(customerId, monthId); + } + /** * @Description 查询org名称 * @param gridIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index 344fe266e4..f1ac5f0d71 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 @@ -27,6 +27,7 @@ import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; @@ -109,6 +110,18 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl selectAllGridIdToPartyLinkMessage(String customerId, String monthId) { + return screenCustomerGridDao.selectAllGridIdToPartyLinkMessage(customerId, monthId); + } + /** * @Description 查询机关的直属网格 * @param agencyIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java index 8c1f8e9182..271ac60c71 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyBranchDataServiceImpl.java @@ -20,9 +20,13 @@ package com.epmet.service.evaluationindex.screen.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.evaluationindex.screen.ScreenPartyBranchDataDao; +import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyBranchDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPartyBranchDataService; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; /** * 基层党建-建设情况数据(支部,联建,志愿服务)按月 @@ -33,5 +37,16 @@ import org.springframework.stereotype.Service; @Service public class ScreenPartyBranchDataServiceImpl extends BaseServiceImpl implements ScreenPartyBranchDataService { - + /** + * @Description 插入建设情况数据 + * @param lists + * @author zxc + * @date 2020/9/25 9:16 上午 + */ + @Override + public void insertScreenPartyBranchData(List lists) { + if (!CollectionUtils.isEmpty(lists)){ + baseDao.insertScreenPartyBranchData(lists); + } + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java index 256246ad11..2aec948249 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPartyLinkMassesDataServiceImpl.java @@ -18,11 +18,17 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.ScreenPartyLinkMassesDataDao; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyLinkMassesDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPartyLinkMassesDataService; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; /** * 党建引领-党员联系群众数据 @@ -31,7 +37,46 @@ import org.springframework.stereotype.Service; * @since v1.0.0 2020-09-22 */ @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenPartyLinkMassesDataServiceImpl extends BaseServiceImpl implements ScreenPartyLinkMassesDataService { + /** + * @Description 批量插入党员联系群众数据 + * @param lists + * @author zxc + * @date 2020/9/24 6:06 下午 + */ + @Override + public void insertScreenPartyLinkMassesData(List lists) { + if (!CollectionUtils.isEmpty(lists)){ + baseDao.insertScreenPartyLinkMassesData(lists); + } + } + + /** + * @Description 删除旧的党员联系群众 + * @param customerId + * @param monthId + * @param orgIds + * @author zxc + * @date 2020/9/22 3:28 下午 + */ + @Override + public Integer deleteOldPartyLinkInfo(String customerId, String monthId, List orgIds) { + return baseDao.deleteOldPartyLinkInfo(customerId, monthId, orgIds); + } + + /** + * @Description 查询党员联系群众信息 + * @Param customerId + * @Param monthId + * @Param agencyId + * @author zxc + * @date 2020/9/25 1:19 下午 + */ + @Override + public List selectPartyLinkMassesInfo(String customerId, String monthId, String agencyId) { + return baseDao.selectPartyLinkMassesInfo(customerId, monthId, agencyId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml index 134c359fd2..a6c9b62bee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -238,4 +238,30 @@ m.GROUP_ID =#{groupId} + + + \ 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 343deb4dd1..9de96650b5 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 @@ -194,6 +194,7 @@ org_id = #{orgId} ) + LIMIT 1000 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 e5d5305639..df9a6fd514 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 @@ -304,4 +304,20 @@ ) + + + 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 19d1947e11..459e873378 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 @@ -296,4 +296,20 @@ DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml index a7058e4a08..92b2b888b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml @@ -58,4 +58,55 @@ ) + + + + INSERT INTO screen_party_branch_data ( + ID, + CUSTOMER_ID, + YEAR_ID, + MONTH_ID, + TYPE, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + MEET_CATEGORY_ID, + MEET_CATEGORY_NAME, + ORGANIZE_COUNT, + JOIN_USER_COUNT, + AVERAGE_JOIN_USER_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.yearId}, + #{item.monthId}, + #{item.type}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.meetCategoryId}, + #{item.meetCategoryName}, + #{item.organizeCount}, + #{item.joinUserCount}, + #{item.averageJoinUserCount}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml index f6760538d1..20d7c3f7e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml @@ -9,6 +9,41 @@ limit 1000; + + + delete from screen_party_link_masses_data + where CUSTOMER_ID = #{customerId} + and DATA_END_TIME = #{monthId} + and + ( + + org_id = #{orgId} + + ) + LIMIT 1000 + + + + + insert into screen_party_link_masses_data ( @@ -49,4 +84,29 @@ + + + INSERT INTO screen_party_link_masses_data ( ID, CUSTOMER_ID, ORG_TYPE, ORG_ID, PARENT_ID, ORG_NAME, CREATE_GROUP_TOTAL, GROUP_USER_TOTAL, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, DATA_END_TIME ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.createGroupTotal}, + #{item.groupUserTotal}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW(), + #{item.dataEndTime} + ) + + + From 657efe0f60ab24f58bf63b1664e983e9f4c7ab81 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 25 Sep 2020 15:17:02 +0800 Subject: [PATCH 30/31] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E8=AE=A4=E8=AF=81=E7=9B=B8=E5=85=B3=E7=9A=84?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=E5=92=8C=E7=B1=BB=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report/data-report-server/pom.xml | 4 +- .../controller/fact/FactIndexController.java | 1 - .../controller/screen/AgencyController.java | 20 +-- .../screen/DistributionController.java | 6 - .../screen/GrassRootsGovernController.java | 6 - .../screen/GrassrootsPartyDevController.java | 5 - .../controller/screen/IndexController.java | 19 +-- .../controller/screen/KcScreenController.java | 146 +++++------------- .../screen/PartyMemberLeadController.java | 6 - .../screen/ScreenProjectController.java | 2 - .../screen/ScreenUserController.java | 3 - .../evaluationindex/screen/AgencyService.java | 3 +- .../screen/KcScreenService.java | 22 +-- .../screen/impl/AgencyServiceImpl.java | 4 +- .../screen/impl/KcScreenServiceImpl.java | 36 ++--- 15 files changed, 72 insertions(+), 211 deletions(-) diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 6dd6fefbcb..3f0c56a777 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -62,11 +62,11 @@ 0.3.1 - + com.epmet 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 c7eb8ac820..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 @@ -1,6 +1,5 @@ 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; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java index 07b6bf2093..035dab63d9 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -1,21 +1,13 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; +import org.springframework.web.bind.annotation.*; /** * 组织相关api @@ -36,14 +28,9 @@ public class AgencyController { * @author zxc * @date 2020/8/18 2:04 下午 */ - @ExternalAppRequestAuth @PostMapping("tree") - public Result tree(HttpServletRequest request, ExternalAppRequestParam externalAppRequestParam){ - String customerId = request.getHeader("CustomerId"); - if(StringUtils.isBlank(externalAppRequestParam.getCustomerId())){ - externalAppRequestParam.setCustomerId(customerId); - } - return new Result().ok(agencyService.tree(externalAppRequestParam)); + public Result tree(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(agencyService.tree(customerId)); } /** @@ -52,7 +39,6 @@ public class AgencyController { * @author zxc * @date 2020/8/18 2:33 下午 */ - @ExternalAppRequestAuth @PostMapping("compartment") public Result compartment(@RequestBody CompartmentFormDTO compartmentFormDTO){ ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentFormDTO.Compartment.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java index 30f0f82584..8c17f03238 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.DistributionService; @@ -33,7 +32,6 @@ public class DistributionController { * @author zxc * @date 2020/8/18 10:59 上午 */ - @ExternalAppRequestAuth @PostMapping("branch") public Result> branch(@RequestBody BranchFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, BranchFormDTO.Branch.class); @@ -46,7 +44,6 @@ public class DistributionController { * @author zxc * @date 2020/8/18 11:10 上午 */ - @ExternalAppRequestAuth @PostMapping("user") public Result user(@RequestBody UserFormDTO userFormDTO){ ValidatorUtils.validateEntity(userFormDTO, UserFormDTO.User.class); @@ -59,7 +56,6 @@ public class DistributionController { * @author zxc * @date 2020/8/18 11:20 上午 */ - @ExternalAppRequestAuth @PostMapping("parymember") public Result parymember(@RequestBody ParymemberFormDTO parymemberFormDTO){ ValidatorUtils.validateEntity(parymemberFormDTO, ParymemberFormDTO.Parymember.class); @@ -72,7 +68,6 @@ public class DistributionController { * @author zxc * @date 2020/8/19 1:29 下午 */ - @ExternalAppRequestAuth @PostMapping("project") public Result> project(@RequestBody ProjectFormDTO projectFormDTO){ ValidatorUtils.validateEntity(projectFormDTO, ProjectFormDTO.Project.class); @@ -85,7 +80,6 @@ public class DistributionController { * @author zxc * @date 2020/8/19 1:52 下午 */ - @ExternalAppRequestAuth @PostMapping("topprofile") public Result topProfile(@RequestBody TopProfileFormDTO topProfileFormDTO){ ValidatorUtils.validateEntity(topProfileFormDTO, TopProfileFormDTO.TopProfile.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java index 1ee85baeb4..4cec62dc66 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService; @@ -39,7 +38,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 11:16 **/ - @ExternalAppRequestAuth @PostMapping("userpointrank") public Result userPointRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); @@ -54,7 +52,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 13:55 **/ - @ExternalAppRequestAuth @PostMapping("difficultprojects") public Result> difficultProject(@RequestBody AgencyNumTypeParamFormDTO param){ ValidatorUtils.validateEntity(param, AgencyNumTypeParamFormDTO.AgencyNumTypeParamGroup.class); @@ -69,7 +66,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 14:37 **/ - @ExternalAppRequestAuth @PostMapping("publicpartiprofile") public Result publicPartiProfile(@RequestBody AgencyFormDTO param){ ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); @@ -84,7 +80,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 15:32 **/ - @ExternalAppRequestAuth @PostMapping("publicpartirank") public Result> publicPartiRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); @@ -99,7 +94,6 @@ public class GrassRootsGovernController { * @author wangc * @date 2020.08.20 17:46 **/ - @ExternalAppRequestAuth @PostMapping("governcapacityrank") public Result> governCapacityRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java index db7c83089f..f7273b3da8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService; @@ -38,7 +37,6 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.18 16:59 **/ - @ExternalAppRequestAuth @PostMapping("basicinfo") public Result baseInfo(@RequestBody ParymemberFormDTO param){ ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); @@ -53,7 +51,6 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.18 17:54 **/ - @ExternalAppRequestAuth @PostMapping("ageinfo") public Result ageInfo(@RequestBody ParymemberFormDTO param){ ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); @@ -68,7 +65,6 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.19 11:02 **/ - @ExternalAppRequestAuth @PostMapping("branchbuildtrend") public Result branchBuildTrend(@RequestBody BranchBuildTrendFormDTO param){ ValidatorUtils.validateEntity(param, BranchBuildTrendFormDTO.branchBuildTrendGroup.class); @@ -83,7 +79,6 @@ public class GrassrootsPartyDevController { * @author wangc * @date 2020.08.19 15:25 **/ - @ExternalAppRequestAuth @PostMapping("branchbuildrank") public Result branchBuildRank(@RequestBody BranchBuildRankFormDTO param){ ValidatorUtils.validateEntity(param, BranchBuildRankFormDTO.BranchBuildRankGroup.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index 162065563b..d3ece6a658 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -1,8 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.eum.OrgTypeEnum; @@ -10,10 +7,7 @@ import com.epmet.datareport.service.evaluationindex.screen.IndexService; import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -36,7 +30,6 @@ public class IndexController { * @author zxc * @date 2020/8/19 2:53 下午 */ - @ExternalAppRequestAuth @PostMapping("yearaverageindex") public Result yearAverageIndex(@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){ ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class); @@ -49,7 +42,6 @@ public class IndexController { * @author zxc * @date 2020/8/19 3:17 下午 */ - @ExternalAppRequestAuth @PostMapping("monthindexanalysis/piechart") public Result monthPieChart(@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){ ValidatorUtils.validateEntity(monthPieChartFormDTO, MonthPieChartFormDTO.MonthPieChart.class); @@ -62,7 +54,6 @@ public class IndexController { * @author zxc * @date 2020/8/19 5:27 下午 */ - @ExternalAppRequestAuth @PostMapping("monthindexanalysis/barchart") public Result monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO){ ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); @@ -75,7 +66,6 @@ public class IndexController { * @author zxc * @date 2020/8/20 10:02 上午 */ - @ExternalAppRequestAuth @PostMapping("subagencyindexrank") public Result> subAgencyIndexRank(@RequestBody SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO){ ValidatorUtils.validateEntity(subAgencyIndexRankFormDTO, SubAgencyIndexRankFormDTO.SubAgencyIndexRank.class); @@ -90,8 +80,6 @@ public class IndexController { * @Author zhangyong * @Date 13:39 2020-09-11 **/ - @InternalAppRequestAuth - @ExternalAppRequestAuth @PostMapping("dataclient/subagencyindexrank") public Result> getSubAgencyIndexRank(@RequestBody SubAgencyIndexRankYMFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, SubAgencyIndexRankYMFormDTO.SubAgencyIndexRank.class); @@ -104,10 +92,9 @@ public class IndexController { * @author jianjun.liu * @date 2020/8/20 10:02 上午 */ - @ExternalAppRequestAuth @PostMapping("gridindexrank") - public Result> gridIndexRank(ExternalAppRequestParam extParam, @RequestBody GridIndexRankFormDTO formDTO) { - formDTO.setCustomerId(extParam.getCustomerId()); + public Result> gridIndexRank(@RequestHeader("CustomerId") String customerId, @RequestBody GridIndexRankFormDTO formDTO) { + formDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(formDTO); formDTO.setOrgType(OrgTypeEnum.GRID.getCode()); return new Result>().ok(indexService.selectIndexRankByOrgType(formDTO)); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java index 8e9a3d0bfa..855be093c1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java @@ -1,8 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.annotation.InternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.KcScreenService; @@ -17,10 +14,7 @@ import com.epmet.dto.result.issue.KcIssueSummary; import com.epmet.dto.result.issue.KcPartiTrendResultDTO; import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -39,42 +33,37 @@ public class KcScreenController { /** - * @param externalAppRequestParam * @Description 首页-平台各类总数 * @author sun */ @PostMapping("homepage/summary") - public Result homepageSummary(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.homepageSummary(externalAppRequestParam)); + public Result homepageSummary(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.homepageSummary(customerId)); } /** - * @param externalAppRequestParam * @Description 公益互助-各类总数汇总 * @author sun */ @PostMapping("heart/summary") - public Result heartSummary(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.heartSummary(externalAppRequestParam)); + public Result heartSummary(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.heartSummary(customerId)); } /** - * @param externalAppRequestParam * @Description 公益互助-公益活动次数 * @author sun */ @PostMapping("heart/actcounttrend") - public Result heartActcounttrend(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.heartActcounttrend(externalAppRequestParam)); + public Result heartActcounttrend(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.heartActcounttrend(customerId)); } /** * 议题分析-各类总数 - * @param externalAppRequestParam * @return */ @PostMapping("issue/summary") - public Result getIssueSummary(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); + public Result getIssueSummary(@RequestHeader("CustomerId") String customerId) { //String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; KcIssueSummary issueSummary = kcScreenService.getIssueSummary(customerId); return new Result().ok(issueSummary); @@ -82,300 +71,247 @@ public class KcScreenController { /** * 参与趋势 - * @param externalAppRequestParam * @return */ @PostMapping("issue/partitrend") - public Result getIssuePartiTrend(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + public Result getIssuePartiTrend(@RequestHeader("CustomerId") String customerId) { KcPartiTrendResultDTO trendResultDTO = kcScreenService.getIssuePartiTrend(customerId); return new Result().ok(trendResultDTO); } /** * 按照议题数量排名 - * @param externalAppRequestParam * @return */ @PostMapping("issue/gridtotalrank") - public Result getIssueGridTotalRank(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + public Result getIssueGridTotalRank(@RequestHeader("CustomerId") String customerId) { return new Result().ok(kcScreenService.getIssueGridTotalRank(customerId)); } /** * 议题分析-审核效率排名 - * @param externalAppRequestParam * @return */ @PostMapping("issue/avgaudittimerank") - public Result getAvgAuditTimeRank(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + public Result getAvgAuditTimeRank(@RequestHeader("CustomerId") String customerId) { return new Result().ok(kcScreenService.getAvgAuditTimeRank(customerId)); } /** * 议题分析-议题效率 - * @param externalAppRequestParam * @return */ @PostMapping("issue/effective") - public Result getIssueEffective(ExternalAppRequestParam externalAppRequestParam) { - String customerId = externalAppRequestParam.getCustomerId(); + public Result getIssueEffective(@RequestHeader("CustomerId") String customerId) { //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; return new Result().ok(kcScreenService.getIssueEffective(customerId)); } /** - * @param externalAppRequestParam * @Description 公益互助-志愿者画像 * @author sun */ @PostMapping("heart/volunteerportrayal") - public Result heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.heartVolunteerportrayal(externalAppRequestParam)); + public Result heartVolunteerportrayal(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.heartVolunteerportrayal(customerId)); } /** - * @param externalAppRequestParam * @Description 公益互助-个人(志愿者)公益时长排名 * @author sun */ @PostMapping("heart/volunteerrank") - public Result> heartVolunteerrank(ExternalAppRequestParam externalAppRequestParam, @RequestBody HeartVolunteerrankFormDTO formDTO){ + public Result> heartVolunteerrank(@RequestHeader("CustomerId") String customerId, @RequestBody HeartVolunteerrankFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, HeartVolunteerrankFormDTO.AddUserInternalGroup.class); - formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + formDTO.setCustomerId(customerId); return new Result>().ok(kcScreenService.heartVolunteerrank(formDTO)); } /** - * @param externalAppRequestParam * @Description 邻里党群-各类总数 * @author sun */ @PostMapping("group/summary") - public Result groupSummary(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.groupSummary(externalAppRequestParam)); + public Result groupSummary(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.groupSummary(customerId)); } /** - * @param externalAppRequestParam * @Description 邻里党群-话题参与趋势 * @author sun */ @PostMapping("group/partitopictrend") - public Result groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.groupPartitopictrend(externalAppRequestParam)); + public Result groupPartitopictrend(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.groupPartitopictrend(customerId)); } /** - * @param externalAppRequestParam * @Description 邻里党群-社群数量排名 * @author sun */ @PostMapping("group/gridgroupcountrank") - public Result groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam){ - return new Result().ok(kcScreenService.groupGridgroupcountrank(externalAppRequestParam)); + public Result groupGridgroupcountrank(@RequestHeader("CustomerId") String customerId){ + return new Result().ok(kcScreenService.groupGridgroupcountrank(customerId)); } /** - * @param externalAppRequestParam * @Description 邻里党群-社群数量排名 * @author sun */ @PostMapping("group/usercountrank") - public Result> groupUserCountRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupUserCountRankFormDTO formDTO){ + public Result> groupUserCountRank(@RequestHeader("CustomerId") String customerId, @RequestBody GroupUserCountRankFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, GroupUserCountRankFormDTO.AddUserInternalGroup.class); - formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + formDTO.setCustomerId(customerId); return new Result>().ok(kcScreenService.groupUserCountRank(formDTO)); } /** - * @param externalAppRequestParam * @Description 邻里党群-话题转化率排名 * @author sun */ @PostMapping("group/topicshiftissueratiorank") - public Result> groupTopicShiftIssueRatioRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody GroupTopicShiftIssueRatioRankFormDTO formDTO){ + public Result> groupTopicShiftIssueRatioRank(@RequestHeader("CustomerId") String customerId, @RequestBody GroupTopicShiftIssueRatioRankFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, GroupTopicShiftIssueRatioRankFormDTO.AddUserInternalGroup.class); - formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + formDTO.setCustomerId(customerId); return new Result>().ok(kcScreenService.groupTopicShiftIssueRatioRank(formDTO)); } /** * 项目各类总数汇总 - * @param externalAppRequestParam * @return */ @PostMapping("project/summary") - public Result getProjectSummary(ExternalAppRequestParam externalAppRequestParam){ - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; - String customerId = externalAppRequestParam.getCustomerId(); + public Result getProjectSummary(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getProjectSummary(customerId)); } /** * 项目分析-网格下项目数量排名 - * @param externalAppRequestParam * @return */ @PostMapping("project/gridcountrank") - public Result getProjectGridCountRank(ExternalAppRequestParam externalAppRequestParam){ - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; - String customerId = externalAppRequestParam.getCustomerId(); + public Result getProjectGridCountRank(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getGridProjectCountRank(customerId)); } /** * 项目分析-项目类别 - * @param externalAppRequestParam * @return */ @PostMapping("project/categoryanalysis") - public Result> getProjectCategoryAnalysis(ExternalAppRequestParam externalAppRequestParam){ - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; - String customerId = externalAppRequestParam.getCustomerId(); + public Result> getProjectCategoryAnalysis(@RequestHeader("CustomerId") String customerId){ return new Result>().ok(kcScreenService.getProjectCategoryAnalysis(customerId)); } /** * 网格项目平均结案时间 - * @param externalAppRequestParam * @return */ @PostMapping("project/avgclosedtimeanalysis") - public Result> getGridProjectAvgClosedTimeAnalysis(ExternalAppRequestParam externalAppRequestParam){ - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; - String customerId = externalAppRequestParam.getCustomerId(); + public Result> getGridProjectAvgClosedTimeAnalysis(@RequestHeader("CustomerId") String customerId){ return new Result>().ok(kcScreenService.getGridProjectAvgClosedTimeAnalysis(customerId)); } /** * 项目分析-居民满意度 - * @param externalAppRequestParam * @return */ @PostMapping("project/statis") - public Result getProjectSatisfactionAnalyze(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getProjectSatisfactionAnalyze(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getProjectSatisfactionAnalyze(customerId)); } /** * 用户-summary - * @param externalAppRequestParam * @return */ @PostMapping("user/summary") - public Result getUserSummary(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933"; + public Result getUserSummary(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getUserSummary(customerId)); } /** * 用户量趋势 - * @param externalAppRequestParam * @return */ @PostMapping("user/trend") - public Result getUserTrend(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getUserTrend(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getUserTrend(customerId)); } /** * 网格用户数量排名 - * @param externalAppRequestParam * @return */ @PostMapping("user/griduserrank") - public Result getUserRank(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getUserRank(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getUserRank(customerId)); } /** * 用户画像 - * @param externalAppRequestParam * @return */ @PostMapping("user/userportrayal") - public Result getUserPortrayal(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getUserPortrayal(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getUserPortrayal(customerId)); } /** * 用户积分排名 - * @param externalAppRequestParam * @return */ @PostMapping("user/pointsrank") - public Result getUserPointsRank(ExternalAppRequestParam externalAppRequestParam, + public Result getUserPointsRank(@RequestHeader("CustomerId") String customerId, @RequestBody PageFormDTO form) { - String customerId = externalAppRequestParam.getCustomerId(); return new Result().ok(kcScreenService.getUserPointsRank(customerId, form.getPageNo(), form.getPageSize())); } /** * 党建声音-各类总数 - * @param externalAppRequestParam * @return */ @PostMapping("news/summary") - public Result getNewsSummary(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getNewsSummary(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getNewsSummary(customerId)); } /** * 新闻阅读参与趋势 - * @param externalAppRequestParam * @return */ @PostMapping("news/partitrend") - public Result getNewsPartiTrend(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getNewsPartiTrend(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getNewsPartiTrend(customerId)); } /** * 党建声音-分类的news数量 - * @param externalAppRequestParam * @return */ @PostMapping("news/category") - public Result> getNewsCountGroupByCategory(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result> getNewsCountGroupByCategory(@RequestHeader("CustomerId") String customerId){ return new Result>().ok(kcScreenService.getNewsCountOfCategory(customerId)); } /** * 党建声音-分类的用户参与数排行 - * @param externalAppRequestParam * @return */ @PostMapping("news/userparticategoryrank") - public Result getNewsPartiCategoryRank(ExternalAppRequestParam externalAppRequestParam){ - String customerId = externalAppRequestParam.getCustomerId(); + public Result getNewsPartiCategoryRank(@RequestHeader("CustomerId") String customerId){ return new Result().ok(kcScreenService.getNewsPartiCategoryRank(customerId)); } /** * 党建声音-热点新闻排行 - * @param externalAppRequestParam * @return */ @PostMapping("news/hotrank") - public Result> listNewsHotRank(ExternalAppRequestParam externalAppRequestParam, + public Result> listNewsHotRank(@RequestHeader("CustomerId") String customerId, @RequestBody PageFormDTO form){ - String customerId = externalAppRequestParam.getCustomerId(); return new Result>().ok(kcScreenService.getNewsHotRank(customerId, form.getPageNo(), form.getPageSize())); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java index 5530fae8b0..ca1104f534 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; @@ -33,7 +32,6 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 1:56 下午 */ - @ExternalAppRequestAuth @PostMapping("fineexample") public Result fineExample(@RequestBody FineExampleFormDTO fineExampleFormDTO){ ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class); @@ -46,7 +44,6 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 2:35 下午 */ - @ExternalAppRequestAuth @PostMapping("contactmasslinechart") public Result contactMassLineChart(@RequestBody ContactMassLineChartFormDTO contactMassLineChartFormDTO){ ValidatorUtils.validateEntity(contactMassLineChartFormDTO, ContactMassLineChartFormDTO.ContactMassLineChart.class); @@ -59,7 +56,6 @@ public class PartyMemberLeadController { * @author zxc * @date 2020/8/20 3:19 下午 */ - @ExternalAppRequestAuth @PostMapping("volunteerservice") public Result volunteerService(@RequestBody VolunteerServiceFormDTO volunteerServiceFormDTO){ ValidatorUtils.validateEntity(volunteerServiceFormDTO, VolunteerServiceFormDTO.VolunteerService.class); @@ -74,7 +70,6 @@ public class PartyMemberLeadController { * @author wangc * @date 2020.08.21 11:05 **/ - @ExternalAppRequestAuth @PostMapping("advancedbranchrank") Result> advancedBranchRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); @@ -89,7 +84,6 @@ public class PartyMemberLeadController { * @author wangc * @date 2020.08.21 14:22 **/ - @ExternalAppRequestAuth @PostMapping("advancedpartymemberrank") Result> advancedPartymemberRank(@RequestBody AgencyAndNumFormDTO param){ ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 5417767ee6..483e3edcc1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; @@ -31,7 +30,6 @@ public class ScreenProjectController { * @author zxc * @date 2020/8/19 4:36 下午 */ - @ExternalAppRequestAuth @PostMapping("detail") public Result projectDetail(@RequestBody ProjectDetailFormDTO projectDetailFormDTO){ ValidatorUtils.validateEntity(projectDetailFormDTO, ProjectDetailFormDTO.ProjectDetail.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java index 5e7c544c38..bc6997d45f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java @@ -1,6 +1,5 @@ package com.epmet.datareport.controller.screen; -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; @@ -35,7 +34,6 @@ public class ScreenUserController { * @Description 热心市民积分排行列表 * @author sun */ - @InternalAppRequestAuth @PostMapping("userpointrank") public Result> userPointRank(@LoginUser TokenDto tokenDTO, @RequestBody UserPointRankFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, UserPointRankFormDTO.AddUserInternalGroup.class); @@ -47,7 +45,6 @@ public class ScreenUserController { * @Description 党员(指标得分)排行 * @author sun */ - @InternalAppRequestAuth @PostMapping("partindexscroerank") public Result> partIndexScroeRank(@LoginUser TokenDto tokenDTO, @RequestBody PartIndexScroeRankFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, PartIndexScroeRankFormDTO.AddUserInternalGroup.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java index f881373c1b..eee423ca41 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java @@ -1,6 +1,5 @@ package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; @@ -19,7 +18,7 @@ public interface AgencyService { * @author zxc * @date 2020/8/18 2:04 下午 */ - TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam); + TreeResultDTO tree(String customerId); /** * @Description 2、组织区域查询 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java index d17df56ba1..480601a129 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java @@ -1,6 +1,5 @@ package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.dto.result.issue.*; import com.epmet.dto.result.project.*; import com.epmet.dto.result.user.*; @@ -22,32 +21,28 @@ import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO; public interface KcScreenService { /** - * @param externalAppRequestParam * @Description 首页-平台各类总数 * @author sun */ - HomepageSummaryResultDTO homepageSummary(ExternalAppRequestParam externalAppRequestParam); + HomepageSummaryResultDTO homepageSummary(String customerId); /** - * @param externalAppRequestParam * @Description 公益互助-各类总数汇总 * @author sun */ - HeartSummaryResultDTO heartSummary(ExternalAppRequestParam externalAppRequestParam); + HeartSummaryResultDTO heartSummary(String customerId); /** - * @param externalAppRequestParam * @Description 公益互助-公益活动次数 * @author sun */ - HeartActcounttrendResultDTO heartActcounttrend(ExternalAppRequestParam externalAppRequestParam); + HeartActcounttrendResultDTO heartActcounttrend(String customerId); /** - * @param externalAppRequestParam * @Description 公益互助-志愿者画像 * @author sun */ - HeartVolunteerportrayalResultDTO heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam); + HeartVolunteerportrayalResultDTO heartVolunteerportrayal(String customerId); /** * @param formDTO @@ -67,25 +62,22 @@ public interface KcScreenService { /** - * @param externalAppRequestParam * @Description 邻里党群-各类总数 * @author sun */ - GroupSummaryResultDTO groupSummary(ExternalAppRequestParam externalAppRequestParam); + GroupSummaryResultDTO groupSummary(String customerId); /** - * @param externalAppRequestParam * @Description 邻里党群-话题参与趋势 * @author sun */ - GroupPartitopictrendResultDTO groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam); + GroupPartitopictrendResultDTO groupPartitopictrend(String customerId); /** - * @param externalAppRequestParam * @Description 邻里党群-社群数量排名 * @author sun */ - GroupGridgroupcountrankResultDTO groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam); + GroupGridgroupcountrankResultDTO groupGridgroupcountrank(String customerId); /** * @param formDTO diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index 3ecb962cc8..104e941333 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.constant.DataSourceConstant; @@ -43,9 +42,8 @@ public class AgencyServiceImpl implements AgencyService { */ @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override - public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) { + public TreeResultDTO tree(String customerId) { // 1. 查询客户根组织ID - String customerId = externalAppRequestParam.getCustomerId(); TreeResultDTO rootAgency = null; try { diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java index b82d6b654f..6a84e531d7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyUserRankDataDao; @@ -99,37 +98,34 @@ public class KcScreenServiceImpl implements KcScreenService { private ScreenKcNewsRankDao screenKcNewsRankDao; /** - * @param externalAppRequestParam * @Description 首页-平台各类总数 * @author sun */ @Override - public HomepageSummaryResultDTO homepageSummary(ExternalAppRequestParam externalAppRequestParam) { - return screenKcPlatformSummaryDailyDao.selectSummaryDaily(externalAppRequestParam.getCustomerId()); + public HomepageSummaryResultDTO homepageSummary(String customerId) { + return screenKcPlatformSummaryDailyDao.selectSummaryDaily(customerId); } /** - * @param externalAppRequestParam * @Description 公益互助-各类总数汇总 * @author sun */ @Override - public HeartSummaryResultDTO heartSummary(ExternalAppRequestParam externalAppRequestParam) { - return screenKcActSummaryDailyDao.selectHeartSummary(externalAppRequestParam.getCustomerId()); + public HeartSummaryResultDTO heartSummary(String customerId) { + return screenKcActSummaryDailyDao.selectHeartSummary(customerId); } /** - * @param externalAppRequestParam * @Description 公益互助-公益活动次数 * @author sun */ @Override - public HeartActcounttrendResultDTO heartActcounttrend(ExternalAppRequestParam externalAppRequestParam) { + public HeartActcounttrendResultDTO heartActcounttrend(String customerId) { HeartActcounttrendResultDTO resultDTO = new HeartActcounttrendResultDTO(); LinkedList xAxis = new LinkedList<>(); LinkedList actCountDataList = new LinkedList<>(); //1.按客户查询最近十二个月数据 - List list = screenKcActTrendMonthlyDao.selectActTrendMonthly(externalAppRequestParam.getCustomerId()); + List list = screenKcActTrendMonthlyDao.selectActTrendMonthly(customerId); //2.倒序遍历封装数据 for (int i = list.size() - 1; i >= 0; i--) { xAxis.add(list.get(i).getMonthId()); @@ -142,16 +138,15 @@ public class KcScreenServiceImpl implements KcScreenService { } /** - * @param externalAppRequestParam * @Description 公益互助-志愿者画像 * @author sun */ @Override - public HeartVolunteerportrayalResultDTO heartVolunteerportrayal(ExternalAppRequestParam externalAppRequestParam) { + public HeartVolunteerportrayalResultDTO heartVolunteerportrayal(String customerId) { HeartVolunteerportrayalResultDTO resultDTO = new HeartVolunteerportrayalResultDTO(); GenderDistributionResultDTO genderDistribution = new GenderDistributionResultDTO(); //1.根据客户Id查询最近日期志愿者统计数据 - AgeDistributionResultDTO ageDistribution = screenKcVolunteerSummaryDailyDao.selectVolunteerSummaryDaily(externalAppRequestParam.getCustomerId()); + AgeDistributionResultDTO ageDistribution = screenKcVolunteerSummaryDailyDao.selectVolunteerSummaryDaily(customerId); //2.封装数据并返回 if (null == ageDistribution) { resultDTO.setAgeDistribution(new AgeDistributionResultDTO()); @@ -219,14 +214,13 @@ public class KcScreenServiceImpl implements KcScreenService { } /** - * @param externalAppRequestParam * @Description 邻里党群-各类总数 * @author sun */ @Override - public GroupSummaryResultDTO groupSummary(ExternalAppRequestParam externalAppRequestParam) { + public GroupSummaryResultDTO groupSummary(String customerId) { //1.按客户查询最近一天各网格各项数据的汇总值 - GroupSummaryResultDTO resultDTO = screenKcGroupSummaryGridDailyDao.selectGroupSummaryDaily(externalAppRequestParam.getCustomerId()); + GroupSummaryResultDTO resultDTO = screenKcGroupSummaryGridDailyDao.selectGroupSummaryDaily(customerId); if (null == resultDTO) { return new GroupSummaryResultDTO(); } @@ -246,17 +240,16 @@ public class KcScreenServiceImpl implements KcScreenService { } /** - * @param externalAppRequestParam * @Description 邻里党群-话题参与趋势 * @author sun */ @Override - public GroupPartitopictrendResultDTO groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam) { + public GroupPartitopictrendResultDTO groupPartitopictrend(String customerId) { GroupPartitopictrendResultDTO resultDTO = new GroupPartitopictrendResultDTO(); LinkedList xAxis = new LinkedList<>(); LinkedList actCountDataList = new LinkedList<>(); //1.按客户查询最近十二个月所有网格汇总数据 - List list = screenKcTopicTrendGridMonthlyDao.selectActTrendMonthly(externalAppRequestParam.getCustomerId()); + List list = screenKcTopicTrendGridMonthlyDao.selectActTrendMonthly(customerId); //2.倒序遍历封装数据 for (int i = list.size() - 1; i >= 0; i--) { xAxis.add(list.get(i).getMonthId()); @@ -269,17 +262,16 @@ public class KcScreenServiceImpl implements KcScreenService { } /** - * @param externalAppRequestParam * @Description 邻里党群-社群数量排名 * @author sun */ @Override - public GroupGridgroupcountrankResultDTO groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam) { + public GroupGridgroupcountrankResultDTO groupGridgroupcountrank(String customerId) { GroupGridgroupcountrankResultDTO resultDTO = new GroupGridgroupcountrankResultDTO(); LinkedList gridNameDataList = new LinkedList<>(); LinkedList groupCountDataList = new LinkedList<>(); //1.按日期降序,查询客户最近一天所有网格数据,按每个网格的社区总数降序排列 - LinkedList list = screenKcGroupSummaryGridDailyDao.selectGridDailyList(externalAppRequestParam.getCustomerId()); + LinkedList list = screenKcGroupSummaryGridDailyDao.selectGridDailyList(customerId); //2.封装数据 list.forEach(l -> { gridNameDataList.add(l.getGridName()); From 5e129bc5faa836183ca39131e49981991f9b4e2b Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 25 Sep 2020 15:32:07 +0800 Subject: [PATCH 31/31] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E9=89=B4=E6=9D=83=E4=BE=9D=E8=B5=96=EF=BC=8C?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E7=9B=B8=E5=85=B3=E6=B3=A8=E8=A7=A3=E5=92=8C?= =?UTF-8?q?=E7=B1=BB=E7=9A=84=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/pom.xml | 2 +- .../FactIndexCollectController.java | 55 ++---- .../controller/IndexCalculateController.java | 12 +- .../controller/KcScreenCollController.java | 159 +++++++++--------- .../ShiBeiScreenCollController.java | 108 ++++-------- 5 files changed, 132 insertions(+), 204 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index e40e69ed9f..ee196b5cbf 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -70,7 +70,7 @@ com.epmet - epmet-commons-extapp-auth + common-service-client 2.0.0 compile diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java index 0a8740c63b..77f2ce51ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java @@ -1,15 +1,10 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.indexcollect.form.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * 指标采集相关api @@ -27,128 +22,112 @@ public class FactIndexCollectController { /** * 1、党建能力-党员相关指标上报(按照月份) * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("gridpartymemberdata") - public Result gridPartyMemberData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyMemberDataFormDTO formDTO) { - factIndexCollectService.insertGridPartyMemberData(formDTO,externalAppRequestParam.getCustomerId() ); + public Result gridPartyMemberData(@RequestHeader("CustomerId") String customerId, @RequestBody GridPartyMemberDataFormDTO formDTO) { + factIndexCollectService.insertGridPartyMemberData(formDTO, customerId); return new Result(); } /** * 2、党建能力-网格相关指标上报(按照月份) * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("gridpartyability") - public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyAbilityDataFormDTO formDTO) { - factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result gridPartyAbility(@RequestHeader("CustomerId") String customerId, @RequestBody GridPartyAbilityDataFormDTO formDTO) { + factIndexCollectService.insertGridPartyAbility(formDTO, customerId); return new Result(); } /** * 3、党建能力-街道及社区相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("orgpartyability") - public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgPartyAbilityDataFormDTO formDTO) { - factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result orgPartyAbility(@RequestHeader("CustomerId") String customerId, @RequestBody OrgPartyAbilityDataFormDTO formDTO) { + factIndexCollectService.insertOrgPartyAbility(formDTO, customerId); return new Result(); } /** * 4、服务能力-网格相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("gridserviceability") - public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridServiceAbilityDataFormDTO formDTO) { - factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result gridServiceAbility(@RequestHeader("CustomerId") String customerId, @RequestBody GridServiceAbilityDataFormDTO formDTO) { + factIndexCollectService.insertGridServiceAbility(formDTO, customerId); return new Result(); } /** * 5、服务能力-组织(街道|社区|全区)相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("orgserviceability") - public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgServiceAbilityDataFormDTO formDTO) { - factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result orgServiceAbility(@RequestHeader("CustomerId") String customerId, @RequestBody OrgServiceAbilityDataFormDTO formDTO) { + factIndexCollectService.insertOrgServiceAbility(formDTO, customerId); return new Result(); } /** * 6、治理能力-网格相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("gridgovrnability") - public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridGovrnAbilityDataFormDTO formDTO) { - factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result gridGovrnAbility(@RequestHeader("CustomerId") String customerId, @RequestBody GridGovrnAbilityDataFormDTO formDTO) { + factIndexCollectService.insertGridGovrnAbility(formDTO, customerId); return new Result(); } /** * 7、治理能力-街道及社区相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("orggovrnability") - public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgGovrnAbilityDataFormDTO formDTO) { - factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result orgGovrnAbility(@RequestHeader("CustomerId") String customerId, @RequestBody OrgGovrnAbilityDataFormDTO formDTO) { + factIndexCollectService.insertOrgGovrnAbility(formDTO, customerId); return new Result(); } /** * 8、治理能力-部门相关指标 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("deptgovrnability") - public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody DeptGovrnAbilityDataFormDTO formDTO) { - factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + public Result deptGovrnAbility(@RequestHeader("CustomerId") String customerId, @RequestBody DeptGovrnAbilityDataFormDTO formDTO) { + factIndexCollectService.insertDeptGovrnAbility(formDTO, customerId); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index c6e24b6893..ae50deb189 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -1,7 +1,5 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.RedisKeys; @@ -20,10 +18,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.PreDestroy; import java.util.Date; @@ -103,11 +98,8 @@ public class IndexCalculateController { * @Author zhangyongç * @Date 10:52 2020-08-20 **/ - @ExternalAppRequestAuth @PostMapping("all") - public Result indexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody CalculateCommonFormDTO formDTO) { - String customerId = externalAppRequestParam.getCustomerId(); - //String customerId = "epmettest"; + public Result indexCalculate(@RequestHeader("CustomerId") String customerId, @RequestBody CalculateCommonFormDTO formDTO) { formDTO.setCustomerId(customerId); indexCalculate(formDTO); return new Result().ok(true); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java index 09d06df653..b64d7855a0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java @@ -1,16 +1,11 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.KcScreenCollService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * 孔村大屏数据采集api @@ -31,16 +26,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_platform_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("homepage/platformsummary") - public Result platFormSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertPlatFormSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result platFormSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertPlatFormSummary(formDTO, customerId); return new Result(); } @@ -50,16 +45,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_issue_summary_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("issue/summary") - public Result issueSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertIssueSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result issueSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertIssueSummary(formDTO, customerId); return new Result(); } @@ -69,16 +64,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table: screen_kc_issue_trend_grid_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("issue/trend") - public Result issueTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertIssueTrend(formDTO, externalAppRequestParam.getCustomerId()); + public Result issueTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertIssueTrend(formDTO, customerId); return new Result(); } @@ -88,16 +83,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_user_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("user/summary") - public Result userSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertUserSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result userSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertUserSummary(formDTO, customerId); return new Result(); } @@ -107,16 +102,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_volunteer_heat_rank_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("volunteer/heartrank") - public Result volunteerHeartRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertVolunteerHeartRank(formDTO, externalAppRequestParam.getCustomerId()); + public Result volunteerHeartRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertVolunteerHeartRank(formDTO, customerId); return new Result(); } @@ -126,16 +121,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_user_trend_grid_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("user/userheartrank") - public Result userHeartRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertUserHeartRank(formDTO, externalAppRequestParam.getCustomerId()); + public Result userHeartRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertUserHeartRank(formDTO, customerId); return new Result(); } @@ -145,16 +140,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_act_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("act/summary") - public Result actSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertActSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result actSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertActSummary(formDTO, customerId); return new Result(); } @@ -164,16 +159,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_act_trend_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("act/trend") - public Result actTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertActTrend(formDTO, externalAppRequestParam.getCustomerId()); + public Result actTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertActTrend(formDTO, customerId); return new Result(); } @@ -183,16 +178,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_volunteer_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("act/volunteersummary") - public Result volunteerSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertVolunteerSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result volunteerSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertVolunteerSummary(formDTO, customerId); return new Result(); } @@ -202,16 +197,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_project_summary_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("project/summary") - public Result projectSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertProjectSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result projectSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertProjectSummary(formDTO, customerId); return new Result(); } @@ -221,16 +216,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_project_category_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("project/categorysummary") - public Result categorySummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertCategorySummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result categorySummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertCategorySummary(formDTO, customerId); return new Result(); } @@ -240,16 +235,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_project_satis_grid_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("project/satisanalysis") - public Result projectSatisanalysis(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertProjectSatisanalysis(formDTO, externalAppRequestParam.getCustomerId()); + public Result projectSatisanalysis(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertProjectSatisanalysis(formDTO, customerId); return new Result(); } @@ -259,16 +254,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_news_summary_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("news/summary") - public Result newsSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result newsSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertNewsSummary(formDTO, customerId); return new Result(); } @@ -278,16 +273,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_news_trend_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("news/trend") - public Result newsTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsTrend(formDTO, externalAppRequestParam.getCustomerId()); + public Result newsTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertNewsTrend(formDTO, customerId); return new Result(); } @@ -297,16 +292,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_news_rank * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("news/hotrank") - public Result newsHotRank(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsHotRank(formDTO, externalAppRequestParam.getCustomerId()); + public Result newsHotRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertNewsHotRank(formDTO, customerId); return new Result(); } @@ -316,16 +311,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_news_category_analysis * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("news/categoryanalysis") - public Result newsCategoryAnalysis(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsCategoryAnalysis(formDTO, externalAppRequestParam.getCustomerId()); + public Result newsCategoryAnalysis(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertNewsCategoryAnalysis(formDTO, customerId); return new Result(); } @@ -335,16 +330,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_group_summary_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("group/summary") - public Result groupSummary(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupSummary(formDTO, externalAppRequestParam.getCustomerId()); + public Result groupSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertGroupSummary(formDTO, customerId); return new Result(); } @@ -354,16 +349,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_group_detail_grid_daily * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("group/detail") - public Result groupDetail(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupDetail(formDTO, externalAppRequestParam.getCustomerId()); + public Result groupDetail(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertGroupDetail(formDTO, customerId); return new Result(); } @@ -373,16 +368,16 @@ public class KcScreenCollController { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * table:screen_kc_topic_trend_grid_monthly * - * @param externalAppRequestParam + * * @param formDTO * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - @ExternalAppRequestAuth + @PostMapping("group/topictrend") - public Result groupTopicTrend(ExternalAppRequestParam externalAppRequestParam, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupTopicTrend(formDTO, externalAppRequestParam.getCustomerId()); + public Result groupTopicTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + kcScreenCollService.insertGroupTopicTrend(formDTO, customerId); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java index 73d6db7bb6..a55567eb45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java @@ -1,15 +1,10 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** @@ -28,144 +23,126 @@ public class ShiBeiScreenCollController { /** * 9、党建引领|基层治理-居民(党员)积分排行榜 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("partyuserrankdata") - public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyUserRankDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result partyUserRankData(@RequestHeader("CustomerId") String customerId, @RequestBody PartyUserRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyUserRankData(formDTO, customerId); return new Result(); } /** * 8、党建引领-党员联系群众数据 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("partylinkmassesdata") - public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyLinkMassesDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); + public Result partyLinkMassesData(@RequestHeader("CustomerId") String customerId, @RequestBody PartyLinkMassesDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyLinkMassesData(formDTO, customerId); return new Result(); } /** * 7、基层党建-建设情况数据(支部、联建、志愿) * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("meetdata") - public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyBranchDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); + public Result meetData(@RequestHeader("CustomerId") String customerId, @RequestBody PartyBranchDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyBranchData(formDTO, customerId); return new Result(); } /** * 6、党建引领-组织排行 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("orgrankdata") - public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgRankDataListFormDTO formDTO) { - shiBeiScreenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result orgRankData(@RequestHeader("CustomerId") String customerId, @RequestBody OrgRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertOrgRankData(formDTO, customerId); return new Result(); } /** * 5、基层治理-治理能力数据 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("governrankdata") - public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GovernRankDataListFormDTO formDTO) { - shiBeiScreenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result governRankData(@RequestHeader("CustomerId") String customerId, @RequestBody GovernRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertGovernRankData(formDTO, customerId); return new Result(); } /** * 4、事件数据 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("eventdata") - public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody EventDataListFormDTO formDTO) { - shiBeiScreenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); + public Result eventData(@RequestHeader("CustomerId") String customerId, @RequestBody EventDataListFormDTO formDTO) { + shiBeiScreenCollService.insertEventData(formDTO, customerId); return new Result(); } /** * 3、难点赌点 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("difficultydata") - public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody DifficultyDataFormDTO formDTO) { - shiBeiScreenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); + public Result difficultyData(@RequestHeader("CustomerId") String customerId, @RequestBody DifficultyDataFormDTO formDTO) { + shiBeiScreenCollService.insertDifficultyData(formDTO, customerId); return new Result(); } /** * 2、党员基本情况 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("cpcbasedata") - public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody CpcBaseDataListFormDTO formDTO) { - shiBeiScreenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); + public Result cpcbaseData(@RequestHeader("CustomerId") String customerId, @RequestBody CpcBaseDataListFormDTO formDTO) { + shiBeiScreenCollService.insertCpcbaseData(formDTO, customerId); return new Result(); } /** * 1、指数_按月统计 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("indexdatamonthly") - public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListMonthlyFormDTO formDTO) { - shiBeiScreenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); + public Result indexDataMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody IndexDataListMonthlyFormDTO formDTO) { + shiBeiScreenCollService.insertIndexDataMonthly(formDTO, customerId); return new Result(); } @@ -174,112 +151,98 @@ public class ShiBeiScreenCollController { /** * 17、指数_按年统计 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("indexdatayearly") - public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListYearlyFormDTO formDTO) { - shiBeiScreenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); + public Result indexDataYearly(@RequestHeader("CustomerId") String customerId, @RequestBody IndexDataListYearlyFormDTO formDTO) { + shiBeiScreenCollService.insertIndexDataYearly(formDTO, customerId); return new Result(); } /** * 16、部门信息上传 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("customerdept") - public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerDeptListFormDTO formDTO) { - shiBeiScreenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerDept(@RequestHeader("CustomerId") String customerId, @RequestBody CustomerDeptListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerDept(formDTO, customerId); return new Result(); } /** * 15、网格信息上传 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("customergrid") - public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerGridListFormDTO formDTO) { - shiBeiScreenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerGrid(@RequestHeader("CustomerId") String customerId, @RequestBody CustomerGridListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerGrid(formDTO, customerId); return new Result(); } /** * 14、组织层级 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("customeragency") - public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerAgencyListFormDTO formDTO) { - shiBeiScreenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerAgency(@RequestHeader("CustomerId") String customerId, @RequestBody CustomerAgencyListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerAgency(formDTO, customerId); return new Result(); } /** * 12、中央区各类总数 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("usertotaldata") - public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserTotalDataListFormDTO formDTO) { - shiBeiScreenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); + public Result userTotalData(@RequestHeader("CustomerId") String customerId, @RequestBody UserTotalDataListFormDTO formDTO) { + shiBeiScreenCollService.insertUserTotalData(formDTO, customerId); return new Result(); } /** * 11、基层治理-公众参与 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("userjoin") - public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserJoinListFormDTO formDTO) { - shiBeiScreenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); + public Result userJoin(@RequestHeader("CustomerId") String customerId, @RequestBody UserJoinListFormDTO formDTO) { + shiBeiScreenCollService.insertUserJoin(formDTO, customerId); return new Result(); } /** * 10、党建引领-先锋模范数据 * - * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @ExternalAppRequestAuth @PostMapping("pioneerdata") - public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PioneerDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); + public Result pioneerData(@RequestHeader("CustomerId") String customerId, @RequestBody PioneerDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPioneerData(formDTO, customerId); return new Result(); } @@ -293,10 +256,9 @@ public class ShiBeiScreenCollController { * @Author zhangyong * @Date 09:44 2020-08-25 **/ - @ExternalAppRequestAuth @PostMapping("publicpartitotaldata") - public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PublicPartiTotalDataListFormDTO formDTO) { - shiBeiScreenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); + public Result publicPartiTotalData(@RequestHeader("CustomerId") String customerId, @RequestBody PublicPartiTotalDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPublicPartiTotalData(formDTO, customerId); return new Result(); } }