Browse Source

Merge branch 'master' into yonge

yonge 5 years ago
parent
commit
be63627286
26 changed files with 277 additions and 229 deletions
  1. 11 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentCompetitionDao.java
  2. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDetailDao.java
  3. 23 23
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentCompetition.java
  4. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/OrderDetailTypeEnum.java
  5. 13 12
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentCompetitionQueryInfo.java
  6. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentCompetitionService.java
  7. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderDetailService.java
  8. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java
  9. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  10. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java
  11. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CoursesGroupServiceImpl.java
  12. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/EduPracticeGroupServiceImpl.java
  13. 3 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java
  14. 88 130
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  15. 6 8
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  16. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectPlanServiceImpl.java
  17. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/OnlineMusicGroupServiceImpl.java
  18. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  19. 27 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCompetitionServiceImpl.java
  20. 11 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderDetailServiceImpl.java
  21. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  22. 31 27
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  23. 6 6
      mec-biz/src/main/resources/config/mybatis/StudentCompetitionMapper.xml
  24. 2 2
      mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml
  25. 4 2
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderDetailMapper.xml
  26. 7 1
      mec-web/src/main/java/com/ym/mec/web/controller/StudentCompetitionController.java

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

@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
+import java.util.Set;
 
 
 public interface StudentCompetitionDao extends BaseDAO<Long, StudentCompetition> {
 public interface StudentCompetitionDao extends BaseDAO<Long, StudentCompetition> {
 
 
@@ -29,5 +30,14 @@ public interface StudentCompetitionDao extends BaseDAO<Long, StudentCompetition>
      * @return java.util.List<com.ym.mec.biz.dal.dto.StudentCompetitionRankingDto>
      * @return java.util.List<com.ym.mec.biz.dal.dto.StudentCompetitionRankingDto>
      */
      */
     List<StudentCompetition> getWinnerList();
     List<StudentCompetition> getWinnerList();
-	
+
+    /**
+     * @describe 获取指定奖项级别的作品编号列表
+     * @author Joburgess
+     * @date 2020.11.10
+     * @param prizeLevel:
+     * @return java.util.Set<java.lang.Long>
+     */
+    Set<Long> getCompetitionsWithPrizeLevel(@Param("prizeLevel") Integer prizeLevel);
+
 }
 }

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

@@ -46,7 +46,7 @@ public interface StudentPaymentOrderDetailDao extends BaseDAO<Long, StudentPayme
      * @param status
      * @param status
      * @return
      * @return
      */
      */
-    List<StudentPaymentOrderDetail> findUserApplyOrder(@Param("userId") Integer userId, @Param("status") DealStatusEnum status);
+    List<StudentPaymentOrderDetail> findUserApplyOrder(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId, @Param("status") DealStatusEnum status);
 
 
     /**
     /**
      * 乐器采购清单明细
      * 乐器采购清单明细
@@ -68,10 +68,10 @@ public interface StudentPaymentOrderDetailDao extends BaseDAO<Long, StudentPayme
      * 获取对应商品类型总价
      * 获取对应商品类型总价
      *
      *
      * @param paymentOrderNo
      * @param paymentOrderNo
-     * @param type
+     * @param types
      * @return
      * @return
      */
      */
-    List<Map<Long, BigDecimal>> queryGoodsPrice(@Param("paymentOrderNo") List<Long> paymentOrderNo, @Param("type") String type);
+    List<Map<Long, BigDecimal>> queryGoodsPrice(@Param("paymentOrderNo") List<Long> paymentOrderNo, @Param("types") String types);
 
 
     /**
     /**
      * 获取订单商品
      * 获取订单商品

+ 23 - 23
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentCompetition.java

@@ -23,7 +23,7 @@ public class StudentCompetition {
 	private Integer age;
 	private Integer age;
 
 
 	@ApiModelProperty(value = "性别")
 	@ApiModelProperty(value = "性别")
-	private boolean gender;
+	private Boolean gender;
 
 
 	@ApiModelProperty(value = "年级")
 	@ApiModelProperty(value = "年级")
 	private String grade;
 	private String grade;
@@ -44,10 +44,10 @@ public class StudentCompetition {
 	private java.math.BigDecimal score;
 	private java.math.BigDecimal score;
 
 
 	@ApiModelProperty(value = "获奖等级")
 	@ApiModelProperty(value = "获奖等级")
-	private java.math.BigDecimal prizeLevel;
+	private Integer prizeLevel;
 
 
 	@ApiModelProperty(value = "是否展示")
 	@ApiModelProperty(value = "是否展示")
-	private boolean isShow;
+	private Boolean isShow;
 
 
 	@ApiModelProperty(value = "评价")
 	@ApiModelProperty(value = "评价")
 	private String comment;
 	private String comment;
@@ -95,15 +95,15 @@ public class StudentCompetition {
 	public Integer getAge(){
 	public Integer getAge(){
 		return this.age;
 		return this.age;
 	}
 	}
-			
-	public void setGender(boolean gender){
-		this.gender = gender;
+
+	public Boolean getGender() {
+		return gender;
 	}
 	}
-	
-	public boolean isGender(){
-		return this.gender;
+
+	public void setGender(Boolean gender) {
+		this.gender = gender;
 	}
 	}
-			
+
 	public void setGrade(String grade){
 	public void setGrade(String grade){
 		this.grade = grade;
 		this.grade = grade;
 	}
 	}
@@ -159,23 +159,23 @@ public class StudentCompetition {
 	public java.math.BigDecimal getScore(){
 	public java.math.BigDecimal getScore(){
 		return this.score;
 		return this.score;
 	}
 	}
-			
-	public void setPrizeLevel(java.math.BigDecimal prizeLevel){
-		this.prizeLevel = prizeLevel;
+
+	public Integer getPrizeLevel() {
+		return prizeLevel;
 	}
 	}
-	
-	public java.math.BigDecimal getPrizeLevel(){
-		return this.prizeLevel;
+
+	public void setPrizeLevel(Integer prizeLevel) {
+		this.prizeLevel = prizeLevel;
 	}
 	}
-			
-	public void setIsShow(boolean isShow){
-		this.isShow = isShow;
+
+	public Boolean getIsShow() {
+		return isShow;
 	}
 	}
-	
-	public boolean isIsShow(){
-		return this.isShow;
+
+	public void setIsShow(Boolean show) {
+		isShow = show;
 	}
 	}
-			
+
 	public void setComment(String comment){
 	public void setComment(String comment){
 		this.comment = comment;
 		this.comment = comment;
 	}
 	}

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/OrderDetailTypeEnum.java

@@ -22,7 +22,8 @@ public enum OrderDetailTypeEnum implements BaseEnum<String, OrderDetailTypeEnum>
     TRAINING_SINGLE("TRAINING_SINGLE", "集训单技课"),
     TRAINING_SINGLE("TRAINING_SINGLE", "集训单技课"),
     TRAINING_MIX("TRAINING_MIX", "集训合奏课"),
     TRAINING_MIX("TRAINING_MIX", "集训合奏课"),
     HIGH_ONLINE("HIGH_ONLINE", "网络基础训练课"),
     HIGH_ONLINE("HIGH_ONLINE", "网络基础训练课"),
-    MUSIC_NETWORK("MUSIC_NETWORK", "乐团网管课");
+    MUSIC_NETWORK("MUSIC_NETWORK", "乐团网管课"),
+    CLASSROOM("CLASSROOM", "课堂课");
 
 
 
 
     private String code;
     private String code;

+ 13 - 12
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentCompetitionQueryInfo.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.page;
 package com.ym.mec.biz.dal.page;
 
 
+import com.sun.org.apache.xpath.internal.operations.Bool;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 
 
@@ -13,7 +14,7 @@ import java.util.Date;
 public class StudentCompetitionQueryInfo extends QueryInfo {
 public class StudentCompetitionQueryInfo extends QueryInfo {
 
 
     @ApiModelProperty(value = "性别")
     @ApiModelProperty(value = "性别")
-    private boolean gender;
+    private Boolean gender;
 
 
     @ApiModelProperty(value = "年级")
     @ApiModelProperty(value = "年级")
     private String grade;
     private String grade;
@@ -28,21 +29,29 @@ public class StudentCompetitionQueryInfo extends QueryInfo {
     private Integer prizeLevel;
     private Integer prizeLevel;
 
 
     @ApiModelProperty(value = "是否展示")
     @ApiModelProperty(value = "是否展示")
-    private boolean isShow;
+    private Boolean isShow;
 
 
     @ApiModelProperty(value = "评价")
     @ApiModelProperty(value = "评价")
     private String comment;
     private String comment;
 
 
     private java.util.Date createTime;
     private java.util.Date createTime;
 
 
-    public boolean isGender() {
+    public Boolean getGender() {
         return gender;
         return gender;
     }
     }
 
 
-    public void setGender(boolean gender) {
+    public void setGender(Boolean gender) {
         this.gender = gender;
         this.gender = gender;
     }
     }
 
 
+    public Boolean getIsShow() {
+        return isShow;
+    }
+
+    public void setIsShow(Boolean show) {
+        isShow = show;
+    }
+
     public String getGrade() {
     public String getGrade() {
         return grade;
         return grade;
     }
     }
@@ -75,14 +84,6 @@ public class StudentCompetitionQueryInfo extends QueryInfo {
         this.prizeLevel = prizeLevel;
         this.prizeLevel = prizeLevel;
     }
     }
 
 
-    public boolean isShow() {
-        return isShow;
-    }
-
-    public void setShow(boolean show) {
-        isShow = show;
-    }
-
     public String getComment() {
     public String getComment() {
         return comment;
         return comment;
     }
     }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentCompetitionService.java

@@ -30,4 +30,13 @@ public interface StudentCompetitionService extends BaseService<Long, StudentComp
     List<StudentCompetitionRankingDto> getWinnerList();
     List<StudentCompetitionRankingDto> getWinnerList();
 
 
     StudentCompetition checkIsUpload(Integer userId);
     StudentCompetition checkIsUpload(Integer userId);
+
+    /**
+     * @describe 更新参赛作品信息
+     * @author Joburgess
+     * @date 2020.11.10
+     * @param studentCompetition:
+     * @return void
+     */
+    void updateCompetition(StudentCompetition studentCompetition);
 }
 }

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

