Browse Source

Merge remote-tracking branch 'origin/master'

Joburgess 5 years ago
parent
commit
ce25c5ed9d
32 changed files with 935 additions and 333 deletions
  1. 13 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ChargeTypeSubjectMapperDao.java
  2. 22 14
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/GoodsDao.java
  3. 10 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupOrganizationCourseSettingsDao.java
  4. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderCourseSettingsDao.java
  5. 31 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupGoodsAndDiscountDto.java
  6. 0 11
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroup.java
  7. 9 39
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java
  8. 125 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderCourseSettings.java
  9. 31 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SporadicChargeInfo.java
  10. 13 16
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/PaymentStatusEnum.java
  11. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/CourseSettingQueryInfo.java
  12. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupOrganizationCourseSettingsService.java
  13. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderCourseSettingsService.java
  14. 12 3
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupSubjectPlanService.java
  15. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupOrganizationCourseSettingsServiceImpl.java
  16. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderCourseSettingsServiceImpl.java
  17. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  18. 141 26
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  19. 34 14
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectPlanServiceImpl.java
  20. 24 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SporadicChargeInfoImpl.java
  21. 7 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  22. 0 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SubjectChangeServiceImpl.java
  23. 65 41
      mec-biz/src/main/resources/config/mybatis/ChargeTypeSubjectMapperMapper.xml
  24. 7 0
      mec-biz/src/main/resources/config/mybatis/GoodsMapper.xml
  25. 32 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupOrganizationCourseSettingsMapper.xml
  26. 98 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderCourseSettingsMapper.xml
  27. 7 7
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  28. 160 128
      mec-biz/src/main/resources/config/mybatis/SporadicChargeInfo.xml
  29. 3 3
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java
  30. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/ChargeTypeSubjectMapperController.java
  31. 7 0
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupOrganizationCourseSettingsController.java
  32. 17 3
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupSubjectPlanController.java

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

@@ -4,6 +4,7 @@ import java.util.List;
 
 
 import com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper;
 import com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
 
 
 public interface ChargeTypeSubjectMapperDao extends BaseDAO<Long, ChargeTypeSubjectMapper> {
 public interface ChargeTypeSubjectMapperDao extends BaseDAO<Long, ChargeTypeSubjectMapper> {
 
 
@@ -12,7 +13,16 @@ public interface ChargeTypeSubjectMapperDao extends BaseDAO<Long, ChargeTypeSubj
      */
      */
     void deleteByChargeTypeId(Integer chargeTypeId);
     void deleteByChargeTypeId(Integer chargeTypeId);
 
 
-	int batchInsert(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList);
-	
-	int batchUpdate(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList);
+    int batchInsert(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList);
+
+    int batchUpdate(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList);
+
+    /**
+     * 根据收费类型获取声部的折扣
+     *
+     * @param chargeTypeId
+     * @param subjectId
+     * @return
+     */
+    ChargeTypeSubjectMapper getSubjectDiscount(@Param("chargeTypeId") Integer chargeTypeId, @Param("subjectId") Integer subjectId);
 }
 }

+ 22 - 14
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/GoodsDao.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 package com.ym.mec.biz.dal.dao;
 
 
 import com.ym.mec.biz.dal.dto.GoodsSellDto;
 import com.ym.mec.biz.dal.dto.GoodsSellDto;
+import com.ym.mec.biz.dal.dto.MusicGroupGoodsAndDiscountDto;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
 
 
@@ -48,64 +49,65 @@ public interface GoodsDao extends BaseDAO<Integer, Goods> {
     void batchInsert(List<Goods> goodsList);
     void batchInsert(List<Goods> goodsList);
 
 
     /**
     /**
+     * @param goodsList:
+     * @return void
      * @describe 批量更新商品
      * @describe 批量更新商品
      * @author Joburgess
      * @author Joburgess
      * @date 2020.09.28
      * @date 2020.09.28
-     * @param goodsList:
-     * @return void
      */
      */
     void batchUpdate(@Param("goodsList") List<Goods> goodsList);
     void batchUpdate(@Param("goodsList") List<Goods> goodsList);
 
 
     /**
     /**
      * 获取商品列表
      * 获取商品列表
+     *
      * @param goodsIds
      * @param goodsIds
      * @return
      * @return
      */
      */
     List<Goods> getGoodies(@Param("goodsIds") List<Integer> goodsIds);
     List<Goods> getGoodies(@Param("goodsIds") List<Integer> goodsIds);
 
 
     /**
     /**
+     * @param goodsId:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.Goods>
      * @describe 查询附件商品列表中存在指定商品的商品
      * @describe 查询附件商品列表中存在指定商品的商品
      * @author Joburgess
      * @author Joburgess
      * @date 2020.10.12
      * @date 2020.10.12
-     * @param goodsId:
-     * @return java.util.List<com.ym.mec.biz.dal.entity.Goods>
      */
      */
     List<Goods> getWithComplementGoodsAndStatus(@Param("goodsId") Integer goodsId,
     List<Goods> getWithComplementGoodsAndStatus(@Param("goodsId") Integer goodsId,
                                                 @Param("status") Integer status);
                                                 @Param("status") Integer status);
 
 
     /**
     /**
+     * @param goodsIds:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.Goods>
      * @describe 锁定指定商品
      * @describe 锁定指定商品
      * @author Joburgess
      * @author Joburgess
      * @date 2020.10.12
      * @date 2020.10.12
-     * @param goodsIds:
-     * @return java.util.List<com.ym.mec.biz.dal.entity.Goods>
      */
      */
     List<Goods> lockGoods(@Param("goodsIds") List<Integer> goodsIds);
     List<Goods> lockGoods(@Param("goodsIds") List<Integer> goodsIds);
 
 
     /**
     /**
+     * @param sn:
+     * @return com.ym.mec.biz.dal.entity.Goods
      * @describe 根据货号查找商品
      * @describe 根据货号查找商品
      * @author Joburgess
      * @author Joburgess
      * @date 2020.10.10
      * @date 2020.10.10
-     * @param sn:
-     * @return com.ym.mec.biz.dal.entity.Goods
      */
      */
     Goods findBySn(@Param("sn") String sn);
     Goods findBySn(@Param("sn") String sn);
 
 
     /**
     /**
+     * @param sn:
+     * @return com.ym.mec.biz.dal.entity.Goods
      * @describe 根据货号锁定商品
      * @describe 根据货号锁定商品
      * @author Joburgess
      * @author Joburgess
      * @date 2020.10.15
      * @date 2020.10.15
-     * @param sn:
-     * @return com.ym.mec.biz.dal.entity.Goods
      */
      */
     Goods lockBySn(@Param("sn") String sn);
     Goods lockBySn(@Param("sn") String sn);
 
 
     /**
     /**
+     * @param sns:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.Goods>
      * @describe 根据货号查找商品
      * @describe 根据货号查找商品
      * @author Joburgess
      * @author Joburgess
      * @date 2020.09.28
      * @date 2020.09.28
-     * @param sns:
-     * @return java.util.List<com.ym.mec.biz.dal.entity.Goods>
      */
      */
     List<Goods> findBySns(@Param("sns") List<String> sns);
     List<Goods> findBySns(@Param("sns") List<String> sns);
 
 
@@ -114,13 +116,19 @@ public interface GoodsDao extends BaseDAO<Integer, Goods> {
     String getOuterRepertoryWarnName(@Param("outerRepertoryWarnNum") String outerRepertoryWarnNum);
     String getOuterRepertoryWarnName(@Param("outerRepertoryWarnNum") String outerRepertoryWarnNum);
 
 
     /**
     /**
+     * @param goodsId:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.GoodsSellDto>
      * @describe 获取商品辅件列表
      * @describe 获取商品辅件列表
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
      * @author zouxuan
      * @author zouxuan
      * @date 2020/10/13
      * @date 2020/10/13
      * @time 15:09
      * @time 15:09
-     * @param goodsId:
-     * @return java.util.List<com.ym.mec.biz.dal.dto.GoodsSellDto>
      */
      */
     List<GoodsSellDto> queryGoodsSellDtos(@Param("goodsId") String goodsId);
     List<GoodsSellDto> queryGoodsSellDtos(@Param("goodsId") String goodsId);
+
+    /**
+     * 获取乐团的商品
+     * @return
+     */
+    List<MusicGroupGoodsAndDiscountDto> getMusicGroupGoodsAndDiscount(@Param("subjectId") Integer subjectId, @Param("type") String type);
 }
 }

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

@@ -2,8 +2,17 @@ package com.ym.mec.biz.dal.dao;
 
 
 import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
 import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
 
 
