Joburgess 5 years ago
parent
commit
daa0c4a829

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

@@ -107,12 +107,12 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 
 			if(yesOrNoEnum==YesOrNoEnum.YES){
 				teacherAttendance.setSignInStatus(YesOrNoEnum.YES);
-				result.put("signInStatus",YesOrNoEnum.YES.getCode());
+				result.put("signInStatus",0);
 			}else{
 				Long timeGap=(date.getTime()-currentCourseDetail.getStartClassTime().getTime())/1000/60;
 				if(timeGap<= advanceSignInMinutes){
 					teacherAttendance.setSignInStatus(YesOrNoEnum.YES);
-					result.put("signInStatus",YesOrNoEnum.YES.getCode());
+					result.put("signInStatus",0);
 				}else{
 					if(StringUtils.isEmpty(teacherAttendance.getRemark())){
 						//当前为异常签到,请填写原因!
@@ -120,7 +120,7 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 						return result;
 					}
 					teacherAttendance.setSignInStatus(YesOrNoEnum.NO);
-					result.put("signInStatus",YesOrNoEnum.NO.getCode());
+					result.put("signInStatus",1);
 				}
 			}
 			teacherAttendance.setSignInTime(date);

+ 20 - 15
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -186,7 +186,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				true,
 				true);
 
-//		if()
+		BigDecimal tempFee = costInfo.get("totalPrice").multiply(new BigDecimal(0.6));
+		if(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary().compareTo(tempFee)>0){
+			throw new BizException("课酬异常");
+		}
 
 		//如果默认课酬与实际课酬不匹配则需要审批
 		if(costInfo.get("offlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary())!=0||
@@ -640,7 +643,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 		BigDecimal teacherSalaryTimeUnit=new BigDecimal(sysConfigDao.findConfigValue(SysConfigService.TEACHER_SALARY_TIME_UNIT));
 		//课程时长与结算单位时长占比
-		BigDecimal classTimeDuty=new BigDecimal(vipGroupCategory.getSingleClassMinutes()).divide(teacherSalaryTimeUnit);
+		BigDecimal classTimeDuty=new BigDecimal(vipGroup.getSingleClassMinutes()).divide(teacherSalaryTimeUnit);
 		BigDecimal offlineClassNum=new BigDecimal(vipGroup.getOfflineClassesNum());
 		BigDecimal onlineClassNum=new BigDecimal(vipGroup.getOnlineClassesNum());
 		BigDecimal onlineVipGroupCharge = onlineClassesUnitPrice.multiply(onlineClassNum);
@@ -1142,19 +1145,21 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());
 			dataList = courseScheduleTeacherSalaryDao.findVipGroupSalarys(params);
-			dataList.forEach(vipGroupSalaryDto -> {
-				if(Objects.isNull(vipGroupSalaryDto.getExpectSalary())){
-					vipGroupSalaryDto.setExpectSalary(new BigDecimal(0));
-				}
-				if(Objects.isNull(vipGroupSalaryDto.getActualSalary())){
-					vipGroupSalaryDto.setActualSalary(new BigDecimal(0));
-					vipGroupSalaryDto.setDeductionFee(new BigDecimal(0));
-					vipGroupSalaryDto.setIsSalary(YesOrNoEnum.NO);
-				}else{
-					vipGroupSalaryDto.setDeductionFee(vipGroupSalaryDto.getExpectSalary().subtract(vipGroupSalaryDto.getActualSalary()));
-					vipGroupSalaryDto.setIsSalary(YesOrNoEnum.YES);
-				}
-			});
+			if(!CollectionUtils.isEmpty(dataList)){
+				dataList.forEach(vipGroupSalaryDto -> {
+					if(Objects.isNull(vipGroupSalaryDto.getExpectSalary())){
+						vipGroupSalaryDto.setExpectSalary(new BigDecimal(0));
+					}
+					if(Objects.isNull(vipGroupSalaryDto.getActualSalary())){
+						vipGroupSalaryDto.setActualSalary(new BigDecimal(0));
+						vipGroupSalaryDto.setDeductionFee(new BigDecimal(0));
+						vipGroupSalaryDto.setIsSalary(YesOrNoEnum.NO);
+					}else{
+						vipGroupSalaryDto.setDeductionFee(vipGroupSalaryDto.getExpectSalary().subtract(vipGroupSalaryDto.getActualSalary()));
+						vipGroupSalaryDto.setIsSalary(YesOrNoEnum.YES);
+					}
+				});
+			}
 		}
 		if (count == 0) {
 			dataList = new ArrayList<>();

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

@@ -222,27 +222,27 @@
     <select id="getCurrentCourseDetail"
             resultMap="TeacherAttendanceViewUtilEntity">
         SELECT
-        cs.id_ ,
-        cs.name_ course_schedule_name_,
-        cs.class_date_,
-        CONCAT(cs.class_date_,' ',cs.start_class_time_) start_class_time_,
-        CONCAT(cs.class_date_,' ',cs.end_class_time_) end_class_time_,
-        cs.status_ course_status_,
-        cg.id_ class_id,
-        cg.name_ class_name,
-        cg.total_class_times_,
-        cg.current_class_times_,
-        cg.student_num_,
-        cs.type_ class_type,
-        mg.id_ music_group_id,
-        mg.name_ music_group_name,
-        s.id_ school_id_,
-        s.address_,
-        s.longitude_latitude_,
-        su.username_ teacher_name_,
-        ta.sign_in_time_
+            cs.id_ ,
+            cs.name_ course_schedule_name_,
+            cs.class_date_,
+            CONCAT(cs.class_date_,' ',cs.start_class_time_) start_class_time_,
+            CONCAT(cs.class_date_,' ',cs.end_class_time_) end_class_time_,
+            cs.status_ course_status_,
+            cg.id_ class_id,
+            cg.name_ class_name,
+            cg.total_class_times_,
+            cg.current_class_times_,
+            cg.student_num_,
+            cs.type_ class_type,
+            mg.id_ music_group_id,
+            mg.name_ music_group_name,
+            s.id_ school_id_,
+            s.address_,
+            s.longitude_latitude_,
+            su.username_ teacher_name_,
+            ta.sign_in_time_
         FROM
-        course_schedule cs
+          course_schedule cs
         LEFT JOIN class_group cg ON cs.class_group_id_=cg.id_
         LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
         LEFT JOIN school s ON cs.schoole_id_=s.id_