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 1/5] =?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 2/5] =?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 3/5] =?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 4/5] =?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 5/5] =?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@