-public interface MusicGroupOrganizationCourseSettingsDao extends BaseDAO<Integer, MusicGroupOrganizationCourseSettings> {
+import java.util.List;
 
 
+public interface MusicGroupOrganizationCourseSettingsDao extends BaseDAO<Integer, MusicGroupOrganizationCourseSettings> {
 
 
+    /**
+     * 获取设置详情
+     *
+     * @param id
+     * @return
+     */
+    MusicGroupOrganizationCourseSettings getSetting(@Param("id") Integer id);
 }
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderCourseSettingsDao.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface MusicGroupPaymentCalenderCourseSettingsDao extends BaseDAO<Integer, MusicGroupPaymentCalenderCourseSettings> {
+
+	
+}

+ 31 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupGoodsAndDiscountDto.java

@@ -0,0 +1,31 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.Goods;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+
+public class MusicGroupGoodsAndDiscountDto extends Goods {
+
+    @ApiModelProperty(value = "折扣", required = true)
+    private BigDecimal discountRate = BigDecimal.ONE;
+
+    @ApiModelProperty(value = "折扣金额", required = true)
+    private BigDecimal musicGroupDiscountPrice = BigDecimal.ZERO;
+
+    public BigDecimal getDiscountRate() {
+        return discountRate;
+    }
+
+    public void setDiscountRate(BigDecimal discountRate) {
+        this.discountRate = discountRate;
+    }
+
+    public BigDecimal getMusicGroupDiscountPrice() {
+        return musicGroupDiscountPrice;
+    }
+
+    public void setMusicGroupDiscountPrice(BigDecimal musicGroupDiscountPrice) {
+        this.musicGroupDiscountPrice = musicGroupDiscountPrice;
+    }
+}

+ 0 - 11
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroup.java

@@ -7,7 +7,6 @@ import java.util.Date;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
 import com.ym.mec.biz.dal.entity.CooperationOrgan.OwnershipType;
 import com.ym.mec.biz.dal.entity.CooperationOrgan.OwnershipType;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.FeeType;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
 import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
@@ -159,8 +158,6 @@ public class MusicGroup {
 	
 	
 	private OwnershipType ownershipType;
 	private OwnershipType ownershipType;
 	
 	
-	private FeeType feeType;
-	
 	private Boolean delFlag;
 	private Boolean delFlag;
 
 
 	private String subjectName;
 	private String subjectName;
@@ -519,14 +516,6 @@ public class MusicGroup {
 		this.ownershipType = ownershipType;
 		this.ownershipType = ownershipType;
 	}
 	}
 
 
-	public FeeType getFeeType() {
-		return feeType;
-	}
-
-	public void setFeeType(FeeType feeType) {
-		this.feeType = feeType;
-	}
-
 	public Boolean getDelFlag() {
 	public Boolean getDelFlag() {
 		return delFlag;
 		return delFlag;
 	}
 	}

+ 9 - 39
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java

@@ -1,49 +1,19 @@
 package com.ym.mec.biz.dal.entity;
 package com.ym.mec.biz.dal.entity;
 
 
-import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
-import com.ym.mec.common.enums.BaseEnum;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
-import java.util.Date;
+import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
 
 
 /**
 /**
  * 对应数据库表(music_group_payment_calender):
  * 对应数据库表(music_group_payment_calender):
  */
  */
 public class MusicGroupPaymentCalender implements Comparable<MusicGroupPaymentCalender> {
 public class MusicGroupPaymentCalender implements Comparable<MusicGroupPaymentCalender> {
 
 
-	public enum FeeType implements BaseEnum<String, FeeType> {
-
-		OFFLINE("OFFLINE", "线下"), ONLINE("ONLINE", "线上"), ALL("ALL", "线上/线下");
-
-		private String code;
-
-		private String msg;
-
-		FeeType(String code, String msg) {
-			this.code = code;
-			this.msg = msg;
-		}
-
-		public void setCode(String code) {
-			this.code = code;
-		}
-
-		public String getMsg() {
-			return msg;
-		}
-
-		public void setMsg(String msg) {
-			this.msg = msg;
-		}
-
-		@Override
-		public String getCode() {
-			return code;
-		}
-	}
-
 	private Long id;
 	private Long id;
 
 
 	@ApiModelProperty(value = "乐团编号", required = false)
 	@ApiModelProperty(value = "乐团编号", required = false)
@@ -78,7 +48,7 @@ public class MusicGroupPaymentCalender implements Comparable<MusicGroupPaymentCa
 
 
 	private String memo;
 	private String memo;
 
 
-	private FeeType type;
+	private Boolean isGiveMusicNetwork;
 
 
 	private java.util.Date createTime;
 	private java.util.Date createTime;
 
 
@@ -218,12 +188,12 @@ public class MusicGroupPaymentCalender implements Comparable<MusicGroupPaymentCa
 		this.memo = memo;
 		this.memo = memo;
 	}
 	}
 
 
-	public FeeType getType() {
-		return type;
+	public Boolean getIsGiveMusicNetwork() {
+		return isGiveMusicNetwork;
 	}
 	}
 
 
-	public void setType(FeeType type) {
-		this.type = type;
+	public void setIsGiveMusicNetwork(Boolean isGiveMusicNetwork) {
+		this.isGiveMusicNetwork = isGiveMusicNetwork;
 	}
 	}
 
 
 	@Override
 	@Override

+ 125 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderCourseSettings.java

@@ -0,0 +1,125 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(music_group_payment_calender_course_settings):
+ */
+public class MusicGroupPaymentCalenderCourseSettings {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private Integer musicGroupPaymentCalenderId;
+	
+	/** 课程类型 */
+	private String courseType;
+	
+	/** 课程总时间 */
+	private String courseTotalMinuties;
+	
+	/** 单价 */
+	private java.math.BigDecimal unitPrice;
+	
+	/** 课程原价 */
+	private java.math.BigDecimal courseOriginalPrice;
+	
+	/** 课程现价 */
+	private java.math.BigDecimal courseCurrentPrice;
+	
+	/** 是否学生可选 */
+	private boolean isStudentOptional;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setMusicGroupPaymentCalenderId(Integer musicGroupPaymentCalenderId){
+		this.musicGroupPaymentCalenderId = musicGroupPaymentCalenderId;
+	}
+	
+	public Integer getMusicGroupPaymentCalenderId(){
+		return this.musicGroupPaymentCalenderId;
+	}
+			
+	public void setCourseType(String courseType){
+		this.courseType = courseType;
+	}
+	
+	public String getCourseType(){
+		return this.courseType;
+	}
+			
+	public void setCourseTotalMinuties(String courseTotalMinuties){
+		this.courseTotalMinuties = courseTotalMinuties;
+	}
+	
+	public String getCourseTotalMinuties(){
+		return this.courseTotalMinuties;
+	}
+			
+	public void setUnitPrice(java.math.BigDecimal unitPrice){
+		this.unitPrice = unitPrice;
+	}
+	
+	public java.math.BigDecimal getUnitPrice(){
+		return this.unitPrice;
+	}
+			
+	public void setCourseOriginalPrice(java.math.BigDecimal courseOriginalPrice){
+		this.courseOriginalPrice = courseOriginalPrice;
+	}
+	
+	public java.math.BigDecimal getCourseOriginalPrice(){
+		return this.courseOriginalPrice;
+	}
+			
+	public void setCourseCurrentPrice(java.math.BigDecimal courseCurrentPrice){
+		this.courseCurrentPrice = courseCurrentPrice;
+	}
+	
+	public java.math.BigDecimal getCourseCurrentPrice(){
+		return this.courseCurrentPrice;
+	}
+			
+	public void setIsStudentOptional(boolean isStudentOptional){
+		this.isStudentOptional = isStudentOptional;
+	}
+	
+	public boolean isIsStudentOptional(){
+		return this.isStudentOptional;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 31 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SporadicChargeInfo.java

@@ -63,6 +63,13 @@ public class SporadicChargeInfo {
 	@ApiModelProperty(value = "所属乐团名称", required = true)
 	@ApiModelProperty(value = "所属乐团名称", required = true)
 	private String musicGroupName;
 	private String musicGroupName;
 
 
+	@ApiModelProperty(value = "缴费最大人数", required = true)
+	private Integer maxNum;
+
+	private Integer paidNum;
+
+	private Integer version;
+
 	public String getMusicGroupName() {
 	public String getMusicGroupName() {
 		return musicGroupName;
 		return musicGroupName;
 	}
 	}
@@ -230,4 +237,28 @@ public class SporadicChargeInfo {
 	public void setOrderType(String orderType) {
 	public void setOrderType(String orderType) {
 		this.orderType = orderType;
 		this.orderType = orderType;
 	}
 	}
+
+	public Integer getMaxNum() {
+		return maxNum;
+	}
+
+	public void setMaxNum(Integer maxNum) {
+		this.maxNum = maxNum;
+	}
+
+	public Integer getPaidNum() {
+		return paidNum;
+	}
+
+	public void setPaidNum(Integer paidNum) {
+		this.paidNum = paidNum;
+	}
+
+	public Integer getVersion() {
+		return version;
+	}
+
+	public void setVersion(Integer version) {
+		this.version = version;
+	}
 }
 }

+ 13 - 16
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/PaymentStatusEnum.java

@@ -2,27 +2,24 @@ package com.ym.mec.biz.dal.enums;
 
 
 import com.ym.mec.common.enums.BaseEnum;
 import com.ym.mec.common.enums.BaseEnum;
 
 
-public enum PaymentStatusEnum implements BaseEnum<Integer, PaymentStatusEnum> {
-	NO(0,"未开启缴费"),
-	OPEN(1,"开启缴费"),
-	YES(2,"已缴费");
-
-	private Integer code;
-
-	private String desc;
-
-	PaymentStatusEnum(Integer code, String desc) {
-		this.code = code;
+public enum PaymentStatusEnum implements BaseEnum<String, PaymentStatusEnum> {
+	NO("未开启缴费"),
+	OPEN("开启缴费"),
+	OVER("已结束");
+	
+	PaymentStatusEnum(String desc){
 		this.desc = desc;
 		this.desc = desc;
 	}
 	}
 
 
-	@Override
-	public Integer getCode() {
-		return code;
-	}
-
+	private String desc;
+	
 	public String getDesc() {
 	public String getDesc() {
 		return desc;
 		return desc;
 	}
 	}
 
 
+	@Override
+	public String getCode() {
+		return this.name();
+	}
+
 }
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/CourseSettingQueryInfo.java

@@ -8,6 +8,8 @@ public class CourseSettingQueryInfo extends QueryInfo {
     @ApiModelProperty(value="分部id")
     @ApiModelProperty(value="分部id")
     private Integer organId;
     private Integer organId;
 
 
+    @ApiModelProperty(value="收费模式id")
+    private Integer chargeTypeId;
 
 
     public Integer getOrganId() {
     public Integer getOrganId() {
         return organId;
         return organId;
@@ -16,4 +18,12 @@ public class CourseSettingQueryInfo extends QueryInfo {
     public void setOrganId(Integer organId) {
     public void setOrganId(Integer organId) {
         this.organId = organId;
         this.organId = organId;
     }
     }
+
+    public Integer getChargeTypeId() {
+        return chargeTypeId;
+    }
+
+    public void setChargeTypeId(Integer chargeTypeId) {
+        this.chargeTypeId = chargeTypeId;
+    }
 }
 }

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupOrganizationCourseSettingsService.java

@@ -28,4 +28,12 @@ public interface MusicGroupOrganizationCourseSettingsService extends BaseService
      * @return
      * @return
      */
      */
     MusicGroupOrganizationCourseSettings updateSetting(MusicGroupOrganizationCourseSettings setting);
     MusicGroupOrganizationCourseSettings updateSetting(MusicGroupOrganizationCourseSettings setting);
+
+
+    /**
+     * 获取收费设置详情
+     * @param id
+     * @return
+     */
+    MusicGroupOrganizationCourseSettings getSetting(Integer id);
 }
 }

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderCourseSettingsService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.common.service.BaseService;
+
+public interface MusicGroupPaymentCalenderCourseSettingsService extends BaseService<Integer, MusicGroupPaymentCalenderCourseSettings> {
+
+}

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

@@ -1,10 +1,9 @@
 package com.ym.mec.biz.service;
 package com.ym.mec.biz.service;
 
 
+import com.ym.mec.biz.dal.dto.MusicGroupGoodsAndDiscountDto;
 import com.ym.mec.biz.dal.dto.MusicGroupRegRespDto;
 import com.ym.mec.biz.dal.dto.MusicGroupRegRespDto;
 import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
 import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
-import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.common.service.BaseService;
 
 
 import java.util.List;
 import java.util.List;
@@ -74,4 +73,14 @@ public interface MusicGroupSubjectPlanService extends BaseService<Integer, Music
      * @return
      * @return
      */
      */
     MusicGroupSubjectGoodsAndInfoDto getStudentGoodsAndInfo(String musicGroupId, Integer subjectId, StudentRegistration studentRegistration);
     MusicGroupSubjectGoodsAndInfoDto getStudentGoodsAndInfo(String musicGroupId, Integer subjectId, StudentRegistration studentRegistration);
+
+
+    /**
+     * 获取声部的乐器、辅件(包含折扣)
+     * @param subjectId
+     * @param type
+     * @param chargeTypeId
+     * @return
+     */
+    List<MusicGroupGoodsAndDiscountDto> getSubjectGoods(Integer subjectId, String type, Integer chargeTypeId);
 }
 }

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

@@ -88,4 +88,9 @@ public class MusicGroupOrganizationCourseSettingsServiceImpl extends BaseService
         musicGroupOrganizationCourseSettingsDetailDao.batchInsert(setting.getDetails());
         musicGroupOrganizationCourseSettingsDetailDao.batchInsert(setting.getDetails());
         return setting;
         return setting;
     }
     }
+
+    @Override
+    public MusicGroupOrganizationCourseSettings getSetting(Integer id) {
+        return musicGroupOrganizationCourseSettingsDao.getSetting(id);
+    }
 }
 }

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderCourseSettingsServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.biz.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderCourseSettingsService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class MusicGroupPaymentCalenderCourseSettingsServiceImpl extends BaseServiceImpl<Integer, MusicGroupPaymentCalenderCourseSettings>  implements MusicGroupPaymentCalenderCourseSettingsService {
+	
+	@Autowired
+	private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
+
+	@Override
+	public BaseDAO<Integer, MusicGroupPaymentCalenderCourseSettings> getDAO() {
+		return musicGroupPaymentCalenderCourseSettingsDao;
+	}
+	
+}

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

