|
@@ -64,6 +64,8 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
|
|
private TeacherDefaultVipGroupSalaryDao teacherDefaultVipGroupSalaryDao;
|
|
private TeacherDefaultVipGroupSalaryDao teacherDefaultVipGroupSalaryDao;
|
|
@Autowired
|
|
@Autowired
|
|
private VipGroupCategoryDao vipGroupCategoryDao;
|
|
private VipGroupCategoryDao vipGroupCategoryDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ private StudentAttendanceDao studentAttendanceDao;
|
|
|
|
|
|
private static final Logger LOGGER = LoggerFactory
|
|
private static final Logger LOGGER = LoggerFactory
|
|
.getLogger(CourseScheduleTeacherSalaryServiceImpl.class);
|
|
.getLogger(CourseScheduleTeacherSalaryServiceImpl.class);
|
|
@@ -181,7 +183,6 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public void teacherSalarySettlement() {
|
|
public void teacherSalarySettlement() {
|
|
-
|
|
|
|
int days = Integer.parseInt(sysConfigDao.findByParamName(SysConfigService.VIP_APPEAL_DAYS_RANGE).getParanValue());
|
|
int days = Integer.parseInt(sysConfigDao.findByParamName(SysConfigService.VIP_APPEAL_DAYS_RANGE).getParanValue());
|
|
|
|
|
|
BigDecimal percent = new BigDecimal(10);
|
|
BigDecimal percent = new BigDecimal(10);
|
|
@@ -195,6 +196,11 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
|
|
Date now = new Date();
|
|
Date now = new Date();
|
|
//获取未结算课程编号列表
|
|
//获取未结算课程编号列表
|
|
List<Long> courseScheduleIds = someDayAgoTeacherCourseSalaryNoSettlement.stream().map(CourseScheduleTeacherSalary::getCourseScheduleId).collect(Collectors.toList());
|
|
List<Long> courseScheduleIds = someDayAgoTeacherCourseSalaryNoSettlement.stream().map(CourseScheduleTeacherSalary::getCourseScheduleId).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ //所有课程的学生考勤记录
|
|
|
|
+ List<StudentAttendance> studentAttendances = studentAttendanceDao.findByCourseIds(courseScheduleIds);
|
|
|
|
+ Map<Long, List<StudentAttendance>> courseStudentAttendancesMap = studentAttendances.stream().collect(Collectors.groupingBy(StudentAttendance::getCourseScheduleId));
|
|
|
|
+
|
|
//获取未结算课程投诉记录
|
|
//获取未结算课程投诉记录
|
|
List<CourseScheduleComplaints> courseScheduleComplaints = courseScheduleComplaintsDao.findByCourseScheduleIds(courseScheduleIds);
|
|
List<CourseScheduleComplaints> courseScheduleComplaints = courseScheduleComplaintsDao.findByCourseScheduleIds(courseScheduleIds);
|
|
//获取未结算课程学生缴费信息
|
|
//获取未结算课程学生缴费信息
|
|
@@ -215,6 +221,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
|
|
|
|
|
|
//处理课酬信息
|
|
//处理课酬信息
|
|
someDayAgoTeacherCourseSalaryNoSettlement.forEach(courseScheduleTeacherSalary -> {
|
|
someDayAgoTeacherCourseSalaryNoSettlement.forEach(courseScheduleTeacherSalary -> {
|
|
|
|
+
|
|
//获取当前课程学生缴费记录
|
|
//获取当前课程学生缴费记录
|
|
List<CourseScheduleStudentPayment> studentPaymentsWithCourse = studentPaymentGroupByCourse.get(courseScheduleTeacherSalary.getCourseScheduleId());
|
|
List<CourseScheduleStudentPayment> studentPaymentsWithCourse = studentPaymentGroupByCourse.get(courseScheduleTeacherSalary.getCourseScheduleId());
|
|
|
|
|
|
@@ -222,6 +229,17 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ List<StudentAttendance> courseStudentAttendances = courseStudentAttendancesMap.get(courseScheduleTeacherSalary.getCourseScheduleId());
|
|
|
|
+ int normalStudentNum=0;
|
|
|
|
+ for (StudentAttendance courseStudentAttendance : courseStudentAttendances) {
|
|
|
|
+ if(courseStudentAttendance.getStatus().equals(StudentAttendanceStatusEnum.NORMAL)){
|
|
|
|
+ normalStudentNum+=1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(normalStudentNum==0){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
//当前课程缴费学生数量
|
|
//当前课程缴费学生数量
|
|
BigDecimal courseStudentNum = new BigDecimal(studentPaymentsWithCourse.size());
|
|
BigDecimal courseStudentNum = new BigDecimal(studentPaymentsWithCourse.size());
|
|
|
|
|