Browse Source

Merge remote-tracking branch 'origin/master'

zouxuan 4 years ago
parent
commit
c7974ee24c

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentExtracurricularExercisesSituationDao.java

@@ -109,4 +109,7 @@ public interface StudentExtracurricularExercisesSituationDao extends BaseDAO<Lon
                                                                                @Param("teacherId") Integer teacherId,
                                                                                @Param("studentIds") List<Integer> studentIds);
 
+    List<StudentExtracurricularExercisesSituation> findServiceWithCourse(@Param("monday") String monday,
+                                                                         @Param("courseId") Long courseId);
+
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherCourseSalaryDetail4WebDto.java

@@ -63,6 +63,16 @@ public class TeacherCourseSalaryDetail4WebDto {
 
     private String deductionReason;
 
+    private Integer belongDaya;
+
+    public Integer getBelongDaya() {
+        return belongDaya;
+    }
+
+    public void setBelongDaya(Integer belongDaya) {
+        this.belongDaya = belongDaya;
+    }
+
     public String getDeductionReason() {
         return deductionReason;
     }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleTeacherSalaryService.java

@@ -17,6 +17,8 @@ import java.util.Map;
 
 public interface CourseScheduleTeacherSalaryService extends BaseService<Long, CourseScheduleTeacherSalary> {
 
+    String TASK_KEY = "SETTLEMENT_TYPES";
+
     /**
      * @Author: Joburgess
      * @Date: 2019/10/14

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentServeService.java

@@ -43,4 +43,14 @@ public interface StudentServeService {
 
     void updateExercisesSituation(Date date, List<Integer> studentIds, Integer teacherId);
 
+    /**
+     * @describe 获取与课程相关的应被服务的学员
+     * @author Joburgess
+     * @date 2020/12/29 0029
+     * @param date:
+     * @param courseId:
+     * @return java.util.Set<java.lang.Integer>
+     */
+    Set<Integer> getStudentWithCourse(Long courseId);
+
 }

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseReviewServiceImpl.java

@@ -577,7 +577,11 @@ public class CourseReviewServiceImpl extends BaseServiceImpl<Integer, CourseSche
         if (!CollectionUtils.isEmpty(courseScheduleStudentPayments)) {
             Teacher teacher = teacherDao.get(courseSchedule.getActualTeacherId());
             String dateStr = DateUtil.dateToString(DateUtil.addDays(date, 3), "MM月dd日");
+            Set<Integer> serveStudentIds = studentServeService.getStudentWithCourse(courseSchedule.getId());
             for (CourseScheduleStudentPayment courseScheduleStudentPayment : courseScheduleStudentPayments) {
+                if(!serveStudentIds.contains(courseScheduleStudentPayment.getUserId())){
+                    continue;
+                }
                 StudentCourseHomework studentCourseHomework = new StudentCourseHomework();
                 if (Objects.isNull(existHomework)) {
                     studentCourseHomework.setCourseHomeworkId(courseHomework.getId());

+ 9 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -24,6 +24,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
@@ -83,6 +84,8 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
     private SchoolDao schoolDao;
     @Autowired
     private SysConfigService sysConfigService;
+    @Autowired
+    private RedisTemplate redisTemplate;
 
     private static final Logger LOGGER = LoggerFactory
             .getLogger(CourseScheduleTeacherSalaryServiceImpl.class);
@@ -208,6 +211,10 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         String endDate = DateUtil.format(DateUtil.getLastDayOfMonth(date),DateUtil.DEFAULT_PATTERN);
         List<CourseScheduleTeacherSalary> someDayAgoTeacherCourseSalaryNoSettlement = courseScheduleTeacherSalaryDao.findTeacherCourseSalaryNoSettlement(startDate,endDate);
 
+        if(CollectionUtils.isEmpty(someDayAgoTeacherCourseSalaryNoSettlement)){
+            return;
+        }
+
         Set<Long> courseScheduleIds = someDayAgoTeacherCourseSalaryNoSettlement.stream().map(CourseScheduleTeacherSalary::getCourseScheduleId).collect(Collectors.toSet());
 
         Set<Integer> teacherIds = someDayAgoTeacherCourseSalaryNoSettlement.stream().map(CourseScheduleTeacherSalary::getUserId).collect(Collectors.toSet());
@@ -1361,10 +1368,11 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         String startDate = DateUtil.format(DateUtil.getFirstDayOfMonth(date),DateUtil.DEFAULT_PATTERN);
         String endDate = DateUtil.format(DateUtil.getLastDayOfMonth(date),DateUtil.DEFAULT_PATTERN);
 
-        int isSalaryGroupTypes = courseScheduleDao.countIsSalaryGroupTypes(startDate, endDate);
+        int isSalaryGroupTypes = redisTemplate.opsForSet().size(CourseScheduleTeacherSalaryService.TASK_KEY).intValue();
         if(isSalaryGroupTypes<3){
             return;
         }
+        redisTemplate.delete(CourseScheduleTeacherSalaryService.TASK_KEY);
         List<CourseScheduleTeacherSalary> salaries = courseScheduleTeacherSalaryDao.getIsSalaryWithDate(startDate, endDate);
         if(CollectionUtils.isEmpty(salaries)){
             return;

+ 90 - 63
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -302,10 +302,10 @@ public class StudentServeServiceImpl implements StudentServeService {
         LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
         Date nextMonday = Date.from(sunDayDate.plusDays(1).atStartOfDay(DateUtil.zoneId).toInstant());
 
-        int weekServiceNum = studentExtracurricularExercisesSituationDao.countWeekServiceNum(monDayDate.toString());
-        if(weekServiceNum>0&&CollectionUtils.isEmpty(studentIds)){
-            return;
-        }
+//        int weekServiceNum = studentExtracurricularExercisesSituationDao.countWeekServiceNum(monDayDate.toString());
+//        if(weekServiceNum>0&&CollectionUtils.isEmpty(studentIds)){
+//            return;
+//        }
 
         List<StudentServeCourseDto> studentFutureCourseInfo = studentDao.getStudentFutureCourseInfo(monDayDate.toString(), studentIds);
         Map<Integer, List<StudentServeCourseDto>> studentCourseMap = studentFutureCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getStudentId));
@@ -319,11 +319,15 @@ public class StudentServeServiceImpl implements StudentServeService {
                 List<StudentServeCourseDto> futureCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.SINGLE);
                 List<StudentServeCourseDto> weekCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.SINGLE).stream().filter(c -> c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
                 if(CollectionUtils.isEmpty(weekCourseInfo)){
-                    StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
-                            futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
-                            DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
-                            "EXERCISE", null);
-                    results.add(studentExtracurricularExercisesSituation);
+                    Map<String, List<StudentServeCourseDto>> groupCourseInfo = futureCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getMusicGroupId));
+                    for (Map.Entry<String, List<StudentServeCourseDto>> groupCourseInfoEntry : groupCourseInfo.entrySet()) {
+                        StudentServeCourseDto courseInfo = groupCourseInfoEntry.getValue().stream().min(Comparator.comparing(StudentServeCourseDto::getCourseStartTime)).get();
+                        StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
+                                courseInfo.getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
+                                DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
+                                "EXERCISE", null);
+                        results.add(studentExtracurricularExercisesSituation);
+                    }
                 }else{
                     Map<String, List<StudentServeCourseDto>> groupCourseInfo = weekCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getMusicGroupId));
                     Map<Integer, Set<Long>> teacherServiceCourseIdMap = new HashMap<>();