@@ -55,7 +55,7 @@ public interface StudentPaymentOrderDetailService extends BaseService<Long, Stud
      * @param status
      * @param status
      * @return
      * @return
      */
      */
-    List<StudentPaymentOrderDetail>findUserApplyOrder(Integer userId,DealStatusEnum status);
+    List<StudentPaymentOrderDetail>findUserApplyOrder(Integer userId,String musicGroupId,DealStatusEnum status);
 
 
     /**
     /**
      * 乐器采购清单明细
      * 乐器采购清单明细

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

@@ -96,9 +96,9 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
     public boolean delClassGroupStudent(Integer userId, Integer classGroupId,Boolean quitMusicGroup) {
     public boolean delClassGroupStudent(Integer userId, Integer classGroupId,Boolean quitMusicGroup) {
         ClassGroup classGroup = classGroupService.get(classGroupId);
         ClassGroup classGroup = classGroupService.get(classGroupId);
         Integer studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(classGroupId);
         Integer studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(classGroupId);
-        if (!quitMusicGroup && classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) && studentNum <= 3) {
+        /*if (!quitMusicGroup && classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) && studentNum <= 3) {
             throw new BizException(classGroup.getName()+"(网络基础训练课班级)人数不能少于3,请调整");
             throw new BizException(classGroup.getName()+"(网络基础训练课班级)人数不能少于3,请调整");
-        }
+        }*/
 
 
         ClassGroupStudentMapper classStudentMapper = findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId, "NORMAL");
         ClassGroupStudentMapper classStudentMapper = findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId, "NORMAL");
         if (classStudentMapper == null) {
         if (classStudentMapper == null) {

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

@@ -1220,7 +1220,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 //                String[] studentNames = classGroupStudentMapperDao.findCourseStudentName(courseScheduleDto.getId().intValue());
 //                String[] studentNames = classGroupStudentMapperDao.findCourseStudentName(courseScheduleDto.getId().intValue());
                 List<StudentNameAndPhoneDto> courseStudentNameAndPhone = classGroupStudentMapperDao.findCourseStudentNameAndPhone(courseScheduleDto.getId().intValue());
                 List<StudentNameAndPhoneDto> courseStudentNameAndPhone = classGroupStudentMapperDao.findCourseStudentNameAndPhone(courseScheduleDto.getId().intValue());
                 if(!CollectionUtils.isEmpty(courseStudentNameAndPhone)){
                 if(!CollectionUtils.isEmpty(courseStudentNameAndPhone)){
-                    List<String> studentNames = courseStudentNameAndPhone.stream().map(StudentNameAndPhoneDto::getUserName).collect(Collectors.toList());
+                    List<String> studentNames = courseStudentNameAndPhone.stream().filter(s->Objects.nonNull(s)).map(StudentNameAndPhoneDto::getUserName).collect(Collectors.toList());
                     courseScheduleDto.setStudentNames(org.apache.commons.lang3.StringUtils.join(studentNames, ","));
                     courseScheduleDto.setStudentNames(org.apache.commons.lang3.StringUtils.join(studentNames, ","));
                     courseScheduleDto.setStudents(courseStudentNameAndPhone);
                     courseScheduleDto.setStudents(courseStudentNameAndPhone);
                 }
                 }

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

@@ -148,6 +148,7 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 					}
 					}
 				}
 				}
                 courseScheduleStudentPayment.setOriginalPrice(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice());
                 courseScheduleStudentPayment.setOriginalPrice(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice());
+				courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
 				courseScheduleStudentPayments.add(courseScheduleStudentPayment);
 				courseScheduleStudentPayments.add(courseScheduleStudentPayment);
 			}
 			}
 		}
 		}

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

@@ -715,6 +715,8 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(order.getUserId());
             courseScheduleStudentPayment.setUserId(order.getUserId());
             courseScheduleStudentPayment.setExpectPrice(singleCoursePrice);
             courseScheduleStudentPayment.setExpectPrice(singleCoursePrice);
+            courseScheduleStudentPayment.setOriginalPrice(singleCoursePrice);
+            courseScheduleStudentPayment.setActualPrice(singleCoursePrice);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayments.add(courseScheduleStudentPayment);
             courseScheduleStudentPayments.add(courseScheduleStudentPayment);
         }
         }

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

@@ -281,6 +281,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             throw new BizException("所在城市暂不参与此活动");
             throw new BizException("所在城市暂不参与此活动");
         }
         }
         BigDecimal oneMonthPrice;
         BigDecimal oneMonthPrice;
