| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -7,22 +7,17 @@ import com.epmet.commons.tools.constant.NumConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.constant.StrConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.distributedlock.DistributedLock; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.distributedlock.LockConstants; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.enums.EnvEnum; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.DateUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.HttpClientManager; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.extract.form.ExtractOriginFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.extract.form.ExtractScreenFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.indexcal.CalculateCommonFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.evaluationindex.extract.todata.FactGridMemberStatisticsDailyService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.evaluationindex.extract.toscreen.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.evaluationindex.screen.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.stats.DimCustomerService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.google.common.util.concurrent.ThreadFactoryBuilder; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import lombok.extern.slf4j.Slf4j; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.redisson.api.RLock; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -33,7 +28,9 @@ import org.springframework.util.CollectionUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.time.LocalDate; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.ArrayList; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.List; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.concurrent.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.concurrent.CountDownLatch; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.concurrent.ExecutorService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.concurrent.TimeUnit; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					/** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @Author zxc | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -42,12 +39,6 @@ import java.util.concurrent.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					@Service | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					@Slf4j | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					public class ScreenExtractServiceImpl implements ScreenExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            .setNameFormat("ScreenExtractServiceImpl-pool-%d").build(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    ExecutorService threadPool = new ThreadPoolExecutor(3, 6, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            10L, TimeUnit.MINUTES, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private DimCustomerService dimCustomerService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -65,8 +56,6 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private IndexCalculateService indexCalculateService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private ScreenGrassrootsGovernDataAbsorptionService screenGrassrootsGovernDataAbsorptionService; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -81,10 +70,6 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private ScreenProjectSettleService screenProjectSettleService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private FactGridGovernDailyService factGridGovernDailyService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private FactAgencyGovernDailyService factAgencyGovernDailyService; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -94,6 +79,9 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private ScreenProjectCategoryGridAndOrgDailyService screenProjectCategoryGridAndOrgDailyService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private DistributedLock distributedLock; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private ExecutorService executorService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param extractOriginFormDTO | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -183,7 +171,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            lock = distributedLock.getLock(LockConstants.SCREEN_DAILY, NumConstant.SIX_HUNDRED_L, NumConstant.TEN_L, TimeUnit.SECONDS); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //等待3个线程执行完毕后再 继续执行下一个客户的 避免死锁
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            final CountDownLatch latch = new CountDownLatch(NumConstant.FOUR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            threadPool.submit(() -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            executorService.submit(() -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //党员基本情况screen_cpc_base_data
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                try { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    try { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -215,7 +203,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            threadPool.submit(() -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            executorService.submit(() -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //公众参与排行(注册人数、参与人数、话题数、议题数、项目数)screen_public_party_total_data
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                try { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -263,7 +251,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    log.info("extractDaily 2 thread run end ========= dateId:{},customerId:{}", dateId, customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            threadPool.submit(() -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            executorService.submit(() -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                try { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    try { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -283,7 +271,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    log.info("extractDaily 3 thread run end ========= dateId:{},customerId:{}", dateId, customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            threadPool.submit(() -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            executorService.submit(() -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //治理能力排行screen_govern_rank_data
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                try { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    try { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -447,16 +435,6 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } catch (Exception e) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            log.error("党建引领抽取到大屏失败,参数为:" + JSON.toJSONString(formDTO), e); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //已经挪到天抽取的抽取里了
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					       /* try { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //基层治理 - 热心市民 screen_party_user_rank_data
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            param.setCustomerId(customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            param.setDateId(monthId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            screenGrassrootsGovernDataAbsorptionService.userScoreDataHub(param); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } catch (Exception e) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            log.error("大屏热心市民/党员得分数据写入失败,参数为:{}" + JSON.toJSONString(formDTO), e); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }*/ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        try { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 项目(事件)数量分析按网格_按月统计
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            screenProjectQuantityGridMonthlyService.extractionProjectGridMonthly(customerId, monthId); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |