|
@ -2,18 +2,22 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; |
|
|
|
|
|
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
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.ConvertUtils; |
|
|
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
import com.epmet.datareport.dao.evaluationindex.screen.*; |
|
|
import com.epmet.datareport.dao.evaluationindex.screen.*; |
|
|
import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; |
|
|
import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; |
|
|
import com.epmet.datareport.utils.DateUtils; |
|
|
import com.epmet.datareport.utils.DateUtils; |
|
|
import com.epmet.datareport.utils.ModuleConstant; |
|
|
import com.epmet.datareport.utils.ModuleConstant; |
|
|
|
|
|
import com.epmet.dto.result.ScreenCustomerAgencyDTO; |
|
|
import com.epmet.evaluationindex.screen.constant.ScreenConstant; |
|
|
import com.epmet.evaluationindex.screen.constant.ScreenConstant; |
|
|
import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; |
|
|
import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; |
|
|
import com.epmet.evaluationindex.screen.dto.form.ContactMassLineChartFormDTO; |
|
|
import com.epmet.evaluationindex.screen.dto.form.ContactMassLineChartFormDTO; |
|
|
import com.epmet.evaluationindex.screen.dto.form.FineExampleFormDTO; |
|
|
import com.epmet.evaluationindex.screen.dto.form.FineExampleFormDTO; |
|
|
import com.epmet.evaluationindex.screen.dto.form.VolunteerServiceFormDTO; |
|
|
import com.epmet.evaluationindex.screen.dto.form.VolunteerServiceFormDTO; |
|
|
import com.epmet.evaluationindex.screen.dto.result.*; |
|
|
import com.epmet.evaluationindex.screen.dto.result.*; |
|
|
|
|
|
import com.epmet.feign.OperCrmOpenFeignClient; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
@ -48,7 +52,10 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { |
|
|
private DateUtils dateUtils; |
|
|
private DateUtils dateUtils; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; |
|
|
private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ScreenCustomerAgencyDao customerAgencyDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private OperCrmOpenFeignClient operCrmOpenFeignClient; |
|
|
/** |
|
|
/** |
|
|
* @Description 1、先锋模范 |
|
|
* @Description 1、先锋模范 |
|
|
* @param fineExampleFormDTO |
|
|
* @param fineExampleFormDTO |
|
@ -58,17 +65,35 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { |
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) |
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) |
|
|
@Override |
|
|
@Override |
|
|
public FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO) { |
|
|
public FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO) { |
|
|
FineExampleResultDTO fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); |
|
|
String customerId = fineExampleFormDTO.getCustomerId(); |
|
|
if (null == fineExampleResultDTO){ |
|
|
String areaCode = null; |
|
|
return new FineExampleResultDTO(); |
|
|
if(StringUtils.isBlank(customerId)){ |
|
|
|
|
|
ScreenCustomerAgencyDTO agencyInfo = customerAgencyDao.selectByAgencyId(fineExampleFormDTO.getAgencyId()); |
|
|
|
|
|
if(null == agencyInfo) throw new RenException("未找到对应的机关"); |
|
|
|
|
|
customerId = agencyInfo.getCustomerId(); |
|
|
|
|
|
areaCode = agencyInfo.getAreaCode(); |
|
|
} |
|
|
} |
|
|
fineExampleResultDTO.setIssueRatio(this.getRatio(fineExampleResultDTO.getIssueRatioA())); |
|
|
Result<List<String>> crmResponse = operCrmOpenFeignClient.getAllSubCustomerIds(customerId); |
|
|
fineExampleResultDTO.setPublishIssueRatio(this.getRatio(fineExampleResultDTO.getPublishIssueRatioA())); |
|
|
if(null == crmResponse || !crmResponse.success()){ |
|
|
fineExampleResultDTO.setResolvedProjectRatio(this.getRatio(fineExampleResultDTO.getResolvedProjectRatioA())); |
|
|
throw new RenException("获取子客户列表失败"); |
|
|
fineExampleResultDTO.setTopicRatio(this.getRatio(fineExampleResultDTO.getTopicRatioA())); |
|
|
} |
|
|
fineExampleResultDTO.setShiftProjectRatio(this.getRatio(fineExampleResultDTO.getShiftProjectRatioA())); |
|
|
List<String> subCustomers = crmResponse.getData(); |
|
|
fineExampleResultDTO.setPlatJoinPartyRatio(this.getRatio(Double.valueOf(fineExampleResultDTO.getPlatJoinPartyRatio()))); |
|
|
FineExampleResultDTO fineExampleResultDTO; |
|
|
return fineExampleResultDTO; |
|
|
if(CollectionUtils.isEmpty(subCustomers)) |
|
|
|
|
|
fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); |
|
|
|
|
|
else |
|
|
|
|
|
fineExampleResultDTO = screenPioneerDataDao.selectFineExampleByAreaCode(areaCode,customerId,subCustomers); |
|
|
|
|
|
|
|
|
|
|
|
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; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|