+        BigDecimal oneMonthOriginalPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
         if(practiceBuyActivityExpireDate.after(now)){
         if(practiceBuyActivityExpireDate.after(now)){
             oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceActivityPrice():practiceGroupSellPrice.getTwiceActivityPrice();
             oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceActivityPrice():practiceGroupSellPrice.getTwiceActivityPrice();
             if(!now.before(practicePromotionActivityStartDate)&&practiceGroupBuyParams.getBuyMonths()>=3&&studentExitChargePractices>0){
             if(!now.before(practicePromotionActivityStartDate)&&practiceGroupBuyParams.getBuyMonths()>=3&&studentExitChargePractices>0){
@@ -291,6 +292,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         }else{
         }else{
             oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
             oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
         }
         }
+        BigDecimal originalAmount = oneMonthOriginalPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
         BigDecimal amount= oneMonthPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
         BigDecimal amount= oneMonthPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
         if(!now.before(practicePromotionActivityStartDate)&&now.before(practiceBuyActivityExpireDate)&&studentExitChargePractices<=0){
         if(!now.before(practicePromotionActivityStartDate)&&now.before(practiceBuyActivityExpireDate)&&studentExitChargePractices<=0){
             amount= oneMonthPrice.multiply(new BigDecimal(1));
             amount= oneMonthPrice.multiply(new BigDecimal(1));
@@ -377,6 +379,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             teacherDefaultSalary=teacherDefaultPracticeGroupSalary.getMainTeacherSalary();
             teacherDefaultSalary=teacherDefaultPracticeGroupSalary.getMainTeacherSalary();
         }
         }
         BigDecimal studentSingleCourseCost=amount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
         BigDecimal studentSingleCourseCost=amount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
+        BigDecimal studentSingleCourseOriginalCost=originalAmount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
         for (CourseSchedule courseSchedule : practiceCourses) {
         for (CourseSchedule courseSchedule : practiceCourses) {
             //课程与老师薪水表
             //课程与老师薪水表
             CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
             CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
@@ -398,6 +401,8 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(practiceGroupBuyParams.getStudentId());
             courseScheduleStudentPayment.setUserId(practiceGroupBuyParams.getStudentId());
             courseScheduleStudentPayment.setExpectPrice(studentSingleCourseCost);
             courseScheduleStudentPayment.setExpectPrice(studentSingleCourseCost);
+            courseScheduleStudentPayment.setActualPrice(studentSingleCourseCost);
+            courseScheduleStudentPayment.setOriginalPrice(studentSingleCourseOriginalCost);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);
@@ -1078,6 +1083,8 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(practiceGroupBuyParams.getStudentId());
             courseScheduleStudentPayment.setUserId(practiceGroupBuyParams.getStudentId());
             courseScheduleStudentPayment.setExpectPrice(BigDecimal.ZERO);
             courseScheduleStudentPayment.setExpectPrice(BigDecimal.ZERO);
+            courseScheduleStudentPayment.setActualPrice(BigDecimal.ZERO);
+            courseScheduleStudentPayment.setOriginalPrice(BigDecimal.ZERO);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);

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

@@ -238,7 +238,9 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		if(musicGroupPaymentCalender == null){
 		if(musicGroupPaymentCalender == null){
 			throw new BizException("查询缴费信息失败");
 			throw new BizException("查询缴费信息失败");
 		}
 		}
-		
+		if(musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY){
+			throw new BizException("操作失败:报名缴费项不允许添加学员");
+		}
 		if (musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.AUDITING
 		if (musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.AUDITING
 				|| musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.REJECT) {
 				|| musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.REJECT) {
 			throw new BizException("当前缴费状态不能添加学生");
 			throw new BizException("当前缴费状态不能添加学生");
@@ -269,7 +271,6 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			musicGroupPaymentCalenderDetail.setUserId(studentId);
 			musicGroupPaymentCalenderDetail.setUserId(studentId);
 			musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
 			musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
 			musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
 			musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
-			
 			userMap.put(studentId, musicGroupPaymentCalenderDetail);
 			userMap.put(studentId, musicGroupPaymentCalenderDetail);
 			musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
 			musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
 		}
 		}

+ 88 - 130
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -41,8 +41,7 @@ import java.util.Map.Entry;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.SCHOOL;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.SCHOOL;
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY;
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_RENEW;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.*;
 
 
 @Service
 @Service
 public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalender> implements MusicGroupPaymentCalenderService {
 public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalender> implements MusicGroupPaymentCalenderService {
@@ -128,10 +127,12 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && musicGroupPaymentCalender.getPayUserType() == PayUserType.STUDENT) {
 		if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && musicGroupPaymentCalender.getPayUserType() == PayUserType.STUDENT) {
 			musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 			musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 		}
 		}
-		int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(), musicGroupPaymentCalender.getPaymentValidStartDate(),
-				musicGroupPaymentCalender.getPaymentValidEndDate(), null);
-		if (count > 0) {
-			throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
+		if(musicGroupPaymentCalender.getPaymentType() != ADD_STUDENT){
+			int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(), musicGroupPaymentCalender.getPaymentValidStartDate(),
+					musicGroupPaymentCalender.getPaymentValidEndDate(), null);
+			if (count > 0) {
+				throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
+			}
 		}
 		}
 		// 获取设置的课程
 		// 获取设置的课程
 		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalender
 		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalender
@@ -193,64 +194,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			
 			
 			//如果是进行中加学生
 			//如果是进行中加学生
 			if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
 			if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
-				String studentIdStr = musicGroupPaymentCalender.getStudentIds();
-				if (StringUtils.isNoneBlank(studentIdStr)) {
-					//计算总费用
-					BigDecimal totalPrice = new BigDecimal(0);
-					for(MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList){
-						totalPrice = totalPrice.add(musicGroupPaymentCalenderCourseSettings.getCourseCurrentPrice());
-					}
-					
-					List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
-					MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
-					
-					for (String studentId : studentIdStr.split(",")) {
-						// 学生加到calenderDetail
-						MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
-						musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
-						musicGroupPaymentCalenderDetail.setCreateTime(date);
-						musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice);
-						musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
-						musicGroupPaymentCalenderDetail.setUpdateTime(date);
-						musicGroupPaymentCalenderDetail.setUserId(Integer.parseInt(studentId));
-						musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
-						musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
-						
-						musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
-						
-						// 学生加课程明细
-						for(MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList){
-							if (courseSettings.getIsStudentOptional() == true) {
-								continue;
-							}
-							musicGroupPaymentStudentCourseDetail = new MusicGroupPaymentStudentCourseDetail();
-							musicGroupPaymentStudentCourseDetail.setCourseType(courseSettings.getCourseType());
-							musicGroupPaymentStudentCourseDetail.setCreateTime(date);
-							musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
-							musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderDetailId(musicGroupPaymentCalenderDetail.getId());
-							musicGroupPaymentStudentCourseDetail.setTotalCourseMinutes(courseSettings.getCourseTotalMinuties());
-							musicGroupPaymentStudentCourseDetail.setUpdateTime(date);
-							musicGroupPaymentStudentCourseDetail.setUsedCourseMinutes(0);
-							musicGroupPaymentStudentCourseDetail.setUserId(Integer.parseInt(studentId));
-							
-							musicGroupPaymentStudentCourseDetailList.add(musicGroupPaymentStudentCourseDetail);
-						}
-						
-						if(musicGroupPaymentStudentCourseDetailList.size() > 0){
-							musicGroupPaymentStudentCourseDetailDao.batchInsert(musicGroupPaymentStudentCourseDetailList);
-						}
-
-						// 学生加到班级
-						String classGroupIdStr = musicGroupPaymentCalender.getAttribute1();
-						if (StringUtils.isNotBlank(classGroupIdStr)) {
-							classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(studentId), classGroupIdStr, musicGroupPaymentCalenderCourseSettingsList);
-						}
-					}
-				}
+				addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettingsList);
 			}
 			}
 		}else {
 		}else {
             Set<Integer> roleIds = new HashSet<>(1);
             Set<Integer> roleIds = new HashSet<>(1);
-            roleIds.add(SysUserRole.SECTION_MANAGER);
+            roleIds.add(SysUserRole.ADMINISTRATOR);
             Organization organization = organizationDao.get(musicGroup.getOrganId());
             Organization organization = organizationDao.get(musicGroup.getOrganId());
             sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, "", organization.getName(),musicGroup.getName());
             sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, "", organization.getName(),musicGroup.getName());
 		}
 		}
@@ -266,9 +214,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 					musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 					musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 					// 记录操作日志
 					// 记录操作日志
 					musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 基础信息审核中)", sysUser.getId(), ""));
 					musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 基础信息审核中)", sysUser.getId(), ""));
-					Set<Integer> roleIds = new HashSet<>(1);
-					roleIds.add(SysUserRole.ADMINISTRATOR);
-					sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
 				}else{
 				}else{
 					musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT);
 					musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT);
 					// 记录操作日志
 					// 记录操作日志
@@ -352,10 +297,12 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && musicGroupPaymentCalender.getPayUserType() == PayUserType.STUDENT) {
 		if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && musicGroupPaymentCalender.getPayUserType() == PayUserType.STUDENT) {
 			musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 			musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 		}
 		}
-		int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(), musicGroupPaymentCalender.getPaymentValidStartDate(),
-				musicGroupPaymentCalender.getPaymentValidEndDate(), musicGroupPaymentCalender.getId());
-		if (count > 0) {
-			throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
+		if(musicGroupPaymentCalender.getPaymentType() != ADD_STUDENT){
+			int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(), musicGroupPaymentCalender.getPaymentValidStartDate(),
+					musicGroupPaymentCalender.getPaymentValidEndDate(), musicGroupPaymentCalender.getId());
+			if (count > 0) {
+				throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
+			}
 		}
 		}
 		
 		
 		//获取设置的课程
 		//获取设置的课程
@@ -416,60 +363,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			
 			
 			//如果是进行中加学生
 			//如果是进行中加学生
 			if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
 			if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