@@ -347,11 +351,14 @@ public class StudentServeServiceImpl implements StudentServeService {
                 List<StudentServeCourseDto> futureCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.VIP);
                 List<StudentServeCourseDto> weekCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.VIP).stream().filter(c -> c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
                 if(CollectionUtils.isEmpty(weekCourseInfo)){
-                    StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
-                            futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
-                            DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
-                            "EXERCISE", null);
-                    results.add(studentExtracurricularExercisesSituation);
+                    Map<Integer, List<StudentServeCourseDto>> teacherCourseMap = futureCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getActualTeacherId));
+                    for (Integer teacherId : teacherCourseMap.keySet()) {
+                        StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
+                                teacherId,nowDate.get(DateUtil.weekFields.weekOfYear()),
+                                DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
+                                "EXERCISE", null);
+                        results.add(studentExtracurricularExercisesSituation);
+                    }
                 }else{
                     Map<Integer, List<StudentServeCourseDto>> teacherCourseMap = weekCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getActualTeacherId));
                     for (Map.Entry<Integer, List<StudentServeCourseDto>> teacherCourseMapEntry : teacherCourseMap.entrySet()) {
@@ -386,11 +393,14 @@ public class StudentServeServiceImpl implements StudentServeService {
                 List<StudentServeCourseDto> futureCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.PRACTICE);
                 List<StudentServeCourseDto> weekCourseInfo = typeCourseMap.get(CourseSchedule.CourseScheduleType.PRACTICE).stream().filter(c -> c.getCourseStartTime().compareTo(nextMonday) < 0).collect(Collectors.toList());
                 if(CollectionUtils.isEmpty(weekCourseInfo)){
-                    StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
-                            futureCourseInfo.get(0).getActualTeacherId(),nowDate.get(DateUtil.weekFields.weekOfYear()),
-                            DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
-                            "EXERCISE", null);
-                    results.add(studentExtracurricularExercisesSituation);
+                    Set<Integer> teacherIds = weekCourseInfo.stream().map(StudentServeCourseDto::getActualTeacherId).collect(Collectors.toSet());
+                    for (Integer teacherId : teacherIds) {
+                        StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(studentCourseMapEntry.getKey(),
+                                teacherId,nowDate.get(DateUtil.weekFields.weekOfYear()),
+                                DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
+                                "EXERCISE", null);
+                        results.add(studentExtracurricularExercisesSituation);
+                    }
                 }else{
                     Map<Integer, List<StudentServeCourseDto>> teacherCourseMap = weekCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getActualTeacherId));
                     Map<Integer, Set<Long>> teacherServiceCourseIdMap = new HashMap<>();
