Browse Source

Merge branch 'practice_1129' into online1

yonge 3 năm trước cách đây
mục cha
commit
863fd38e59
30 tập tin đã thay đổi với 351 bổ sung143 xóa
  1. 5 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DegreeRegistrationDao.java
  2. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherDao.java
  3. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PageInfoDegree.java
  4. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PracticeBuyResultDto.java
  5. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/DegreeRegistration.java
  6. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/PracticeGroup.java
  7. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/DegreeQueryInfo.java
  8. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupService.java
  9. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java
  10. 18 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/DegreeRegistrationServiceImpl.java
  11. 22 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/EduPracticeGroupServiceImpl.java
  12. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberRankSettingServiceImpl.java
  13. 4 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  14. 123 57
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  15. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ReplacementInstrumentActivityServiceImpl.java
  16. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java
  17. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SubjectChangeServiceImpl.java
  18. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  19. 27 2
      mec-biz/src/main/resources/config/mybatis/DegreeRegistrationMapper.xml
  20. 1 1
      mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml
  21. 22 0
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  22. 32 20
      mec-student/src/main/java/com/ym/mec/student/controller/DegreeController.java
  23. 4 4
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java
  24. 5 3
      mec-student/src/main/java/com/ym/mec/student/controller/PracticeGroupController.java
  25. 2 2
      mec-student/src/main/java/com/ym/mec/student/controller/RepairController.java
  26. 2 2
      mec-student/src/main/java/com/ym/mec/student/controller/ReplacementInstrumentActivityController.java
  27. 2 2
      mec-student/src/main/java/com/ym/mec/student/controller/SporadicChargeInfoController.java
  28. 2 2
      mec-student/src/main/java/com/ym/mec/student/controller/SubjectChangeController.java
  29. 10 10
      mec-web/src/main/java/com/ym/mec/web/controller/DegreeController.java
  30. 4 2
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduPracticeGroupController.java

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

@@ -17,8 +17,12 @@ public interface DegreeRegistrationDao extends BaseDAO<Integer, DegreeRegistrati
 
     DegreeRegistration getTotalAmount(Map<String, Object> params);
 
+    int countApplyNum(Map<String, Object> params);
+
     DegreeRegistration getWithUserIdAndActivityTag(@Param("degree") DegreeRegistration degree);
 
     List<DegreeRegistration> getUserLevelDegrees(@Param("userId") Integer userId,
-                                                 @Param("activityTag") String activityTag);
+                                                 @Param("activityTag") String activityTag,
+                                                 @Param("degreeType") Integer degreeType,
+                                                 @Param("sporadicId") Integer sporadicId);
 }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherDao.java