-				String studentIdStr = musicGroupPaymentCalender.getStudentIds();
-				if (StringUtils.isNoneBlank(studentIdStr)) {
-					//计算总费用
-					BigDecimal totalPrice = new BigDecimal(0);
-					for(MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList){
-						totalPrice = totalPrice.add(musicGroupPaymentCalenderCourseSettings.getCourseCurrentPrice());
-					}
-					
-					List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
-					MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
-					
-					for (String studentId : studentIdStr.split(",")) {
-						// 学生加到calenderDetail
-						MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
-						musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
-						musicGroupPaymentCalenderDetail.setCreateTime(date);
-						musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice);
-						musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
-						musicGroupPaymentCalenderDetail.setUpdateTime(date);
-						musicGroupPaymentCalenderDetail.setUserId(Integer.parseInt(studentId));
-						musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
-						musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
-						
-						musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
-						
-						// 学生加课程明细
-						for(MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList){
-							if (courseSettings.getIsStudentOptional() == true) {
-								continue;
-							}
-							musicGroupPaymentStudentCourseDetail = new MusicGroupPaymentStudentCourseDetail();
-							musicGroupPaymentStudentCourseDetail.setCourseType(courseSettings.getCourseType());
-							musicGroupPaymentStudentCourseDetail.setCreateTime(date);
-							musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
-							musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderDetailId(musicGroupPaymentCalenderDetail.getId());
-							musicGroupPaymentStudentCourseDetail.setTotalCourseMinutes(courseSettings.getCourseTotalMinuties());
-							musicGroupPaymentStudentCourseDetail.setUpdateTime(date);
-							musicGroupPaymentStudentCourseDetail.setUsedCourseMinutes(0);
-							musicGroupPaymentStudentCourseDetail.setUserId(Integer.parseInt(studentId));
-							
-							musicGroupPaymentStudentCourseDetailList.add(musicGroupPaymentStudentCourseDetail);
-						}
-						
-						if(musicGroupPaymentStudentCourseDetailList.size() > 0){
-							musicGroupPaymentStudentCourseDetailDao.batchInsert(musicGroupPaymentStudentCourseDetailList);
-						}
-
-						// 学生加到班级
-						String classGroupIdStr = musicGroupPaymentCalender.getAttribute1();
-						if(StringUtils.isNotBlank(classGroupIdStr)){
-							classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(studentId), classGroupIdStr, musicGroupPaymentCalenderCourseSettingsList);
-						}
-					}
-				}
+				addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettingsList);
 			}
 			}
 
 
 		}else {
 		}else {
@@ -522,6 +416,65 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		return musicGroupPaymentCalender.getId();
 		return musicGroupPaymentCalender.getId();
 	}
 	}
 
 
+	public void addStudent(MusicGroupPaymentCalender musicGroupPaymentCalender,List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList){
+		//如果是进行中加学生
+		Date date = new Date();
+		String studentIdStr = musicGroupPaymentCalender.getStudentIds();
+		if (StringUtils.isNoneBlank(studentIdStr)) {
+			//计算总费用
+			BigDecimal totalPrice = new BigDecimal(0);
+			for(MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList){
+				totalPrice = totalPrice.add(musicGroupPaymentCalenderCourseSettings.getCourseCurrentPrice());
+			}
+
+			List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
+			MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
+
+			for (String studentId : studentIdStr.split(",")) {
+				// 学生加到calenderDetail
+				MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
+				musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
+				musicGroupPaymentCalenderDetail.setCreateTime(date);
+				musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice);
+				musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
+				musicGroupPaymentCalenderDetail.setUpdateTime(date);
+				musicGroupPaymentCalenderDetail.setUserId(Integer.parseInt(studentId));
+				musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
+				musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
+
+				musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
+
+				// 学生加课程明细
+				for(MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList){
+					if (courseSettings.getIsStudentOptional() == true) {
+						continue;
+					}
+					musicGroupPaymentStudentCourseDetail = new MusicGroupPaymentStudentCourseDetail();
+					musicGroupPaymentStudentCourseDetail.setCourseType(courseSettings.getCourseType());
+					musicGroupPaymentStudentCourseDetail.setCreateTime(date);
+					musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
+					musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderDetailId(musicGroupPaymentCalenderDetail.getId());
+					musicGroupPaymentStudentCourseDetail.setTotalCourseMinutes(courseSettings.getCourseTotalMinuties());
+					musicGroupPaymentStudentCourseDetail.setUpdateTime(date);
+					musicGroupPaymentStudentCourseDetail.setUsedCourseMinutes(0);
+					musicGroupPaymentStudentCourseDetail.setUserId(Integer.parseInt(studentId));
+
+					musicGroupPaymentStudentCourseDetailList.add(musicGroupPaymentStudentCourseDetail);
+				}
+
+				if(musicGroupPaymentStudentCourseDetailList.size() > 0){
+					musicGroupPaymentStudentCourseDetailDao.batchInsert(musicGroupPaymentStudentCourseDetailList);
+				}
+
+				// 学生加到班级
+				String classGroupIdStr = musicGroupPaymentCalender.getAttribute1();
+				if(StringUtils.isNotBlank(classGroupIdStr)){
+					classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(studentId), classGroupIdStr, musicGroupPaymentCalenderCourseSettingsList);
+				}
+			}
+		}
+	}
+
 	@Override
 	@Override
 	public void autoUpdateMusicGroupStudentFeeStatus() {
 	public void autoUpdateMusicGroupStudentFeeStatus() {
 		Date date = new Date();
 		Date date = new Date();
@@ -653,6 +606,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				roleIds.add(SysUserRole.SECTION_MANAGER);
 				roleIds.add(SysUserRole.SECTION_MANAGER);
 				sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
 				sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
 			}
 			}
+		}else if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
+			List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(calenderId);
+			addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings);
 		}
 		}
 	}
 	}
 
 
@@ -841,18 +797,20 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		}
 		}
 		Date date = new Date();
 		Date date = new Date();
 		// 判断缴费开始时间、结束时间是否被其他缴费记录占用
 		// 判断缴费开始时间、结束时间是否被其他缴费记录占用
-		int count = musicGroupPaymentCalenderDao.queryIntersectionByPaymentDate(calender.getMusicGroupId(), paymentCalender.getStartPaymentDate(),
-				paymentCalender.getDeadlinePaymentDate(), paymentCalender.getId());
+//		int count = musicGroupPaymentCalenderDao.queryIntersectionByPaymentDate(calender.getMusicGroupId(), paymentCalender.getStartPaymentDate(),
+//				paymentCalender.getDeadlinePaymentDate(), paymentCalender.getId());
 		// String format = DateUtil.format(startTime, DateUtil.DEFAULT_PATTERN);
 		// String format = DateUtil.format(startTime, DateUtil.DEFAULT_PATTERN);
 		// String format1 = DateUtil.format(endTime, DateUtil.DEFAULT_PATTERN);
 		// String format1 = DateUtil.format(endTime, DateUtil.DEFAULT_PATTERN);
 		// int count = musicGroupPaymentCalenderDao.queryIntersectionByDate(calender.getMusicGroupId(), format,format1);
 		// int count = musicGroupPaymentCalenderDao.queryIntersectionByDate(calender.getMusicGroupId(), format,format1);
-		if (count > 0) {
+		/*if (count > 0) {
 			throw new BizException("缴费时间存在冲突,请修改缴费开始日期");
 			throw new BizException("缴费时间存在冲突,请修改缴费开始日期");
-		}
-		count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(calender.getMusicGroupId(), paymentCalender.getPayUserType(), paymentCalender.getPaymentValidStartDate(),
-				paymentCalender.getPaymentValidEndDate(), paymentCalender.getId());
-		if (count > 0) {
-			throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
+		}*/
+		if(paymentCalender.getPaymentType() != ADD_STUDENT){
+			int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(paymentCalender.getMusicGroupId(), paymentCalender.getPayUserType(), paymentCalender.getPaymentValidStartDate(),
+					paymentCalender.getPaymentValidEndDate(), paymentCalender.getId());
+			if (count > 0) {
+				throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
+			}
 		}
 		}
 		calender.setStartPaymentDate(paymentCalender.getStartPaymentDate());
 		calender.setStartPaymentDate(paymentCalender.getStartPaymentDate());
 		calender.setDeadlinePaymentDate(paymentCalender.getDeadlinePaymentDate());
 		calender.setDeadlinePaymentDate(paymentCalender.getDeadlinePaymentDate());

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

