diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java index 542c2e5b48..b5aeaf83ee 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java @@ -3,7 +3,6 @@ package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -22,4 +21,16 @@ public class FineExampleFormDTO implements Serializable { */ @NotBlank(message = "机关ID不能为空",groups = {FineExample.class}) private String agencyId; + + /** + * 目前只有平阴在传,默认赋值:370124,跟随8个街道变化 + */ + private String areaCode; + + /** + * 当前token中的客户id + */ + @NotBlank(message = "token中的customerId不能为空",groups = {FineExample.class}) + private String customerId; + } 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 bbd0039e71..f5615c15bd 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 @@ -30,7 +30,8 @@ public class PartyMemberLeadController { * @date 2020/8/20 1:56 下午 */ @PostMapping("fineexample") - public Result fineExample(@RequestBody FineExampleFormDTO fineExampleFormDTO){ + public Result fineExample(@RequestHeader("CustomerId") String customerId,@RequestBody FineExampleFormDTO fineExampleFormDTO){ + fineExampleFormDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class); return new Result().ok(partyMemberLeadService.fineExample(fineExampleFormDTO)); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java index 5bc3077e85..0983d7c047 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java @@ -21,8 +21,6 @@ import com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import java.util.List; - /** * 党建引领-先锋模范数据 * @@ -43,12 +41,11 @@ public interface ScreenPioneerDataDao{ /** * @Description 根据地区码查询先锋模范 * @param areaCode - * @param customerId - * @param customerIds - 子级客户列表 + * @param dataEndTime 默认是昨天yyyyMMdd * @return com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO * @author wangc * @date 2021.02.24 15:39 */ - FineExampleResultDTO selectFineExampleByAreaCode(@Param("areaCode")String areaCode,@Param("customerId")String customerId,@Param("list") List customerIds); + FineExampleResultDTO selectFineExampleByAreaCode(@Param("areaCode") String areaCode, @Param("dataEndTime") String dataEndTime); } \ 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/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java index b74a777bd5..0cdb93a9c7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java @@ -110,6 +110,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); if (StringUtils.isNotEmpty(param.getAreaCode())){ + // 目前只有平阴大屏才会传areaCode,下面的sql限制住状态为:处理中 result = screenDifficultyDataDao.selectDifficultyByAreaCode(param.getAreaCode(),param.getType()); }else { result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType()); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java index 150bde5417..06979f8b65 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java @@ -3,16 +3,13 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.*; import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.ModuleConstant; -import com.epmet.dto.result.ScreenCustomerAgencyDTO; import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; import com.epmet.evaluationindex.screen.dto.form.ContactMassLineChartFormDTO; @@ -62,41 +59,39 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { private AgencyService screenCustomerAgencyService; /** - * @Description 1、先锋模范 * @param fineExampleFormDTO + * @Description 1、先锋模范 * @author zxc * @date 2020/8/20 1:56 下午 */ - @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override public FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO) { - ScreenCustomerAgencyDTO agencyInfo = customerAgencyDao.selectByAgencyId(fineExampleFormDTO.getAgencyId()); - if(null == agencyInfo) throw new RenException("未找到对应的机关"); - String customerId = agencyInfo.getCustomerId(); - String areaCode = agencyInfo.getAreaCode(); - - Result> crmResponse = operCrmOpenFeignClient.getAllSubCustomerIds(customerId); - List subCustomers; - if(null == crmResponse || !crmResponse.success()) - {subCustomers = null;} - else - {subCustomers = crmResponse.getData();} - FineExampleResultDTO fineExampleResultDTO; - if(CollectionUtils.isEmpty(subCustomers)) - fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); - else - fineExampleResultDTO = screenPioneerDataDao.selectFineExampleByAreaCode(areaCode,customerId,subCustomers); - - if (null == fineExampleResultDTO) { - return new FineExampleResultDTO(); + FineExampleResultDTO fineExampleResultDTO; + if (StringUtils.isNotBlank(fineExampleFormDTO.getAreaCode())) { + //如果是平阴县的areaCode + if ("370124".equals(fineExampleFormDTO.getAreaCode())) { + String yesterDay = com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(1); + // 只有平阴的需要汇聚 8个街道的数 + fineExampleResultDTO = screenPioneerDataDao.selectFineExampleByAreaCode(fineExampleFormDTO.getAreaCode(), yesterDay); + } else { + // 不是平阴的话,依然按照agencyId查询 + fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); } - fineExampleResultDTO.setIssueRatio(this.getRatio(fineExampleResultDTO.getIssueRatioA())); - fineExampleResultDTO.setPublishIssueRatio(this.getRatio(fineExampleResultDTO.getPublishIssueRatioA())); - fineExampleResultDTO.setResolvedProjectRatio(this.getRatio(fineExampleResultDTO.getResolvedProjectRatioA())); - fineExampleResultDTO.setTopicRatio(this.getRatio(fineExampleResultDTO.getTopicRatioA())); - fineExampleResultDTO.setShiftProjectRatio(this.getRatio(fineExampleResultDTO.getShiftProjectRatioA())); - fineExampleResultDTO.setPlatJoinPartyRatio(this.getRatio(Double.valueOf(fineExampleResultDTO.getPlatJoinPartyRatio()))); - return fineExampleResultDTO; + } else { + //单客户直接按照agencyId查询 + fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); + } + if (null == fineExampleResultDTO) { + return new FineExampleResultDTO(); + } + fineExampleResultDTO.setIssueRatio(this.getRatio(fineExampleResultDTO.getIssueRatioA())); + fineExampleResultDTO.setPublishIssueRatio(this.getRatio(fineExampleResultDTO.getPublishIssueRatioA())); + fineExampleResultDTO.setResolvedProjectRatio(this.getRatio(fineExampleResultDTO.getResolvedProjectRatioA())); + fineExampleResultDTO.setTopicRatio(this.getRatio(fineExampleResultDTO.getTopicRatioA())); + fineExampleResultDTO.setShiftProjectRatio(this.getRatio(fineExampleResultDTO.getShiftProjectRatioA())); + fineExampleResultDTO.setPlatJoinPartyRatio(this.getRatio(Double.valueOf(fineExampleResultDTO.getPlatJoinPartyRatio()))); + return fineExampleResultDTO; } /** diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml index 7f30a13cac..191cc4034a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -14,7 +14,7 @@ diff.EVENT_IMG_URL AS imgUrl, IFNULL(diff.EVENT_CATEGORY_NAME,'') AS categoryName, diff.EVENT_RE_ORG AS handleDepts, - diff.EVENT_RE_ORG AS handleCount + diff.EVENT_HANDLED_COUNT AS handleCount FROM screen_difficulty_data diff WHERE @@ -63,13 +63,15 @@ diff.EVENT_IMG_URL AS imgUrl, IFNULL(diff.EVENT_CATEGORY_NAME,'') AS categoryName, diff.EVENT_RE_ORG AS handleDepts, - diff.EVENT_RE_ORG AS handleCount + diff.EVENT_HANDLED_COUNT AS handleCount FROM screen_difficulty_data diff left join screen_customer_grid scg on(diff.ORG_ID=scg.GRID_ID and scg.DEL_FLAG='0') WHERE diff.DEL_FLAG = '0' + and diff.orgType='grid' + and diff.EVENT_STATUS_CODE in('pending','0') AND scg.AREA_CODE like concat(#{areaCode},'%') ORDER BY (CASE #{type} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml index 6534512f8a..259f50c80f 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml @@ -47,20 +47,12 @@ IFNULL(avg(data.PLAT_JOIN_PARTY_RATIO),0) AS platJoinPartyRatio FROM screen_pioneer_data data - LEFT JOIN screen_customer_agency agency - ON data.org_id = agency.agency_id + ON (data.org_id = agency.agency_id and agency.del_flag='0') WHERE data.del_flag = '0' - AND data.org_type = 'agency' - AND agency.area_code LIKE concat(#{areaCode},'%') - - - data.customer_id = #{subId} - - - ORDER BY data.data_end_time DESC - LIMIT 1 + and agency.PARENT_AREA_CODE=#{areaCode} + and data.DATA_END_TIME=#{dataEndTime}