@@ -130,6 +130,9 @@ public interface TeacherDao extends BaseDAO<Integer, Teacher> {
     List<ExtendTeacherBasicDto> findTeaTeachersByOrganAndSubject3(@Param("organId") Integer organId,
                                                                   @Param("subjectId") Integer subjectId);
 
+    List<ExtendTeacherBasicDto> findTeaTeachersByOrganAndSubject4(@Param("organIdList") String organIdList,
+                                                                  @Param("subjectId") Integer subjectId);
+
     /**
      * @param organIds:   部门编号列表
      * @param subjectIds: 声部编号列表

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PageInfoDegree.java

@@ -16,6 +16,17 @@ public class PageInfoDegree<T> extends PageInfo<T> {
     @ApiModelProperty(value = "考级总金额", required = true)
     private BigDecimal totalAmount = BigDecimal.ZERO;
 
+    @ApiModelProperty(value = "报考人数", required = true)
+    private Integer applyNum;
+
+    public Integer getApplyNum() {
+        return applyNum;
+    }
+
+    public void setApplyNum(Integer applyNum) {
+        this.applyNum = applyNum;
+    }
+
     public PageInfoDegree() {
     }
 

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PracticeBuyResultDto.java

@@ -30,6 +30,8 @@ public class PracticeBuyResultDto {
     private String type;
 
     private Object detail;
+    
+    private Integer courseNum;
 
     public String getOrderNo() {
         return orderNo;
@@ -110,4 +112,12 @@ public class PracticeBuyResultDto {
     public void setDetail(Object detail) {
         this.detail = detail;
     }
+
+	public Integer getCourseNum() {
+		return courseNum;
+	}
+
+	public void setCourseNum(Integer courseNum) {
+		this.courseNum = courseNum;
+	}
 }

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/DegreeRegistration.java

@@ -73,6 +73,12 @@ public class DegreeRegistration {
     private String level;
 
     /**
+     * 考试类型
+     */
+    @ApiModelProperty(value = "考试类型",required = true)
+    private Integer degreeType;
+
+    /**
      * 乐理级别
      */
     @ApiModelProperty(value = "乐理级别",required = true)
@@ -140,6 +146,14 @@ public class DegreeRegistration {
 
     private String activityTag;
 
+    public Integer getDegreeType() {
+        return degreeType;
+    }
+
+    public void setDegreeType(Integer degreeType) {
+        this.degreeType = degreeType;
+    }
+
     public Boolean getRepay() {
         return isRepay;
     }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/PracticeGroup.java

@@ -57,7 +57,7 @@ public class PracticeGroup {
 	
 	/**  */
 	private String memo;
-
+	
 	private Integer buyMonths;
 
 	private Integer drillTimesOnWeek;

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/DegreeQueryInfo.java

@@ -16,6 +16,8 @@ public class DegreeQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "零星支付id", required = true)
     private Integer sporadicId;
 
+    private String degreeType;
+
     /**
      * 订单编号
      */
@@ -134,6 +136,13 @@ public class DegreeQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "状态 reg-报名 pay-已缴费",required = false)
     private String status;
 
+    public String getDegreeType() {
+        return degreeType;
+    }
+
+    public void setDegreeType(String degreeType) {
+        this.degreeType = degreeType;
+    }
 
     public Integer getId() {
         return id;

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

@@ -202,7 +202,7 @@ public interface PracticeGroupService extends BaseService<Long, PracticeGroup> {
      * @param practiceGroupBuyParams: 购买参数
      * @return void
      */
-    HttpResponseResult buyPracticeGroup(PracticeGroupBuyDto practiceGroupBuyParams);
+    HttpResponseResult buyPracticeGroup(PracticeGroupBuyDto practiceGroupBuyParams, String operatorInfo);
 
 	/**
 	 * @describe 创建关心包课程
@@ -212,7 +212,7 @@ public interface PracticeGroupService extends BaseService<Long, PracticeGroup> {
 	 * @param operatorInfo:
 	 * @return com.ym.mec.common.entity.HttpResponseResult
 	 */
-	HttpResponseResult createPackagePracticeGroup(PracticeGroupBuyDto practiceGroupBuyParams);
+	HttpResponseResult createPackagePracticeGroup(PracticeGroupBuyDto practiceGroupBuyParams, String operatorInfo);
 
     /**
      * @describe 支付订单回调
@@ -294,7 +294,7 @@ public interface PracticeGroupService extends BaseService<Long, PracticeGroup> {
 	 * @param groupId:
 	 * @return void
 	 */
-	HttpResponseResult cancelWaitPayOrder(Integer userId, Integer groupId);
+	HttpResponseResult cancelWaitPayOrder(Integer userId, Integer groupId) throws Exception;
 
 	/**
 	 * @describe 推送练习报告

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java

@@ -110,6 +110,11 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
      * @describe 陪练课时长
      */
     String PRACTICE_COURSE_MINUTES = "practice_course_minutes";
+    
+    /**
+     * 陪练课可选老师的分部
+     */
+    String PRACTICE_TEACHER_ORGAN_RANGE = "practice_teacher_organ_range";
 
     /**
      * @describe 陪练课预约开始时间

+ 18 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/DegreeRegistrationServiceImpl.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service.impl;
 
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.stream.Collectors;
 
 import com.alibaba.fastjson.JSON;
 import com.ym.mec.biz.dal.dao.*;
@@ -12,6 +13,7 @@ import com.ym.mec.biz.service.SysUserCashAccountService;
 import com.ym.mec.common.constant.CommonConstants;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.util.date.DateUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
@@ -77,7 +79,7 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
     public HttpResponseResult pay(DegreeRegistrationActivityDto degreeRegistration) throws Exception {
         Student student = studentDao.getLocked(degreeRegistration.getUserId());
 
-        List<DegreeRegistration> userLevelDegrees = degreeRegistrationDao.getUserLevelDegrees(degreeRegistration.getUserId(), ACTIVITY_TAG);
+        List<DegreeRegistration> userLevelDegrees = degreeRegistrationDao.getUserLevelDegrees(degreeRegistration.getUserId(), ACTIVITY_TAG,degreeRegistration.getDegreeType(),degreeRegistration.getSporadicId());
         long endLevelNum = userLevelDegrees.stream().filter(d -> Objects.nonNull(d.getSporadicId())&&d.getStatus().equals(2)).count();
         long ingLevelNum = userLevelDegrees.stream().filter(d -> Objects.nonNull(d.getSporadicId())&&d.getStatus().equals(1)).count();
         long endTheoryLevelNum = userLevelDegrees.stream().filter(d -> StringUtils.isNotBlank(d.getTheoryLevel())&&d.getStatus().equals(2)).count();
@@ -93,9 +95,15 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
         degreeRegistration.setActivityTag(ACTIVITY_TAG);
 
         Date nowDate = new Date();
-
-        if(ACTIVITY_END_TIME.compareTo(nowDate)<0){
-            throw new BizException("活动已截至");
+        String startTimeStr = sysConfigDao.findConfigValue("degree_activity_start_time");
+        Date startTime = DateUtil.stringToDate(startTimeStr);
+        if (startTime.compareTo(nowDate) > 0) {
+            throw new BizException("活动还未开始,谢谢关注");
+        }
+        String endTimeStr = sysConfigDao.findConfigValue("degree_activity_end_time");
+        Date endTime = DateUtil.stringToDate(endTimeStr);
+        if (endTime.compareTo(nowDate) <= 0) {
+            throw new BizException("活动已结束,谢谢关注");
         }
 
         String orderNo = idGeneratorService.generatorId("payment") + "";
@@ -175,8 +183,8 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
         }
 
         BigDecimal additionCoursePrice = new BigDecimal("0");
-        if(Objects.nonNull(degreeRegistration.getAdditionCourseInfo())){
-            Map<CourseSchedule.CourseScheduleType, Integer> additionCourseInfo = degreeRegistration.getAdditionCourseInfo();
+        Map<CourseSchedule.CourseScheduleType, Integer> additionCourseInfo = degreeRegistration.getAdditionCourseInfo();
+        if(additionCourseInfo != null && additionCourseInfo.size() > 0){
             PracticeGroupSellPrice practiceGroupSellPrice = practiceGroupSellPriceDao.get(degreeRegistration.getOrganId());
             if(Objects.isNull(practiceGroupSellPrice)){
                 throw new BizException("该分部暂未参与此活动");
@@ -297,8 +305,8 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
         if(BigDecimal.ZERO.compareTo(additionCoursePrice)<0){
             StudentPaymentOrderDetail studentPaymentOrderDetail = new StudentPaymentOrderDetail();
             studentPaymentOrderDetail.setType(OrderDetailTypeEnum.DEGREE_REGISTRATION);
-            if(Objects.nonNull(degreeRegistration.getAdditionCourseInfo())){
-                studentPaymentOrderDetail.setGoodsIdList(JSON.toJSONString(degreeRegistration.getAdditionCourseInfo()));
+            if(additionCourseInfo != null && additionCourseInfo.size() > 0){
+            	studentPaymentOrderDetail.setGoodsIdList(JSON.toJSONString(degreeRegistration.getAdditionCourseInfo()));
             }
             studentPaymentOrderDetail.setPrice(additionCoursePrice);
             studentPaymentOrderDetail.setRemitFee(BigDecimal.ZERO);
@@ -348,7 +356,7 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
     public HttpResponseResult theoryPay(DegreeRegistrationActivityDto degreeRegistration) throws Exception {
         studentDao.getLocked(degreeRegistration.getUserId());
 
-        List<DegreeRegistration> userLevelDegrees = degreeRegistrationDao.getUserLevelDegrees(degreeRegistration.getUserId(), ACTIVITY_TAG);
+        List<DegreeRegistration> userLevelDegrees = degreeRegistrationDao.getUserLevelDegrees(degreeRegistration.getUserId(), ACTIVITY_TAG,degreeRegistration.getDegreeType(),degreeRegistration.getSporadicId());
 
         long endTheoryLevelNum = userLevelDegrees.stream().filter(d -> StringUtils.isNotBlank(d.getTheoryLevel())&&d.getStatus().equals(2)).count();
         long ingTheoryLevelNum = userLevelDegrees.stream().filter(d -> StringUtils.isNotBlank(d.getTheoryLevel())&&d.getStatus().equals(1)).count();
@@ -602,7 +610,7 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
             BigDecimal subjectLevelAmount = degree.getMoney() == null ? BigDecimal.ZERO : degree.getMoney();
             BigDecimal theoryLevelAmount = degree.getTheoryMoney() == null ? BigDecimal.ZERO : degree.getTheoryMoney();
             BigDecimal totalAmount = subjectLevelAmount.add(theoryLevelAmount);
-
+            pageInfo.setApplyNum(degreeRegistrationDao.countApplyNum(params));
             pageInfo.setSubjectLevelAmount(subjectLevelAmount);
             pageInfo.setTheoryLevelAmount(theoryLevelAmount);
             pageInfo.setTotalAmount(totalAmount);

+ 22 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/EduPracticeGroupServiceImpl.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
+import static java.math.BigDecimal.ROUND_DOWN;
+
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -725,9 +727,18 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         if(teacherDefaultSalary == null){
             throw new BizException("请设置老师课酬");
         }
-        BigDecimal studentSingleCourseCost=price.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
-        BigDecimal studentSingleCourseOriginalCost=price.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
-        for (CourseSchedule courseSchedule : practiceCourses) {
+        
+        BigDecimal studentSingleCourseOriginalCost = price.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
+
+        //使用优惠券
+        StudentPaymentOrder studentPaymentOrder = sysCouponCodeService.use(practiceGroupBuyParams.getCouponIdList(), price, true);
+        //实际支付金额,去除优惠券
+        BigDecimal actualPrice = studentPaymentOrder.getExpectAmount();
+        BigDecimal divide = actualPrice.divide(new BigDecimal(practiceCourses.size()), ROUND_DOWN);
+        BigDecimal firstAmount = actualPrice.subtract(divide.multiply(new BigDecimal(practiceCourses.size()))).add(divide);
+        
+        for (int i = 0; i < practiceCourses.size(); i++) {
+            CourseSchedule courseSchedule = practiceCourses.get(i);
             //课程与老师薪水表
             CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
             courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
@@ -747,8 +758,13 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             courseScheduleStudentPayment.setMusicGroupId(practiceGroupBuyParams.getId().toString());
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(practiceGroupBuyParams.getStudentId());
-            courseScheduleStudentPayment.setExpectPrice(studentSingleCourseCost);
-            courseScheduleStudentPayment.setActualPrice(studentSingleCourseCost);
+            if(i == 0){
+                courseScheduleStudentPayment.setExpectPrice(firstAmount);
+                courseScheduleStudentPayment.setActualPrice(firstAmount);
+            }else {
+                courseScheduleStudentPayment.setExpectPrice(divide);
+                courseScheduleStudentPayment.setActualPrice(divide);
+            }
             courseScheduleStudentPayment.setOriginalPrice(studentSingleCourseOriginalCost);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setCreateTime(now);
@@ -787,7 +803,6 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             return BaseController.failed(HttpStatus.FOUND, errMessage);
         }
 
-        StudentPaymentOrder studentPaymentOrder=new StudentPaymentOrder();
         studentPaymentOrder.setUserId(practiceGroupBuyParams.getStudentId());
         studentPaymentOrder.setGroupType(GroupType.PRACTICE);
         String orderNo=idGeneratorService.generatorId("payment") + "";
@@ -795,7 +810,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         studentPaymentOrder.setStatus(DealStatusEnum.ING);
         studentPaymentOrder.setType(OrderTypeEnum.PRACTICE_GROUP_BUY);
 
-        studentPaymentOrder.setExpectAmount(price);
+        studentPaymentOrder.setExpectAmount(actualPrice);
         studentPaymentOrder.setMusicGroupId(practiceGroupBuyParams.getId().toString());
         studentPaymentOrder.setActualAmount(studentPaymentOrder.getExpectAmount());
         studentPaymentOrder.setClassGroupId(classGroup.getId());

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

@@ -421,9 +421,9 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe
 			PayStatus payStatus = studentPaymentOrderService.queryPayStatus(applyOrder.getPaymentChannel(), applyOrder.getOrderNo(), applyOrder.getTransNo());
 			if(payStatus == PayStatus.SUCCESSED){
 				throw new BizException("订单已支付成功,请勿重复支付");
-			}else if(payStatus == PayStatus.PAYING){
+			}/*else if(payStatus == PayStatus.PAYING){
 				throw new BizException("订单还在交易中,请稍后重试");
-			}
+			}*/
 			if(repay){
 				//处理关闭订单
 				applyOrder.setStatus(DealStatusEnum.CLOSE);

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

@@ -982,9 +982,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if(payStatus != PayStatus.FAILED){
         	if(payStatus == PayStatus.SUCCESSED){
         		throw new BizException("订单已支付成功,请勿重复支付");
-        	}else if(payStatus == PayStatus.PAYING){
+        	}/*else if(payStatus == PayStatus.PAYING){
         		throw new BizException("订单还在交易中,请稍后重试");
-        	}
+        	}*/
         }
 
     	MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderDao.getMusicGroupRegCalender(studentRegistration.getMusicGroupId());
@@ -3016,9 +3016,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 if(payStatus != PayStatus.FAILED){
                 	if(payStatus == PayStatus.SUCCESSED){
                 		throw new BizException("订单已支付成功,请勿重复支付");
-                	}else if(payStatus == PayStatus.PAYING){
+                	}/*else if(payStatus == PayStatus.PAYING){
                 		throw new BizException("订单还在交易中,请稍后重试");
-                	}
+                	}*/
                 }
                 oldStudentPaymentOrder.setStatus(CLOSE);
                 studentPaymentOrderService.update(oldStudentPaymentOrder);

+ 123 - 57
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -28,6 +28,7 @@ import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.http.HttpUtil;
 import com.ym.mec.util.string.MessageFormatter;
+
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -41,6 +42,7 @@ import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.util.CollectionUtils;
+
 import java.math.BigDecimal;
 import java.time.*;
 import java.time.format.DateTimeFormatter;
@@ -2406,9 +2408,15 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         if (Objects.nonNull(practiceCourseMinutesConfig)) {
             practiceCourseMinutes = practiceCourseMinutesConfig.getParanValue(Integer.class);
         }
+        
+        SysConfig organIdConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_TEACHER_ORGAN_RANGE);
+        
+        if(organIdConfig == null || StringUtils.isBlank(organIdConfig.getParanValue())){
+        	throw new BizException("系统参数[{}]未配置", SysConfigService.PRACTICE_TEACHER_ORGAN_RANGE);
+        }
 
         List<Integer> includeTeacherIds = new ArrayList<>();
-        List<ExtendTeacherBasicDto> organAndSubjectTeachers = teacherDao.findTeaTeachersByOrganAndSubject2(sysUser.getOrganId(), subjectId);
+        List<ExtendTeacherBasicDto> organAndSubjectTeachers = teacherDao.findTeaTeachersByOrganAndSubject4(organIdConfig.getParanValue(), subjectId);
         if (CollectionUtils.isEmpty(organAndSubjectTeachers)) {
             return new ArrayList<>();
         }
@@ -2613,7 +2621,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         }
         now = now.plusDays(1);
         Date applyStartDate = Date.from(now.atStartOfDay(zoneId).toInstant());
-        Date applyEndDate = Date.from(now.plusMonths(buyMonths).atStartOfDay(zoneId).toInstant());
+        Date applyEndDate = Date.from(now.plusDays(buyMonths).atStartOfDay(zoneId).toInstant());
         Date firstMonday = DateUtil.getWeekDayWithDate(applyStartDate, Calendar.MONDAY);
         Date secondSunday = DateUtil.getWeekDayWithDate(applyEndDate, Calendar.SUNDAY);
 
@@ -2820,15 +2828,15 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 
     @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
-    public HttpResponseResult buyPracticeGroup(PracticeGroupBuyDto practiceGroupBuyParams) {
+    public HttpResponseResult buyPracticeGroup(PracticeGroupBuyDto practiceGroupBuyParams, String operatorInfo) {
         if (Objects.isNull(practiceGroupBuyParams.getUserId())) {
             return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "请选择教师");
         }
         if (Objects.isNull(practiceGroupBuyParams.getSubjectId())) {
             return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "请选择声部");
         }
-        if (Objects.isNull(practiceGroupBuyParams.getBuyMonths())) {
-            return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "请选择需要购买的数");
+        if (Objects.isNull(practiceGroupBuyParams.getAllCourseNum())) {
+            return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "请选择需要购买的课时数");
         }
         if (Objects.isNull(practiceGroupBuyParams.getDrillTimesOnWeek())) {
             return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "请选择单周陪练次数");
@@ -2855,14 +2863,14 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         SysConfig practiceCourseMinutesConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_COURSE_MINUTES);
         Integer practiceCourseMinutes = practiceCourseMinutesConfig.getParanValue(Integer.class);
         SysConfig practiceCourseSalaryConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_COURSE_SALARY);
-        SysConfig practiceBuyActivityExpireDateConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_BUY_ACTIVITY_EXPIRE_DATE);
+        /*SysConfig practiceBuyActivityExpireDateConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_BUY_ACTIVITY_EXPIRE_DATE);
         Date practiceBuyActivityExpireDate = DateUtil.stringToDate(practiceBuyActivityExpireDateConfig.getParanValue(), "yyyy-MM-dd HH:mm:ss");
         SysConfig practicePromotionActivityStartDateConfig = sysConfigDao.findByParamName(SysConfigService.PRACTICE_PROMOTION_ACTIVITY_START_DATE);
         Date practicePromotionActivityStartDate = DateUtil.stringToDate(practicePromotionActivityStartDateConfig.getParanValue(), "yyyy-MM-dd HH:mm:ss");
-
+*/
         Date now = new Date();
 
-        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(practiceGroupBuyParams.getStudentId(),"2021-03-09 00:00:00");
+//        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(practiceGroupBuyParams.getStudentId(),"2021-03-09 00:00:00");
 
         LocalDate courseStartDay = LocalDate.now();
         LocalDate tempCourseLocalDate = LocalDate.parse("2020-03-01", DateUtil.dateFormatter);
@@ -2902,7 +2910,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         courseStartDay = courseStartDay.plusDays(1);
         Date courseStartDate = Date.from(courseStartDay.atStartOfDay(DateUtil.zoneId).toInstant());
         practiceGroupBuyParams.setCoursesStartDate(courseStartDate);
-        LocalDate currentExpiredDay = courseStartDay.plusMonths(practiceGroupBuyParams.getBuyMonths());
+        LocalDate currentExpiredDay = courseStartDay.plusDays(practiceGroupBuyParams.getBuyMonths());
         Date courseExpiredDate = Date.from(currentExpiredDay.atStartOfDay(DateUtil.zoneId).toInstant());
         courseExpiredDate = DateUtil.addSeconds(courseExpiredDate, -1);
         practiceGroupBuyParams.setCoursesExpireDate(courseExpiredDate);
@@ -2969,8 +2977,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         if (Objects.isNull(practiceGroupSellPrice)) {
             throw new BizException("所在城市暂不参与此活动");
         }
