| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -28,7 +28,6 @@ import org.springframework.stereotype.Service; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.ArrayList; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.Date; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.List; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.Map; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					/** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @author liujianjun | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -83,18 +82,17 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                customerIds.add(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //查询客户编码、以及下一级客户列表 add01.14
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Map<String, CustomerSubInfoDTO> customerInfoMap=this.getCustomerInfoMap(customerIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Boolean flag = false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            for (String customerId : customerIds) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                CalculateCommonFormDTO param = new CalculateCommonFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                param.setCustomerId(customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                param.setMonthId(formDTO.getMonthId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //01.14 add
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (!customerInfoMap.isEmpty() && null != customerInfoMap.get(customerId)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    param.setCustomerAreaCode(customerInfoMap.get(customerId).getCustomerAreaCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    param.setSubCustomerIds(customerInfoMap.get(customerId).getSubCustomerIds()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //01.14 add 查询客户编码、以及下一级客户列表
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                CustomerSubInfoDTO customerSubInfoDTO=this.getCustomerSubInfo(customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (null != customerSubInfoDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    param.setCustomerAreaCode(customerSubInfoDTO.getCustomerAreaCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    param.setSubCustomerIds(customerSubInfoDTO.getSubCustomerIds()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                flag = calulateCustomerIndexScore(param); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -202,14 +200,14 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param customerIds | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param customerId | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @author yinzuomei | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @description 查询当前客户的area_code信息、以及下一级客户列表 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @Date 2021/1/21 11:28 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     **/ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public Map<String, CustomerSubInfoDTO> getCustomerInfoMap(List<String> customerIds) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return customerRelationService.getCustomerInfoMap(customerIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public CustomerSubInfoDTO getCustomerSubInfo(String customerId) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return customerRelationService.getCustomerSubInfo(customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Async | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -256,17 +254,15 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     **/ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public void toScreenIndexData(CalculateCommonFormDTO formDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> customerIds=new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        customerIds.add(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //查询客户编码、以及下一级客户列表 add01.14
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, CustomerSubInfoDTO> customerInfoMap=this.getCustomerInfoMap(customerIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("customerInfoMap:  "+JSON.toJSONString(customerInfoMap,true)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        CustomerSubInfoDTO customerSubInfoDTO = this.getCustomerSubInfo(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("customerInfoMap:  " + JSON.toJSONString(customerSubInfoDTO, true)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //01.14 add
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (!customerInfoMap.isEmpty() && null != customerInfoMap.get(formDTO.getCustomerId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            formDTO.setCustomerAreaCode(customerInfoMap.get(formDTO.getCustomerId()).getCustomerAreaCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            formDTO.setSubCustomerIds(customerInfoMap.get(formDTO.getCustomerId()).getSubCustomerIds()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (null != customerSubInfoDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            formDTO.setCustomerAreaCode(customerSubInfoDTO.getCustomerAreaCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            formDTO.setSubCustomerIds(customerSubInfoDTO.getSubCustomerIds()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("入参:  "+JSON.toJSONString(formDTO,true)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("入参:  " + JSON.toJSONString(formDTO, true)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        factIndexCollectService.insertScreenIndexDataMonthlyAndYearly(formDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
					 | 
				
				 | 
				
					
  |