|
|
@ -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<List<String>> crmResponse = operCrmOpenFeignClient.getAllSubCustomerIds(customerId); |
|
|
|
List<String> 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; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|