@@ -413,7 +423,7 @@ public class StudentServeServiceImpl implements StudentServeService {
             }
         }
 
-        if(CollectionUtils.isEmpty(studentIds)){
+        if(!CollectionUtils.isEmpty(results)){
             studentExtracurricularExercisesSituationDao.deleteByMonday(monDayDate.toString());
             BigDecimal currentPage1=BigDecimal.ONE,
                     pageSize1=new BigDecimal(10000),
@@ -422,55 +432,56 @@ public class StudentServeServiceImpl implements StudentServeService {
 
             while (currentPage1.compareTo(totalPage1)<=0){
                 List<StudentExtracurricularExercisesSituation> rows=results.stream().skip(pageSize1.multiply(currentPage1.subtract(BigDecimal.ONE)).longValue()).limit(pageSize1.longValue()).collect(Collectors.toList());
-                studentExtracurricularExercisesSituationDao.batchInsert(rows);
-                currentPage1=currentPage1.add(BigDecimal.ONE);
-            }
-            return;
-        }
-
-        List<StudentExtracurricularExercisesSituation> weekServiceWithStudents = studentExtracurricularExercisesSituationDao.findWeekServiceWithStudents(monDayDate.toString(), null, studentIds);
-        Map<String, StudentExtracurricularExercisesSituation> codeServeMap = weekServiceWithStudents.stream().collect(Collectors.toMap(StudentExtracurricularExercisesSituation::getStuAndTeaCode, s -> s, (s1, s2) -> s1));
+                List<Integer> updateStudentIds = rows.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
 
-        Set<String> newCodes = results.stream().map(StudentExtracurricularExercisesSituation::getStuAndTeaCode).collect(Collectors.toSet());
-        for (StudentExtracurricularExercisesSituation weekServiceWithStudent : weekServiceWithStudents) {
-            if(weekServiceWithStudent.getActualExercisesNum()>0||newCodes.contains(weekServiceWithStudent.getStuAndTeaCode())){
-                continue;
-            }
-            studentExtracurricularExercisesSituationDao.delete(weekServiceWithStudent.getId());
-        }
+                List<StudentExtracurricularExercisesSituation> weekServiceWithStudents = studentExtracurricularExercisesSituationDao.findWeekServiceWithStudents(monDayDate.toString(), null, updateStudentIds);
+                Map<String, StudentExtracurricularExercisesSituation> codeServeMap = weekServiceWithStudents.stream().collect(Collectors.toMap(StudentExtracurricularExercisesSituation::getStuAndTeaCode, s -> s, (s1, s2) -> s1));
 
-        List<StudentExtracurricularExercisesSituation> newService = new ArrayList<>();
-        List<StudentExtracurricularExercisesSituation> updateService = new ArrayList<>();
-        for (StudentExtracurricularExercisesSituation result : results) {
-            if(codeServeMap.containsKey(result.getStuAndTeaCode())){
-                StudentExtracurricularExercisesSituation s = codeServeMap.get(result.getStuAndTeaCode());
-                Set<Long> courseIds = new HashSet<>();
-                if(StringUtils.isNotBlank(s.getCourseIds())&&s.getActualExercisesNum()>0){
-                    courseIds = Arrays.stream(s.getCourseIds().split(",")).map(id->Long.valueOf(id)).collect(Collectors.toSet());
-                }
-                if(StringUtils.isNotBlank(result.getCourseIds())){
-                    courseIds.addAll(Arrays.stream(result.getCourseIds().split(",")).map(id->Long.valueOf(id)).collect(Collectors.toSet()));
-                }
-                s.setServeType(result.getServeType());
-                if(s.getServeType().equals("HOMEWORK")){
-                    s.setCourseIds(StringUtils.join(courseIds, ","));
-                }else{
-                    s.setCourseIds("");
+                Set<String> newCodes = rows.stream().map(StudentExtracurricularExercisesSituation::getStuAndTeaCode).collect(Collectors.toSet());
+                for (StudentExtracurricularExercisesSituation weekServiceWithStudent : weekServiceWithStudents) {
+                    if(weekServiceWithStudent.getActualExercisesNum()>0||newCodes.contains(weekServiceWithStudent.getStuAndTeaCode())){
+                        continue;
+                    }
+                    studentExtracurricularExercisesSituationDao.delete(weekServiceWithStudent.getId());
                 }
-                if(StringUtils.isBlank(s.getCourseIds())){
-                    s.setExpectExercisesNum(1);
-                }else{
-                    s.setExpectExercisesNum(courseIds.size());
+
+                List<StudentExtracurricularExercisesSituation> newService = new ArrayList<>();
+                List<StudentExtracurricularExercisesSituation> updateService = new ArrayList<>();
+                for (StudentExtracurricularExercisesSituation result : rows) {
+                    if(codeServeMap.containsKey(result.getStuAndTeaCode())){
+                        StudentExtracurricularExercisesSituation s = codeServeMap.get(result.getStuAndTeaCode());
+                        Set<Long> courseIds = new HashSet<>();
+                        if(StringUtils.isNotBlank(s.getCourseIds())&&s.getActualExercisesNum()>0){
+                            courseIds = Arrays.stream(s.getCourseIds().split(",")).map(id->Long.valueOf(id)).collect(Collectors.toSet());
+                        }
+                        if(StringUtils.isNotBlank(result.getCourseIds())){
+                            courseIds.addAll(Arrays.stream(result.getCourseIds().split(",")).map(id->Long.valueOf(id)).collect(Collectors.toSet()));
+                        }
+                        s.setServeType(result.getServeType());
+                        if(s.getServeType().equals("HOMEWORK")){
+                            s.setCourseIds(StringUtils.join(courseIds, ","));
+                        }else{
+                            s.setCourseIds("");
+                        }
+                        if(StringUtils.isBlank(s.getCourseIds())){
+                            s.setExpectExercisesNum(1);
+                        }else{
+                            s.setExpectExercisesNum(courseIds.size());
+                        }
+                        updateService.add(s);
+                    }else{
+                        newService.add(result);
+                    }
                 }
-                updateService.add(s);
-            }else{
-                newService.add(result);
+                if(!CollectionUtils.isEmpty(updateService))
+                    studentExtracurricularExercisesSituationDao.batchUpdate(updateService);
+                if(!CollectionUtils.isEmpty(newService))
+                    studentExtracurricularExercisesSituationDao.batchInsert(newService);
+
+                currentPage1=currentPage1.add(BigDecimal.ONE);
             }
+            return;
         }
-        if(!CollectionUtils.isEmpty(updateService))
-            studentExtracurricularExercisesSituationDao.batchUpdate(updateService);
-        if(!CollectionUtils.isEmpty(newService))
-            studentExtracurricularExercisesSituationDao.batchInsert(newService);
     }
 
     @Override
@@ -655,4 +666,20 @@ public class StudentServeServiceImpl implements StudentServeService {
         }
         return courseIds;
     }
+
+    @Override
+    public Set<Integer> getStudentWithCourse(Long courseId) {
+        CourseSchedule courseSchedule = courseScheduleDao.get(courseId);
+        if(Objects.isNull(courseSchedule)){
+            return new HashSet<>();
+        }
+        LocalDate nowDate = LocalDateTime.ofInstant(courseSchedule.getClassDate().toInstant(), DateUtil.zoneId).toLocalDate();
+
+        LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
+        List<StudentExtracurricularExercisesSituation> serviceWithCourse = studentExtracurricularExercisesSituationDao.findServiceWithCourse(monDayDate.toString(), courseId);
+        if(CollectionUtils.isEmpty(serviceWithCourse)){
+            return new HashSet<>();
+        }
+        return serviceWithCourse.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toSet());
+    }
 }

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -285,6 +285,14 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 					if(CollectionUtils.isEmpty(studentCourseHomeworks)){
 						throw new BizException("此课程没有学生");
 					}