-        BigDecimal oneMonthPrice;
-        if (practiceBuyActivityExpireDate.after(now)&&Objects.nonNull(sysUser.getOrganId())&&sysUser.getOrganId()==14&& studentExitChargePractices <= 0) {
+        BigDecimal oneMonthPrice = practiceGroupSellPrice.getSingleClassMinutesPrice();
+        /*if (practiceBuyActivityExpireDate.after(now)&&Objects.nonNull(sysUser.getOrganId())&&sysUser.getOrganId()==14&& studentExitChargePractices <= 0) {
 //            oneMonthPrice = practiceGroupBuyParams.getDrillTimesOnWeek() == 1 ? practiceGroupSellPrice.getOnceActivityPrice() : practiceGroupSellPrice.getTwiceActivityPrice();
             oneMonthPrice = practiceGroupBuyParams.getDrillTimesOnWeek() == 1 ? practiceGroupSellPrice.getOnceOriginalPrice() : practiceGroupSellPrice.getTwiceOriginalPrice();
             if (!now.before(practicePromotionActivityStartDate) && practiceGroupBuyParams.getBuyMonths() >= 3 && studentExitChargePractices > 0) {
@@ -2980,17 +2988,17 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             }
         } else {
             oneMonthPrice = practiceGroupBuyParams.getDrillTimesOnWeek() == 1 ? practiceGroupSellPrice.getOnceOriginalPrice() : practiceGroupSellPrice.getTwiceOriginalPrice();
-        }
-        BigDecimal amount = oneMonthPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
-        if (!now.before(practicePromotionActivityStartDate) && now.before(practiceBuyActivityExpireDate) && Objects.nonNull(sysUser.getOrganId())&&sysUser.getOrganId()==14 && studentExitChargePractices <= 0) {
-            amount = oneMonthPrice.multiply(new BigDecimal(1));
-        }
+        }*/
+        BigDecimal amount = oneMonthPrice.multiply(new BigDecimal(practiceGroupBuyParams.getAllCourseNum()));
 
         practiceGroupBuyParams.setDrillTimesJson(drillTimesObject.toJSONString());
         practiceGroupBuyParams.setOrganId(sysUser.getOrganId());
         practiceGroupBuyParams.setSingleClassMinutes(practiceCourseMinutes);
         practiceGroupBuyParams.setGroupStatus(GroupStatusEnum.LOCK);
         practiceGroupBuyParams.setType(PracticeGroupType.CHARGE);
+        if(StringUtils.isNotBlank(operatorInfo)){
+        	practiceGroupBuyParams.setMemo(operatorInfo+",教务代买");
+        }
         practiceGroupDao.insert(practiceGroupBuyParams);
 
         //创建班级信息
@@ -3007,6 +3015,26 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         classGroup.setCreateTime(now);
         classGroup.setUpdateTime(now);
         classGroupDao.insert(classGroup);
+        
+        //使用优惠券
+        StudentPaymentOrder studentPaymentOrder = sysCouponCodeService.use(practiceGroupBuyParams.getCouponIdList(),amount,true);
+        amount = studentPaymentOrder.getActualAmount();
+        studentPaymentOrder.setUserId(practiceGroupBuyParams.getStudentId());
+        studentPaymentOrder.setGroupType(GroupType.PRACTICE);
+        String orderNo = idGeneratorService.generatorId("payment") + "";
+        studentPaymentOrder.setOrderNo(orderNo);
+        studentPaymentOrder.setStatus(DealStatusEnum.ING);
+        studentPaymentOrder.setType(OrderTypeEnum.PRACTICE_GROUP_BUY);
+        if (practiceGroupBuyParams.isRenew()) {
+            studentPaymentOrder.setType(OrderTypeEnum.PRACTICE_GROUP_RENEW);
+        }
+        studentPaymentOrder.setMusicGroupId(practiceGroupBuyParams.getId().toString());
+        studentPaymentOrder.setClassGroupId(classGroup.getId());
+        studentPaymentOrder.setVersion(0);
+        if(StringUtils.isNotBlank(operatorInfo)){
+        	studentPaymentOrder.setMemo(operatorInfo+",教务代买");
+        }
+        studentPaymentOrderService.insert(studentPaymentOrder);
 
         //创建班级老师关联记录
         ClassGroupTeacherMapper classGroupTeacherMapper = new ClassGroupTeacherMapper();
@@ -3068,13 +3096,18 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         if(teacherDefaultSalary == null){
         	throw new BizException("请设置教师课酬");
         }
-        BigDecimal studentSingleCourseCost = amount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, ROUND_DOWN);
+//        BigDecimal studentSingleCourseCost = amount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, ROUND_DOWN);
 
-        BigDecimal oneMonthOriginalPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
-        BigDecimal originalAmount = oneMonthOriginalPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
-        BigDecimal studentSingleCourseOriginalCost=originalAmount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, ROUND_DOWN);
+//        BigDecimal oneMonthOriginalPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
+//        BigDecimal originalAmount = oneMonthOriginalPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
+//        BigDecimal studentSingleCourseOriginalCost=originalAmount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, ROUND_DOWN);
 
-        for (CourseSchedule courseSchedule : practiceCourses) {
+        //实际支付金额,去除优惠券
+        BigDecimal actualPrice = studentPaymentOrder.getExpectAmount();
+        BigDecimal divide = actualPrice.divide(new BigDecimal(practiceCourses.size()), ROUND_DOWN);
+        BigDecimal firstAmount = actualPrice.subtract(divide.multiply(new BigDecimal(practiceCourses.size()))).add(divide);
+        for (int i = 0; i < practiceCourses.size(); i++) {
+            CourseSchedule courseSchedule = practiceCourses.get(i);
             //课程与老师薪水表
             CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
             courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
@@ -3094,9 +3127,16 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             courseScheduleStudentPayment.setMusicGroupId(practiceGroupBuyParams.getId().toString());
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(practiceGroupBuyParams.getStudentId());
-            courseScheduleStudentPayment.setExpectPrice(studentSingleCourseCost);
-            courseScheduleStudentPayment.setActualPrice(studentSingleCourseCost);
-            courseScheduleStudentPayment.setOriginalPrice(studentSingleCourseOriginalCost);
+            if(i == 0){
+                courseScheduleStudentPayment.setExpectPrice(firstAmount);
+                courseScheduleStudentPayment.setActualPrice(firstAmount);
+            }else {
+                courseScheduleStudentPayment.setExpectPrice(divide);
+                courseScheduleStudentPayment.setActualPrice(divide);
+            }
+//            courseScheduleStudentPayment.setExpectPrice(oneMonthPrice);
+//            courseScheduleStudentPayment.setActualPrice(studentSingleCourseCost);
+            courseScheduleStudentPayment.setOriginalPrice(oneMonthPrice);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);
@@ -3133,24 +3173,6 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             }
             return BaseController.failed(HttpStatus.FOUND, errMessage);
         }
