浏览代码

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

zouxuan 5 年之前
父节点
当前提交
755a803502

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java

@@ -177,7 +177,7 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
     List<Map<Long, BigDecimal>> queryActualAmount(@Param("paymentOrderNo") List<Long> paymentOrderNo);
 
 
-    List<StudentPaymentOrder> findFixOrder(@Param("status") DealStatusEnum status, @Param("paymentChannel") String paymentChannel);
+    List<StudentPaymentOrder> findFixOrder();
 
     /**
      * 订单导出

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

@@ -1378,6 +1378,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             if (newCourseSchedule.getEndClassTime().before(now)) {
                 newCourseSchedule.setStatus(CourseStatusEnum.OVER);
             }
+            if(!CollectionUtils.isEmpty(newCourseSchedule.getTeachingTeacherIdList())){
+                if (newCourseSchedule.getTeachingTeacherIdList().contains(newCourseSchedule.getActualTeacherId())){
+                    throw new BizException("主教和助教不可重复");
+                }
+            }
         });
         //课程冲突检测
         checkNewCourseSchedules(newCourseSchedules, false);
@@ -1423,16 +1428,21 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         List<Map<Long, Integer>> courseLeaveStudentNumMaps = studentAttendanceDao.countCourseLeaveStudentNumWithFourHoursAgo(newCourseScheduleIds, advanceLeaveHours);
         Map<Long,Long> courseLeaveStudentNumMap = MapUtil.convertIntegerMap((courseLeaveStudentNumMaps));
 
+        List<Map<Integer, Integer>> classGroupStudentNumMaps = classGroupStudentMapperDao.countClassGroupsStudentNum(classGroupIds, ClassGroupStudentStatusEnum.NORMAL);
+        Map<Integer, Long> classGroupStudentNumMap = MapUtil.convertIntegerMap(classGroupStudentNumMaps);
+
         newCourseSchedules.forEach(newCourseSchedule -> {
 
             CourseSchedule oldCourseSchedule = oldCourseScheduleMap.get(newCourseSchedule.getId()).get(0);
 
             if (!sysUser.getUserType().contains("SYSTEM") && sysUser.getUserType().contains("TEACHER")) {
+                Long normalStudentNum = classGroupStudentNumMap.get(oldCourseSchedule.getClassGroupId());
                 Long courseLeaveStudentNum = courseLeaveStudentNumMap.get(newCourseSchedule.getId());
                 ClassGroup classGroup=idClassGroupMap.get(oldCourseSchedule.getClassGroupId());
                 if(oldCourseSchedule.getGroupType().equals(GroupType.VIP)
                         &&Objects.nonNull(courseLeaveStudentNum)
-                        &&courseLeaveStudentNum.intValue()==classGroup.getExpectStudentNum()){
+                        &&Objects.nonNull(normalStudentNum)
+                        &&courseLeaveStudentNum.intValue()==normalStudentNum.intValue()){
                     if(!DateUtil.isSameDay(now,oldCourseSchedule.getStartClassTime())&&now.after(oldCourseSchedule.getStartClassTime())){
                         throw new BizException("当前时间不可对相关课程进行调整");
                     }

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

@@ -450,7 +450,7 @@
             cs.teach_mode_,
             cg.student_num_ total_student_num_,
             su.real_name_ teacher_name_,
-            IF(ta.sign_in_status_ IS NULL,3,ta.sign_in_status_) attendance_status_,
+            IF(ta.sign_in_status_ IS NULL,3,ta.sign_in_status_) sign_in_status_,
             s.name_ school_name_
         FROM
             course_schedule cs

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

@@ -405,13 +405,7 @@
     </select>
 
     <select id="findFixOrder" resultMap="StudentPaymentOrder">
-        SELECT *
-        FROM student_payment_order
-        WHERE status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-          AND payment_channel_ =
-              #{paymentChannel}
-          AND com_amount_ IS NULL
-        LIMIT 100
+        SELECT * FROM student_payment_order where status_ ='SUCCESS' AND type_='APPLY' AND actual_amount_> 0 and mer_nos_ IS NULL LIMIT 100
     </select>
 
 

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -341,7 +341,7 @@ public class StudentOrderController extends BaseController {
 
     @GetMapping("/fixOrder")
     private void fixOrder() throws Exception {
-        List<StudentPaymentOrder> payingOrders = studentPaymentOrderService.findOrdersByStatus(DealStatusEnum.SUCCESS, "YQPAY");
+        List<StudentPaymentOrder> payingOrders = studentPaymentOrderDao.findFixOrder();
 
         if (payingOrders.size() == 0) {
             return;