+					Set<Integer> serveStudentIds = studentServeService.getStudentWithCourse(teacherAttendance.getCourseScheduleId());
+					Iterator<StudentCourseHomework> iterator = studentCourseHomeworks.iterator();
+					while (iterator.hasNext()){
+						StudentCourseHomework next = iterator.next();
+						if(!serveStudentIds.contains(next.getUserId())){
+							iterator.remove();
+						}
+					}
 					studentCourseHomeworkDao.batchInsertStudentCourseHomeworkRecord(studentCourseHomeworks);
 					List<Integer> studentIds = studentCourseHomeworks.stream().map(StudentCourseHomework::getUserId).collect(Collectors.toList());
 					studentServeService.updateExercisesSituation(courseSchedule.getClassDate(), studentIds, teacherAttendance.getTeacherId());

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

@@ -1840,8 +1840,6 @@
             cs.class_date_ BETWEEN #{startDate} AND #{endDate}
           AND ( cs.del_flag_ IS NULL OR cs.del_flag_ = 0 )
           AND csts.settlement_time_ IS NOT NULL
-        GROUP BY
-            csts.group_type_
     </select>
 
     <select id="findByClassGroup" resultMap="CourseSchedule">

+ 6 - 4
mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml

@@ -31,7 +31,7 @@
 		<result column="reduce_salary" property="reduceSalary" />
 		<result column="confirm_status_" property="confirmStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 		<result column="memo_" property="memo" />