@@ -447,7 +447,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         //乐器及打包辅件
         //乐器及打包辅件
         List<MusicGroupSubjectGoodsGroup> goodsGroups = new ArrayList<>();
         List<MusicGroupSubjectGoodsGroup> goodsGroups = new ArrayList<>();
         if (studentRegistration.getTemporaryCourseFee() != null) {
         if (studentRegistration.getTemporaryCourseFee() != null) {
-            List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailService.findUserApplyOrder(studentRegistration.getUserId(), DealStatusEnum.WAIT_PAY);
+            List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailService.findUserApplyOrder(studentRegistration.getUserId(),studentRegistration.getMusicGroupId(), DealStatusEnum.WAIT_PAY);
             for (StudentPaymentOrderDetail orderDetail : orderDetails) {
             for (StudentPaymentOrderDetail orderDetail : orderDetails) {
                 if (orderDetail == null || orderDetail.getPrice() == null || orderDetail.getGoodsIdList() == null) {
                 if (orderDetail == null || orderDetail.getPrice() == null || orderDetail.getGoodsIdList() == null) {
                     continue;
                     continue;
@@ -665,7 +665,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         //乐器及打包辅件
         //乐器及打包辅件
         List<MusicGroupSubjectGoodsGroup> goodsGroups = new ArrayList<>();
         List<MusicGroupSubjectGoodsGroup> goodsGroups = new ArrayList<>();
         if (studentRegistration.getTemporaryCourseFee() != null) {
         if (studentRegistration.getTemporaryCourseFee() != null) {
-            List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailService.findUserApplyOrder(studentRegistration.getUserId(), DealStatusEnum.WAIT_PAY);
+            List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailService.findUserApplyOrder(studentRegistration.getUserId(),studentRegistration.getMusicGroupId(), DealStatusEnum.WAIT_PAY);
             for (StudentPaymentOrderDetail orderDetail : orderDetails) {
             for (StudentPaymentOrderDetail orderDetail : orderDetails) {
                 if (orderDetail == null || orderDetail.getPrice() == null || orderDetail.getGoodsIdList() == null) {
                 if (orderDetail == null || orderDetail.getPrice() == null || orderDetail.getGoodsIdList() == null) {
                     continue;
                     continue;
@@ -2072,7 +2072,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         MusicGroup musicGroup = subFeeSettingDto.getMusicGroup();
         MusicGroup musicGroup = subFeeSettingDto.getMusicGroup();
         if (group == null) {
         if (group == null) {
             throw new BizException("乐团信息不存在");
             throw new BizException("乐团信息不存在");
-        } else if (group.getSchoolId() != musicGroup.getSchoolId()) {
+        } else if (!group.getSchoolId().equals(musicGroup.getSchoolId())) {
             //如果已生成课表,那么修改未上课时教学点
             //如果已生成课表,那么修改未上课时教学点
             courseScheduleDao.updateCourseScheduleSchool("MUSIC", musicGroupId, musicGroup.getSchoolId());
             courseScheduleDao.updateCourseScheduleSchool("MUSIC", musicGroupId, musicGroup.getSchoolId());
         }
         }
@@ -2083,8 +2083,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         //缴费方式不同
         //缴费方式不同
         if ((group.getStatus().equals(MusicGroupStatusEnum.AUDIT_FAILED) || group.getStatus().equals(MusicGroupStatusEnum.DRAFT))
         if ((group.getStatus().equals(MusicGroupStatusEnum.AUDIT_FAILED) || group.getStatus().equals(MusicGroupStatusEnum.DRAFT))
                 && !group.getChargeTypeId().equals(musicGroup.getChargeTypeId())) {
                 && !group.getChargeTypeId().equals(musicGroup.getChargeTypeId())) {
-            //删除原有的乐团声部规划
-            musicGroupSubjectPlanDao.delByMusicGroupId(musicGroupId);
             //删除原有的声部商品组合
             //删除原有的声部商品组合
             musicGroupSubjectGoodsGroupDao.delByMusicGroupId(musicGroupId);
             musicGroupSubjectGoodsGroupDao.delByMusicGroupId(musicGroupId);
             //删除原有的缴费项目
             //删除原有的缴费项目
@@ -2140,9 +2138,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroup.setUpdateTime(date);
         musicGroup.setUpdateTime(date);
         musicGroupDao.update(musicGroup);
         musicGroupDao.update(musicGroup);
         //修改课程里面的教学点
         //修改课程里面的教学点
-        if (!group.getSchoolId().equals(musicGroup.getSchoolId())) {
-            courseScheduleDao.updateByMusicGroupId(musicGroupId, musicGroup.getSchoolId());
-        }
+//        if (!musicGroup.getSchoolId().equals(musicGroup.getSchoolId())) {
+//            courseScheduleDao.updateByMusicGroupId(musicGroupId, musicGroup.getSchoolId());
+//        }
         // 删除乐团付费主体列表
         // 删除乐团付费主体列表
         musicGroupPaymentEntitiesDao.delByGroupId(musicGroupId);
         musicGroupPaymentEntitiesDao.delByGroupId(musicGroupId);
         //批量新增
         //批量新增

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

@@ -182,7 +182,7 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
         //乐团乐器及辅件信息
         //乐团乐器及辅件信息
         List<MusicGroupSubjectGoodsGroup> goodsGroups = new ArrayList<>();
         List<MusicGroupSubjectGoodsGroup> goodsGroups = new ArrayList<>();
 
 
-        List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailDao.findUserApplyOrder(studentRegistration.getUserId(), DealStatusEnum.WAIT_PAY);
+        List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailDao.findUserApplyOrder(studentRegistration.getUserId(),musicGroupId, DealStatusEnum.WAIT_PAY);
         for (StudentPaymentOrderDetail orderDetail : orderDetails) {
         for (StudentPaymentOrderDetail orderDetail : orderDetails) {
             if (orderDetail == null || orderDetail.getGoodsIdList() == null || orderDetail.getGoodsIdList().isEmpty())
             if (orderDetail == null || orderDetail.getGoodsIdList() == null || orderDetail.getGoodsIdList().isEmpty())
                 continue;
                 continue;

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

@@ -222,6 +222,8 @@ public class OnlineMusicGroupServiceImpl implements OnlineMusicGroupService {
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(onlineMusicGroupCourseInfo.getStudentId());
             courseScheduleStudentPayment.setUserId(onlineMusicGroupCourseInfo.getStudentId());
             courseScheduleStudentPayment.setExpectPrice(studentSingleCourseCost);
             courseScheduleStudentPayment.setExpectPrice(studentSingleCourseCost);
+            courseScheduleStudentPayment.setOriginalPrice(studentSingleCourseCost);
+            courseScheduleStudentPayment.setActualPrice(studentSingleCourseCost);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -2003,6 +2003,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(practiceGroup.getStudentId());
             courseScheduleStudentPayment.setUserId(practiceGroup.getStudentId());
             courseScheduleStudentPayment.setExpectPrice(BigDecimal.ZERO);
             courseScheduleStudentPayment.setExpectPrice(BigDecimal.ZERO);
+            courseScheduleStudentPayment.setActualPrice(BigDecimal.ZERO);
+            courseScheduleStudentPayment.setOriginalPrice(BigDecimal.ZERO);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);
@@ -2992,6 +2994,11 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             teacherDefaultSalary = teacherDefaultPracticeGroupSalary.getMainTeacherSalary();
             teacherDefaultSalary = teacherDefaultPracticeGroupSalary.getMainTeacherSalary();
         }
         }
         BigDecimal studentSingleCourseCost = amount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
         BigDecimal studentSingleCourseCost = amount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.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, BigDecimal.ROUND_DOWN);
+
         for (CourseSchedule courseSchedule : practiceCourses) {
         for (CourseSchedule courseSchedule : practiceCourses) {
             //课程与老师薪水表
             //课程与老师薪水表
             CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
             CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
@@ -3013,6 +3020,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(practiceGroupBuyParams.getStudentId());
             courseScheduleStudentPayment.setUserId(practiceGroupBuyParams.getStudentId());
             courseScheduleStudentPayment.setExpectPrice(studentSingleCourseCost);
             courseScheduleStudentPayment.setExpectPrice(studentSingleCourseCost);
+            courseScheduleStudentPayment.setActualPrice(studentSingleCourseCost);
+            courseScheduleStudentPayment.setOriginalPrice(studentSingleCourseOriginalCost);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);

+ 27 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCompetitionServiceImpl.java

@@ -1,16 +1,13 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
-import cfca.sadk.org.bouncycastle.apache.bzip2.BZip2Constants;
 import com.ym.mec.biz.dal.dto.StudentCompetitionRankingDto;
 import com.ym.mec.biz.dal.dto.StudentCompetitionRankingDto;
 import com.ym.mec.biz.dal.page.StudentCompetitionQueryInfo;
 import com.ym.mec.biz.dal.page.StudentCompetitionQueryInfo;
-import com.ym.mec.biz.service.ContractService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import com.ym.mec.biz.dal.entity.StudentCompetition;
 import com.ym.mec.biz.dal.entity.StudentCompetition;
 import com.ym.mec.biz.service.StudentCompetitionService;
 import com.ym.mec.biz.service.StudentCompetitionService;
@@ -86,4 +83,31 @@ public class StudentCompetitionServiceImpl extends BaseServiceImpl<Long, Student
 		}
 		}
 		return winnerSimpleInfoList;
 		return winnerSimpleInfoList;
 	}
 	}
+
+	@Override
+	public void updateCompetition(StudentCompetition studentCompetition) {
+		if(Objects.nonNull(studentCompetition.getPrizeLevel())){
+			Set<Long> competitionsWithPrizeLevel = studentCompetitionDao.getCompetitionsWithPrizeLevel(studentCompetition.getPrizeLevel());
+			int maxPrizeLevelUserNum = 0;
+			switch (studentCompetition.getPrizeLevel()){
+				case 1:
+					maxPrizeLevelUserNum = 1;
+					break;
+				case 2:
+				case 3:
+					maxPrizeLevelUserNum = 12;
+					break;
+				case 4:
+					maxPrizeLevelUserNum = 24;
+					break;
+				case 5:
+					maxPrizeLevelUserNum = 50;
+					break;
+			}
+			if(competitionsWithPrizeLevel.size()>=maxPrizeLevelUserNum&&!competitionsWithPrizeLevel.contains(studentCompetition.getId())){
+				throw new BizException("该奖项名额已达上线");
+			}
+		}
+		studentCompetitionDao.update(studentCompetition);
+	}
 }
 }

+ 11 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderDetailServiceImpl.java

@@ -9,6 +9,7 @@ import com.ym.mec.biz.dal.dto.MusicalListDetailDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
 import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -44,6 +45,10 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
     private SubjectDao subjectDao;
     private SubjectDao subjectDao;
     @Autowired
     @Autowired
     private SubjectChangeDao subjectChangeDao;
     private SubjectChangeDao subjectChangeDao;
+    @Autowired
+    private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
+    @Autowired
+    private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
 
 
     @Override
     @Override
     public BaseDAO<Long, StudentPaymentOrderDetail> getDAO() {
     public BaseDAO<Long, StudentPaymentOrderDetail> getDAO() {
@@ -231,8 +236,8 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
     }
     }
 
 
     @Override
     @Override
-    public List<StudentPaymentOrderDetail> findUserApplyOrder(Integer userId, DealStatusEnum status) {
-        return studentPaymentOrderDetailDao.findUserApplyOrder(userId, status);
+    public List<StudentPaymentOrderDetail> findUserApplyOrder(Integer userId, String musicGroupId, DealStatusEnum status) {
+        return studentPaymentOrderDetailDao.findUserApplyOrder(userId, musicGroupId, status);
     }
     }
 
 
     @Override
     @Override
@@ -244,6 +249,9 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
         List<Long> paymentOrderNo = musicalListDetailDtos.stream().map(MusicalListDetailDto::getPaymentOrderId).collect(Collectors.toList());
         List<Long> paymentOrderNo = musicalListDetailDtos.stream().map(MusicalListDetailDto::getPaymentOrderId).collect(Collectors.toList());
         List<Integer> userIds = musicalListDetailDtos.stream().map(MusicalListDetailDto::getUserId).collect(Collectors.toList());
         List<Integer> userIds = musicalListDetailDtos.stream().map(MusicalListDetailDto::getUserId).collect(Collectors.toList());
         //商品名称
         //商品名称
+        MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderService.findByMusicGroupRegCalender(musicGroupId);
+        List<MusicGroupPaymentCalenderCourseSettings> courseSettings = musicGroupPaymentCalenderCourseSettingsDao.getWithPaymentCalender(musicGroupRegCalender.getId());
+        String courseTypes = courseSettings.stream().map(e -> e.getCourseType().getCode()).collect(Collectors.joining(","));
         MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
         MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
         Organization organization = organizationDao.get(musicGroup.getOrganId());
         Organization organization = organizationDao.get(musicGroup.getOrganId());
         Map<Long, String> goodsNameMap = MapUtil.convertIntegerMap(studentPaymentOrderDetailDao.queryGoodsNames(paymentOrderNo));
         Map<Long, String> goodsNameMap = MapUtil.convertIntegerMap(studentPaymentOrderDetailDao.queryGoodsNames(paymentOrderNo));
@@ -251,7 +259,7 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
         Map<Long, BigDecimal> expectAmountMap = MapUtil.convertIntegerMap(studentPaymentOrderDao.queryExpectAmount(paymentOrderNo));
         Map<Long, BigDecimal> expectAmountMap = MapUtil.convertIntegerMap(studentPaymentOrderDao.queryExpectAmount(paymentOrderNo));
         Map<Long, BigDecimal> musicalAmountMap = MapUtil.convertIntegerMap(studentPaymentOrderDetailDao.queryGoodsPrice(paymentOrderNo, "MUSICAL"));
         Map<Long, BigDecimal> musicalAmountMap = MapUtil.convertIntegerMap(studentPaymentOrderDetailDao.queryGoodsPrice(paymentOrderNo, "MUSICAL"));
         Map<Long, BigDecimal> accessoriesAmountMap = MapUtil.convertIntegerMap(studentPaymentOrderDetailDao.queryGoodsPrice(paymentOrderNo, "ACCESSORIES"));
         Map<Long, BigDecimal> accessoriesAmountMap = MapUtil.convertIntegerMap(studentPaymentOrderDetailDao.queryGoodsPrice(paymentOrderNo, "ACCESSORIES"));
-        Map<Long, BigDecimal> courseAmountMap = MapUtil.convertIntegerMap(studentPaymentOrderDetailDao.queryGoodsPrice(paymentOrderNo, "COURSE"));
+        Map<Long, BigDecimal> courseAmountMap = MapUtil.convertIntegerMap(studentPaymentOrderDetailDao.queryGoodsPrice(paymentOrderNo, courseTypes));
         Map<Long, String> purchaseTypeMap = MapUtil.convertIntegerMap(studentPaymentOrderDetailDao.queryPurchaseTypeMap(paymentOrderNo));
         Map<Long, String> purchaseTypeMap = MapUtil.convertIntegerMap(studentPaymentOrderDetailDao.queryPurchaseTypeMap(paymentOrderNo));
         Map<Integer, String> userSubjectMap = subjectDao.getRegisterSubject(musicGroupId, userIds).stream().collect(Collectors.toMap(StudentRegistration::getUserId, StudentRegistration::getSubjectName));
         Map<Integer, String> userSubjectMap = subjectDao.getRegisterSubject(musicGroupId, userIds).stream().collect(Collectors.toMap(StudentRegistration::getUserId, StudentRegistration::getSubjectName));
         List<StudentPaymentOrderDetail> details = studentPaymentOrderDetailDao.getOrderGoodies(paymentOrderNo);
         List<StudentPaymentOrderDetail> details = studentPaymentOrderDetailDao.getOrderGoodies(paymentOrderNo);

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

@@ -1955,6 +1955,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			courseScheduleStudentPayment.setCourseScheduleId(surplusCourseWithGroup.get(i).getId());
 			courseScheduleStudentPayment.setCourseScheduleId(surplusCourseWithGroup.get(i).getId());
 			courseScheduleStudentPayment.setUserId(studentRecoverInfo.getUserId());
 			courseScheduleStudentPayment.setUserId(studentRecoverInfo.getUserId());
 			courseScheduleStudentPayment.setExpectPrice(coursePrices.get(i));
 			courseScheduleStudentPayment.setExpectPrice(coursePrices.get(i));
+			courseScheduleStudentPayment.setActualPrice(coursePrices.get(i));
+			courseScheduleStudentPayment.setOriginalPrice(TeachModeEnum.ONLINE.equals(surplusCourseWithGroup.get(i))?vipGroup.getOnlineClassesUnitPrice():vipGroup.getOfflineClassesUnitPrice());
 			courseScheduleStudentPayment.setCreateTime(now);
 			courseScheduleStudentPayment.setCreateTime(now);
 			courseScheduleStudentPayment.setUpdateTime(now);
 			courseScheduleStudentPayment.setUpdateTime(now);
 			courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
 			courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
@@ -2836,8 +2838,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				courseScheduleStudentPayment.setUserId(studentId);
 				courseScheduleStudentPayment.setUserId(studentId);
                 if(vipGroupCourseSchedule.getTeachMode().equals(TeachModeEnum.OFFLINE)){
                 if(vipGroupCourseSchedule.getTeachMode().equals(TeachModeEnum.OFFLINE)){
 					courseScheduleStudentPayment.setExpectPrice(vipGroup.getOfflineClassesUnitPrice());
 					courseScheduleStudentPayment.setExpectPrice(vipGroup.getOfflineClassesUnitPrice());
+					courseScheduleStudentPayment.setOriginalPrice(vipGroup.getOfflineClassesUnitPrice());
                 }else if(vipGroupCourseSchedule.getTeachMode().equals(TeachModeEnum.ONLINE)){
                 }else if(vipGroupCourseSchedule.getTeachMode().equals(TeachModeEnum.ONLINE)){
 					courseScheduleStudentPayment.setExpectPrice(vipGroup.getOnlineClassesUnitPrice());
 					courseScheduleStudentPayment.setExpectPrice(vipGroup.getOnlineClassesUnitPrice());
+					courseScheduleStudentPayment.setOriginalPrice(vipGroup.getOnlineClassesUnitPrice());
                 }
                 }
 				if(hasGiveClass
 				if(hasGiveClass
 						&&vipGroup.getGiveTeachMode() == vipGroupCourseSchedule.getTeachMode()){
 						&&vipGroup.getGiveTeachMode() == vipGroupCourseSchedule.getTeachMode()){
@@ -2853,6 +2857,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				if(Objects.nonNull(discount)){
 				if(Objects.nonNull(discount)){
                     courseScheduleStudentPayment.setExpectPrice(courseScheduleStudentPayment.getExpectPrice().multiply(discount).setScale(CommonConstants.DECIMAL_FINAL_PLACE,BigDecimal.ROUND_HALF_UP));
                     courseScheduleStudentPayment.setExpectPrice(courseScheduleStudentPayment.getExpectPrice().multiply(discount).setScale(CommonConstants.DECIMAL_FINAL_PLACE,BigDecimal.ROUND_HALF_UP));
                 }
                 }
+				courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
 				courseScheduleStudentPayment.setCreateTime(now);
 				courseScheduleStudentPayment.setCreateTime(now);
 				courseScheduleStudentPayment.setUpdateTime(now);
 				courseScheduleStudentPayment.setUpdateTime(now);
 				courseScheduleStudentPayments.add(courseScheduleStudentPayment);
 				courseScheduleStudentPayments.add(courseScheduleStudentPayment);

+ 31 - 27
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -30,6 +30,7 @@
         <result column="payment_amount_" property="paymentAmount"/>
         <result column="payment_amount_" property="paymentAmount"/>
         <result column="attribute1_" property="attribute1"/>
         <result column="attribute1_" property="attribute1"/>
         <result column="attribute2_" property="attribute2"/>
         <result column="attribute2_" property="attribute2"/>
+        <result column="student_ids_" property="studentIds"/>
     </resultMap>
     </resultMap>
 
 
     <!-- 根据主键查询一条记录 -->
     <!-- 根据主键查询一条记录 -->
@@ -48,12 +49,12 @@
         INSERT INTO music_group_payment_calender
         INSERT INTO music_group_payment_calender
         (music_group_id_,music_group_organization_course_settings_id_,pay_user_type_,reject_reason_,start_payment_date_,deadline_payment_date_,status_,expect_num_,
         (music_group_id_,music_group_organization_course_settings_id_,pay_user_type_,reject_reason_,start_payment_date_,deadline_payment_date_,status_,expect_num_,
         actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,
         actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,
-        payment_pattern_,payment_type_,payment_amount_,batch_no_,audit_memo_,operator_,attribute1_,attribute2_)
+        payment_pattern_,payment_type_,payment_amount_,batch_no_,audit_memo_,operator_,attribute1_,attribute2_,student_ids_)
         VALUES(#{musicGroupId},#{musicGroupOrganizationCourseSettingId},#{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         VALUES(#{musicGroupId},#{musicGroupOrganizationCourseSettingId},#{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{rejectReason},#{startPaymentDate},#{deadlinePaymentDate},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{rejectReason},#{startPaymentDate},#{deadlinePaymentDate},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{expectNum},#{actualNum},#{memo},#{isGiveMusicNetwork},now(),now(),
         #{expectNum},#{actualNum},#{memo},#{isGiveMusicNetwork},now(),now(),
         #{paymentValidStartDate},#{paymentValidEndDate},#{paymentPattern},#{paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{paymentValidStartDate},#{paymentValidEndDate},#{paymentPattern},#{paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{paymentAmount},#{batchNo},#{auditMemo},#{operator},#{attribute1},#{attribute2})
+        #{paymentAmount},#{batchNo},#{auditMemo},#{operator},#{attribute1},#{attribute2},#{studentIds})
     </insert>
     </insert>
 
 
     <insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender" useGeneratedKeys="true"
     <insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender" useGeneratedKeys="true"
@@ -61,13 +62,13 @@
         INSERT INTO music_group_payment_calender
         INSERT INTO music_group_payment_calender
         (music_group_id_,music_group_organization_course_settings_id_,pay_user_type_,reject_reason_,start_payment_date_,deadline_payment_date_,status_,expect_num_,
         (music_group_id_,music_group_organization_course_settings_id_,pay_user_type_,reject_reason_,start_payment_date_,deadline_payment_date_,status_,expect_num_,
         actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,payment_amount_,
         actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,payment_amount_,
-        payment_type_,batch_no_,audit_memo_,operator_,attribute1_,attribute2_)
+        payment_type_,batch_no_,audit_memo_,operator_,attribute1_,attribute2_,student_ids_)
         VALUES
         VALUES
         <foreach collection="list" item="item" index="index" separator=",">
         <foreach collection="list" item="item" index="index" separator=",">
         (#{item.musicGroupId},#{item.musicGroupOrganizationCourseSettingId},#{item.payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.rejectReason},#{item.startPaymentDate},#{item.deadlinePaymentDate},#{item.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         (#{item.musicGroupId},#{item.musicGroupOrganizationCourseSettingId},#{item.payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.rejectReason},#{item.startPaymentDate},#{item.deadlinePaymentDate},#{item.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{item.expectNum},#{item.actualNum},#{item.memo},#{item.isGiveMusicNetwork},now(),now(),
         #{item.expectNum},#{item.actualNum},#{item.memo},#{item.isGiveMusicNetwork},now(),now(),
         #{item.paymentValidStartDate},#{item.paymentValidEndDate},#{item.paymentPattern},#{item.paymentAmount},#{item.paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{item.paymentValidStartDate},#{item.paymentValidEndDate},#{item.paymentPattern},#{item.paymentAmount},#{item.paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{item.batchNo},#{item.auditMemo},#{item.operator},#{item.attribute1},#{item.attribute2})
+        #{item.batchNo},#{item.auditMemo},#{item.operator},#{item.attribute1},#{item.attribute2},#{item.studentIds})
         </foreach>
         </foreach>
     </insert>
     </insert>
 
 
@@ -75,6 +76,9 @@
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender">
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender">
         UPDATE music_group_payment_calender
         UPDATE music_group_payment_calender
         <set>
         <set>
+            <if test="studentIds != null and studentIds != ''">
+                student_ids_ = #{studentIds},
+            </if>
             <if test="auditMemo != null and auditMemo != ''">
             <if test="auditMemo != null and auditMemo != ''">
                 audit_memo_ = #{auditMemo},
                 audit_memo_ = #{auditMemo},
             </if>
             </if>
@@ -144,6 +148,9 @@
 	    <foreach collection="list" item="item" index="index" open="" close="" separator=";">
 	    <foreach collection="list" item="item" index="index" open="" close="" separator=";">
 	        UPDATE music_group_payment_calender
 	        UPDATE music_group_payment_calender
 	        <set>
 	        <set>
+                <if test="item.studentIds != null and item.studentIds != ''">
+                    student_ids_ = #{item.studentIds},
+                </if>
                 <if test="item.paymentPattern != null">
                 <if test="item.paymentPattern != null">
                     payment_pattern_ = #{item.paymentPattern},
                     payment_pattern_ = #{item.paymentPattern},
                 </if>
                 </if>
@@ -212,35 +219,32 @@
     <!-- 分页查询 -->
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="MusicGroupPaymentCalender" parameterType="map">
     <select id="queryPage" resultMap="MusicGroupPaymentCalender" parameterType="map">
         SELECT * FROM music_group_payment_calender mgpc
         SELECT * FROM music_group_payment_calender mgpc
-        <where>
-        	<if test="musicGroupId != null">
-        		and mgpc.music_group_id_ = #{musicGroupId}
-        	</if>
-        	<if test="payUserType != null">
-        		and mgpc.pay_user_type_ = #{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-        	</if>
-        	<if test="status != null">
-        		and mgpc.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-        	</if>
-        </where>
+        <include refid="queryPageSql"/>
         ORDER BY mgpc.payment_valid_start_date_ DESC
         ORDER BY mgpc.payment_valid_start_date_ DESC
         <include refid="global.limit"/>
         <include refid="global.limit"/>
     </select>
     </select>
 
 
+    <sql id="queryPageSql">
+        <where>
+            <if test="musicGroupId != null">
+                AND mgpc.music_group_id_ = #{musicGroupId}
+            </if>
+            <if test="payUserType != null">
+                AND mgpc.pay_user_type_ = #{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+            <if test="paymentType != null">
+                AND mgpc.payment_type_ = #{paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+            <if test="status != null">
+                AND mgpc.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+        </where>
+    </sql>
+
     <!-- 查询当前表的总记录数 -->
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
     <select id="queryCount" resultType="int">
 		SELECT COUNT(mgpc.id_) FROM music_group_payment_calender mgpc
 		SELECT COUNT(mgpc.id_) FROM music_group_payment_calender mgpc
-        <where>
-        	<if test="musicGroupId != null">
-        		and mgpc.music_group_id_ = #{musicGroupId}
-        	</if>
-        	<if test="payUserType != null">
-        		and mgpc.pay_user_type_ = #{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-        	</if>
-        	<if test="status != null">
-        		and mgpc.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-        	</if>
-        </where>
+		<include refid="queryPageSql"/>
 	</select>
 	</select>
 	
 	
     <select id="findByMusicGroupId" resultMap="MusicGroupPaymentCalender">
     <select id="findByMusicGroupId" resultMap="MusicGroupPaymentCalender">
@@ -485,7 +489,7 @@
 		LEFT JOIN music_group_payment_calender mgpc ON mgpc.music_group_id_ = mg.id_
 		LEFT JOIN music_group_payment_calender mgpc ON mgpc.music_group_id_ = mg.id_
         LEFT JOIN music_group_payment_calender_detail mgpcd ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
         LEFT JOIN music_group_payment_calender_detail mgpcd ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
         AND mgpcd.user_id_ = #{userId} AND mgpcd.payment_status_ = 'NON_PAYMENT'
         AND mgpcd.user_id_ = #{userId} AND mgpcd.payment_status_ = 'NON_PAYMENT'
-        WHERE FIND_IN_SET(mg.id_,#{musicGroupId})
+        WHERE FIND_IN_SET(mg.id_,#{musicGroupId}) AND DATE_FORMAT(NOW(),'%Y-%m-%d') > DATE_FORMAT(mgpc.payment_valid_end_date_,'%Y-%m-%d')
         GROUP BY mg.id_
         GROUP BY mg.id_
     </select>
     </select>
 </mapper>
 </mapper>

+ 6 - 6
mec-biz/src/main/resources/config/mybatis/StudentCompetitionMapper.xml

@@ -1,9 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<!--
-这个文件是自动生成的。
-不要修改此文件。所有改动将在下次重新自动生成时丢失。
--->
 <mapper namespace="com.ym.mec.biz.dal.dao.StudentCompetitionDao">
 <mapper namespace="com.ym.mec.biz.dal.dao.StudentCompetitionDao">
 	
 	
 	<resultMap type="com.ym.mec.biz.dal.entity.StudentCompetition" id="StudentCompetition">
 	<resultMap type="com.ym.mec.biz.dal.entity.StudentCompetition" id="StudentCompetition">
@@ -28,7 +24,7 @@
 	
 	
 	<!-- 根据主键查询一条记录 -->
 	<!-- 根据主键查询一条记录 -->
 	<select id="get" resultMap="StudentCompetition" >
 	<select id="get" resultMap="StudentCompetition" >
-		SELECT * FROM student_competition WHERE id_ = #{id} FOR UPDATE
+		SELECT * FROM student_competition WHERE id_ = #{id}
 	</select>
 	</select>
 	
 	
 	<!-- 全查询 -->
 	<!-- 全查询 -->
@@ -149,10 +145,14 @@
 	</select>
 	</select>
 
 
 	<select id="getWinnerList" resultMap="StudentCompetition">
 	<select id="getWinnerList" resultMap="StudentCompetition">
-		SELECT * FROM student_competition WHERE is_show_ = 1 AND prize_level_ IS NOT NULL ORDER BY prize_level_
+		SELECT * FROM student_competition WHERE is_show_ = 1 AND prize_level_ &gt; 0 ORDER BY prize_level_,score_ DESC
 	</select>
 	</select>
 
 
 	<select id="getCompetitionWithUser" resultMap="StudentCompetition">
 	<select id="getCompetitionWithUser" resultMap="StudentCompetition">
 		SELECT * FROM student_competition WHERE user_id_ = #{userId}
 		SELECT * FROM student_competition WHERE user_id_ = #{userId}
 	</select>
 	</select>
+
+	<select id="getCompetitionsWithPrizeLevel" resultType="long">
+		SELECT id_ FROM student_competition WHERE prize_level_ = #{prizeLevel} FOR UPDATE
+	</select>
 </mapper>
 </mapper>

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

@@ -898,11 +898,11 @@
         LEFT JOIN student_registration sr ON sr.music_group_id_ = mgpc.music_group_id_
         LEFT JOIN student_registration sr ON sr.music_group_id_ = mgpc.music_group_id_
         LEFT JOIN sys_user su ON su.id_ = sr.user_id_
         LEFT JOIN sys_user su ON su.id_ = sr.user_id_
         LEFT JOIN `subject` s ON s.id_ = sr.subject_id_
         LEFT JOIN `subject` s ON s.id_ = sr.subject_id_
-        WHERE mgpc.id_ = #{musicGroupPaymentCalenderId} AND mgpc.music_group_id_ = #{musicGroupId} AND sr.music_group_status_ != 'QUIT' AND sr.user_id_ NOT IN (
+        WHERE mgpc.id_ = #{musicGroupPaymentCalenderId} AND mgpc.music_group_id_ = #{musicGroupId} AND sr.music_group_status_ = 'NORMAL' AND sr.user_id_ NOT IN (
         SELECT DISTINCT user_id_ FROM music_group_payment_calender_detail
         SELECT DISTINCT user_id_ FROM music_group_payment_calender_detail
         WHERE music_group_payment_calender_id_ = #{musicGroupPaymentCalenderId})
         WHERE music_group_payment_calender_id_ = #{musicGroupPaymentCalenderId})
         <if test="search != null and search != ''">
         <if test="search != null and search != ''">
-            AND sr.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%')
+            AND (sr.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%'))
         </if>
         </if>
         <if test="subjectId != null">
         <if test="subjectId != null">
             AND sr.subject_id_ = #{subjectId}
             AND sr.subject_id_ = #{subjectId}

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

@@ -138,6 +138,7 @@
         FROM student_payment_order spo
         FROM student_payment_order spo
                  LEFT JOIN student_payment_order_detail spod ON spo.id_ = spod.payment_order_id_
                  LEFT JOIN student_payment_order_detail spod ON spo.id_ = spod.payment_order_id_
         WHERE spo.user_id_ = #{userId}
         WHERE spo.user_id_ = #{userId}
+          AND spo.music_group_id_ = #{musicGroupId}
           AND spo.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
           AND spo.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
           AND spo.type_ = 'APPLY'
           AND spo.type_ = 'APPLY'
     </select>
     </select>
@@ -176,7 +177,8 @@
     </select>
     </select>
     <select id="queryGoodsPrice" resultType="java.util.Map">
     <select id="queryGoodsPrice" resultType="java.util.Map">
         SELECT spod.payment_order_id_ 'key' ,SUM(price_) 'value' FROM student_payment_order_detail spod
         SELECT spod.payment_order_id_ 'key' ,SUM(price_) 'value' FROM student_payment_order_detail spod
-        WHERE spod.type_ = #{type} AND spod.payment_order_id_ IN
+        WHERE FIND_IN_SET(spod.type_,#{types})
+        AND spod.payment_order_id_ IN
         <foreach collection="paymentOrderNo" open="(" close=")" separator="," item="item">
         <foreach collection="paymentOrderNo" open="(" close=")" separator="," item="item">
             #{item}
             #{item}
         </foreach>
         </foreach>
@@ -242,7 +244,7 @@
 
 
     <select id="getOrderGoodies" resultMap="StudentPaymentOrderDetail">
     <select id="getOrderGoodies" resultMap="StudentPaymentOrderDetail">
         SELECT spod.*,
         SELECT spod.*,
-        g.id_   goods_id_,
+        g.id_ goods_id_,
         g.name_ goods_name_,
         g.name_ goods_name_,
         g.group_purchase_price_,
         g.group_purchase_price_,
         g.discount_price_,
         g.discount_price_,

+ 7 - 1
mec-web/src/main/java/com/ym/mec/web/controller/StudentCompetitionController.java

@@ -5,6 +5,7 @@ import com.ym.mec.biz.dal.page.StudentCompetitionQueryInfo;
 import com.ym.mec.biz.service.StudentCompetitionService;
 import com.ym.mec.biz.service.StudentCompetitionService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
@@ -15,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import java.util.Objects;
+
 /**
 /**
  * @Author Joburgess
  * @Author Joburgess
  * @Date 2020.11.10
  * @Date 2020.11.10
@@ -37,7 +40,10 @@ public class StudentCompetitionController extends BaseController {
     @PostMapping("/update")
     @PostMapping("/update")
     @PreAuthorize("@pcs.hasPermissions('studentCompetition/update')")
     @PreAuthorize("@pcs.hasPermissions('studentCompetition/update')")
     public HttpResponseResult update(@RequestBody StudentCompetition studentCompetition){
     public HttpResponseResult update(@RequestBody StudentCompetition studentCompetition){
-        studentCompetitionService.update(studentCompetition);
+        if(Objects.isNull(studentCompetition.getId())){
+            throw new BizException("请指定参赛作品");
+        }
+        studentCompetitionService.updateCompetition(studentCompetition);
         return succeed();
         return succeed();
     }
     }