浏览代码

Merge remote-tracking branch 'origin/zx_online_update_1218' into zx_online_update_1218

zouxuan 6 月之前
父节点
当前提交
592c0c11a0

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseScheduleDao.java

@@ -240,7 +240,7 @@ public interface CourseScheduleDao extends BaseMapper<CourseSchedule> {
     List<PianoClassVo> queryPianoClass(IPage page,@Param("param") MyCourseSearch search);
 
     //查询待结算课程
-    List<UserAccountRecordDto> selectWaitCourse(String day);
+    List<UserAccountRecordDto> selectWaitCourse(@Param("day") String day, @Param("type") String type);
 
     /**
      * 查询课程数

+ 19 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseScheduleServiceImpl.java

@@ -2131,12 +2131,28 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
      */
     @Transactional(rollbackFor = Exception.class)
     public void teacherSalaryTask() {
-        //课程结算日期(天)
-        Integer settlementDay = Integer.valueOf(sysConfigService.findConfigValue(SysConfigConstant.COURSE_SETTLEMENT_TIME_DAY));
+        //趣纠课
+        Integer practice = Integer.valueOf(sysConfigService.findConfigValue(SysConfigConstant.PRACTICE_ACCOUNT_PERIOD));
+        teacherSalary(practice, CourseScheduleEnum.PRACTICE.getCode());
+        // 直播课
+        Integer live = Integer.valueOf(sysConfigService.findConfigValue(SysConfigConstant.LIVE_ACCOUNT_PERIOD));
+        teacherSalary(live, CourseScheduleEnum.LIVE.getCode());
+        // 小组课
+        Integer group = Integer.valueOf(sysConfigService.findConfigValue(SysConfigConstant.GROUP_COURSE_ACCOUNT_PERIOD));
+        teacherSalary(group, CourseScheduleEnum.GROUP.getCode());
+        //vip课
+        Integer vipCourse = Integer.valueOf(sysConfigService.findConfigValue(SysConfigConstant.VIP_COURSE_ACCOUNT_PERIOD));
+        teacherSalary(vipCourse, CourseScheduleEnum.VIP.getCode());
+
+//        Integer settlementDay = Integer.valueOf(sysConfigService.findConfigValue(SysConfigConstant.PRACTICE_ACCOUNT_PERIOD));
+
+    }
+
+    private void teacherSalary(Integer settlementDay,String type) {
         //获取n天前日期
         String day = DateUtil.getDayAgoOrAftString(-settlementDay);
 
-        List<UserAccountRecordDto> list = baseMapper.selectWaitCourse(day);
+        List<UserAccountRecordDto> list = baseMapper.selectWaitCourse(day, type);
         if (CollectionUtils.isNotEmpty(list)) {
             for (UserAccountRecordDto dto : list) {
                 UserAccountRecordVo record = userAccountRecordService.detail(dto.getOrderNo(), dto.getBizType(), dto.getBizId());
@@ -2151,7 +2167,6 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
                     .set(CourseScheduleTeacherSalary::getSettlementTime, new Date())
                     .in(CourseScheduleTeacherSalary::getCourseScheduleId, bizIds));
         }
-
     }
 
     /**

+ 2 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -995,6 +995,7 @@
         WHERE ts.course_group_type_ = 'LIVE'
         AND ts.status_ = 'WAIT'
         <![CDATA[ AND DATE_FORMAT(ts.update_time_,'%Y-%m-%d') <= #{day}]]>
+        and ts.course_group_type_ = #{type}
         UNION
         SELECT DISTINCT
             ts.teacher_id_ AS userId,
@@ -1011,6 +1012,7 @@
         WHERE ts.course_group_type_ in ('PRACTICE','VIP','GROUP')
         AND ts.status_ = 'WAIT'
         <![CDATA[ AND DATE_FORMAT(ts.update_time_,'%Y-%m-%d') <= #{day}]]>
+        and ts.course_group_type_ = #{type}
     </select>
 
     <select id="selectStudentPianoCourse"