-		<result column="is_belong_to_daya_" property="belongToDaya" />
+		<result column="belong_to_daya_" property="belongToDaya" />
 	</resultMap>
 	
 	<resultMap type="com.ym.mec.biz.dal.dto.TeacherVipSalaryDto" id="teacherVipSalaryDto" extends="CourseScheduleTeacherSalary">
@@ -122,7 +122,7 @@
 				deduction_reason_ = #{deductionReason},
 			</if>
 			<if test="belongToDaya != null">
-				is_belong_to_daya_ = #{belongToDaya},
+				belong_to_daya_ = #{belongToDaya},
 			</if>
 		</set> WHERE id_ = #{id} 
 	</update>
@@ -147,7 +147,7 @@
                     user_id_ = #{courseScheduleTeacherSalary.userId},
                 </if>
 				<if test="courseScheduleTeacherSalary.belongToDaya!=null">
-					is_belong_to_daya_ = #{courseScheduleTeacherSalary.belongToDaya},
+					belong_to_daya_ = #{courseScheduleTeacherSalary.belongToDaya},
 				</if>
                 update_time_ = NOW()
             </set>
@@ -803,6 +803,7 @@
 		<result property="confirmStatus" column="confirm_status_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 		<result property="memo" column="memo_" />
 		<result property="deductionReason" column="deduction_reason_" />
