|  |  | @ -78,7 +78,7 @@ public class BizDataStatsServiceImpl implements BizDataStatsService { | 
			
		
	
		
			
				
					|  |  |  |             List<String> customerIdList = null; | 
			
		
	
		
			
				
					|  |  |  |             do { | 
			
		
	
		
			
				
					|  |  |  |                 customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); | 
			
		
	
		
			
				
					|  |  |  |                 if (!CollectionUtils.isEmpty(customerIdList)){ | 
			
		
	
		
			
				
					|  |  |  |                 if (!CollectionUtils.isEmpty(customerIdList)) { | 
			
		
	
		
			
				
					|  |  |  |                     customerIds.addAll(customerIdList); | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |             } while (!CollectionUtil.isEmpty(customerIdList) && customerIdList.size() == pageSize); | 
			
		
	
	
		
			
				
					|  |  | @ -99,8 +99,8 @@ public class BizDataStatsServiceImpl implements BizDataStatsService { | 
			
		
	
		
			
				
					|  |  |  |         //校正参数里的前一天日期的数据
 | 
			
		
	
		
			
				
					|  |  |  |         //获取所有网格员
 | 
			
		
	
		
			
				
					|  |  |  |         List<CustomerGridStaffDTO> allGridMembers = getAllGridMembers(formDTO); | 
			
		
	
		
			
				
					|  |  |  |         if (CollectionUtils.isEmpty(allGridMembers)){ | 
			
		
	
		
			
				
					|  |  |  |             log.warn("executeStaffPatrolStats have any gridMembers,param:{}",JSON.toJSONString(formDTO)); | 
			
		
	
		
			
				
					|  |  |  |         if (CollectionUtils.isEmpty(allGridMembers)) { | 
			
		
	
		
			
				
					|  |  |  |             log.warn("executeStaffPatrolStats have any gridMembers,param:{}", JSON.toJSONString(formDTO)); | 
			
		
	
		
			
				
					|  |  |  |             return; | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         String yesterdayStr = getYesterdayString(formDTO); | 
			
		
	
	
		
			
				
					|  |  | @ -110,12 +110,12 @@ public class BizDataStatsServiceImpl implements BizDataStatsService { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         //初始化参数里日期的数据  如果当前时间在1分钟内 则初始化
 | 
			
		
	
		
			
				
					|  |  |  |         String todayDateDimId = DimIdGenerator.getDateDimId(new Date()); | 
			
		
	
		
			
				
					|  |  |  |         if (todayDateDimId.equals(formDTO.getDateId())){ | 
			
		
	
		
			
				
					|  |  |  |         if (todayDateDimId.equals(formDTO.getDateId())) { | 
			
		
	
		
			
				
					|  |  |  |             //如果当前时间-1分钟还等于今天 则进行初始化操作 否则执行数据纠正
 | 
			
		
	
		
			
				
					|  |  |  |             String dateDimId = DimIdGenerator.getDateDimId(new Date(System.currentTimeMillis() - 1 * 60 * 1000)); | 
			
		
	
		
			
				
					|  |  |  |             if (!dateDimId.equals(todayDateDimId)){ | 
			
		
	
		
			
				
					|  |  |  |             if (!dateDimId.equals(todayDateDimId)) { | 
			
		
	
		
			
				
					|  |  |  |                 initStaffPatrolTodayData(formDTO, allGridMembers); | 
			
		
	
		
			
				
					|  |  |  |             }else{ | 
			
		
	
		
			
				
					|  |  |  |             } else { | 
			
		
	
		
			
				
					|  |  |  |                 reloadStaffPatrolStatsData(formDTO, allGridMembers); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
	
		
			
				
					|  |  | @ -123,7 +123,7 @@ public class BizDataStatsServiceImpl implements BizDataStatsService { | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     private void reloadStaffPatrolStatsData(StaffPatrolStatsFormDTO formDTO, List<CustomerGridStaffDTO> allGridMembers) { | 
			
		
	
		
			
				
					|  |  |  |         log.info("reloadStaffPatrolStatsData param:{}",JSON.toJSONString(formDTO)); | 
			
		
	
		
			
				
					|  |  |  |         log.info("reloadStaffPatrolStatsData param:{}", JSON.toJSONString(formDTO)); | 
			
		
	
		
			
				
					|  |  |  |         //获取昨日的巡查统计记录
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         //遍历网格员重新初始化数据
 | 
			
		
	
	
		
			
				
					|  |  | @ -216,7 +216,7 @@ public class BizDataStatsServiceImpl implements BizDataStatsService { | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     private void initStaffPatrolTodayData(StaffPatrolStatsFormDTO formDTO, List<CustomerGridStaffDTO> allGridMembers) { | 
			
		
	
		
			
				
					|  |  |  |         log.info("initStaffPatrolTodayData param:{}",JSON.toJSONString(formDTO)); | 
			
		
	
		
			
				
					|  |  |  |         log.info("initStaffPatrolTodayData param:{}", JSON.toJSONString(formDTO)); | 
			
		
	
		
			
				
					|  |  |  |         List<StatsStaffPatrolRecordDailyDTO> insertList = buildInitPatrolStatsData(formDTO, allGridMembers); | 
			
		
	
		
			
				
					|  |  |  |         Integer effectRow = statsStaffPatrolService.delAndInsertBatch(formDTO, insertList); | 
			
		
	
		
			
				
					|  |  |  |         log.debug("initStaffPatrolStats insert rows:{}", effectRow); | 
			
		
	
	
		
			
				
					|  |  | @ -302,24 +302,24 @@ public class BizDataStatsServiceImpl implements BizDataStatsService { | 
			
		
	
		
			
				
					|  |  |  |             daysBetween = DateUtils.getDaysBetween(param.getStartDate(), param.getEndDate()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         List<String> finalDaysBetween = daysBetween; | 
			
		
	
		
			
				
					|  |  |  |         threadPool.submit(() -> { | 
			
		
	
		
			
				
					|  |  |  |             if (!isRange) { | 
			
		
	
		
			
				
					|  |  |  |                 try { | 
			
		
	
		
			
				
					|  |  |  |                     //初始化form里的今天的数据 并纠正昨日的数据
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         if (!isRange) { | 
			
		
	
		
			
				
					|  |  |  |             try { | 
			
		
	
		
			
				
					|  |  |  |                 //初始化form里的今天的数据 并纠正昨日的数据
 | 
			
		
	
		
			
				
					|  |  |  |                 this.executeStaffPatrolStats(formDTO); | 
			
		
	
		
			
				
					|  |  |  |             } catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  |                 log.error("【网格员巡查数据统计】发生异常,参数:" + JSON.toJSONString(formDTO), e); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } else { | 
			
		
	
		
			
				
					|  |  |  |             try { | 
			
		
	
		
			
				
					|  |  |  |                 for (String dateDimId : finalDaysBetween) { | 
			
		
	
		
			
				
					|  |  |  |                     formDTO.setDateId(dateDimId); | 
			
		
	
		
			
				
					|  |  |  |                     this.executeStaffPatrolStats(formDTO); | 
			
		
	
		
			
				
					|  |  |  |                 } catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  |                     log.error("【网格员巡查数据统计】发生异常,参数:" + JSON.toJSONString(formDTO), e); | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |             } else { | 
			
		
	
		
			
				
					|  |  |  |                 try { | 
			
		
	
		
			
				
					|  |  |  |                     for (String dateDimId : finalDaysBetween) { | 
			
		
	
		
			
				
					|  |  |  |                         formDTO.setDateId(dateDimId); | 
			
		
	
		
			
				
					|  |  |  |                         this.executeStaffPatrolStats(formDTO); | 
			
		
	
		
			
				
					|  |  |  |                     } | 
			
		
	
		
			
				
					|  |  |  |                 } catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  |                     log.error("【网格员巡查数据统计】发生异常,参数:" + JSON.toJSONString(param), e); | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |             } catch (Exception e) { | 
			
		
	
		
			
				
					|  |  |  |                 log.error("【网格员巡查数据统计】发生异常,参数:" + JSON.toJSONString(param), e); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         }); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
	
		
			
				
					|  |  | 
 |