|
@@ -416,6 +416,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
|
|
|
String c1 = sysTenantConfigService.getTenantConfigValue(SysConfigService.OFFLINE_SIGN_IN_GPS_ERROR_CUT_SALARY_UNIT, tenantId);
|
|
|
BigDecimal signInGpsCutAmount = getCutAmount(c, c1, expectSalary);
|
|
|
if(signInGpsCutAmount.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ deductCost = deductCost.add(signInGpsCutAmount);
|
|
|
deductReasons.add("签到经纬度异常扣除" + signInGpsCutAmount);
|
|
|
}
|
|
|
}
|
|
@@ -424,6 +425,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
|
|
|
String c1 = sysTenantConfigService.getTenantConfigValue(SysConfigService.OFFLINE_SIGN_OUT_GPS_ERROR_CUT_SALARY_UNIT, tenantId);
|
|
|
BigDecimal signOutGpsCutAmount = getCutAmount(c, c1, expectSalary);
|
|
|
if(signOutGpsCutAmount.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ deductCost = deductCost.add(signOutGpsCutAmount);
|
|
|
deductReasons.add("签退经纬度异常扣除" + signOutGpsCutAmount);
|
|
|
}
|
|
|
}
|
|
@@ -705,6 +707,23 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
|
|
|
List<TeacherAttendance> allTeacherAttendances = teacherAttendanceDao.findByCourseSchedules(courseScheduleIds);
|
|
|
Map<String, List<TeacherAttendance>> teacherCourseAttendanceMap = allTeacherAttendances.stream().collect(Collectors.groupingBy(ta -> org.apache.commons.lang3.StringUtils.joinWith(":", ta.getCourseScheduleId(), ta.getTeacherId())));
|
|
|
|
|
|
+ //需要根据实际上课学员结算课酬的课程编号
|
|
|
+ List<Long> needStudentAttendanceCourseScheduleIds = yesterdayCourseSchedules.stream()
|
|
|
+ .filter(c -> CourseSchedule.CourseScheduleType.HIGH_ONLINE.equals(c.getType())
|
|
|
+ || CourseSchedule.CourseScheduleType.MUSIC_NETWORK.equals(c.getType())
|
|
|
+ || CourseSchedule.CourseScheduleType.HIGH.equals(c.getType()))
|
|
|
+ .map(CourseSchedule::getId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<CourseScheduleStudentPayment> studentAttendances = null;
|
|
|
+ if(!CollectionUtils.isEmpty(needStudentAttendanceCourseScheduleIds)){
|
|
|
+ studentAttendances = courseScheduleStudentPaymentDao.findByCourseScheduleIds(needStudentAttendanceCourseScheduleIds);
|
|
|
+ }
|
|
|
+ Map<Long, Long> courseNormalStudentsMap = new HashMap<>();
|
|
|
+ if(!CollectionUtils.isEmpty(studentAttendances)){
|
|
|
+ courseNormalStudentsMap =studentAttendances.stream()
|
|
|
+ .collect(Collectors.groupingBy(CourseScheduleStudentPayment::getCourseScheduleId, Collectors.counting()));
|
|
|
+ }
|
|
|
+
|
|
|
Set<Integer> teacherIds = courseScheduleTeacherSalaries.stream().map(CourseScheduleTeacherSalary::getUserId).collect(Collectors.toSet());
|
|
|
List<Teacher> teachers = teacherDao.findByTeacherIds(new ArrayList<>(teacherIds));
|
|
|
Map<Integer, Teacher> idTeacherMap = teachers.stream().collect(Collectors.toMap(Teacher::getId, t -> t, (t1, t2) -> t1));
|
|
@@ -727,8 +746,17 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
|
|
|
courseScheduleTeacherSalary.setSettlementTime(now);
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
List<String> deductReasons = new ArrayList<>();
|
|
|
+ if(CourseSchedule.CourseScheduleType.MUSIC_NETWORK.equals(courseSchedule.getType())||CourseSchedule.CourseScheduleType.HIGH_ONLINE.equals(courseSchedule.getType())) {
|
|
|
+ Long normalStudentNum = courseNormalStudentsMap.get(courseSchedule.getId());
|
|
|
+ if (Objects.isNull(normalStudentNum)) {
|
|
|
+ normalStudentNum = Long.valueOf(0);
|
|
|
+ }
|
|
|
+ if (normalStudentNum > 5) {
|
|
|
+ normalStudentNum = Long.valueOf(5);
|
|
|
+ }
|
|
|
+ deductReasons.add("课程应到人数:" + normalStudentNum);
|
|
|
+ }
|
|
|
|
|
|
if(Objects.isNull(courseScheduleTeacherSalary.getSubsidy())){
|
|
|
courseScheduleTeacherSalary.setSubsidy(BigDecimal.ZERO);
|