+		<result property="belongDaya" column="belong_to_daya_" />
 	</resultMap>
 
 	<sql id="queryCourseSalaryCondition">
@@ -873,7 +874,8 @@
 			csts.reduce_salary,
 			csts.confirm_status_,
 			csts.memo_,
-			csts.deduction_reason_
+			csts.deduction_reason_,
+		    csts.belong_to_daya_
 		FROM
 			course_schedule_teacher_salary csts
 			LEFT JOIN course_schedule cs ON csts.course_schedule_id_=cs.id_

+ 5 - 0
mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml

@@ -456,4 +456,9 @@
     <select id="findTeacherNoStartServices" resultMap="StudentExtracurricularExercisesSituation">
 		SELECT * FROM student_extracurricular_exercises_situation_ WHERE teacher_id_=#{teacherId} AND actual_exercises_num_&lt;=0 AND serve_type_='HOMEWORK';
 	</select>
+
+	<select id="findServiceWithCourse"
+			resultType="com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation">
+		SELECT * FROM student_extracurricular_exercises_situation_ WHERE monday_=#{monday} AND FIND_IN_SET(#{courseId}, course_ids_)
+	</select>
 </mapper>

+ 8 - 8
mec-biz/src/main/resources/config/mybatis/StudentPaymentRouteOrderMapper.xml

@@ -157,8 +157,8 @@
     </insert>
 
     <select id="queryPageOrder" parameterType="map" resultMap="StudentPaymentRouteOrderDto">
-        SELECT spo.*,spro.*,u.username_,u.phone_ FROM student_payment_route_order spro
-        LEFT JOIN student_payment_order spo ON spo.order_no_ = spro.order_no_
+        SELECT spo.*,spro.*,u.username_,u.phone_ FROM student_payment_order spo
+        LEFT JOIN student_payment_route_order spro ON spo.order_no_ = spro.order_no_
         left join sys_user u on spo.user_id_ = u.id_
         <include refid="queryPaymentOrder"/>
         ORDER BY spo.id_ DESC
@@ -166,22 +166,22 @@
     </select>
     <select id="getOrderMoneyAmount" parameterType="map" resultMap="StudentPaymentRouteOrderDto">
         SELECT SUM(spro.route_amount_) actual_amount_,SUM(spro.route_balance_amount_)
-        balance_payment_amount_ FROM student_payment_route_order spro
-        LEFT JOIN student_payment_order spo on spo.order_no_ = spro.order_no_
+        balance_payment_amount_ FROM student_payment_order spo
+        LEFT JOIN student_payment_route_order spro on spo.order_no_ = spro.order_no_
         <include refid="queryPaymentOrder"/>
     </select>
 
     <select id="getChargeAmount" parameterType="map" resultType="java.math.BigDecimal">
-        SELECT SUM(spro.route_amount_) FROM student_payment_route_order spro
-        LEFT JOIN student_payment_order spo ON spo.order_no_=spro.order_no_
+        SELECT SUM(spro.route_amount_) FROM student_payment_order spo
+        LEFT JOIN student_payment_route_order spro ON spo.order_no_=spro.order_no_
         LEFT JOIN sporadic_charge_info sci ON spo.music_group_id_ = sci.id_
         <include refid="queryPaymentOrder"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int" parameterType="map">
