Joburgess 5 år sedan
förälder
incheckning
a3d89324d9

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherAttendance.java

@@ -78,6 +78,11 @@ public class TeacherAttendance {
 		this.courseScheduleId = courseScheduleId;
 	}
 
+	public TeacherAttendance(Long courseScheduleId, Integer status) {
+		this.courseScheduleId = courseScheduleId;
+		this.status = status;
+	}
+
 	public Integer getCurrentClassTimes() {
 		return currentClassTimes;
 	}

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

@@ -12,7 +12,6 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -97,12 +96,12 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 courseScheduleTeacherSalary.setClassGroupId(courseSchedules.get(i).getClassGroupId());
                 courseScheduleTeacherSalary.setSubsidy(school.getSubsidy());
 
-                Map<String, BigDecimal> feeInfo = vipGroupService.countVipGroupPredictFee(vipGroup,
-                        courseSchedules.get(i).getActualTeacherId().intValue(),
-                        onlineTeacherSalary,
-                        offlineTeacherSalary,
-                        false,
-                        false);
+//                Map<String, BigDecimal> feeInfo = vipGroupService.countVipGroupPredictFee(vipGroup,
+//                        courseSchedules.get(i).getActualTeacherId().intValue(),
+//                        onlineTeacherSalary,
+//                        offlineTeacherSalary,
+//                        false,
+//                        true);
 
                 if (vipGroupActivity.getType() == VipGroupActivityTypeEnum.GIVE_CLASS
                         && vipGroup.getGiveTeachMode() == teachModeEnum
@@ -111,9 +110,11 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                     courseScheduleTeacherSalary.setExpectSalary(new BigDecimal(0));
                 } else {
                     if (teachModeEnum == TeachModeEnum.ONLINE) {
-                        courseScheduleTeacherSalary.setExpectSalary(feeInfo.get("onlineTeacherSalary"));
+                        courseScheduleTeacherSalary.setExpectSalary(onlineTeacherSalary);
+//                        courseScheduleTeacherSalary.setExpectSalary(feeInfo.get("onlineTeacherSalary"));
                     } else {
-                        courseScheduleTeacherSalary.setExpectSalary(feeInfo.get("offlineTeacherSalary"));
+                        courseScheduleTeacherSalary.setExpectSalary(offlineTeacherSalary);
+//                        courseScheduleTeacherSalary.setExpectSalary(feeInfo.get("offlineTeacherSalary"));
                     }
                 }
                 if(Objects.isNull(courseScheduleTeacherSalary.getId())){

+ 8 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java

@@ -4,16 +4,14 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.entity.ClassGroup;
-import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
-import com.ym.mec.biz.dal.entity.StudentAttendance;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.page.CourseHomeworkQueryInfo;
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.biz.service.SysConfigService;
 import com.ym.mec.biz.service.SysMessageService;
+import com.ym.mec.biz.service.TeacherAttendanceService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
@@ -58,6 +56,8 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 	private SysMessageService sysMessageService;
 	@Autowired
 	private SysConfigDao sysConfigDao;
+	@Autowired
+	private TeacherAttendanceService teacherAttendanceService;
 
 	@Override
 	public BaseDAO<Long, StudentAttendance> getDAO() {
@@ -131,6 +131,10 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 		courseSchedule.setStudentNum(studentNum);
 		courseSchedule.setLeaveStudentNum(leaveStudentNum);
 		courseScheduleDao.update(courseSchedule);
+
+		TeacherSignOutDto teacherSignOutDto=new TeacherSignOutDto();
+		teacherSignOutDto.setTeacherAttendanceInfo(new TeacherAttendance(courseSchedule.getId(),0));
+		teacherAttendanceService.addTeacherAttendanceRecord(teacherSignOutDto);
 	}
 
 	@Override

+ 5 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCourseHomeworkServiceImpl.java

@@ -76,7 +76,11 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
 
 	@Override
 	public CourseHomeworkStudentDetailDto findCourseHomeworkStudentDetail(Long courseScheduleID, Long userId) {
-		return studentCourseHomeworkDao.findCourseHomeworkStudentDetail(courseScheduleID, userId);
+		CourseHomework courseHomework = courseHomeworkDao.get(courseScheduleID);
+		if(Objects.isNull(courseHomework)){
+			throw new BizException("作业不存在");
+		}
+		return studentCourseHomeworkDao.findCourseHomeworkStudentDetail(courseHomework.getCourseScheduleId(), userId);
 	}
 
 	@Override

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

@@ -898,6 +898,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			throw new BizException("用户信息获取失败");
 		}
 
+		ClassGroup classGroup= classGroupDao.lockByMusicGroupAndType(vipGroupBuyParams.getVipGroupId().toString(),ClassGroupTypeEnum.VIP.getCode());
+		if(Objects.isNull(classGroup)){
+			throw new BizException("课程信息错误");
+		}
+
 		VipGroup vipGroup = vipGroupDao.get(vipGroupBuyParams.getVipGroupId());
 
 		if(vipGroup.getStatus()!=VipGroupStatusEnum.APPLYING){
@@ -912,11 +917,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			throw new BizException("您已购买过此课程");
 		}
 
-		ClassGroup classGroup= classGroupDao.lockByMusicGroupAndType(vipGroup.getId().toString(),ClassGroupTypeEnum.VIP.getCode());
-		if(Objects.isNull(classGroup)){
-			throw new BizException("课程信息错误");
-		}
-
 		StudentPaymentOrder byStudentVipGroup = studentPaymentOrderDao.findByStudentVipGroup(vipGroupBuyParams.getVipGroupId(),
 				user.getId(),
 				DealStatusEnum.ING.getCode());