|  | @@ -1619,18 +1619,12 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  //老师课酬状态改为已完成
 | 
	
		
			
				|  |  |                  courseScheduleTeacherSalaryService.update(null, Wrappers.<CourseScheduleTeacherSalary>lambdaUpdate()
 | 
	
		
			
				|  |  | -                        .set(CourseScheduleTeacherSalary::getStatus, CourseScheduleEnum.COMPLETE.getCode())
 | 
	
		
			
				|  |  | +                        .set(CourseScheduleTeacherSalary::getStatus, TeacherSalaryEnum.WAIT.getCode())
 | 
	
		
			
				|  |  |                          .set(CourseScheduleTeacherSalary::getSettlementTime, new Date())
 | 
	
		
			
				|  |  |                          .in(CourseScheduleTeacherSalary::getCourseScheduleId, practiceList.stream().map(CourseScheduleStudentVo::getCourseId).collect(Collectors.toList())));
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                //获取教师课酬写入到金额变更表
 | 
	
		
			
				|  |  | +                //清除缓存
 | 
	
		
			
				|  |  |                  for (CourseScheduleStudentVo practice : practiceList) {
 | 
	
		
			
				|  |  | -                    userAccountService.accountChange(
 | 
	
		
			
				|  |  | -                            new UserAccountRecordDto(practice.getTeacherId(), practice.getActualSalary()
 | 
	
		
			
				|  |  | -                                    , InOrOutEnum.IN, AccountBizTypeEnum.PRACTICE, practice.getCourseId(),
 | 
	
		
			
				|  |  | -                                    practice.getGroupName(), practice.getOrderNo())
 | 
	
		
			
				|  |  | -                    );
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                      //清除学生统计缓存
 | 
	
		
			
				|  |  |                      redissonClient.getBucket(CacheNameEnum.STUDENT_TOTAL.getRedisKey(practice.getStudentId())).delete();
 | 
	
		
			
				|  |  |                      //清除老师统计缓存
 | 
	
	
		
			
				|  | @@ -1698,17 +1692,20 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
 | 
	
		
			
				|  |  |       * @Author: cy
 | 
	
		
			
				|  |  |       * @Date: 2022/5/24
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  | -//    @Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | -//    public void teacherSalaryTask() {
 | 
	
		
			
				|  |  | -//        //课程结算日期(天)
 | 
	
		
			
				|  |  | -//        Integer settlementDay = Integer.valueOf(sysConfigService.findConfigValue(SysConfigConstant.COURSE_SALARY_SETTLEMENT_DAY));
 | 
	
		
			
				|  |  | -//        //获取n天前日期
 | 
	
		
			
				|  |  | -//        String day = DateUtil.getDayAgoOrAftString(-settlementDay);
 | 
	
		
			
				|  |  | -//        //获取小于n天前所有课程id
 | 
	
		
			
				|  |  | -//        List<Long> idList = baseMapper.selectIdList(day);
 | 
	
		
			
				|  |  | -//        //更新老师课酬表
 | 
	
		
			
				|  |  | -//        baseMapper.updateTeacherSalary(idList);
 | 
	
		
			
				|  |  | -//    }
 | 
	
		
			
				|  |  | +    @Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | +    public void teacherSalaryTask() {
 | 
	
		
			
				|  |  | +        //课程结算日期(天)
 | 
	
		
			
				|  |  | +        Integer settlementDay = Integer.valueOf(sysConfigService.findConfigValue(SysConfigConstant.COURSE_SALARY_SETTLEMENT_DAY));
 | 
	
		
			
				|  |  | +        //获取n天前日期
 | 
	
		
			
				|  |  | +        String day = DateUtil.getDayAgoOrAftString(-settlementDay);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        List<UserAccountRecordDto> list = baseMapper.selectWaitCourse(day);
 | 
	
		
			
				|  |  | +        if (CollectionUtils.isNotEmpty(list)){
 | 
	
		
			
				|  |  | +            for (UserAccountRecordDto dto : list) {
 | 
	
		
			
				|  |  | +                userAccountService.accountChange(dto);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * @Description: 查询琴房剩余时长、冻结时长、统计学员人数
 |