Joburgess 5 years ago
parent
commit
49367e2099

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

@@ -33,6 +33,14 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
                                               @Param("status") String status);
                                               @Param("status") String status);
 
 
     /**
     /**
+     * @Author: Joburgess
+     * @Date: 2019/10/3
+     * 根据学生vip课获取非失败缴费订单
+     */
+    StudentPaymentOrder findNotFailedOrderByStudentVipGroup(@Param("vipGroupId") Long vipGroupId,
+                                              @Param("userId") Integer userId);
+
+    /**
      * @describe 统计报名人数
      * @describe 统计报名人数
      * @author Joburgess
      * @author Joburgess
      * @date 2019/11/13
      * @date 2019/11/13

+ 18 - 10
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseSchedule.java

@@ -1,6 +1,14 @@
 package com.ym.mec.biz.dal.entity;
 package com.ym.mec.biz.dal.entity;
 
 
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
+import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.TeachModeEnum;
+import com.ym.mec.common.enums.BaseEnum;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.ParseException;
@@ -8,16 +16,6 @@ import java.text.SimpleDateFormat;
 import java.util.List;
 import java.util.List;
 import java.util.Objects;
 import java.util.Objects;
 
 
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.enums.CourseStatusEnum;
-import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.biz.dal.enums.TeachModeEnum;
-import com.ym.mec.common.enums.BaseEnum;
-
 /**
 /**
  * 对应数据库表(course_schedule):
  * 对应数据库表(course_schedule):
  */
  */
@@ -122,11 +120,21 @@ public class CourseSchedule {
 
 
 	private Integer schoolId;
 	private Integer schoolId;
 
 
+	private String schoolName;
+
 	/** 主教是否不需要重新生成课酬 */
 	/** 主教是否不需要重新生成课酬 */
 	private boolean bishopTeacherSalaryNotCreate;
 	private boolean bishopTeacherSalaryNotCreate;
 
 
 	private String classGroupName;
 	private String classGroupName;
 
 
+	public String getSchoolName() {
+		return schoolName;
+	}
+
+	public void setSchoolName(String schoolName) {
+		this.schoolName = schoolName;
+	}
+
 	public String getClassGroupName() {
 	public String getClassGroupName() {
 		return classGroupName;
 		return classGroupName;
 	}
 	}

+ 0 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -494,8 +494,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                             errInfo.append("安排的课程存在学生冲突");
                             errInfo.append("安排的课程存在学生冲突");
                             throw new BizException(errInfo.toString());
                             throw new BizException(errInfo.toString());
                         }
                         }
-						System.out.print(j==repeatTimes);
-                        System.out.println(" "+j);
                         if(j==repeatTimes){
                         if(j==repeatTimes){
                             repeatTimes+=1;
                             repeatTimes+=1;
                         }
                         }

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

@@ -907,9 +907,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			throw new BizException("该课程已结束报名!");
 			throw new BizException("该课程已结束报名!");
 		}
 		}
 
 
-		StudentPaymentOrder oldOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupBuyParams.getVipGroupId(),
-				user.getId(),
-				null);
+		StudentPaymentOrder oldOrder = studentPaymentOrderDao.findNotFailedOrderByStudentVipGroup(vipGroupBuyParams.getVipGroupId(),
+				user.getId());
 
 
 		if(Objects.nonNull(oldOrder)&&oldOrder.getStatus().equals(DealStatusEnum.SUCCESS)){
 		if(Objects.nonNull(oldOrder)&&oldOrder.getStatus().equals(DealStatusEnum.SUCCESS)){
 			throw new BizException("您已购买过此课程");
 			throw new BizException("您已购买过此课程");

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

@@ -28,6 +28,7 @@
         <result column="student_num_" property="studentNum"/>
         <result column="student_num_" property="studentNum"/>
         <result column="leave_student_num_" property="leaveStudentNum"/>
         <result column="leave_student_num_" property="leaveStudentNum"/>
         <result column="schoole_id_" property="schoolId"/>
         <result column="schoole_id_" property="schoolId"/>
+        <result column="schoole_name_" property="schoolName"/>
         <result column="class_group_name_" property="classGroupName"/>
         <result column="class_group_name_" property="classGroupName"/>
     </resultMap>
     </resultMap>
     
     
@@ -805,9 +806,11 @@
             cs.name_,
             cs.name_,
             cs.student_num_,
             cs.student_num_,
             cs.leave_student_num_,
             cs.leave_student_num_,
-            cs.schoole_id_
+            cs.schoole_id_,
+            s.name_ schoole_name_
         FROM
         FROM
         	course_schedule cs
         	course_schedule cs
+        	LEFT JOIN school s ON cs.schoole_id_=s.id_
         WHERE
         WHERE
           cs.music_group_id_ =#{vipGroupId} AND cs.group_type_ = 'VIP'
           cs.music_group_id_ =#{vipGroupId} AND cs.group_type_ = 'VIP'
     </select>
     </select>

+ 10 - 0
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -205,6 +205,16 @@
             </if>
             </if>
             AND spo.type_ = 'SMALL_CLASS_TO_BUY'
             AND spo.type_ = 'SMALL_CLASS_TO_BUY'
     </select>
     </select>
+    <select id="findNotFailedOrderByStudentVipGroup" resultMap="StudentPaymentOrder">
+        SELECT
+          spo.*
+        FROM
+          student_payment_order spo
+        WHERE spo.user_id_=#{userId}
+            AND spo.music_group_id_=#{vipGroupId}
+            AND spo.status_!='FAILED'
+            AND spo.type_ = 'SMALL_CLASS_TO_BUY'
+    </select>
     <!-- 查询报名订单 -->
     <!-- 查询报名订单 -->
     <select id="findMusicGroupApplyOrderByStatus" resultMap="StudentPaymentOrder">
     <select id="findMusicGroupApplyOrderByStatus" resultMap="StudentPaymentOrder">
         SELECT * FROM student_payment_order WHERE music_group_id_= #{musicGroupId} AND user_id_=#{userId} AND type_ =
         SELECT * FROM student_payment_order WHERE music_group_id_= #{musicGroupId} AND user_id_=#{userId} AND type_ =