@@ -83,7 +83,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
 			throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
 		}
 		}
 		if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
 		if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
-			musicGroupPaymentCalender.setPaymentStatus(PaymentStatusEnum.YES);
+			musicGroupPaymentCalender.setPaymentStatus(PaymentStatusEnum.OVER);
 		} else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
 		} else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
 			musicGroupPaymentCalender.setPaymentStatus(PaymentStatusEnum.OPEN);
 			musicGroupPaymentCalender.setPaymentStatus(PaymentStatusEnum.OPEN);
 		} else {
 		} else {
@@ -247,7 +247,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			if (mgpc.getDeadlinePaymentDate() != null && date.after(mgpc.getDeadlinePaymentDate()) && mgpc.getPaymentStatus() == PaymentStatusEnum.OPEN) {
 			if (mgpc.getDeadlinePaymentDate() != null && date.after(mgpc.getDeadlinePaymentDate()) && mgpc.getPaymentStatus() == PaymentStatusEnum.OPEN) {
 				// “进行中”更新至“已结束”
 				// “进行中”更新至“已结束”
 				mgpc.setUpdateTime(date);
 				mgpc.setUpdateTime(date);
-				mgpc.setPaymentStatus(PaymentStatusEnum.YES);
+				mgpc.setPaymentStatus(PaymentStatusEnum.OVER);
 				updateMusicGroupPaymentCalenderList.add(mgpc);
 				updateMusicGroupPaymentCalenderList.add(mgpc);
 
 
 				// 0元学生改成“已缴费”
 				// 0元学生改成“已缴费”
@@ -427,7 +427,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		calender.setPaymentPattern(paymentCalender.getPaymentPattern());
 		calender.setPaymentPattern(paymentCalender.getPaymentPattern());
 		calender.setUpdateTime(date);
 		calender.setUpdateTime(date);
 		if (paymentCalender.getDeadlinePaymentDate().before(date) && !DateUtil.isSameDay(date,paymentCalender.getDeadlinePaymentDate())) {
 		if (paymentCalender.getDeadlinePaymentDate().before(date) && !DateUtil.isSameDay(date,paymentCalender.getDeadlinePaymentDate())) {
-			calender.setPaymentStatus(PaymentStatusEnum.YES);
+			calender.setPaymentStatus(PaymentStatusEnum.OVER);
 		} else if (date.after(paymentCalender.getStartPaymentDate()) || DateUtil.isSameDay(date,paymentCalender.getStartPaymentDate())) {
 		} else if (date.after(paymentCalender.getStartPaymentDate()) || DateUtil.isSameDay(date,paymentCalender.getStartPaymentDate())) {
 			calender.setPaymentStatus(PaymentStatusEnum.OPEN);
 			calender.setPaymentStatus(PaymentStatusEnum.OPEN);
 			//修改Fee缴费状态为未缴费
 			//修改Fee缴费状态为未缴费

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

@@ -1,19 +1,126 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.TypeReference;
 import com.alibaba.fastjson.TypeReference;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUserRole;
 import com.ym.mec.auth.api.entity.SysUserRole;
-import com.ym.mec.biz.dal.dao.*;
-import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.entity.*;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.FeeType;
+import com.ym.mec.biz.dal.dao.ChargeTypeDao;
+import com.ym.mec.biz.dal.dao.ClassGroupDao;
+import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
+import com.ym.mec.biz.dal.dao.CooperationOrganDao;
+import com.ym.mec.biz.dal.dao.CourseScheduleDao;
+import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
+import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
+import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.dao.MusicGroupBuildLogDao;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentEntitiesDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPurchaseListDao;
+import com.ym.mec.biz.dal.dao.MusicGroupQuitDao;
+import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
+import com.ym.mec.biz.dal.dao.MusicGroupSubjectGoodsGroupDao;
+import com.ym.mec.biz.dal.dao.MusicGroupSubjectPlanDao;
+import com.ym.mec.biz.dal.dao.OrganizationDao;
+import com.ym.mec.biz.dal.dao.SchoolDao;
+import com.ym.mec.biz.dal.dao.SporadicChargeInfoDao;
+import com.ym.mec.biz.dal.dao.StudentDao;
+import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
+import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
+import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
+import com.ym.mec.biz.dal.dao.SysConfigDao;
+import com.ym.mec.biz.dal.dao.TeacherAttendanceDao;
+import com.ym.mec.biz.dal.dao.TeacherDao;
+import com.ym.mec.biz.dal.dto.BasicUserDto;
+import com.ym.mec.biz.dal.dto.CourseFormDto;
+import com.ym.mec.biz.dal.dto.CourseScheduleTeachersDto;
+import com.ym.mec.biz.dal.dto.HighClassGroupDto;
+import com.ym.mec.biz.dal.dto.MusicCardDto;
+import com.ym.mec.biz.dal.dto.RegisterPayDto;
+import com.ym.mec.biz.dal.dto.SporadicPayDto;
+import com.ym.mec.biz.dal.dto.SubFeeSettingDto;
+import com.ym.mec.biz.dal.dto.SubjectRegisterDto;
+import com.ym.mec.biz.dal.dto.UpdateExpectedNumDto;
+import com.ym.mec.biz.dal.entity.ApprovalStatus;
+import com.ym.mec.biz.dal.entity.ChargeType;
+import com.ym.mec.biz.dal.entity.ClassGroup;
+import com.ym.mec.biz.dal.entity.CooperationOrgan;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
+import com.ym.mec.biz.dal.entity.Goods;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupBuildLog;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
+import com.ym.mec.biz.dal.entity.MusicGroupPurchaseList;
+import com.ym.mec.biz.dal.entity.MusicGroupQuit;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
-import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
+import com.ym.mec.biz.dal.entity.Organization;
+import com.ym.mec.biz.dal.entity.School;
+import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
+import com.ym.mec.biz.dal.entity.Student;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
+import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.entity.SysUserCashAccount;
+import com.ym.mec.biz.dal.entity.SysUserCashAccountDetail;
+import com.ym.mec.biz.dal.entity.Teacher;
+import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
+import com.ym.mec.biz.dal.enums.GoodsType;
+import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
+import com.ym.mec.biz.dal.enums.MessageTypeEnum;
+import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
+import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
+import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
+import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
+import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
+import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
 import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
-import com.ym.mec.biz.service.*;
+import com.ym.mec.biz.service.ClassGroupService;
+import com.ym.mec.biz.service.ClassGroupStudentMapperService;
+import com.ym.mec.biz.service.GoodsService;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
+import com.ym.mec.biz.service.MusicGroupService;
+import com.ym.mec.biz.service.MusicGroupSubjectGoodsGroupService;
+import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
+import com.ym.mec.biz.service.PayService;
+import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
+import com.ym.mec.biz.service.StudentPaymentOrderService;
+import com.ym.mec.biz.service.StudentPaymentRouteOrderService;
+import com.ym.mec.biz.service.StudentRegistrationService;
+import com.ym.mec.biz.service.SysConfigService;
+import com.ym.mec.biz.service.SysMessageService;
+import com.ym.mec.biz.service.SysUserCashAccountDetailService;
+import com.ym.mec.biz.service.SysUserCashAccountService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.ImGroupMember;
 import com.ym.mec.common.entity.ImGroupMember;
 import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.entity.ImGroupModel;
@@ -27,18 +134,6 @@ import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.http.HttpUtil;
 import com.ym.mec.util.http.HttpUtil;
 
 
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.stream.Collectors;
-
 @Service
 @Service
 public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> implements MusicGroupService {
 public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> implements MusicGroupService {
 
 
@@ -228,7 +323,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                         studentRegistration.setId(null);
                         studentRegistration.setId(null);
                         if (musicGroupSubjectPlan.getFee().compareTo(BigDecimal.ZERO) == 0) {
                         if (musicGroupSubjectPlan.getFee().compareTo(BigDecimal.ZERO) == 0) {
                             studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
                             studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
-                            studentRegistration.setPaymentStatus(PaymentStatusEnum.YES);
+                            studentRegistration.setPaymentStatus(PaymentStatusEnum.OVER);
                         } else {
                         } else {
                             studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.APPLY);
                             studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.APPLY);
                             studentRegistration.setPaymentStatus(PaymentStatusEnum.OPEN);
                             studentRegistration.setPaymentStatus(PaymentStatusEnum.OPEN);
@@ -298,6 +393,26 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (!(amount.compareTo(sporadicPayDto.getAmount()) == 0)) {
         if (!(amount.compareTo(sporadicPayDto.getAmount()) == 0)) {
             throw new BizException("订单金额异常");
             throw new BizException("订单金额异常");
         }
         }
+        if (chargeInfo.getMaxNum() != null) {
+            //重试避免人数过多频繁冲突
+            boolean flag = false;
+            for (int i = 1; i <= 10; i++) {
+                chargeInfo = sporadicChargeInfoDao.get(sporadicPayDto.getSporadicId());
+                if (chargeInfo.getMaxNum() >= chargeInfo.getPaidNum()) {
+                    throw new BizException("活动人数暂时已满,请稍后再试");
+                }
+                chargeInfo.setPaidNum(chargeInfo.getPaidNum() + 1);
+                chargeInfo.setUpdateTime(new Date());
+                int update = sporadicChargeInfoDao.update(chargeInfo);
+                if (update > 0) {
+                    flag = true;
+                    break;
+                }
+            }
+            if (!flag) {
+                throw new BizException("活动火爆,请稍后再试");
+            }
+        }
 
 
         OrderTypeEnum type = OrderTypeEnum.SPORADIC;
         OrderTypeEnum type = OrderTypeEnum.SPORADIC;
         if(chargeInfo.getChargeType().equals(SporadicChargeTypeEnum.DOUBLE_ELEVEN2020)){
         if(chargeInfo.getChargeType().equals(SporadicChargeTypeEnum.DOUBLE_ELEVEN2020)){
@@ -895,7 +1010,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
         }
 //        updateTeamTeacher(musicGroup, musicGroup);
 //        updateTeamTeacher(musicGroup, musicGroup);
         //生成学员费用表
         //生成学员费用表
-        List<MusicGroupStudentFee> musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
+        /*List<MusicGroupStudentFee> musicGroupStudentFees = musicGroupStudentFeeDao.initMusicGroupStudentFee(musicGroupId);
         if (musicGroupStudentFees != null && musicGroupStudentFees.size() > 0) {
         if (musicGroupStudentFees != null && musicGroupStudentFees.size() > 0) {
             if (musicGroup.getFeeType() != null && musicGroup.getFeeType() != FeeType.OFFLINE) {
             if (musicGroup.getFeeType() != null && musicGroup.getFeeType() != FeeType.OFFLINE) {
                 for (MusicGroupStudentFee sf : musicGroupStudentFees) {
                 for (MusicGroupStudentFee sf : musicGroupStudentFees) {
@@ -903,7 +1018,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 }
                 }
             }
             }
             musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees, null, "PAID_COMPLETED");
             musicGroupStudentFeeDao.batchInsert(musicGroupStudentFees, null, "PAID_COMPLETED");
-        }
+        }*/
         musicGroupStudentFeeDao.batchUpdateCalenders(musicGroupId);
         musicGroupStudentFeeDao.batchUpdateCalenders(musicGroupId);
         //记录操作日志
         //记录操作日志
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "确认开团(筹备中 -> 进行中)", sysUser.getId(), ""));
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "确认开团(筹备中 -> 进行中)", sysUser.getId(), ""));
@@ -1609,7 +1724,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
         }
 
 
         StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, musicGroupId);
         StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, musicGroupId);
-        if (studentRegistration == null || studentRegistration.getPaymentStatus() != PaymentStatusEnum.YES) {
+        if (studentRegistration == null || studentRegistration.getPaymentStatus() != PaymentStatusEnum.OVER) {
             throw new BizException("请走报名缴费流程");
             throw new BizException("请走报名缴费流程");
         }
         }
         MusicGroupPaymentCalenderDetail userLastCalenderDetail = musicGroupPaymentCalenderDetailDao.getUserLastCalenderDetail(musicGroupId, userId);
         MusicGroupPaymentCalenderDetail userLastCalenderDetail = musicGroupPaymentCalenderDetailDao.getUserLastCalenderDetail(musicGroupId, userId);
@@ -1685,10 +1800,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 musicGroupStudentFee.setLatestPaidTime(date);
                 musicGroupStudentFee.setLatestPaidTime(date);
                 musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
                 musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
                 musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
                 musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
-                if (musicGroupPaymentCalender.getType().equals(MusicGroupPaymentCalender.FeeType.ONLINE)) {
+                /*if (musicGroupPaymentCalender.getType().equals(MusicGroupPaymentCalender.FeeType.ONLINE)) {
                     Integer getRemainNetworkClassTimes = musicGroupStudentFee.getRemainNetworkClassTimes() == null ? 0 : musicGroupStudentFee.getRemainNetworkClassTimes();
                     Integer getRemainNetworkClassTimes = musicGroupStudentFee.getRemainNetworkClassTimes() == null ? 0 : musicGroupStudentFee.getRemainNetworkClassTimes();
                     musicGroupStudentFee.setRemainNetworkClassTimes(getRemainNetworkClassTimes + 1);
                     musicGroupStudentFee.setRemainNetworkClassTimes(getRemainNetworkClassTimes + 1);
-                }
+                }*/
 //                musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, musicGroupStudentFee.getNextPaymentDate(), musicGroupStudentFee));
 //                musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, musicGroupStudentFee.getNextPaymentDate(), musicGroupStudentFee));
                 musicGroupStudentFeeDao.update(musicGroupStudentFee);
                 musicGroupStudentFeeDao.update(musicGroupStudentFee);
 
 
@@ -1782,10 +1897,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             musicGroupStudentFee.setLatestPaidTime(date);
             musicGroupStudentFee.setLatestPaidTime(date);
             musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
             musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
             musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
             musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
-            if (musicGroupPaymentCalender.getType().equals(MusicGroupPaymentCalender.FeeType.ONLINE)) {
+            /*if (musicGroupPaymentCalender.getType().equals(MusicGroupPaymentCalender.FeeType.ONLINE)) {
                 Integer getRemainNetworkClassTimes = musicGroupStudentFee.getRemainNetworkClassTimes() == null ? 0 : musicGroupStudentFee.getRemainNetworkClassTimes();
                 Integer getRemainNetworkClassTimes = musicGroupStudentFee.getRemainNetworkClassTimes() == null ? 0 : musicGroupStudentFee.getRemainNetworkClassTimes();
                 musicGroupStudentFee.setRemainNetworkClassTimes(getRemainNetworkClassTimes + 1);
                 musicGroupStudentFee.setRemainNetworkClassTimes(getRemainNetworkClassTimes + 1);
-            }
+            }*/
 //            musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, musicGroupStudentFee.getNextPaymentDate(), musicGroupStudentFee));
 //            musicGroupStudentFee.setNextPaymentDate(musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId, musicGroupStudentFee.getNextPaymentDate(), musicGroupStudentFee));
             musicGroupStudentFeeDao.update(musicGroupStudentFee);
             musicGroupStudentFeeDao.update(musicGroupStudentFee);
 
 

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

@@ -1,10 +1,15 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
+import com.ym.mec.biz.dal.dao.ChargeTypeSubjectMapperDao;
+import com.ym.mec.biz.dal.dao.GoodsDao;
+import com.ym.mec.biz.dal.dto.MusicGroupGoodsAndDiscountDto;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
 import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -14,13 +19,6 @@ import com.ym.mec.biz.dal.dao.MusicGroupSubjectPlanDao;
 import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
 import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
 import com.ym.mec.biz.dal.dto.MusicGroupRegRespDto;
 import com.ym.mec.biz.dal.dto.MusicGroupRegRespDto;
 import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
 import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
-import com.ym.mec.biz.dal.entity.Goods;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
-import com.ym.mec.biz.dal.entity.StudentRegistration;
-import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.GoodsType;
 import com.ym.mec.biz.dal.enums.GoodsType;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
@@ -56,6 +54,10 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
     private SubjectService subjectService;
     private SubjectService subjectService;
     @Autowired
     @Autowired
     private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
     private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
+    @Autowired
+    private GoodsDao goodsDao;
+    @Autowired
+    private ChargeTypeSubjectMapperDao chargeTypeSubjectMapperDao;
 
 
     @Override
     @Override
     public BaseDAO<Integer, MusicGroupSubjectPlan> getDAO() {
     public BaseDAO<Integer, MusicGroupSubjectPlan> getDAO() {
@@ -96,9 +98,9 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
 
 
         //乐团乐器及辅件信息
         //乐团乐器及辅件信息
         List<MusicGroupSubjectGoodsGroup> goodsGroups = musicGroupSubjectGoodsGroupService.findGoodsGroup(musicGroupId, subjectId);
         List<MusicGroupSubjectGoodsGroup> goodsGroups = musicGroupSubjectGoodsGroupService.findGoodsGroup(musicGroupId, subjectId);
-        
-        List<Goods> accessoriesList = goodsService.findGoodsBySubId(subjectId,GoodsType.ACCESSORIES.getCode());
-        
+
+        List<Goods> accessoriesList = goodsService.findGoodsBySubId(subjectId, GoodsType.ACCESSORIES.getCode());
+
         goodsGroups.forEach(goodsGroup -> {
         goodsGroups.forEach(goodsGroup -> {
             if (goodsGroup.getType().equals(GoodsType.INSTRUMENT)) {
             if (goodsGroup.getType().equals(GoodsType.INSTRUMENT)) {
                 goodsGroup.getGoodsList().forEach(goods -> {
                 goodsGroup.getGoodsList().forEach(goods -> {
@@ -183,11 +185,11 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
                 musicGroupSubjectGoodsGroup.setName("辅件");
                 musicGroupSubjectGoodsGroup.setName("辅件");
                 musicGroupSubjectGoodsGroup.setType(GoodsType.ACCESSORIES);
                 musicGroupSubjectGoodsGroup.setType(GoodsType.ACCESSORIES);
             }
             }
-            if(orderDetail.getKitGroupPurchaseType() != null){
-                if(orderDetail.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)){
+            if (orderDetail.getKitGroupPurchaseType() != null) {
+                if (orderDetail.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
                     musicGroupSubjectGoodsGroup.setDepositFee(orderDetail.getPrice());
                     musicGroupSubjectGoodsGroup.setDepositFee(orderDetail.getPrice());
                 }
                 }
-                String kitGroupPurchaseTypeJson = "{\""+orderDetail.getKitGroupPurchaseType().getCode()+"\":0}";
+                String kitGroupPurchaseTypeJson = "{\"" + orderDetail.getKitGroupPurchaseType().getCode() + "\":0}";
                 musicGroupSubjectGoodsGroup.setKitGroupPurchaseTypeJson(kitGroupPurchaseTypeJson);
                 musicGroupSubjectGoodsGroup.setKitGroupPurchaseTypeJson(kitGroupPurchaseTypeJson);
             }
             }
 
 
@@ -208,9 +210,27 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
         return musicGroupSubjectGoodsAndInfo;
         return musicGroupSubjectGoodsAndInfo;
     }
     }
 
 
-
     @Override
     @Override
     public MusicGroupSubjectPlan findSubjectPlan(String musicGroupId, Integer subjectId) {
     public MusicGroupSubjectPlan findSubjectPlan(String musicGroupId, Integer subjectId) {
         return musicGroupSubjectPlanDao.findSubjectPlan(musicGroupId, subjectId);
         return musicGroupSubjectPlanDao.findSubjectPlan(musicGroupId, subjectId);
     }
     }
+
+    @Override
+    public List<MusicGroupGoodsAndDiscountDto> getSubjectGoods(Integer subjectId, String type, Integer chargeTypeId) {
+        List<MusicGroupGoodsAndDiscountDto> goodsList = goodsDao.getMusicGroupGoodsAndDiscount(subjectId, type);
+        if (chargeTypeId == null || !"INSTRUMENT".equals(type)) {
+            return goodsList;
+        }
+
+        ChargeTypeSubjectMapper subjectDiscount = chargeTypeSubjectMapperDao.getSubjectDiscount(chargeTypeId, subjectId);
+        if (subjectDiscount == null || subjectDiscount.getGoodsDiscountRate() == null) {
+            return goodsList;
+        }
+        for (MusicGroupGoodsAndDiscountDto musicGroupGoodsAndDiscountDto : goodsList) {
+            musicGroupGoodsAndDiscountDto.setDiscountRate(subjectDiscount.getGoodsDiscountRate());
+            musicGroupGoodsAndDiscountDto.setDiscountPrice(musicGroupGoodsAndDiscountDto.getGroupPurchasePrice()
+                    .subtract(musicGroupGoodsAndDiscountDto.getGroupPurchasePrice().multiply(subjectDiscount.getGoodsDiscountRate())).setScale(2, BigDecimal.ROUND_HALF_UP));
+        }
+        return goodsList;
+    }
 }
 }

+ 24 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SporadicChargeInfoImpl.java

@@ -54,7 +54,7 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
     @Autowired
     @Autowired
     private ContractService contractService;
     private ContractService contractService;
 
 
-    private final Logger logger= LoggerFactory.getLogger(this.getClass());
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
 
     @Override
     @Override
     public BaseDAO<Integer, SporadicChargeInfo> getDAO() {
     public BaseDAO<Integer, SporadicChargeInfo> getDAO() {
@@ -89,7 +89,7 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
             } else if (info.getChargeType().getCode() == 9) { //零星收费账户充值
             } else if (info.getChargeType().getCode() == 9) { //零星收费账户充值
                 sysUserCashAccountService.updateBalance(userId, studentPaymentOrder.getActualAmount(), PlatformCashAccountDetailTypeEnum.RECHARGE, "零星收费账户充值", studentPaymentOrder.getTransNo());
                 sysUserCashAccountService.updateBalance(userId, studentPaymentOrder.getActualAmount(), PlatformCashAccountDetailTypeEnum.RECHARGE, "零星收费账户充值", studentPaymentOrder.getTransNo());
             } else if (info.getOrganId().equals(42) && info.getChargeType().equals(SporadicChargeTypeEnum.LEVEL)) {
             } else if (info.getOrganId().equals(42) && info.getChargeType().equals(SporadicChargeTypeEnum.LEVEL)) {
-                degreeRegistrationService.updateStatus(studentPaymentOrder.getUserId(), 2,studentPaymentOrder.getOrderNo());
+                degreeRegistrationService.updateStatus(studentPaymentOrder.getUserId(), 2, studentPaymentOrder.getOrderNo());
                 return true;
                 return true;
             } else {
             } else {
                 //插入交易明细
                 //插入交易明细
@@ -139,8 +139,25 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
             return true;
             return true;
         }
         }
         if (studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAILED) {
         if (studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAILED) {
-            if (info.getOrganId().equals(42) && info.getChargeType().equals(SporadicChargeTypeEnum.LEVEL)){
-                degreeRegistrationService.updateStatus(studentPaymentOrder.getUserId(),0,studentPaymentOrder.getOrderNo());
+            if (info.getMaxNum() != null) {
+                //重试避免人数过多频繁冲突
+                boolean flag = false;
+                for (int i = 1; i <= 10; i++) {
+                    info = sporadicChargeInfoDao.get(info.getId());
+                    info.setPaidNum(info.getPaidNum() - 1);
+                    info.setUpdateTime(new Date());
+                    int update = sporadicChargeInfoDao.update(info);
+                    if (update > 0) {
+                        flag = true;
+                        break;
+                    }
+                }
+                if (!flag) {
+                    throw new BizException("活动火爆,请稍后再试");
+                }
+            }
+            if (info.getOrganId().equals(42) && info.getChargeType().equals(SporadicChargeTypeEnum.LEVEL)) {
+                degreeRegistrationService.updateStatus(studentPaymentOrder.getUserId(), 0, studentPaymentOrder.getOrderNo());
                 return true;
                 return true;
             }
             }
 
 
@@ -213,9 +230,9 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public void del(Integer id) {
     public void del(Integer id) {
         Integer count = studentPaymentOrderDao.countSporadicOrder(id);
         Integer count = studentPaymentOrderDao.countSporadicOrder(id);
-        if(count == null || count == 0){
+        if (count == null || count == 0) {
             sporadicChargeInfoDao.delete(id);
             sporadicChargeInfoDao.delete(id);
-        }else {
+        } else {
             throw new BizException("当前缴费项目存在收费记录,请走关闭流程");
             throw new BizException("当前缴费项目存在收费记录,请走关闭流程");
         }
         }
     }
     }
@@ -231,7 +248,7 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
         }
         }
         SporadicChargeInfo chargeInfo = sporadicChargeInfoDao.get(id);
         SporadicChargeInfo chargeInfo = sporadicChargeInfoDao.get(id);
         MusicGroup musicGroup = musicGroupDao.get(chargeInfo.getMusicGroupId());
         MusicGroup musicGroup = musicGroupDao.get(chargeInfo.getMusicGroupId());
-        if(musicGroup != null){
+        if (musicGroup != null) {
             chargeInfo.setMusicGroupName(musicGroup.getName());
             chargeInfo.setMusicGroupName(musicGroup.getName());
         }
         }
         if (chargeInfo != null) {
         if (chargeInfo != null) {

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

@@ -703,7 +703,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             if (reduce == BigDecimal.ZERO) {
             if (reduce == BigDecimal.ZERO) {
                 paymentStatus = MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
                 paymentStatus = MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
                 studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
                 studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
-                studentRegistration.setPaymentStatus(PaymentStatusEnum.YES);
+                studentRegistration.setPaymentStatus(PaymentStatusEnum.OVER);
                 studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
                 studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
                 studentPaymentOrder.setActualAmount(reduce);
                 studentPaymentOrder.setActualAmount(reduce);
                 studentPaymentOrder.setPayTime(date);
                 studentPaymentOrder.setPayTime(date);
@@ -712,9 +712,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                     userId, studentRegistration.getSubjectId(), studentAddDto.getCourseFee(),
                     userId, studentRegistration.getSubjectId(), studentAddDto.getCourseFee(),
                     null, studentAddDto.getTemporaryCourseFee(), paymentStatus);
                     null, studentAddDto.getTemporaryCourseFee(), paymentStatus);
 
 
-            if (musicGroup.getFeeType() != null && musicGroup.getFeeType() != MusicGroupPaymentCalender.FeeType.OFFLINE && musicGroupStudentFee.getTemporaryCourseFee().doubleValue() * 100 == 0) {
+            /*if (musicGroup.getFeeType() != null && musicGroup.getFeeType() != MusicGroupPaymentCalender.FeeType.OFFLINE && musicGroupStudentFee.getTemporaryCourseFee().doubleValue() * 100 == 0) {
                 musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getRemainNetworkClassTimes() + 1);
                 musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getRemainNetworkClassTimes() + 1);
-            }
+            }*/
             musicGroupStudentFeeDao.insert(musicGroupStudentFee);
             musicGroupStudentFeeDao.insert(musicGroupStudentFee);
 //            musicGroupStudentFeeDao.insert(new MusicGroupStudentFee(musicGroupId,
 //            musicGroupStudentFeeDao.insert(new MusicGroupStudentFee(musicGroupId,
 //                    userId, studentRegistration.getSubjectId(), studentAddDto.getCourseFee(),
 //                    userId, studentRegistration.getSubjectId(), studentAddDto.getCourseFee(),
@@ -851,7 +851,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         //成功报名状态变更
         //成功报名状态变更
         StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(studentPaymentOrder.getUserId(), studentPaymentOrder.getMusicGroupId());
         StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(studentPaymentOrder.getUserId(), studentPaymentOrder.getMusicGroupId());
 
 
-        if (studentRegistration.getPaymentStatus().equals(PaymentStatusEnum.YES)) {
+        if (studentRegistration.getPaymentStatus().equals(PaymentStatusEnum.OVER)) {
             return studentPaymentOrder;
             return studentPaymentOrder;
         }
         }
         MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
         MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
@@ -863,7 +863,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             if (studentRegistration.getTemporaryCourseFee() != null) {
             if (studentRegistration.getTemporaryCourseFee() != null) {
                 studentRegistration.setTemporaryCourseFee(new BigDecimal(0));
                 studentRegistration.setTemporaryCourseFee(new BigDecimal(0));
             }
             }
-            studentRegistration.setPaymentStatus(PaymentStatusEnum.YES);
+            studentRegistration.setPaymentStatus(PaymentStatusEnum.OVER);
             studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
             studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
             studentRegistrationDao.update(studentRegistration);
             studentRegistrationDao.update(studentRegistration);
 
 
@@ -877,9 +877,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 musicGroupStudentFee.setLatestPaidTime(nowDate);
                 musicGroupStudentFee.setLatestPaidTime(nowDate);
                 musicGroupStudentFee.setPaymentStatus(MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED);
                 musicGroupStudentFee.setPaymentStatus(MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED);
                 musicGroupStudentFee.setTemporaryCourseFee(BigDecimal.ZERO);
                 musicGroupStudentFee.setTemporaryCourseFee(BigDecimal.ZERO);
-                if (musicGroup.getFeeType() != null && musicGroup.getFeeType() != MusicGroupPaymentCalender.FeeType.OFFLINE) {
+                /*if (musicGroup.getFeeType() != null && musicGroup.getFeeType() != MusicGroupPaymentCalender.FeeType.OFFLINE) {
                     musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getRemainNetworkClassTimes() + 1);
                     musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getRemainNetworkClassTimes() + 1);
-                }
+                }*/
                 musicGroupStudentFee.setUpdateTime(nowDate);
                 musicGroupStudentFee.setUpdateTime(nowDate);
                 musicGroupStudentFeeDao.update(musicGroupStudentFee);
                 musicGroupStudentFeeDao.update(musicGroupStudentFee);
                 //添加学生
                 //添加学生

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

@@ -1,12 +1,8 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dao.*;
-import com.ym.mec.biz.dal.dto.StudentVisitDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.enums.*;
-import com.ym.mec.biz.dal.page.StudentVisitQueryInfo;
 import com.ym.mec.biz.dal.page.SubjectChangeQueryInfo;
 import com.ym.mec.biz.dal.page.SubjectChangeQueryInfo;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
@@ -27,7 +23,6 @@ import org.springframework.transaction.annotation.Transactional;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 
 @Service
 @Service
 public class SubjectChangeServiceImpl extends BaseServiceImpl<Integer, SubjectChange> implements SubjectChangeService {
 public class SubjectChangeServiceImpl extends BaseServiceImpl<Integer, SubjectChange> implements SubjectChangeService {

+ 65 - 41
mec-biz/src/main/resources/config/mybatis/ChargeTypeSubjectMapperMapper.xml

@@ -12,7 +12,8 @@
         <result column="subject_id_" property="subjectId"/>
         <result column="subject_id_" property="subjectId"/>
         <result column="create_time_" property="createTime"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
         <result column="update_time_" property="updateTime"/>
-        <result column="kit_group_purchase_type_" property="kitGroupPurchaseTypeEnum" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="kit_group_purchase_type_" property="kitGroupPurchaseTypeEnum"
+                typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="deposit_fee_" property="depositFee"/>
         <result column="deposit_fee_" property="depositFee"/>
         <result column="fee_" property="fee"/>
         <result column="fee_" property="fee"/>
         <result column="goods_discount_rate_" property="goodsDiscountRate"/>
         <result column="goods_discount_rate_" property="goodsDiscountRate"/>
@@ -20,31 +21,39 @@
 
 
     <!-- 根据主键查询一条记录 -->
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="ChargeTypeSubjectMapper">
     <select id="get" resultMap="ChargeTypeSubjectMapper">
-		SELECT * FROM charge_type_subject_mapper WHERE id_ = #{id} 
-	</select>
+        SELECT *
+        FROM charge_type_subject_mapper
+        WHERE id_ = #{id}
+    </select>
 
 
     <!-- 全查询 -->
     <!-- 全查询 -->
     <select id="findAll" resultMap="ChargeTypeSubjectMapper">
     <select id="findAll" resultMap="ChargeTypeSubjectMapper">
-		SELECT * FROM charge_type_subject_mapper ORDER BY id_
-	</select>
+        SELECT *
+        FROM charge_type_subject_mapper
+        ORDER BY id_
+    </select>
 
 
     <!-- 向数据库增加一条记录 -->
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper" useGeneratedKeys="true"
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
             keyColumn="id" keyProperty="id">
-        INSERT INTO charge_type_subject_mapper (charge_type_id_,subject_id_,kit_group_purchase_type_,deposit_fee_,fee_,goods_discount_rate_,create_time_,update_time_)
-        VALUES(#{chargeTypeId},#{subjectId},#{kitGroupPurchaseTypeEnum,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{depositFee},#{fee},#{goodsDiscountRate},now(),now())
+        INSERT INTO charge_type_subject_mapper (charge_type_id_, subject_id_, kit_group_purchase_type_, deposit_fee_,
+                                                fee_, goods_discount_rate_, create_time_, update_time_)
+        VALUES (#{chargeTypeId}, #{subjectId},
+                #{kitGroupPurchaseTypeEnum,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{depositFee},
+                #{fee}, #{goodsDiscountRate}, now(), now())
     </insert>
     </insert>
 
 
     <!-- 向数据库增加一条记录 -->
     <!-- 向数据库增加一条记录 -->
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id"
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
             keyProperty="id">
-        INSERT INTO charge_type_subject_mapper (charge_type_id_,subject_id_,kit_group_purchase_type_,deposit_fee_,fee_,goods_discount_rate_,create_time_,update_time_)
+        INSERT INTO charge_type_subject_mapper
+        (charge_type_id_,subject_id_,kit_group_purchase_type_,deposit_fee_,fee_,goods_discount_rate_,create_time_,update_time_)
         VALUES
         VALUES
         <foreach collection="list" item="item" separator=",">
         <foreach collection="list" item="item" separator=",">
-        (#{item.chargeTypeId},#{item.subjectId},#{item.kitGroupPurchaseTypeEnum,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.depositFee},#{item.fee},#{item.goodsDiscountRate},now(),now())
+            (#{item.chargeTypeId},#{item.subjectId},#{item.kitGroupPurchaseTypeEnum,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.depositFee},#{item.fee},#{item.goodsDiscountRate},now(),now())
         </foreach>
         </foreach>
     </insert>
     </insert>
-    
+
     <!-- 根据主键查询一条记录 -->
     <!-- 根据主键查询一条记录 -->
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper">
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper">
         UPDATE charge_type_subject_mapper
         UPDATE charge_type_subject_mapper
@@ -56,7 +65,8 @@
                 charge_type_id_ = #{chargeTypeId},
                 charge_type_id_ = #{chargeTypeId},
             </if>
             </if>
             <if test="kitGroupPurchaseTypeEnum != null">
             <if test="kitGroupPurchaseTypeEnum != null">
-                kit_group_purchase_type_ = #{kitGroupPurchaseTypeEnum, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+                kit_group_purchase_type_ =
+                #{kitGroupPurchaseTypeEnum, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
             </if>
             <if test="depositFee != null">
             <if test="depositFee != null">
                 deposit_fee_ = #{depositFee},
                 deposit_fee_ = #{depositFee},
@@ -73,44 +83,49 @@
         </set>
         </set>
         WHERE id_ = #{id}
         WHERE id_ = #{id}
     </update>
     </update>
-    
+
     <update id="batchUpdate" parameterType="java.util.List">
     <update id="batchUpdate" parameterType="java.util.List">
         <foreach collection="list" item="item" index="index" open="" close="" separator=";">
         <foreach collection="list" item="item" index="index" open="" close="" separator=";">
-        UPDATE charge_type_subject_mapper
-        <set>
-            <if test="item.subjectId != null">
-                subject_id_ = #{item.subjectId},
-            </if>
-            <if test="item.chargeTypeId != null">
-                charge_type_id_ = #{item.chargeTypeId},
-            </if>
-            <if test="item.kitGroupPurchaseTypeEnum != null">
-                kit_group_purchase_type_ = #{item.kitGroupPurchaseTypeEnum, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-            </if>
-            <if test="item.depositFee != null">
-                deposit_fee_ = #{item.depositFee},
-            </if>
-            <if test="item.fee != null">
-                fee_ = #{item.fee},
-            </if>
-            <if test="item.goodsDiscountRate != null">
-                goods_discount_rate_ = #{item.goodsDiscountRate},
-            </if>
-            <if test="item.updateTime != null">
-                update_time_ = NOW(),
-            </if>
-        </set>
+            UPDATE charge_type_subject_mapper
+            <set>
+                <if test="item.subjectId != null">
+                    subject_id_ = #{item.subjectId},
+                </if>
+                <if test="item.chargeTypeId != null">
+                    charge_type_id_ = #{item.chargeTypeId},
+                </if>
+                <if test="item.kitGroupPurchaseTypeEnum != null">
+                    kit_group_purchase_type_ =
+                    #{item.kitGroupPurchaseTypeEnum, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+                </if>
+                <if test="item.depositFee != null">
+                    deposit_fee_ = #{item.depositFee},
+                </if>
+                <if test="item.fee != null">
+                    fee_ = #{item.fee},
+                </if>
+                <if test="item.goodsDiscountRate != null">
+                    goods_discount_rate_ = #{item.goodsDiscountRate},
+                </if>
+                <if test="item.updateTime != null">
+                    update_time_ = NOW(),
+                </if>
+            </set>
             WHERE id_ = #{item.id}
             WHERE id_ = #{item.id}
         </foreach>
         </foreach>
     </update>
     </update>
 
 
     <!-- 根据主键删除一条记录 -->
     <!-- 根据主键删除一条记录 -->
     <delete id="delete">
     <delete id="delete">
-		DELETE FROM charge_type_subject_mapper WHERE id_ = #{id} 
-	</delete>
+        DELETE
+        FROM charge_type_subject_mapper
+        WHERE id_ = #{id}
+    </delete>
 
 
     <delete id="deleteByChargeTypeId">
     <delete id="deleteByChargeTypeId">
-        DELETE FROM charge_type_subject_mapper WHERE charge_type_id_ = #{chargeTypeId}
+        DELETE
+        FROM charge_type_subject_mapper
+        WHERE charge_type_id_ = #{chargeTypeId}
     </delete>
     </delete>
 
 
     <!-- 分页查询 -->
     <!-- 分页查询 -->
@@ -121,6 +136,15 @@
 
 
     <!-- 查询当前表的总记录数 -->
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
     <select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM charge_type_subject_mapper
-	</select>
+        SELECT COUNT(*)
+        FROM charge_type_subject_mapper
+    </select>
+
+    <!-- 根据收费类型获取乐团乐器折扣 -->
+    <select id="getSubjectDiscount" resultMap="ChargeTypeSubjectMapper">
+        SELECT *
+        FROM charge_type_subject_mapper
+        WHERE charge_type_id_ = #{chargeTypeId}
+          AND subject_id_ = #{subjectId}
+    </select>
 </mapper>
 </mapper>

+ 7 - 0
mec-biz/src/main/resources/config/mybatis/GoodsMapper.xml

@@ -363,4 +363,11 @@
     <select id="queryGoodsSellDtos" resultMap="GoodsSellDtoMap">
     <select id="queryGoodsSellDtos" resultMap="GoodsSellDtoMap">
         SELECT id_,image_,name_,type_,discount_price_ FROM goods WHERE FIND_IN_SET(id_,#{goodsId})
         SELECT id_,image_,name_,type_,discount_price_ FROM goods WHERE FIND_IN_SET(id_,#{goodsId})
     </select>
     </select>
+
+    <resultMap id="MusicGroupGoods" type="com.ym.mec.biz.dal.dto.MusicGroupGoodsAndDiscountDto" extends="Goods"/>
+    <select id="getMusicGroupGoodsAndDiscount" resultMap="MusicGroupGoods">
+        SELECT g.* FROM subject_goods_mapper sgm
+        LEFT JOIN goods g ON sgm.goods_category_id_ = g.goods_category_id_
+        WHERE sgm.subject_id_ = #{subjectId} AND g.type_ = #{type} and g.status_ != 0
+    </select>
 </mapper>
 </mapper>

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

@@ -16,7 +16,8 @@
         <collection property="details" ofType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail"
         <collection property="details" ofType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail"
                     columnPrefix="detail_">
                     columnPrefix="detail_">
             <result column="id_" property="id"/>
             <result column="id_" property="id"/>
-            <result column="course_type_" property="courseType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+            <result column="course_type_" property="courseType"
+                    typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
             <result column="is_student_optional_" property="isStudentOptional"/>
             <result column="is_student_optional_" property="isStudentOptional"/>
             <result column="course_total_minuties_" property="courseTotalMinuties"/>
             <result column="course_total_minuties_" property="courseTotalMinuties"/>
             <result column="unit_price_" property="unitPrice"/>
             <result column="unit_price_" property="unitPrice"/>
@@ -89,6 +90,7 @@
         FROM music_group_organization_course_settings mgocs
         FROM music_group_organization_course_settings mgocs
         LEFT JOIN music_group_organization_course_settings_detail mgocsd ON mgocs.id_ =
         LEFT JOIN music_group_organization_course_settings_detail mgocsd ON mgocs.id_ =
         mgocsd.music_group_organization_course_settings_id_
         mgocsd.music_group_organization_course_settings_id_
+        <include refid="queryCondition"/>
         <include refid="global.limit"/>
         <include refid="global.limit"/>
     </select>
     </select>
 
 
@@ -96,7 +98,36 @@
     <select id="queryCount" resultType="int">
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
         SELECT COUNT(*)
         FROM music_group_organization_course_settings mgocs
         FROM music_group_organization_course_settings mgocs
+        LEFT JOIN music_group_organization_course_settings_detail mgocsd
+        ON mgocs.id_ = mgocsd.music_group_organization_course_settings_id_
+        <include refid="queryCondition"/>
+    </select>
+
+    <sql id="queryCondition">
+        <where>
+            <if test="organId != null">
+                AND mgocs.organ_id_=#{organId}
+            </if>
+            <if test="chargeTypeId != null">
+                AND mgocs.charge_type_id_ = #{chargeTypeId}
+            </if>
+        </where>
+    </sql>
+
+    <select id="getSetting" resultMap="MusicGroupOrganizationCourseSettings">
+        SELECT mgocs.*,
+               mgocsd.id_                    detail_id_,
+               mgocsd.course_type_           detail_course_type_,
+               mgocsd.is_student_optional_   detail_is_student_optional_,
+               mgocsd.course_total_minuties_ detail_course_total_minuties_,
+               mgocsd.unit_price_            detail_unit_price_,
+               mgocsd.course_current_price_  detail_course_current_price_,
+               mgocsd.course_original_price_ detail_course_original_price_,
+               mgocsd.course_current_price_  detail_course_current_price_
+        FROM music_group_organization_course_settings mgocs
                  LEFT JOIN music_group_organization_course_settings_detail mgocsd
                  LEFT JOIN music_group_organization_course_settings_detail mgocsd
                            ON mgocs.id_ = mgocsd.music_group_organization_course_settings_id_
                            ON mgocs.id_ = mgocsd.music_group_organization_course_settings_id_
+        WHERE mgocs.id_ = #{id}
     </select>
     </select>
+
 </mapper>
 </mapper>

+ 98 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderCourseSettingsMapper.xml

@@ -0,0 +1,98 @@
+<?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">
+<!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
+<mapper
+	namespace="com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao">
+
+	<resultMap
+		type="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings"
+		id="MusicGroupPaymentCalenderCourseSettings">
+		<result column="id_" property="id" />
+		<result column="music_group_payment_calender_id_" property="musicGroupPaymentCalenderId" />
+		<result column="course_type_" property="courseType" />
+		<result column="course_total_minuties_" property="courseTotalMinuties" />
+		<result column="unit_price_" property="unitPrice" />
+		<result column="course_original_price_" property="courseOriginalPrice" />
+		<result column="course_current_price_" property="courseCurrentPrice" />
+		<result column="is_student_optional_" property="isStudentOptional" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="MusicGroupPaymentCalenderCourseSettings">
+		SELECT * FROM music_group_payment_calender_course_settings WHERE id_ = #{id}
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="MusicGroupPaymentCalenderCourseSettings">
+		SELECT * FROM music_group_payment_calender_course_settings ORDER BY id_
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert"
+		parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings"
+		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
+			AS ID FROM DUAL </selectKey> -->
+		INSERT INTO music_group_payment_calender_course_settings
+		(id_,music_group_payment_calender_id_,course_type_,course_total_minuties_,unit_price_,course_original_price_,course_current_price_,is_student_optional_,create_time_,update_time_)
+		VALUES(#{id},#{musicGroupPaymentCalenderId},#{courseType},#{courseTotalMinuties},#{unitPrice},#{courseOriginalPrice},#{courseCurrentPrice},#{isStudentOptional},#{createTime},#{updateTime})
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update"
+		parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings">
+		UPDATE music_group_payment_calender_course_settings
+		<set>
+			<if test="isStudentOptional != null">
+				is_student_optional_ = #{isStudentOptional},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="unitPrice != null">
+				unit_price_ = #{unitPrice},
+			</if>
+			<if test="updateTime != null">
+				update_time_ = #{updateTime},
+			</if>
+			<if test="courseCurrentPrice != null">
+				course_current_price_ = #{courseCurrentPrice},
+			</if>
+			<if test="musicGroupPaymentCalenderId != null">
+				music_group_payment_calender_id_ = #{musicGroupPaymentCalenderId},
+			</if>
+			<if test="courseType != null">
+				course_type_ = #{courseType},
+			</if>
+			<if test="courseOriginalPrice != null">
+				course_original_price_ = #{courseOriginalPrice},
+			</if>
+			<if test="courseTotalMinuties != null">
+				course_total_minuties_ = #{courseTotalMinuties},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete">
+		DELETE FROM music_group_payment_calender_course_settings WHERE id_ = #{id}
+	</delete>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="MusicGroupPaymentCalenderCourseSettings"
+		parameterType="map">
+		SELECT * FROM music_group_payment_calender_course_settings ORDER BY id_
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM music_group_payment_calender_course_settings
+	</select>
+</mapper>

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

@@ -16,7 +16,7 @@
         <result column="expect_num_" property="expectNum"/>
         <result column="expect_num_" property="expectNum"/>
         <result column="actual_num_" property="actualNum"/>
         <result column="actual_num_" property="actualNum"/>
         <result column="memo_" property="memo"/>
         <result column="memo_" property="memo"/>
-        <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="is_give_music_network_" property="isGiveMusicNetwork"/>
         <result column="create_time_" property="createTime"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
         <result column="update_time_" property="updateTime"/>
         <result column="payment_valid_start_date_" property="paymentValidStartDate"/>
         <result column="payment_valid_start_date_" property="paymentValidStartDate"/>
@@ -40,9 +40,9 @@
             keyColumn="id" keyProperty="id">
             keyColumn="id" keyProperty="id">
         INSERT INTO music_group_payment_calender
         INSERT INTO music_group_payment_calender
         (music_group_id_,payment_month_,start_payment_date_,deadline_payment_date_,payment_status_,expect_num_,
         (music_group_id_,payment_month_,start_payment_date_,deadline_payment_date_,payment_status_,expect_num_,
-        actual_num_,memo_,type_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,payment_type_)
+        actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,payment_type_)
         VALUES(#{musicGroupId},#{paymentMonth},#{startPaymentDate},#{deadlinePaymentDate},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         VALUES(#{musicGroupId},#{paymentMonth},#{startPaymentDate},#{deadlinePaymentDate},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{expectNum},#{actualNum},#{memo},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now(),
+        #{expectNum},#{actualNum},#{memo},#{isGiveMusicNetwork},now(),now(),
         #{paymentValidStartDate},#{paymentValidEndDate},#{paymentPattern},#{paymentType})
         #{paymentValidStartDate},#{paymentValidEndDate},#{paymentPattern},#{paymentType})
     </insert>
     </insert>
     <insert id="batchAdd">
     <insert id="batchAdd">
@@ -68,8 +68,8 @@
             <if test="paymentPattern != null">
             <if test="paymentPattern != null">
                 payment_pattern_ = #{paymentPattern},
                 payment_pattern_ = #{paymentPattern},
             </if>
             </if>
-            <if test="type != null">
-                type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            <if test="isGiveMusicNetwork != null">
+                is_give_music_network_ = #{isGiveMusicNetwork},
             </if>
             </if>
             <if test="deadlinePaymentDate != null">
             <if test="deadlinePaymentDate != null">
                 deadline_payment_date_ = #{deadlinePaymentDate},
                 deadline_payment_date_ = #{deadlinePaymentDate},
@@ -109,8 +109,8 @@
                 <if test="item.paymentPattern != null">
                 <if test="item.paymentPattern != null">
                     payment_pattern_ = #{item.paymentPattern},
                     payment_pattern_ = #{item.paymentPattern},
                 </if>
                 </if>
-	            <if test="item.type != null">
-	                type_ = #{item.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+	            <if test="item.isGiveMusicNetwork != null">
+	                is_give_music_network_ = #{item.isGiveMusicNetwork},
 	            </if>
 	            </if>
 	            <if test="item.deadlinePaymentDate != null">
 	            <if test="item.deadlinePaymentDate != null">
 	                deadline_payment_date_ = #{item.deadlinePaymentDate},
 	                deadline_payment_date_ = #{item.deadlinePaymentDate},

+ 160 - 128
mec-biz/src/main/resources/config/mybatis/SporadicChargeInfo.xml

@@ -3,143 +3,175 @@
 <!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
 <!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
 <mapper namespace="com.ym.mec.biz.dal.dao.SporadicChargeInfoDao">
 <mapper namespace="com.ym.mec.biz.dal.dao.SporadicChargeInfoDao">
 
 
-	<resultMap type="com.ym.mec.biz.dal.entity.SporadicChargeInfo" id="SporadicChargeInfo">
-		<result column="id_" property="id" />
-		<result column="title_" property="title" />
-		<result column="charge_type_" property="chargeType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
-		<result column="organ_id_" property="organId"/>
-		<result column="amount_" property="amount" />
-		<result column="discount_amount_" property="discountAmount" />
-		<result column="detail_" property="detail" />
-		<result column="create_time_" property="createTime" />
-		<result column="update_time_" property="updateTime" />
-		<result column="operator_id_" property="operatorId" />
-		<result column="del_flag_" property="delFlag" />
-		<result column="open_flag_" property="openFlag" />
-		<result column="organ_name_" property="organName" />
-		<result column="user_id_" property="userId" />
-		<result column="music_group_id_" property="musicGroupId" />
-	</resultMap>
+    <resultMap type="com.ym.mec.biz.dal.entity.SporadicChargeInfo" id="SporadicChargeInfo">
+        <result column="id_" property="id"/>
+        <result column="title_" property="title"/>
+        <result column="charge_type_" property="chargeType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="organ_id_" property="organId"/>
+        <result column="amount_" property="amount"/>
+        <result column="discount_amount_" property="discountAmount"/>
+        <result column="detail_" property="detail"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+        <result column="operator_id_" property="operatorId"/>
+        <result column="del_flag_" property="delFlag"/>
+        <result column="open_flag_" property="openFlag"/>
+        <result column="organ_name_" property="organName"/>
+        <result column="user_id_" property="userId"/>
+        <result column="music_group_id_" property="musicGroupId"/>
+        <result column="max_num_" property="maxNum"/>
+        <result column="paid_num_" property="paidNum"/>
+        <result column="version_" property="version"/>
+    </resultMap>
 
 
-	<!-- 根据主键查询一条记录 -->
-	<select id="get" resultMap="SporadicChargeInfo">
-		SELECT * FROM sporadic_charge_info WHERE id_ = #{id}
-	</select>
+    <!-- 根据主键查询一条记录 -->
+    <select id="get" resultMap="SporadicChargeInfo">
+        SELECT *
+        FROM sporadic_charge_info
+        WHERE id_ = #{id}
+    </select>
 
 
-	<!-- 全查询 -->
-	<select id="findAll" resultMap="SporadicChargeInfo">
-		SELECT * FROM sporadic_charge_info ORDER BY id_
-	</select>
+    <!-- 全查询 -->
+    <select id="findAll" resultMap="SporadicChargeInfo">
+        SELECT *
+        FROM sporadic_charge_info
+        ORDER BY id_
+    </select>
 
 
-	<!-- 向数据库增加一条记录 -->
-	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SporadicChargeInfo"
-		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO sporadic_charge_info
-		(title_,charge_type_,organ_id_,amount_,discount_amount_,detail_,create_time_,update_time_,operator_id_,user_id_,music_group_id_)
-		VALUES(#{title},#{chargeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-		#{organId},#{amount},#{discountAmount},#{detail},now(),now(),#{operatorId},#{userId},#{musicGroupId})
-	</insert>
+    <!-- 向数据库增加一条记录 -->
+    <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SporadicChargeInfo"
+            useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+        INSERT INTO sporadic_charge_info
+        (title_, charge_type_, organ_id_, amount_, discount_amount_, detail_, create_time_, update_time_, operator_id_,
+         user_id_, music_group_id_, max_num_)
+        VALUES (#{title}, #{chargeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+                #{organId}, #{amount}, #{discountAmount}, #{detail}, now(), now(), #{operatorId}, #{userId},
+                #{musicGroupId}, #{maxNum})
+    </insert>
 
 
-	<!-- 根据主键查询一条记录 -->
-	<update id="update" parameterType="com.ym.mec.biz.dal.entity.SporadicChargeInfo">
-		UPDATE sporadic_charge_info
-		<set>
-			<if test="musicGroupId != null">
-				music_group_id_ = #{musicGroupId},
-			</if>
-			<if test="title != null">
-				title_ = #{title},
-			</if>
-			<if test="openFlag != null">
-				open_flag_ = #{openFlag},
-			</if>
-			<if test="chargeType != null">
-				charge_type_ = #{chargeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-			</if>
-			<if test="organId != null">
-				organ_id_ = #{organId},
-			</if>
-			<if test="amount != null">
-				amount_ = #{amount},
-			</if>
-			<if test="discountAmount != null">
-				discount_amount_ = #{discountAmount},
-			</if>
-			<if test="detail != null">
-				detail_ = #{detail},
-			</if>
-			<if test="updateTime != null">
-				update_time_ = now(),
-			</if>
-			<if test="operatorId != null">
-				operator_id_ = #{operatorId},
-			</if>
-			<if test="userId != null">
-				user_id_ = #{userId},
-			</if>
-		</set>
-		WHERE id_ = #{id}
-	</update>
+    <!-- 根据主键查询一条记录 -->
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.SporadicChargeInfo">
+        UPDATE sporadic_charge_info
+        <set>
+            <if test="musicGroupId != null">
+                music_group_id_ = #{musicGroupId},
+            </if>
+            <if test="title != null">
+                title_ = #{title},
+            </if>
+            <if test="openFlag != null">
+                open_flag_ = #{openFlag},
+            </if>
+            <if test="chargeType != null">
+                charge_type_ = #{chargeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="organId != null">
+                organ_id_ = #{organId},
+            </if>
+            <if test="amount != null">
+                amount_ = #{amount},
+            </if>
+            <if test="discountAmount != null">
+                discount_amount_ = #{discountAmount},
+            </if>
+            <if test="detail != null">
+                detail_ = #{detail},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = now(),
+            </if>
+            <if test="operatorId != null">
+                operator_id_ = #{operatorId},
+            </if>
+            <if test="userId != null">
+                user_id_ = #{userId},
+            </if>
+            <if test="maxNum != null">
+                max_num_ = #{maxNum},
+            </if>
+            <if test="paidNum != null">
+                paid_num_ = #{paidNum},
+            </if>
+            <if test="version != null">
+                version_ = version_+1,
+            </if>
+        </set>
+        WHERE id_ = #{id} AND version_ = #{version}
+    </update>
 
 
-	<!-- 根据主键删除一条记录 -->
-	<update id="delete">
-		UPDATE sporadic_charge_info SET del_flag_ = 1 WHERE id_ = #{id}
-	</update>
+    <!-- 根据主键删除一条记录 -->
+    <update id="delete">
+        UPDATE sporadic_charge_info
+        SET del_flag_ = 1
+        WHERE id_ = #{id}
+    </update>
 
 
-	<!-- 分页查询 -->
-	<select id="queryPage" resultMap="SporadicChargeInfo" parameterType="map">
-		SELECT sci.* FROM sporadic_charge_info sci
-		LEFT JOIN sys_user su ON su.id_ = sci.user_id_
-		<include refid="queryPageSql"/>
-		<include refid="global.orderby"/>
-		<include refid="global.limit" />
-	</select>
+    <!-- 分页查询 -->
+    <select id="queryPage" resultMap="SporadicChargeInfo" parameterType="map">
+        SELECT sci.* FROM sporadic_charge_info sci
+        LEFT JOIN sys_user su ON su.id_ = sci.user_id_
+        <include refid="queryPageSql"/>
+        <include refid="global.orderby"/>
+        <include refid="global.limit"/>
+    </select>
 
 
-	<sql id="queryPageSql">
-		<where>
-				sci.del_flag_ != 1
-			<if test="organId != null">
-				AND FIND_IN_SET(sci.organ_id_,#{organId})
-			</if>
-			<if test="chargeType != null">
-				AND sci.charge_type_ = #{chargeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-			</if>
-			<if test="type == 'personal'">
-				AND sci.user_id_ IS NOT NULL
-			</if>
-			<if test="type == 'common'">
-				AND sci.user_id_ IS NULL
-			</if>
-			<if test="openFlag != null">
-				AND sci.open_flag_ = #{openFlag}
-			</if>
-			<if test="search != null">
-				AND (sci.title_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%'))
-			</if>
-		</where>
-	</sql>
+    <sql id="queryPageSql">
+        <where>
+            sci.del_flag_ != 1
+            <if test="organId != null">
+                AND FIND_IN_SET(sci.organ_id_,#{organId})
+            </if>
+            <if test="chargeType != null">
+                AND sci.charge_type_ = #{chargeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+            <if test="type == 'personal'">
+                AND sci.user_id_ IS NOT NULL
+            </if>
+            <if test="type == 'common'">
+                AND sci.user_id_ IS NULL
+            </if>
+            <if test="openFlag != null">
+                AND sci.open_flag_ = #{openFlag}
+            </if>
+            <if test="search != null">
+                AND (sci.title_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%'))
+            </if>
+        </where>
+    </sql>
 
 
-	<!-- 查询当前表的总记录数 -->
-	<select id="queryCount" resultType="int">
-		SELECT COUNT(sci.id_) FROM sporadic_charge_info sci
-		LEFT JOIN sys_user su ON su.id_ = sci.user_id_
-		<include refid="queryPageSql"/>
-	</select>
-	<select id="findInfoById" resultMap="SporadicChargeInfo">
-		SELECT * FROM sporadic_charge_info where id_ = #{id}
-	</select>
-	<!-- 根据类型和分部id查询活动 -->
-	<select id="findByOrganIdAndType" resultMap="SporadicChargeInfo">
-		SELECT * FROM sporadic_charge_info where organ_id_=#{organId} AND charge_type_=#{chargeType} AND del_flag_=0
-	</select>
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount" resultType="int">
+        SELECT COUNT(sci.id_) FROM sporadic_charge_info sci
+        LEFT JOIN sys_user su ON su.id_ = sci.user_id_
+        <include refid="queryPageSql"/>
+    </select>
+    <select id="findInfoById" resultMap="SporadicChargeInfo">
+        SELECT *
+        FROM sporadic_charge_info
+        where id_ = #{id}
+    </select>
+    <!-- 根据类型和分部id查询活动 -->
+    <select id="findByOrganIdAndType" resultMap="SporadicChargeInfo">
+        SELECT *
+        FROM sporadic_charge_info
+        where organ_id_ = #{organId}
+          AND charge_type_ = #{chargeType}
+          AND del_flag_ = 0
+    </select>
     <select id="getOrganActiveInfo" resultMap="SporadicChargeInfo">
     <select id="getOrganActiveInfo" resultMap="SporadicChargeInfo">
-		SELECT * FROM sporadic_charge_info where organ_id_=#{organId} AND charge_type_=#{chargeType} AND del_flag_=0
-	</select>
+        SELECT *
+        FROM sporadic_charge_info
+        where organ_id_ = #{organId}
+          AND charge_type_ = #{chargeType}
+          AND del_flag_ = 0
+    </select>
 
 
     <select id="getActiveOrgans" resultMap="com.ym.mec.biz.dal.dao.OrganizationDao.Organization">
     <select id="getActiveOrgans" resultMap="com.ym.mec.biz.dal.dao.OrganizationDao.Organization">
-		SELECT o.* FROM sporadic_charge_info sci
-		LEFT JOIN organization o ON o.id_ =sci.organ_id_
-		WHERE sci.charge_type_ = #{type} AND sci.del_flag_=0
-		GROUP BY o.id_
-	</select>
+        SELECT o.*
+        FROM sporadic_charge_info sci
+                 LEFT JOIN organization o ON o.id_ = sci.organ_id_
+        WHERE sci.charge_type_ = #{type}
+          AND sci.del_flag_ = 0
+        GROUP BY o.id_
+    </select>
 </mapper>
 </mapper>

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

@@ -146,7 +146,7 @@ public class MusicGroupController extends BaseController {
         if (studentRegistration == null) {
         if (studentRegistration == null) {
             return failed(HttpStatus.CONTINUE, "乐团报名信息不存在");
             return failed(HttpStatus.CONTINUE, "乐团报名信息不存在");
         }
         }
-        if (studentRegistration.getPaymentStatus() != null && studentRegistration.getPaymentStatus() == PaymentStatusEnum.YES) {
+        if (studentRegistration.getPaymentStatus() != null && studentRegistration.getPaymentStatus() == PaymentStatusEnum.OVER) {
             return failed("您已缴费,请等待乐团开启");
             return failed("您已缴费,请等待乐团开启");
         }
         }
 
 
@@ -192,7 +192,7 @@ public class MusicGroupController extends BaseController {
         MusicGroupPaymentCalenderDetail userLastCalenderDetail = musicGroupPaymentCalenderDetailDao.getUserLastCalenderDetail(musicGroupId, userId);
         MusicGroupPaymentCalenderDetail userLastCalenderDetail = musicGroupPaymentCalenderDetailDao.getUserLastCalenderDetail(musicGroupId, userId);
         if(userLastCalenderDetail == null){
         if(userLastCalenderDetail == null){
             MusicGroupPaymentCalender lastCalender = musicGroupPaymentCalenderDao.getLastStartOne(musicGroupId);
             MusicGroupPaymentCalender lastCalender = musicGroupPaymentCalenderDao.getLastStartOne(musicGroupId);
-           String tips =  (lastCalender != null && lastCalender.getPaymentStatus().equals(PaymentStatusEnum.YES))?"当前续费时间已截止,如有问题请联系指导老师":"当前续费未开始,如有问题请联系指导老师";
+           String tips =  (lastCalender != null && lastCalender.getPaymentStatus().equals(PaymentStatusEnum.OVER))?"当前续费时间已截止,如有问题请联系指导老师":"当前续费未开始,如有问题请联系指导老师";
             throw new BizException(tips);
             throw new BizException(tips);
         }
         }
 
 
@@ -236,7 +236,7 @@ public class MusicGroupController extends BaseController {
         MusicGroupPaymentCalenderDetail userLastCalenderDetail = musicGroupPaymentCalenderDetailDao.getUserLastCalenderDetail(musicGroupId, userId);
         MusicGroupPaymentCalenderDetail userLastCalenderDetail = musicGroupPaymentCalenderDetailDao.getUserLastCalenderDetail(musicGroupId, userId);
         if(userLastCalenderDetail == null){
         if(userLastCalenderDetail == null){
             MusicGroupPaymentCalender lastCalender = musicGroupPaymentCalenderDao.getLastStartOne(musicGroupId);
             MusicGroupPaymentCalender lastCalender = musicGroupPaymentCalenderDao.getLastStartOne(musicGroupId);
-            String tips =  (lastCalender != null && lastCalender.getPaymentStatus().equals(PaymentStatusEnum.YES))?"当前续费时间已截止,如有问题请联系指导老师":"当前续费未开始,如有问题请联系指导老师";
+            String tips =  (lastCalender != null && lastCalender.getPaymentStatus().equals(PaymentStatusEnum.OVER))?"当前续费时间已截止,如有问题请联系指导老师":"当前续费未开始,如有问题请联系指导老师";
             throw new BizException(tips);
             throw new BizException(tips);
         }
         }
         return succeed(musicGroupService.renew(musicGroupId, userId, isUseBalancePayment));
         return succeed(musicGroupService.renew(musicGroupId, userId, isUseBalancePayment));

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

@@ -33,7 +33,7 @@ public class ChargeTypeSubjectMapperController extends BaseController {
     @GetMapping(value = "/queryPage", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     @GetMapping(value = "/queryPage", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     @PreAuthorize("@pcs.hasPermissions('chargeTypeSubjectMapper/queryPage')")
     @PreAuthorize("@pcs.hasPermissions('chargeTypeSubjectMapper/queryPage')")
     public Object queryPage(QueryInfo queryInfo) {
     public Object queryPage(QueryInfo queryInfo) {
-        return succeed();
+        return succeed(chargeTypeSubjectMapperService.queryPage(queryInfo));
     }
     }
 
 
     @ApiOperation(value = "新增对象")
     @ApiOperation(value = "新增对象")

+ 7 - 0
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupOrganizationCourseSettingsController.java

@@ -47,4 +47,11 @@ public class MusicGroupOrganizationCourseSettingsController extends BaseControll
     public HttpResponseResult<MusicGroupOrganizationCourseSettings> update(@RequestBody MusicGroupOrganizationCourseSettings musicGroupOrganizationCourseSettings) {
     public HttpResponseResult<MusicGroupOrganizationCourseSettings> update(@RequestBody MusicGroupOrganizationCourseSettings musicGroupOrganizationCourseSettings) {
         return succeed(musicGroupOrganizationCourseSettingsService.updateSetting(musicGroupOrganizationCourseSettings));
         return succeed(musicGroupOrganizationCourseSettingsService.updateSetting(musicGroupOrganizationCourseSettings));
     }
     }
+
+    @ApiOperation(value = "获取收费设置详情")
+    @GetMapping("/getSetting")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupOrganizationCourseSettings/getSetting')")
+    public HttpResponseResult<MusicGroupOrganizationCourseSettings> getSetting(Integer id) {
+        return succeed(musicGroupOrganizationCourseSettingsService.getSetting(id));
+    }
 }
 }

+ 17 - 3
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupSubjectPlanController.java

@@ -1,10 +1,12 @@
 package com.ym.mec.web.controller;
 package com.ym.mec.web.controller;
 
 
+import com.ym.mec.biz.dal.dto.MusicGroupGoodsAndDiscountDto;
+import com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper;
+import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
+import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.exception.BizException;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.*;
 
 
 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;
@@ -62,4 +64,16 @@ public class MusicGroupSubjectPlanController extends BaseController {
         return succeed(musicGroupSubjectPlanService.findSubjectPlan(musicGroupId,subjectId));
         return succeed(musicGroupSubjectPlanService.findSubjectPlan(musicGroupId,subjectId));
     }
     }
 
 
+
+    @ApiOperation(value = "获取乐团商品和折扣")
+    @GetMapping("/getSubjectGoods")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupSubjectPlan/getSubjectGoods')")
+    @ApiImplicitParams({ @ApiImplicitParam(name = "subjectId", value = "科目编号", required = true, dataType = "Integer"),
+            @ApiImplicitParam(name = "type", value = "INSTRUMENT 乐器, ACCESSORIES 教辅", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "chargeTypeId", value = "收费模式id", required = true, dataType = "Integer")
+    })
+    public HttpResponseResult<List<MusicGroupGoodsAndDiscountDto>> getSubjectGoods(Integer subjectId, String type, Integer chargeTypeId) {
+        return succeed(musicGroupSubjectPlanService.getSubjectGoods(subjectId, type, chargeTypeId));
+    }
+
 }
 }