-        SELECT COUNT(spo.id_) FROM student_payment_route_order spro
-        LEFT JOIN student_payment_order spo ON spo.order_no_ = spro.order_no_
+        SELECT COUNT(spo.id_) FROM student_payment_order spo
+        LEFT JOIN student_payment_route_order spro ON spo.order_no_ = spro.order_no_
         LEFT JOIN sys_user u on spo.user_id_ = u.id_
         <include refid="queryPaymentOrder"/>
     </select>

+ 4 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -40,6 +40,7 @@ import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 @RequestMapping("studentOrder")
 @Api(tags = "订单回调")
@@ -130,7 +131,10 @@ public class StudentOrderController extends BaseController {
             MusicGroup musicGroup = musicGroupService.get(orderByOrderNo.getMusicGroupId());
             List<Goods> goodsList = studentPaymentOrderDetailService.findApplyOrderGoods(orderByOrderNo.getId());
             List<String> orderDetailType = studentPaymentOrderDetailService.getOrderDetailType(orderByOrderNo.getId());
+            List<StudentPaymentOrderDetail> orderDetail1 = studentPaymentOrderDetailService.getOrderDetail(orderByOrderNo.getId());
+            String kitGroupPurchaseType = orderDetail1.stream().filter(e -> e.getGoodsList() != null).filter(e -> e.getKitGroupPurchaseType() != null).map(e -> e.getKitGroupPurchaseType().getCode()).collect(Collectors.joining(","));
             orderDetail.put("goods", goodsList);
+            orderDetail.put("kitGroupPurchaseType",kitGroupPurchaseType);
             orderDetail.put("course", musicGroup.getCourseForm());
             orderDetail.put("ownershipType", musicGroup.getOwnershipType());
             orderDetail.put("detailType", orderDetailType);

+ 6 - 0
mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

@@ -3,6 +3,7 @@ package com.ym.mec.web.controller;
 import com.ym.mec.biz.event.source.CourseEventSource;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.redis.service.RedisCache;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -85,6 +86,8 @@ public class TaskController extends BaseController {
 
 	@Autowired
 	private CourseEventSource courseEventSource;
+	@Autowired
+	private RedisCache<String, Object> redisCache;
 
 	@GetMapping(value = "/autoAffirmReceiveTask")
 	// 自动确认收货
@@ -126,6 +129,7 @@ public class TaskController extends BaseController {
 	// vip课课酬结算
 	public void vipGroupTeacherSalarySettlement() {
 		courseScheduleTeacherSalaryService.teacherSalarySettlement();
+		redisCache.getRedisTemplate().opsForSet().add(CourseScheduleTeacherSalaryService.TASK_KEY, "VIP");
 		courseScheduleTeacherSalaryService.salaryMark();
 	}
 
@@ -133,6 +137,7 @@ public class TaskController extends BaseController {
 	// 陪练课课酬结算
 	public void practiceTeacherSalarySettlement() {
 		courseScheduleTeacherSalaryService.practiceTeacherSalarySettlement();
+		redisCache.getRedisTemplate().opsForSet().add(CourseScheduleTeacherSalaryService.TASK_KEY, "PRACTICE");
 		courseScheduleTeacherSalaryService.salaryMark();
 	}
 
@@ -140,6 +145,7 @@ public class TaskController extends BaseController {
 	@GetMapping("/musicGroupTeacherSalarySettlement")
 	public void musicGroupTeacherSalarySettlement() {
 		courseScheduleTeacherSalaryService.musicGroupTeacherSalarySettlement();
+		redisCache.getRedisTemplate().opsForSet().add(CourseScheduleTeacherSalaryService.TASK_KEY, "MUSIC");
 		courseScheduleTeacherSalaryService.salaryMark();
 	}