|
@@ -15,6 +15,9 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
|
|
|
import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
|
|
|
import com.ym.mec.biz.dal.dao.MusicGroupDao;
|
|
|
import com.ym.mec.biz.dal.dao.TeacherDefaultMusicGroupSalaryDao;
|
|
@@ -39,6 +42,9 @@ public class TeacherDefaultMusicGroupSalaryServiceImpl extends BaseServiceImpl<L
|
|
|
|
|
|
@Autowired
|
|
|
private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ClassGroupStudentMapperDao classGroupStudentMapperDao;
|
|
|
|
|
|
@Autowired
|
|
|
private MusicGroupDao musicGroupDao;
|
|
@@ -84,6 +90,8 @@ public class TeacherDefaultMusicGroupSalaryServiceImpl extends BaseServiceImpl<L
|
|
|
}*/
|
|
|
salaryMap.put(ms.getCourseScheduleType(), ms);
|
|
|
}
|
|
|
+
|
|
|
+ Map<Integer,Integer> classGroupStudentNumMap = new HashMap<Integer, Integer>();
|
|
|
|
|
|
if (salaryMap.size() > 0) {
|
|
|
|
|
@@ -115,33 +123,52 @@ public class TeacherDefaultMusicGroupSalaryServiceImpl extends BaseServiceImpl<L
|
|
|
BigDecimal duration = new BigDecimal(DateUtil.minutesBetween(ts.getCourseSchedule().getStartClassTime(), ts.getCourseSchedule()
|
|
|
.getEndClassTime()));
|
|
|
int mins = 0;
|
|
|
- if (musicGroup.getSettlementType() == SalarySettlementTypeEnum.GRADIENT_SALARY) {// 3.0课酬
|
|
|
- mins = 90;
|
|
|
- if (tdms.getCourseScheduleType() == CourseScheduleType.CLASSROOM) {
|
|
|
- mins = 40;
|
|
|
- } else if (tdms.getCourseScheduleType() == CourseScheduleType.HIGH) {
|
|
|
- mins = 45;
|
|
|
+ if(tdms.getCourseScheduleType() == CourseScheduleType.HIGH_ONLINE) {
|
|
|
+ if (!classGroupStudentNumMap.containsKey(ts.getClassGroupId())) {
|
|
|
+ // 查询 班级人数
|
|
|
+ String[] strs = classGroupStudentMapperDao.findStudentNumByClassGroupId(ts.getClassGroupId());
|
|
|
+ classGroupStudentNumMap.put(ts.getClassGroupId(), strs.length);
|
|
|
+ }
|
|
|
+ String salaryRuleJson = tdms.getSalaryRuleJson();
|
|
|
+ if (StringUtils.isNotBlank(salaryRuleJson)) {
|
|
|
+ JSONObject obj = JSON.parseObject(salaryRuleJson);
|
|
|
+ ts.setExpectSalary(new BigDecimal(obj.getDouble(classGroupStudentNumMap.get(ts.getClassGroupId()) + "")));
|
|
|
+ list.add(ts);
|
|
|
}
|
|
|
+
|
|
|
+ } else if (musicGroup.getSettlementType() == SalarySettlementTypeEnum.GRADIENT_SALARY) {// 3.0课酬
|
|
|
+ mins = 90;
|
|
|
// 判断是助教、主教
|
|
|
if (ts.getTeacherRole() == TeachTypeEnum.BISHOP) {
|
|
|
- ts.setExpectSalary(duration.divide(new BigDecimal(mins), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(tdms.getMainTeacher90MinSalary()));
|
|
|
+ if (tdms.getCourseScheduleType() == CourseScheduleType.CLASSROOM || tdms.getCourseScheduleType() == CourseScheduleType.HIGH) {
|
|
|
+ ts.setExpectSalary(tdms.getMainTeacher90MinSalary());
|
|
|
+ }else{
|
|
|
+ ts.setExpectSalary(duration.divide(new BigDecimal(mins), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(tdms.getMainTeacher90MinSalary()));
|
|
|
+ }
|
|
|
} else {
|
|
|
- ts.setExpectSalary(duration.divide(new BigDecimal(mins), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(tdms.getAssistantTeacher90MinSalary()));
|
|
|
+ if (tdms.getCourseScheduleType() == CourseScheduleType.CLASSROOM || tdms.getCourseScheduleType() == CourseScheduleType.HIGH) {
|
|
|
+ ts.setExpectSalary(tdms.getAssistantTeacher90MinSalary());
|
|
|
+ }else{
|
|
|
+ ts.setExpectSalary(duration.divide(new BigDecimal(mins), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(tdms.getAssistantTeacher90MinSalary()));
|
|
|
+ }
|
|
|
}
|
|
|
list.add(ts);
|
|
|
} else if (musicGroup.getSettlementType() == SalarySettlementTypeEnum.TEACHER_DEFAULT) {// 默认课酬
|
|
|
mins = 30;
|
|
|
- if (tdms.getCourseScheduleType() == CourseScheduleType.CLASSROOM) {
|
|
|
- mins = 40;
|
|
|
- } else if (tdms.getCourseScheduleType() == CourseScheduleType.HIGH) {
|
|
|
- mins = 45;
|
|
|
- }
|
|
|
BigDecimal minsDecimal = new BigDecimal(mins);
|
|
|
// 判断是助教、主教
|
|
|
if (ts.getTeacherRole() == TeachTypeEnum.BISHOP) {
|
|
|
- ts.setExpectSalary(duration.divide(minsDecimal, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(tdms.getMainTeacher30MinSalary()));
|
|
|
+ if (tdms.getCourseScheduleType() == CourseScheduleType.CLASSROOM || tdms.getCourseScheduleType() == CourseScheduleType.HIGH) {
|
|
|
+ ts.setExpectSalary(tdms.getMainTeacher30MinSalary());
|
|
|
+ }else{
|
|
|
+ ts.setExpectSalary(duration.divide(minsDecimal, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(tdms.getMainTeacher30MinSalary()));
|
|
|
+ }
|
|
|
} else {
|
|
|
- ts.setExpectSalary(duration.divide(minsDecimal, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(tdms.getAssistantTeacher30MinSalary()));
|
|
|
+ if (tdms.getCourseScheduleType() == CourseScheduleType.CLASSROOM || tdms.getCourseScheduleType() == CourseScheduleType.HIGH) {
|
|
|
+ ts.setExpectSalary(tdms.getAssistantTeacher30MinSalary());
|
|
|
+ }else{
|
|
|
+ ts.setExpectSalary(duration.divide(minsDecimal, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(tdms.getAssistantTeacher30MinSalary()));
|
|
|
+ }
|
|
|
}
|
|
|
list.add(ts);
|
|
|
}
|