فهرست منبع

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

yonge 5 سال پیش
والد
کامیت
867d2d3df6

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

@@ -488,11 +488,20 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 						courseScheduleTeacherSalary.setTeacherRole(cgtm.getTeacherRole());
 						courseScheduleTeacherSalary.setUserId(cgtm.getUserId());
 						if (type == CourseScheduleType.PRACTICE) {
-							BigDecimal salary = teacherPracticeSalaryMap.get(cgtm.getUserId());
-							if (salary == null) {
-								throw new BizException("请设置老师陪练课课酬");
+							PracticeGroup practiceGroup = practiceGroupDao.get(Long.parseLong(classGroup.getMusicGroupId()));
+							if(practiceGroup == null){
+								throw new BizException("课程组不存在");
+							}else if (practiceGroup.getBuyMonths() == null){
+								SysConfig practiceCourseSalaryConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_COURSE_SALARY);
+								BigDecimal teacherSalary = new BigDecimal(practiceCourseSalaryConfig.getParanValue());
+								courseScheduleTeacherSalary.setExpectSalary(teacherSalary);
+							}else {
+								BigDecimal salary = teacherPracticeSalaryMap.get(cgtm.getUserId());
+								if (salary == null) {
+									throw new BizException("请设置老师陪练课课酬");
+								}
+								courseScheduleTeacherSalary.setExpectSalary(salary);
 							}
-							courseScheduleTeacherSalary.setExpectSalary(salary);
 						} else if (type == CourseScheduleType.VIP) {
 
 						} else {
@@ -3823,7 +3832,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = courseScheduleTeacherSalaryDao.findByCourseSchedule(courseScheduleId);
 			if(!CollectionUtils.isEmpty(courseScheduleTeacherSalaries)){
                 SysConfig practiceCourseSalaryConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_COURSE_SALARY);
-                BigDecimal teacherSalary = new BigDecimal(practiceCourseSalaryConfig.getParanValue());;
+                BigDecimal teacherSalary = new BigDecimal(practiceCourseSalaryConfig.getParanValue());
                 for (CourseScheduleTeacherSalary courseScheduleTeacherSalary : courseScheduleTeacherSalaries) {
                     courseScheduleTeacherSalary.setUserId(teacherId);
                     courseScheduleTeacherSalary.setExpectSalary(teacherSalary);

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

@@ -448,7 +448,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
 	public void addStudentAttendanceRecord(Integer courseScheduleId, Integer userId, StudentAttendanceStatusEnum statusEnum,SignStatusEnum signStatusEnum) {
 		CourseSchedule courseSchedule = courseScheduleDao.get(courseScheduleId.longValue());
 		ClassGroup classGroup = classGroupDao.findByCourseSchedule(courseScheduleId);

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -401,7 +401,7 @@
             WHERE class_group_id_=#{classGroupId}
     </select>
     <select id="findByStatusAndCourseScheduleId" resultMap="StudentAttendance">
-        SELECT * FROM student_attendance sa WHERE course_schedule_id_ = #{courseScheduleId} AND user_id_ = #{userId} LIMIT 1 FOR UPDATE
+        SELECT * FROM student_attendance sa WHERE course_schedule_id_ = #{courseScheduleId} AND user_id_ = #{userId} LIMIT 1
     </select>
 
     <select id="queryNoSignStudentRecord" resultMap="StudentAttendance">

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml

@@ -143,7 +143,7 @@
 				AND sees.teacher_id_ = #{teacherId}
 			</if>
 			<if test="search!=null">
-				AND (stu.id_=#{search} OR stu.username_ LIKE CONCAT('%', #{search}, '%') OR tea.real_name_ LIKE CONCAT('%', #{search}, '%'))
+				AND (stu.id_=#{search} OR stu.username_ LIKE CONCAT('%', #{search}, '%'))
 			</if>
 			<if test="organIdList != null">
 				AND FIND_IN_SET(stu.organ_id_,#{organIdList})
@@ -197,7 +197,7 @@
 				AND sees.teacher_id_ = #{teacherId}
 			</if>
 			<if test="search!=null">
-				AND (stu.id_=#{search} OR stu.username_ LIKE CONCAT('%', #{search}, '%') OR tea.real_name_ LIKE CONCAT('%', #{search}, '%'))
+				AND (stu.id_=#{search} OR stu.username_ LIKE CONCAT('%', #{search}, '%'))
 			</if>
 			<if test="organIdList != null">
 				AND FIND_IN_SET(stu.organ_id_, #{organIdList})

+ 8 - 5
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -13,12 +13,10 @@ import com.ym.job.ScheduleManager;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.CourseScheduleDao;
+import com.ym.mec.biz.dal.dao.StudentDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
-import com.ym.mec.biz.dal.entity.StudentAttendance;
-import com.ym.mec.biz.dal.entity.Teacher;
-import com.ym.mec.biz.dal.entity.TeacherAttendance;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.SignStatusEnum;
 import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
@@ -41,6 +39,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
@@ -98,6 +97,9 @@ public class RoomServiceImpl implements RoomService {
     @Autowired
     private SysConfigDao sysConfigDao;
 
+    @Autowired
+    private StudentDao studentDao;
+
     @Value("${auth.sysconfig.tenantId}")
     private Integer lesseeOrganId;
 
@@ -240,12 +242,13 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    @Transactional(rollbackFor = Exception.class)
+    @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
     public void signIn(Long roomId) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         Integer userId = sysUser.getId();
         log.info("roomSignIn: roomId={}, userId={}", roomId, userId);
         Teacher teacher = teacherDao.get(userId);
+        studentDao.lockUser(userId);
         CourseSchedule courseSchedule = courseScheduleDao.get(roomId);
         Date date = new Date();
         String continueCourseTime = sysConfigDao.findConfigValue(SysConfigService.ONLINE_CONTINUE_COURSE_TIME);