-        //使用优惠券
-        StudentPaymentOrder studentPaymentOrder = sysCouponCodeService.use(practiceGroupBuyParams.getCouponIdList(),amount,true);
-        amount = studentPaymentOrder.getActualAmount();
-        studentPaymentOrder.setUserId(practiceGroupBuyParams.getStudentId());
-        studentPaymentOrder.setGroupType(GroupType.PRACTICE);
-        String orderNo = idGeneratorService.generatorId("payment") + "";
-        studentPaymentOrder.setOrderNo(orderNo);
-        studentPaymentOrder.setStatus(DealStatusEnum.ING);
-        studentPaymentOrder.setType(OrderTypeEnum.PRACTICE_GROUP_BUY);
-        if (practiceGroupBuyParams.isRenew()) {
-            studentPaymentOrder.setType(OrderTypeEnum.PRACTICE_GROUP_RENEW);
-        }
-        studentPaymentOrder.setExpectAmount(amount);
-        studentPaymentOrder.setMusicGroupId(practiceGroupBuyParams.getId().toString());
-        studentPaymentOrder.setActualAmount(studentPaymentOrder.getExpectAmount());
-        studentPaymentOrder.setClassGroupId(classGroup.getId());
-        studentPaymentOrder.setVersion(0);
-        studentPaymentOrderService.insert(studentPaymentOrder);
 
         BigDecimal balance = BigDecimal.ZERO;
         if (practiceGroupBuyParams.isUseBalancePayment() || studentPaymentOrder.getExpectAmount().doubleValue() == 0) {
@@ -3257,7 +3279,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 
     @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
-    public HttpResponseResult createPackagePracticeGroup(PracticeGroupBuyDto practiceGroupBuyParams) {
+    public HttpResponseResult createPackagePracticeGroup(PracticeGroupBuyDto practiceGroupBuyParams, String operatorInfo) {
         studentDao.lockUser(practiceGroupBuyParams.getStudentId());
         if (Objects.isNull(practiceGroupBuyParams.getUserId())) {
             return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "请选择教师");
@@ -3439,6 +3461,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         practiceGroupBuyParams.setSingleClassMinutes(practiceCourseMinutes);
         practiceGroupBuyParams.setGroupStatus(GroupStatusEnum.LOCK);
         practiceGroupBuyParams.setType(PracticeGroupType.COME_ON_PACKAGE);
+        if(StringUtils.isNotBlank(operatorInfo)){
+        	practiceGroupBuyParams.setMemo(operatorInfo+",教务代买");
+        }
         practiceGroupDao.insert(practiceGroupBuyParams);
 
         //创建班级信息
@@ -3522,7 +3547,14 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         BigDecimal originalAmount = oneMonthOriginalPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
         BigDecimal studentSingleCourseOriginalCost=originalAmount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, ROUND_DOWN);
 
-        for (CourseSchedule courseSchedule : practiceCourses) {
+        //使用优惠券
+        StudentPaymentOrder studentPaymentOrder = sysCouponCodeService.use(practiceGroupBuyParams.getCouponIdList(),amount,true);
+        //实际支付金额,去除优惠券
+        BigDecimal actualPrice = studentPaymentOrder.getExpectAmount();
+        BigDecimal divide = actualPrice.divide(new BigDecimal(practiceCourses.size()), ROUND_DOWN);
+        BigDecimal firstAmount = actualPrice.subtract(divide.multiply(new BigDecimal(practiceCourses.size()))).add(divide);
+        for (int i = 0; i < practiceCourses.size(); i++) {
+            CourseSchedule courseSchedule = practiceCourses.get(i);
             //课程与老师薪水表
             CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
             courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
@@ -3542,8 +3574,13 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             courseScheduleStudentPayment.setMusicGroupId(practiceGroupBuyParams.getId().toString());
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(practiceGroupBuyParams.getStudentId());
-            courseScheduleStudentPayment.setExpectPrice(studentSingleCourseCost);
-            courseScheduleStudentPayment.setActualPrice(studentSingleCourseCost);
+            if(i == 0){
+                courseScheduleStudentPayment.setExpectPrice(firstAmount);
+                courseScheduleStudentPayment.setActualPrice(firstAmount);
+            }else {
+                courseScheduleStudentPayment.setExpectPrice(divide);
+                courseScheduleStudentPayment.setActualPrice(divide);
+            }
             courseScheduleStudentPayment.setOriginalPrice(studentSingleCourseOriginalCost);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setCreateTime(now);
@@ -3580,9 +3617,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             }
             return BaseController.failed(HttpStatus.FOUND, errMessage);
         }
-
-        //使用优惠券
-        StudentPaymentOrder studentPaymentOrder = sysCouponCodeService.use(practiceGroupBuyParams.getCouponIdList(),amount,true);
+        
         amount = studentPaymentOrder.getActualAmount();
         studentPaymentOrder.setUserId(practiceGroupBuyParams.getStudentId());
         studentPaymentOrder.setGroupType(GroupType.PRACTICE);
@@ -3598,6 +3633,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         studentPaymentOrder.setActualAmount(studentPaymentOrder.getExpectAmount());
         studentPaymentOrder.setClassGroupId(classGroup.getId());
         studentPaymentOrder.setVersion(0);
+        if(StringUtils.isNotBlank(operatorInfo)){
+        	studentPaymentOrder.setMemo(operatorInfo+",教务代买");
+        }
         studentPaymentOrderService.insert(studentPaymentOrder);
 
         BigDecimal balance = BigDecimal.ZERO;
@@ -4376,6 +4414,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         if(Objects.nonNull(practiceGroup.getType())&&(PracticeGroupType.CARE_PACKAGE.equals(practiceGroup.getType())||PracticeGroupType.COME_ON_PACKAGE.equals(practiceGroup.getType()))){
             practiceCourseMinutes = 50;
         }
+        
+        practiceBuyResult.setCourseNum(practiceGroup.getAllCourseNum());
 
         if(StringUtils.isNotEmpty(practiceGroup.getDrillTimesJson())){
             JSONArray coursesArry = new JSONArray();
@@ -4557,14 +4597,40 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
     }
 
     @Override
-    @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
-    public HttpResponseResult cancelWaitPayOrder(Integer userId, Integer groupId) {
+    @Transactional(rollbackFor = Exception.class)
+    public HttpResponseResult cancelWaitPayOrder(Integer userId, Integer groupId) throws Exception {
         PracticeGroup practiceGroup = practiceGroupDao.get(groupId.longValue());
         if (practiceGroup.getGroupStatus().equals(GroupStatusEnum.LOCK)) {
             groupService.deleteGroupOtherInfo(groupId.toString(), GroupType.PRACTICE);
             practiceGroup.setGroupStatus(GroupStatusEnum.CANCEL);
             practiceGroup.setMemo("用户手动取消");
             practiceGroupDao.update(practiceGroup);
+            
+			// 判断是否存在支付中的记录
+			List<StudentPaymentOrder> list = studentPaymentOrderService.queryByCondition(GroupType.PRACTICE, groupId + "", userId, DealStatusEnum.ING,
+					OrderTypeEnum.PRACTICE_GROUP_BUY);
+			
+			if (list.size() > 0) {
+				StudentPaymentOrder applyOrder = list.get(list.size() - 1);
+				// 查询订单状态
+				PayStatus payStatus = studentPaymentOrderService.queryPayStatus(applyOrder.getPaymentChannel(), applyOrder.getOrderNo(), applyOrder.getTransNo());
+				if(payStatus == PayStatus.SUCCESSED){
+					throw new BizException("订单已支付成功,请勿重复支付");
+				}/*else if(payStatus == PayStatus.PAYING){
+					throw new BizException("订单还在交易中,请稍后重试");
+				}*/
+				//处理关闭订单
+				applyOrder.setStatus(DealStatusEnum.CLOSE);
+				applyOrder.setMemo("主动关闭订单");
+				if (applyOrder.getBalancePaymentAmount() != null && applyOrder.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
+					sysUserCashAccountService.updateBalance(applyOrder.getUserId(), applyOrder.getBalancePaymentAmount(),
+							PlatformCashAccountDetailTypeEnum.REFUNDS, "购买网管课支付失败");
+				}
+				studentPaymentOrderService.update(applyOrder);
+				sysCouponCodeService.quit(applyOrder.getCouponCodeId());
+			}
+    		
+    		
         } else if (practiceGroup.getGroupStatus().equals(GroupStatusEnum.NORMAL)) {
             return BaseController.failed(HttpStatus.CREATED, "该订单已经支付成功");
         } else if (practiceGroup.getGroupStatus().equals(GroupStatusEnum.CANCEL)) {
@@ -5328,9 +5394,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             PayStatus payStatus = studentPaymentOrderService.queryPayStatus(applyOrder.getPaymentChannel(), applyOrder.getOrderNo(), applyOrder.getTransNo());
             if(payStatus == PayStatus.SUCCESSED){
                 throw new BizException("订单已支付成功,请勿重复支付");
-            }else if(payStatus == PayStatus.PAYING){
+            }/*else if(payStatus == PayStatus.PAYING){
                 throw new BizException("订单还在交易中,请稍后重试");
-            }
+            }*/
             if(!practiceGroupBuyParams.isRepeatPay()){
                 return BaseController.failed(HttpStatus.CONTINUE, "您有待支付的订单");
             }
@@ -5515,9 +5581,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             PayStatus payStatus = studentPaymentOrderService.queryPayStatus(order.getPaymentChannel(), order.getOrderNo(), order.getTransNo());
             if(payStatus == PayStatus.SUCCESSED){
                 throw new BizException("订单已支付成功,请勿重复支付");
-            }else if(payStatus == PayStatus.PAYING){
+            }/*else if(payStatus == PayStatus.PAYING){
                 throw new BizException("订单还在交易中,请稍后重试");
-            }
+            }*/
             if(practiceGroupBuyParams.isRepeatPay()){
                 //处理关闭订单
                 order.setStatus(DealStatusEnum.CLOSE);
@@ -5703,9 +5769,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             PayStatus payStatus = studentPaymentOrderService.queryPayStatus(order.getPaymentChannel(), order.getOrderNo(), order.getTransNo());
             if(payStatus == PayStatus.SUCCESSED){
                 throw new BizException("订单已支付成功,请勿重复支付");
-            }else if(payStatus == PayStatus.PAYING){
+            }/*else if(payStatus == PayStatus.PAYING){
                 throw new BizException("订单还在交易中,请稍后重试");
-            }
+            }*/
             if(buyDoubleEleven2021Dto.isRepeatPay()){
                 //处理关闭订单
                 order.setStatus(DealStatusEnum.CLOSE);

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

@@ -285,9 +285,9 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
                 if(payStatus != PayStatus.FAILED){
                 	if(payStatus == PayStatus.SUCCESSED){
                 		throw new BizException("订单已支付成功,请勿重复支付");
-                	}else if(payStatus == PayStatus.PAYING){
+                	}/*else if(payStatus == PayStatus.PAYING){
                 		throw new BizException("订单还在交易中,请稍后重试");
-                	}
+                	}*/
                 }
                 
                 oldOrder.setStatus(DealStatusEnum.FAILED);

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

@@ -137,9 +137,9 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
                 if(payStatus != PayStatus.FAILED){
                 	if(payStatus == PayStatus.SUCCESSED){
                 		throw new BizException("订单已支付成功,请勿重复支付");
-                	}else if(payStatus == PayStatus.PAYING){
+                	}/*else if(payStatus == PayStatus.PAYING){
                 		throw new BizException("订单还在交易中,请稍后重试");
-                	}
+                	}*/
                 }
                 
                 orderByOrderNo.setStatus(CLOSE);

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

@@ -143,9 +143,9 @@ public class SubjectChangeServiceImpl extends BaseServiceImpl<Integer, SubjectCh
                 if(payStatus != PayStatus.FAILED){
                 	if(payStatus == PayStatus.SUCCESSED){
                 		throw new BizException("订单已支付成功,请勿重复支付");
-                	}else if(payStatus == PayStatus.PAYING){
+                	}/*else if(payStatus == PayStatus.PAYING){
                 		throw new BizException("订单还在交易中,请稍后重试");
-                	}
+                	}*/
                 }
                 
                 studentPaymentOrder.setStatus(DealStatusEnum.CLOSE);

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

@@ -2630,9 +2630,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			PayStatus payStatus = studentPaymentOrderService.queryPayStatus(applyOrder.getPaymentChannel(), applyOrder.getOrderNo(), applyOrder.getTransNo());
 			if(payStatus == PayStatus.SUCCESSED){
 				throw new BizException("订单已支付成功,请勿重复支付");
-			}else if(payStatus == PayStatus.PAYING){
+			}/*else if(payStatus == PayStatus.PAYING){
 				throw new BizException("订单还在交易中,请稍后重试");
-			}
+			}*/
 			if(!vipGroupBuyParams.isRepeatPay()){
 				return BaseController.failed(HttpStatus.CONTINUE, "您有待支付的订单,是否继续支付");
 			}

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

@@ -27,6 +27,7 @@
         <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
         <result column="status_" jdbcType="TINYINT" property="status"/>
         <result column="activity_tag_" property="activityTag"/>
+        <result column="degree_type_" property="degreeType"/>
     </resultMap>
 
     <select id="get" parameterType="java.lang.Integer" resultMap="DegreeRegistration">
@@ -53,6 +54,9 @@
             <if test="status != null and status=='pay'">
                 AND status_ = 2
             </if>
+            <if test="degreeType != null">
+                AND degree_type_ = #{degreeType}
+            </if>
             <if test="id != null">
                 AND id_ = #{id}
             </if>
@@ -115,6 +119,12 @@
         <include refid="queryPageSql"/>
     </select>
 
+    <select id="countApplyNum" parameterType="map" resultType="int">
+        SELECT COUNT(DISTINCT user_id_)
+        FROM degree_registration
+        <include refid="queryPageSql"/>
+    </select>
+
     <delete id="delete" parameterType="java.lang.Integer">
         delete
         from degree_registration
@@ -127,13 +137,13 @@
         idcard_, city_, school_,
         subject_,level_, theory_level_,theory_money_, theory_cert_,mobile_,
         money_, memo_, create_time_,
-        update_time_, status_, activity_tag_)
+        update_time_, status_, activity_tag_,degree_type_)
         values (#{userId},#{sporadicId,jdbcType=INTEGER},#{organId,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR},
         #{idcard,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{school,jdbcType=VARCHAR},
         #{subject,jdbcType=VARCHAR},#{level,jdbcType=VARCHAR},
         #{theoryLevel,jdbcType=VARCHAR},#{theoryMoney,jdbcType=DECIMAL},
         #{theoryCert,jdbcType=VARCHAR},#{mobile,jdbcType=VARCHAR},#{money,jdbcType=DECIMAL}, #{memo,jdbcType=VARCHAR},
-        #{createTime}, #{updateTime}, #{status,jdbcType=TINYINT}, #{activityTag})
+        #{createTime}, #{updateTime}, #{status,jdbcType=TINYINT}, #{activityTag}, #{degreeType})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.DegreeRegistration">
         <!--@mbg.generated-->
@@ -142,6 +152,9 @@
             <if test="userId != null">
                 user_id_ = #{userId},
             </if>
+            <if test="degreeType != null">
+                degree_type_ = #{degreeType},
+            </if>
             <if test="organId != null">
                 organ_id_ = #{organId,jdbcType=INTEGER},
             </if>
@@ -214,6 +227,9 @@
                 <if test="degree.userId != null">
                     user_id_ = #{degree.userId},
                 </if>
+                <if test="degree.degreeType != null">
+                    degree_type_ = #{degree.degreeType},
+                </if>
                 <if test="degree.organId != null">
                     organ_id_ = #{degree.organId,jdbcType=INTEGER},
                 </if>
@@ -309,6 +325,9 @@
             <if test="degree.theoryLevel!=null">
                 AND theory_level_ = #{degree.theoryLevel}
             </if>
+            <if test="degree.degreeType != null">
+                AND degree_type_ = #{degree.degreeType}
+            </if>
     </select>
 
     <select id="getUserLevelDegrees" resultMap="DegreeRegistration">
@@ -318,5 +337,11 @@
             user_id_ = #{userId}
             AND activity_tag_=#{activityTag}
             AND (sporadic_id_ IS NOT NULL OR theory_level_ IS NOT NULL)
+            <if test="degreeType != null">
+                AND degree_type_ = #{degreeType}
+            </if>
+            <if test="sporadicId != null">
+                AND sporadic_id_ = #{sporadicId}
+            </if>
     </select>
 </mapper>

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

@@ -245,7 +245,7 @@
                  LEFT JOIN sys_user su ON pg.user_id_ = su.id_
                  LEFT JOIN `subject` s ON pg.subject_id_ = s.id_
         WHERE student_id_ = #{userId}
-          AND (pg.group_status_ = 'NORMAL' OR pg.group_status_ = 'LOCK')
+          AND (pg.group_status_ = 'LOCK')
           <if test="type!=null">
               AND pg.type_=#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
           </if>

+ 22 - 0
mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -607,6 +607,28 @@
             GROUP BY su.id_
     </select>
 
+    <select id="findTeaTeachersByOrganAndSubject4" resultMap="ExtendTeacherBasicDto">
+        SELECT
+            su.id_,
+            su.username_,
+            su.real_name_,
+            su.avatar_,
+            t.introduction_,
+            t.organ_id_,
+            t.is_support_extra_practice_lesson_,
+            GROUP_CONCAT(s.name_) subject_names_
+        FROM
+            teacher t
+            LEFT JOIN sys_user su ON t.id_ = su.id_
+            LEFT JOIN subject s ON FIND_IN_SET(s.id_,t.subject_id_)
+        WHERE
+            FIND_IN_SET(#{subjectId},t.subject_id_)
+            AND FIND_IN_SET(t.organ_id_,#{organIdList})
+            AND su.del_flag_=0 AND su.lock_flag_=0
+            AND t.is_support_extra_practice_lesson_=1
+            GROUP BY su.id_
+    </select>
+
     <select id="findTeacherByOrganAndSubject" resultMap="TeacherBasicDto">
         SELECT
             su.id_,

+ 32 - 20
mec-student/src/main/java/com/ym/mec/student/controller/DegreeController.java

@@ -6,31 +6,31 @@ 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.DegreeRegistrationActivityDto;
-import com.ym.mec.biz.dal.dto.SporadicPayDto;
 import com.ym.mec.biz.dal.entity.*;
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
 import com.ym.mec.biz.dal.page.SporadicChargeInfoQueryInfo;
 import com.ym.mec.biz.service.DegreeRegistrationService;
 import com.ym.mec.biz.service.SporadicChargeInfoService;
-import com.ym.mec.biz.service.StudentPaymentOrderService;
+import com.ym.mec.biz.service.SysConfigService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.util.idcard.IdcardValidator;
-import com.ym.mec.util.validator.CommonValidator;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpStatus;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.*;
+import java.util.stream.Collectors;
 
 @RequestMapping("degree")
 @Api(tags = "考级报名服务")
@@ -54,10 +54,16 @@ public class DegreeController extends BaseController {
 
     @Autowired
     private StudentDao studentDao;
+    
+    @Autowired
+    private SysConfigDao sysConfigDao;
 
     @Autowired
     private OrganizationDao organizationDao;
 
+	@Value("${message.debugMode: false}")
+	private boolean debugMode;
+
     @Autowired
     private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
 
@@ -72,7 +78,7 @@ public class DegreeController extends BaseController {
 
         if(Objects.nonNull(degreeRegistration.getSporadicId())&&Objects.nonNull(degreeRegistration.getTheoryLevel())){
             IdcardValidator idcardValidator = new IdcardValidator();
-            if (!idcardValidator.isValidatedAllIdcard(degreeRegistration.getIdcard())) {
+            if (!debugMode && !idcardValidator.isValidatedAllIdcard(degreeRegistration.getIdcard())) {
                 throw new BizException("身份证号不正确,请核对");
             }
             SporadicChargeInfo info = sporadicChargeInfoDao.get(degreeRegistration.getSporadicId());
@@ -86,8 +92,8 @@ public class DegreeController extends BaseController {
             degreeRegistration.setOrganId(user.getOrganId());
         }
 
-        if(Objects.isNull(degreeRegistration.getOrganId()) || degreeRegistration.getOrganId() != 40){
-            return failed("该分部暂未参与此活动");
+        if(Objects.isNull(degreeRegistration.getOrganId()) || degreeRegistration.getOrganId() == 4){
+            return failed("该分部暂未开放此活动");
         }
 
         return degreeRegistrationService.pay(degreeRegistration);
@@ -111,8 +117,8 @@ public class DegreeController extends BaseController {
             degreeRegistration.setOrganId(user.getOrganId());
         }
 
-        if(Objects.isNull(degreeRegistration.getOrganId()) || degreeRegistration.getOrganId() != 40){
-            return failed("该分部暂未参与此活动");
+        if(Objects.isNull(degreeRegistration.getOrganId()) || degreeRegistration.getOrganId() == 4){
+            return failed("该分部暂未开放此活动");
         }
 
         return degreeRegistrationService.theoryPay(degreeRegistration);
@@ -129,11 +135,12 @@ public class DegreeController extends BaseController {
         degreeRegistration.setUserId(user.getId());
         degreeRegistration.setActivityTag(DegreeRegistrationService.ACTIVITY_TAG);
         studentDao.getLocked(degreeRegistration.getUserId());
-        List<DegreeRegistration> userLevelDegrees = degreeRegistrationDao.getUserLevelDegrees(degreeRegistration.getUserId(), DegreeRegistrationService.ACTIVITY_TAG);
+        List<DegreeRegistration> userLevelDegrees = degreeRegistrationDao.getUserLevelDegrees(degreeRegistration.getUserId(),
+                DegreeRegistrationService.ACTIVITY_TAG,degreeRegistration.getDegreeType(),degreeRegistration.getSporadicId());
         long levelNum = userLevelDegrees.stream().filter(d -> Objects.nonNull(d.getSporadicId())&&d.getStatus().equals(2)).count();
         long theoryLevelNum = userLevelDegrees.stream().filter(d -> StringUtils.isNotBlank(d.getTheoryLevel())&&d.getStatus().equals(2)).count();
 
-        if(Objects.nonNull(degreeRegistration.getSporadicId())&&levelNum>0){
+        if(Objects.nonNull(degreeRegistration.getSporadicId()) && levelNum > 0){
             return failed(HttpStatus.CREATED, "您已报考过选择的考级项目");
         }
         if(StringUtils.isNotBlank(degreeRegistration.getTheoryLevel())&&theoryLevelNum>0){
@@ -172,18 +179,23 @@ public class DegreeController extends BaseController {
 
         Map<String, Object> result = new HashMap<>();
 
-        Student student = studentDao.get(user.getId());
+//        Student student = studentDao.get(user.getId());
         result.put("userInfo", user);
-        result.put("isNewUser", student.getIsNewUser());
-        result.put("organs", organizationDao.getActivityOrgans());
+        //result.put("isNewUser", student.getIsNewUser());
+        
+        SysConfig organConfig = sysConfigDao.findByParamName("degree_support_organ_list");
+        if(StringUtils.isNotEmpty(organConfig.getParanValue())){
+            List<Integer> userIds = Arrays.stream(organConfig.getParanValue().split(",")).mapToInt(Integer::valueOf).boxed().collect(Collectors.toList());
+            result.put("organs", organizationDao.findOrgans(userIds));
+        }
         result.put("sporadicChargeInfo", sporadicChargeInfoService.queryDetailPage(queryInfo));
 
-        List<DegreeRegistration> userLevelDegrees = degreeRegistrationDao.getUserLevelDegrees(user.getId(), DegreeRegistrationService.ACTIVITY_TAG);
-        long levelNum = userLevelDegrees.stream().filter(d -> Objects.nonNull(d.getSporadicId())&&d.getStatus().equals(2)).count();
-        long theoryLevelNum = userLevelDegrees.stream().filter(d -> StringUtils.isNotBlank(d.getTheoryLevel())&&d.getStatus().equals(2)).count();
+//        List<DegreeRegistration> userLevelDegrees = degreeRegistrationDao.getUserLevelDegrees(user.getId(), DegreeRegistrationService.ACTIVITY_TAG,2);
+//        long levelNum = userLevelDegrees.stream().filter(d -> Objects.nonNull(d.getSporadicId())&&d.getStatus().equals(2)).count();
+//        long theoryLevelNum = userLevelDegrees.stream().filter(d -> StringUtils.isNotBlank(d.getTheoryLevel())&&d.getStatus().equals(2)).count();
 
-        result.put("levelApplied", levelNum>0?1:0);
-        result.put("theoryLevelApplied", theoryLevelNum>0?1:0);
+//        result.put("levelApplied", levelNum>0?1:0);
+//        result.put("theoryLevelApplied", theoryLevelNum>0?1:0);
 
         List<StudentPaymentOrderDetail> historyOrderDetails = studentPaymentOrderDetailDao.getWithUserAndOrderType(user.getId(), OrderTypeEnum.DEGREE_REGISTRATION);
         int historyVipNum = 0, historyPracticeNum = 0, historyHighNum = 0;

+ 4 - 4
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -251,9 +251,9 @@ public class MusicGroupController extends BaseController {
                     PayStatus payStatus = studentPaymentOrderService.queryPayStatus(order.getPaymentChannel(), order.getOrderNo(), order.getTransNo());
                     if(payStatus == PayStatus.SUCCESSED){
                         throw new BizException("订单已支付成功,请勿重复支付");
-                    }else if(payStatus == PayStatus.PAYING){
+                    }/*else if(payStatus == PayStatus.PAYING){
                         throw new BizException("订单还在交易中,请稍后重试");
-                    }
+                    }*/
                     return failed(HttpStatus.CONTINUE, "您有待支付的订单");
                 }
             }
@@ -354,9 +354,9 @@ public class MusicGroupController extends BaseController {
             PayStatus payStatus = studentPaymentOrderService.queryPayStatus(applyOrder.getPaymentChannel(), applyOrder.getOrderNo(), applyOrder.getTransNo());
             if(payStatus == PayStatus.SUCCESSED){
         		throw new BizException("订单已支付成功,请勿重复支付");
-        	}else if(payStatus == PayStatus.PAYING){
+        	}/*else if(payStatus == PayStatus.PAYING){
         		throw new BizException("订单还在交易中,请稍后重试");
-        	}
+        	}*/
             return failed(HttpStatus.CONTINUE, "您有待支付的订单");
         }
         Map payMap = musicGroupService.pay(registerPayDto);

+ 5 - 3
mec-student/src/main/java/com/ym/mec/student/controller/PracticeGroupController.java

@@ -23,8 +23,10 @@ import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.http.HttpUtil;
 import com.yonge.log.model.AuditLogAnnotation;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.util.CollectionUtils;
@@ -262,9 +264,9 @@ public class PracticeGroupController extends BaseController {
         }
         practiceGroupBuyParams.setStudentId(sysUser.getId());
         if(Objects.isNull(practiceGroupBuyParams.getType())||PracticeGroupType.CHARGE.equals(practiceGroupBuyParams.getType())){
-            return practiceGroupService.buyPracticeGroup(practiceGroupBuyParams);
+            return practiceGroupService.buyPracticeGroup(practiceGroupBuyParams, null);
         }else{
-            return practiceGroupService.createPackagePracticeGroup(practiceGroupBuyParams);
+            return practiceGroupService.createPackagePracticeGroup(practiceGroupBuyParams, null);
         }
     }
 
@@ -423,7 +425,7 @@ public class PracticeGroupController extends BaseController {
     @ApiOperation("取消待支付的订单")
     @PostMapping(value = "/cancelWaitPayOrder")
     @AuditLogAnnotation(operateName = "取消待支付的订单")
-    public HttpResponseResult cancelWaitPayOrder(Integer groupId){
+    public HttpResponseResult cancelWaitPayOrder(Integer groupId) throws Exception{
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {
             return failed(HttpStatus.FORBIDDEN, "请登录");

+ 2 - 2
mec-student/src/main/java/com/ym/mec/student/controller/RepairController.java

@@ -66,9 +66,9 @@ public class RepairController extends BaseController {
                 PayStatus payStatus = studentPaymentOrderService.queryPayStatus(applyOrder.getPaymentChannel(), applyOrder.getOrderNo(), applyOrder.getTransNo());
                 if(payStatus == PayStatus.SUCCESSED){
             		throw new BizException("订单已支付成功,请勿重复支付");
-            	}else if(payStatus == PayStatus.PAYING){
+            	}/*else if(payStatus == PayStatus.PAYING){
             		throw new BizException("订单还在交易中,请稍后重试");
-            	}
+            	}*/
                 return failed(HttpStatus.CONTINUE, "您有待支付的订单");
             }
         }

+ 2 - 2
mec-student/src/main/java/com/ym/mec/student/controller/ReplacementInstrumentActivityController.java

@@ -174,9 +174,9 @@ public class ReplacementInstrumentActivityController extends BaseController {
             PayStatus payStatus = studentPaymentOrderService.queryPayStatus(applyOrder.getPaymentChannel(), applyOrder.getOrderNo(), applyOrder.getTransNo());
             if(payStatus == PayStatus.SUCCESSED){
         		throw new BizException("订单已支付成功,请勿重复支付");
-        	}else if(payStatus == PayStatus.PAYING){
+        	}/*else if(payStatus == PayStatus.PAYING){
         		throw new BizException("订单还在交易中,请稍后重试");
-        	}
+        	}*/
             return failed(HttpStatus.CONTINUE, "您有待支付的订单");
         }
         Map payMap = replacementInstrumentActivityService.pay(replacementPayDto);

+ 2 - 2
mec-student/src/main/java/com/ym/mec/student/controller/SporadicChargeInfoController.java

@@ -77,9 +77,9 @@ public class SporadicChargeInfoController extends BaseController {
                 PayStatus payStatus = studentPaymentOrderService.queryPayStatus(applyOrder.getPaymentChannel(), applyOrder.getOrderNo(), applyOrder.getTransNo());
                 if(payStatus == PayStatus.SUCCESSED){
             		throw new BizException("订单已支付成功,请勿重复支付");
-            	}else if(payStatus == PayStatus.PAYING){
+            	}/*else if(payStatus == PayStatus.PAYING){
             		throw new BizException("订单还在交易中,请稍后重试");
-            	}
+            	}*/
                 
                 return failed(HttpStatus.CONTINUE, "您有待支付的订单");
             }

+ 2 - 2
mec-student/src/main/java/com/ym/mec/student/controller/SubjectChangeController.java

@@ -54,9 +54,9 @@ public class SubjectChangeController extends BaseController {
             PayStatus payStatus = studentPaymentOrderService.queryPayStatus(applyOrder.getPaymentChannel(), applyOrder.getOrderNo(), applyOrder.getTransNo());
             if(payStatus == PayStatus.SUCCESSED){
         		throw new BizException("订单已支付成功,请勿重复支付");
-        	}else if(payStatus == PayStatus.PAYING){
+        	}/*else if(payStatus == PayStatus.PAYING){
         		throw new BizException("订单还在交易中,请稍后重试");
-        	}
+        	}*/
             return failed(HttpStatus.CONTINUE, "您有待支付的订单");
         }
         Map payMap = subjectChangeService.payChange(subjectChangeParamDto);

+ 10 - 10
mec-web/src/main/java/com/ym/mec/web/controller/DegreeController.java

@@ -42,17 +42,17 @@ public class DegreeController extends BaseController { ;
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-                return failed("用户所在分部异常");
-            }else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                    return failed("非法请求");
-                }
+        Employee employee = employeeDao.get(sysUser.getId());
+        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+            queryInfo.setOrganId(employee.getOrganIdList());
+        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
+            return failed("用户所在分部异常");
+        }else {
+            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
+                return failed("非法请求");
             }
+        }
         queryInfo.setSort("create_time_");
         queryInfo.setOrder("DESC");
         return succeed(degreeRegistrationService.getPageList(queryInfo));

+ 4 - 2
mec-web/src/main/java/com/ym/mec/web/controller/education/EduPracticeGroupController.java

@@ -19,8 +19,10 @@ import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.util.date.DateUtil;
 import com.yonge.log.model.AuditLogAnnotation;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
@@ -189,7 +191,7 @@ public class EduPracticeGroupController extends BaseController {
         }
         practiceGroupBuyParams.setEducationalTeacherId(sysUser.getId());
         if(Objects.isNull(practiceGroupBuyParams.getType())||PracticeGroupType.CHARGE.equals(practiceGroupBuyParams.getType())){
-            return eduPracticeGroupService.buyPracticeGroup(practiceGroupBuyParams, sysUser.getRealName()+"("+sysUser.getId()+")");
+            return practiceGroupService.buyPracticeGroup(practiceGroupBuyParams, sysUser.getRealName()+"("+sysUser.getId()+")");
         }else{
             return eduPracticeGroupService.createPackagePracticeGroup(practiceGroupBuyParams, sysUser.getRealName()+"("+sysUser.getId()+")");
         }
@@ -228,7 +230,7 @@ public class EduPracticeGroupController extends BaseController {
 
     @ApiOperation("取消待支付的订单")
     @PostMapping(value = "/cancelWaitPayOrder")
-    public HttpResponseResult cancelWaitPayOrder(Integer studentId,Integer groupId){
+    public HttpResponseResult cancelWaitPayOrder(Integer studentId,Integer groupId) throws Exception{
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {
             return failed(HttpStatus.FORBIDDEN, "请登录");