| 
						
						
							
								
							
						
						
					 | 
					@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.baomidou.mybatisplus.core.metadata.IPage; | 
					 | 
					 | 
					import com.baomidou.mybatisplus.core.metadata.IPage; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
					 | 
					 | 
					import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.constant.NumConstant; | 
					 | 
					 | 
					import com.epmet.commons.tools.constant.NumConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.commons.tools.constant.StrConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.exception.EpmetException; | 
					 | 
					 | 
					import com.epmet.commons.tools.exception.EpmetException; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.page.PageData; | 
					 | 
					 | 
					import com.epmet.commons.tools.page.PageData; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.utils.ConvertUtils; | 
					 | 
					 | 
					import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -339,12 +340,12 @@ public class IssueVoteStatisticalDailyServiceImpl extends BaseServiceImpl<IssueV | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            List<String> daysBetween = DateUtils.getDaysBetween(form.getStartDate(), form.getEndDate()); | 
					 | 
					 | 
					            List<String> daysBetween = DateUtils.getDaysBetween(form.getStartDate(), form.getEndDate()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            customerIds.forEach(customerId -> { | 
					 | 
					 | 
					            customerIds.forEach(customerId -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                daysBetween.forEach(dateId -> { | 
					 | 
					 | 
					                daysBetween.forEach(dateId -> { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    statisticVote(customerId,dateId); | 
					 | 
					 | 
					                    statisticVote(customerId,yyyyMMddToLine(dateId)); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                }); | 
					 | 
					 | 
					                }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            }); | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        }else { | 
					 | 
					 | 
					        }else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (StringUtils.isBlank(form.getDateId())){ | 
					 | 
					 | 
					            if (StringUtils.isBlank(form.getDateId())){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                form.setDateId(LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", "")); | 
					 | 
					 | 
					                form.setDateId(LocalDate.now().minusDays(NumConstant.ONE).toString()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            customerIds.forEach(customerId -> { | 
					 | 
					 | 
					            customerIds.forEach(customerId -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                statisticVote(customerId, form.getDateId()); | 
					 | 
					 | 
					                statisticVote(customerId, form.getDateId()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -352,6 +353,14 @@ public class IssueVoteStatisticalDailyServiceImpl extends BaseServiceImpl<IssueV | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    public String yyyyMMddToLine(String dateId){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        StringBuilder sb = new StringBuilder(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        sb.append(dateId.substring(0,4)).append(StrConstant.HYPHEN); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        sb.append(dateId.substring(4,6)).append(StrConstant.HYPHEN); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        sb.append(dateId.substring(6,8)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        return sb.toString(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    /** | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @Description  统计 issue_vote_statistical_daily 表 | 
					 | 
					 | 
					     * @Description  统计 issue_vote_statistical_daily 表 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     *               只统计表决日增存在的,不存在的不写入,查询程序补全 | 
					 | 
					 | 
					     *               只统计表决日增存在的,不存在的不写入,查询程序补全 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -360,28 +369,32 @@ public class IssueVoteStatisticalDailyServiceImpl extends BaseServiceImpl<IssueV | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @author zxc | 
					 | 
					 | 
					     * @author zxc | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @date 2021/12/29 1:46 下午 | 
					 | 
					 | 
					     * @date 2021/12/29 1:46 下午 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     */ | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Transactional(rollbackFor = Exception.class) | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public void statisticVote(String customerId,String dateId){ | 
					 | 
					 | 
					    public void statisticVote(String customerId,String dateId){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // 日增
 | 
					 | 
					 | 
					        // 日增
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<DailyStatisticalVoteJobResultDTO> dayAdd = issueVoteDetailDao.statisticVote(customerId, dateId); | 
					 | 
					 | 
					        List<DailyStatisticalVoteJobResultDTO> dayAdd = issueVoteDetailDao.statisticVote(customerId, dateId, true); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        if (CollectionUtils.isNotEmpty(dayAdd)){ | 
					 | 
					 | 
					        if (CollectionUtils.isNotEmpty(dayAdd)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            //累计
 | 
					 | 
					 | 
					            //累计
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            List<DailyStatisticalVoteJobResultDTO> allDayAdd = issueVoteDetailDao.statisticVote(customerId, null); | 
					 | 
					 | 
					            List<DailyStatisticalVoteJobResultDTO> allDayAdd = issueVoteDetailDao.statisticVote(customerId, dateId, false); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            dayAdd.forEach(d -> allDayAdd.stream().filter(a -> a.getIssueId().equals(d.getIssueId())).forEach(a -> { | 
					 | 
					 | 
					            dayAdd.forEach(d -> allDayAdd.stream().filter(a -> a.getIssueId().equals(d.getIssueId())).forEach(a -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                d.setOppositionCount(a.getOppositionCount()); | 
					 | 
					 | 
					                d.setOppositionCount(a.getOppositionCount()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                d.setSupportCount(a.getSupportCount()); | 
					 | 
					 | 
					                d.setSupportCount(a.getSupportCount()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                d.setTotalCount(a.getTotalCount()); | 
					 | 
					 | 
					                d.setTotalCount(a.getTotalCount()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            })); | 
					 | 
					 | 
					            })); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            List<IssueVoteStatisticalDailyEntity> needInsert = ConvertUtils.sourceToTarget(dayAdd, IssueVoteStatisticalDailyEntity.class); | 
					 | 
					 | 
					            List<IssueVoteStatisticalDailyEntity> needInsert = ConvertUtils.sourceToTarget(dayAdd, IssueVoteStatisticalDailyEntity.class); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            Integer delNum; | 
					 | 
					 | 
					            delAndInsert(needInsert,customerId,dateId); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					            do { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                delNum = baseDao.delHistoryData(customerId, dateId); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } while (delNum != null && delNum > NumConstant.ZERO); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            List<List<IssueVoteStatisticalDailyEntity>> partition = ListUtils.partition(needInsert, NumConstant.ONE_HUNDRED); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            partition.forEach(p -> { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                baseDao.insertBatch(p); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            }); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    @Transactional(rollbackFor = Exception.class) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    public void delAndInsert(List<IssueVoteStatisticalDailyEntity> needInsert,String customerId,String dateId){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        Integer delNum; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        do { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            delNum = baseDao.delHistoryData(customerId, dateId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } while (delNum != null && delNum > NumConstant.ZERO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<List<IssueVoteStatisticalDailyEntity>> partition = ListUtils.partition(needInsert, NumConstant.ONE_HUNDRED); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        partition.forEach(p -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            baseDao.insertBatch(p); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} | 
					 | 
					 | 
					} |