| 
						
						
							
								
							
						
						
					 | 
					@ -3,16 +3,13 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.alibaba.fastjson.JSON; | 
					 | 
					 | 
					import com.alibaba.fastjson.JSON; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					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.AgencyService; | 
					 | 
					 | 
					import com.epmet.datareport.service.evaluationindex.screen.AgencyService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					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; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -62,31 +59,29 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    private AgencyService screenCustomerAgencyService; | 
					 | 
					 | 
					    private AgencyService screenCustomerAgencyService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    /** | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @Description  1、先锋模范 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @param fineExampleFormDTO | 
					 | 
					 | 
					     * @param fineExampleFormDTO | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @Description 1、先锋模范 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @author zxc | 
					 | 
					 | 
					     * @author zxc | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @date 2020/8/20 1:56 下午 | 
					 | 
					 | 
					     * @date 2020/8/20 1:56 下午 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     */ | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    @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) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        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; | 
					 | 
					 | 
					        FineExampleResultDTO fineExampleResultDTO; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if(CollectionUtils.isEmpty(subCustomers)) | 
					 | 
					 | 
					        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 = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							else | 
					 | 
					 | 
					            } | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
								fineExampleResultDTO = screenPioneerDataDao.selectFineExampleByAreaCode(areaCode,customerId,subCustomers); | 
					 | 
					 | 
					        } else { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					
 | 
					 | 
					 | 
					            //单客户直接按照agencyId查询
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (null == fineExampleResultDTO) { | 
					 | 
					 | 
					        if (null == fineExampleResultDTO) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return new FineExampleResultDTO(); | 
					 | 
					 | 
					            return new FineExampleResultDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |