Explorar o código

Merge remote-tracking branch 'origin/master'

Joburgess %!s(int64=5) %!d(string=hai) anos
pai
achega
c8a745e977
Modificáronse 20 ficheiros con 486 adicións e 240 borrados
  1. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/GoodsDao.java
  2. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupSubjectGoodsGroupDao.java
  3. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupSubjectPlanDao.java
  4. 46 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupSubjectGoodsAndInfo.java
  5. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Goods.java
  6. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupSubjectGoodsGroup.java
  7. 61 40
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java
  8. 10 1
      mec-biz/src/main/java/com/ym/mec/biz/service/GoodsService.java
  9. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupSubjectGoodsGroupService.java
  10. 21 1
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupSubjectPlanService.java
  11. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SubjectService.java
  12. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java
  13. 7 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectGoodsGroupServiceImpl.java
  14. 53 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectPlanServiceImpl.java
  15. 99 99
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SubjectServiceImpl.java
  16. 3 0
      mec-biz/src/main/resources/config/mybatis/GoodsMapper.xml
  17. 89 90
      mec-biz/src/main/resources/config/mybatis/MusicGroupSubjectGoodsGroupMapper.xml
  18. 6 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupSubjectPlanMapper.xml
  19. 1 1
      mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java
  20. 25 0
      mec-student/src/main/java/com/ym/mec/student/controller/RegisterController.java

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/GoodsDao.java

@@ -11,6 +11,7 @@ public interface GoodsDao extends BaseDAO<Integer, Goods> {
 
 
     /**
     /**
      * 通过科目编号查询商品(教材、辅件)列表
      * 通过科目编号查询商品(教材、辅件)列表
+     *
      * @param subjectId
      * @param subjectId
      * @return
      * @return
      */
      */
@@ -18,8 +19,18 @@ public interface GoodsDao extends BaseDAO<Integer, Goods> {
 
 
     /**
     /**
      * 根据商品分类查找商品数量
      * 根据商品分类查找商品数量
+     *
      * @param goodsCategoryId
      * @param goodsCategoryId
      * @return
      * @return
      */
      */
     int findGoodsNumByCategoryId(@Param("goodsCategoryId") Integer goodsCategoryId);
     int findGoodsNumByCategoryId(@Param("goodsCategoryId") Integer goodsCategoryId);
+
+    /**
+     * 根据ids获取商品信息
+     *
+     * @param ids
+     * @return
+     */
+    List<Goods> findGoodsByIds(@Param("ids") String ids);
+
 }
 }

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

@@ -22,5 +22,5 @@ public interface MusicGroupSubjectGoodsGroupDao extends BaseDAO<Long, MusicGroup
      * @param subId
      * @param subId
      * @return
      * @return
      */
      */
-    List<MusicGroupSubjectGoodsGroup> findGoodsGroup(@Param("musicGroupId") Integer musicGroupId, @Param("subId") String subId);
+    List<MusicGroupSubjectGoodsGroup> findGoodsGroup(@Param("musicGroupId") Integer musicGroupId, @Param("subId") Integer subId);
 }
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupSubjectPlanDao.java

@@ -15,4 +15,14 @@ public interface MusicGroupSubjectPlanDao extends BaseDAO<Integer, MusicGroupSub
      * @return
      * @return
      */
      */
     List<MusicGroupSubjectPlan> getMusicSubjectClassPlan(@Param("musicGroupId") int musicGroupId);
     List<MusicGroupSubjectPlan> getMusicSubjectClassPlan(@Param("musicGroupId") int musicGroupId);
+
+
+    /**
+     * 获取乐团声部报名缴费商品信息
+     *
+     * @param musicGroupId
+     * @param subjectId
+     * @return
+     */
+    MusicGroupSubjectPlan getMusicOneSubjectClassPlan(@Param("musicGroupId") int musicGroupId, @Param("subjectId") int subjectId);
 }
 }

+ 46 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupSubjectGoodsAndInfo.java

@@ -0,0 +1,46 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 乐团报名缴费相关信息
+ */
+public class MusicGroupSubjectGoodsAndInfo {
+
+    //课程信息
+    private Map CourseScheduleInfo;
+
+    //乐团声部商品信息
+    private List<MusicGroupSubjectGoodsGroup> musicGroupSubjectGoodsGroupList;
+
+    //乐团计划及收费信息
+    private MusicGroupSubjectPlan musicGroupSubjectPlan;
+
+    public Map getCourseScheduleInfo() {
+        return CourseScheduleInfo;
+    }
+
+    public void setCourseScheduleInfo(Map courseScheduleInfo) {
+        CourseScheduleInfo = courseScheduleInfo;
+    }
+
+    public List<MusicGroupSubjectGoodsGroup> getMusicGroupSubjectGoodsGroupList() {
+        return musicGroupSubjectGoodsGroupList;
+    }
+
+    public void setMusicGroupSubjectGoodsGroupList(List<MusicGroupSubjectGoodsGroup> musicGroupSubjectGoodsGroupList) {
+        this.musicGroupSubjectGoodsGroupList = musicGroupSubjectGoodsGroupList;
+    }
+
+    public MusicGroupSubjectPlan getMusicGroupSubjectPlan() {
+        return musicGroupSubjectPlan;
+    }
+
+    public void setMusicGroupSubjectPlan(MusicGroupSubjectPlan musicGroupSubjectPlan) {
+        this.musicGroupSubjectPlan = musicGroupSubjectPlan;
+    }
+}

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Goods.java

@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.util.List;
 
 
 /**
 /**
  * 对应数据库表(goods):
  * 对应数据库表(goods):
@@ -92,6 +93,9 @@ public class Goods {
 	/** 发布时间 */
 	/** 发布时间 */
 	@ApiModelProperty(value = "附件商品列表编号(用逗号分开)",required = false)
 	@ApiModelProperty(value = "附件商品列表编号(用逗号分开)",required = false)
 	private String complementGoodsIdList;
 	private String complementGoodsIdList;
+
+	/** 辅件列表 */
+	private List<Goods> goodsList;
 	
 	
 	/** 创建时间 */
 	/** 创建时间 */
 	private java.util.Date createTime;
 	private java.util.Date createTime;
@@ -274,6 +278,14 @@ public class Goods {
 	public java.util.Date getUpdateTime(){
 	public java.util.Date getUpdateTime(){
 		return this.updateTime;
 		return this.updateTime;
 	}
 	}
+
+	public List<Goods> getGoodsList() {
+		return goodsList;
+	}
+
+	public void setGoodsList(List<Goods> goodsList) {
+		this.goodsList = goodsList;
+	}
 			
 			
 	@Override
 	@Override
 	public String toString() {
 	public String toString() {

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupSubjectGoodsGroup.java

@@ -39,6 +39,8 @@ public class MusicGroupSubjectGoodsGroup {
 
 
 	@ApiModelProperty(value = "商品名称列表",required = false)
 	@ApiModelProperty(value = "商品名称列表",required = false)
 	private List<String> goodsName;
 	private List<String> goodsName;
+
+	private List<Goods> goodsList;
 	
 	
 	/**  */
 	/**  */
 	private java.util.Date createTime;
 	private java.util.Date createTime;
@@ -135,4 +137,11 @@ public class MusicGroupSubjectGoodsGroup {
 		return ToStringBuilder.reflectionToString(this);
 		return ToStringBuilder.reflectionToString(this);
 	}
 	}
 
 
+	public List<Goods> getGoodsList() {
+		return goodsList;
+	}
+
+	public void setGoodsList(List<Goods> goodsList) {
+		this.goodsList = goodsList;
+	}
 }
 }

+ 61 - 40
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java

@@ -14,26 +14,32 @@ public class StudentRegistration {
 
 
 	/**  */
 	/**  */
 	private Long id;
 	private Long id;
-	
+
 	/**  */
 	/**  */
 	@ApiModelProperty(value = "学生编号",required = false)
 	@ApiModelProperty(value = "学生编号",required = false)
 	private Integer userId;
 	private Integer userId;
 
 
 	@ApiModelProperty(value = "学生姓名",required = true)
 	@ApiModelProperty(value = "学生姓名",required = true)
 	private String name;
 	private String name;
-	
+
+	@ApiModelProperty(value = "性别(0,女  1,男",required = true)
+	private String gender;
+
+	@ApiModelProperty(value = "身份证号",required = true)
+	private String idCardNo;
+
 	/** 所属乐团(对应 music_group 表id) */
 	/** 所属乐团(对应 music_group 表id) */
 	@ApiModelProperty(value = "所属乐团(对应 music_group 表id)",required = false)
 	@ApiModelProperty(value = "所属乐团(对应 music_group 表id)",required = false)
 	private Integer musicGroupId;
 	private Integer musicGroupId;
-	
+
 	/** 当前所在年级 */
 	/** 当前所在年级 */
 	@ApiModelProperty(value = "当前所在年级",required = false)
 	@ApiModelProperty(value = "当前所在年级",required = false)
 	private String currentGrade;
 	private String currentGrade;
-	
+
 	/** 当前所在班级 */
 	/** 当前所在班级 */
 	@ApiModelProperty(value = "当前所在班级",required = false)
 	@ApiModelProperty(value = "当前所在班级",required = false)
 	private String currentClass;
 	private String currentClass;
-	
+
 	/** 报名科目 */
 	/** 报名科目 */
 	@ApiModelProperty(value = "报名科目",required = true)
 	@ApiModelProperty(value = "报名科目",required = true)
 	private Integer subjectId;
 	private Integer subjectId;
@@ -41,25 +47,25 @@ public class StudentRegistration {
 	/** 报名科目 */
 	/** 报名科目 */
 	@ApiModelProperty(value = "实际科目",hidden = true)
 	@ApiModelProperty(value = "实际科目",hidden = true)
 	private Integer actualSubjectId;
 	private Integer actualSubjectId;
-	
+
 	/** 是否允许调剂 */
 	/** 是否允许调剂 */
 	@ApiModelProperty(value = "是否允许调剂",required = false)
 	@ApiModelProperty(value = "是否允许调剂",required = false)
 	private YesOrNoEnum isAllowAdjust;
 	private YesOrNoEnum isAllowAdjust;
-	
+
 	/** 器材购买方式(团购、自备) */
 	/** 器材购买方式(团购、自备) */
 	@ApiModelProperty(value = "器材购买方式(团购、自备)",required = false)
 	@ApiModelProperty(value = "器材购买方式(团购、自备)",required = false)
 	private KitPurchaseMethodEnum kitPurchaseMethod;
 	private KitPurchaseMethodEnum kitPurchaseMethod;
-	
+
 	/**  */
 	/**  */
 	@ApiModelProperty(value = "备注",required = false)
 	@ApiModelProperty(value = "备注",required = false)
 	private String remark;
 	private String remark;
-	
+
 	/**  */
 	/**  */
 	private java.util.Date createTime;
 	private java.util.Date createTime;
-	
+
 	/**  */
 	/**  */
 	private java.util.Date updateTime;
 	private java.util.Date updateTime;
-	
+
 	/** 家长姓名 */
 	/** 家长姓名 */
 	@ApiModelProperty(value = "家长姓名",required = false)
 	@ApiModelProperty(value = "家长姓名",required = false)
 	private String parentsName;
 	private String parentsName;
@@ -67,22 +73,22 @@ public class StudentRegistration {
 	/** 家长姓名 */
 	/** 家长姓名 */
 	@ApiModelProperty(value = "家长电话",required = false)
 	@ApiModelProperty(value = "家长电话",required = false)
 	private String parentsPhone;
 	private String parentsPhone;
-	
+
 	/** 家长单位 */
 	/** 家长单位 */
 	@ApiModelProperty(value = "家长单位",required = false)
 	@ApiModelProperty(value = "家长单位",required = false)
 	private String parentsCompany;
 	private String parentsCompany;
-	
+
 	/** 缴费状态(1-已缴费 0-未交费) */
 	/** 缴费状态(1-已缴费 0-未交费) */
 	@ApiModelProperty(value = "缴费状态(1-已缴费 0-未交费)",required = false)
 	@ApiModelProperty(value = "缴费状态(1-已缴费 0-未交费)",required = false)
 	private YesOrNoEnum paymentStatus;
 	private YesOrNoEnum paymentStatus;
 
 
 	@ApiModelProperty(value = "班级id",hidden = true)
 	@ApiModelProperty(value = "班级id",hidden = true)
 	private Integer ClassGroupId;
 	private Integer ClassGroupId;
-	
+
 	/** 最后缴费日期 */
 	/** 最后缴费日期 */
 	@ApiModelProperty(value = "最后缴费日期",required = false)
 	@ApiModelProperty(value = "最后缴费日期",required = false)
 	private java.util.Date lastPaymentDate;
 	private java.util.Date lastPaymentDate;
-	
+
 	/** 预计下次缴费日期 */
 	/** 预计下次缴费日期 */
 	@ApiModelProperty(value = "预计下次缴费日期",required = false)
 	@ApiModelProperty(value = "预计下次缴费日期",required = false)
 	private java.util.Date nextPaymentDate;
 	private java.util.Date nextPaymentDate;
@@ -106,47 +112,47 @@ public class StudentRegistration {
 	public void setId(Long id){
 	public void setId(Long id){
 		this.id = id;
 		this.id = id;
 	}
 	}
-	
+
 	public Long getId(){
 	public Long getId(){
 		return this.id;
 		return this.id;
 	}
 	}
-			
+
 	public void setUserId(Integer userId){
 	public void setUserId(Integer userId){
 		this.userId = userId;
 		this.userId = userId;
 	}
 	}
-	
+
 	public Integer getUserId(){
 	public Integer getUserId(){
 		return this.userId;
 		return this.userId;
 	}
 	}
-			
+
 	public void setMusicGroupId(Integer musicGroupId){
 	public void setMusicGroupId(Integer musicGroupId){
 		this.musicGroupId = musicGroupId;
 		this.musicGroupId = musicGroupId;
 	}
 	}
-	
+
 	public Integer getMusicGroupId(){
 	public Integer getMusicGroupId(){
 		return this.musicGroupId;
 		return this.musicGroupId;
 	}
 	}
-			
+
 	public void setCurrentGrade(String currentGrade){
 	public void setCurrentGrade(String currentGrade){
 		this.currentGrade = currentGrade;
 		this.currentGrade = currentGrade;
 	}
 	}
-	
+
 	public String getCurrentGrade(){
 	public String getCurrentGrade(){
 		return this.currentGrade;
 		return this.currentGrade;
 	}
 	}
-			
+
 	public void setCurrentClass(String currentClass){
 	public void setCurrentClass(String currentClass){
 		this.currentClass = currentClass;
 		this.currentClass = currentClass;
 	}
 	}
-	
+
 	public String getCurrentClass(){
 	public String getCurrentClass(){
 		return this.currentClass;
 		return this.currentClass;
 	}
 	}
-			
+
 	public void setSubjectId(Integer subjectId){
 	public void setSubjectId(Integer subjectId){
 		this.subjectId = subjectId;
 		this.subjectId = subjectId;
 	}
 	}
-	
+
 	public Integer getSubjectId(){
 	public Integer getSubjectId(){
 		return this.subjectId;
 		return this.subjectId;
 	}
 	}
@@ -174,39 +180,39 @@ public class StudentRegistration {
 	public void setRemark(String remark){
 	public void setRemark(String remark){
 		this.remark = remark;
 		this.remark = remark;
 	}
 	}
-	
+
 	public String getRemark(){
 	public String getRemark(){
 		return this.remark;
 		return this.remark;
 	}
 	}
-			
+
 	public void setCreateTime(java.util.Date createTime){
 	public void setCreateTime(java.util.Date createTime){
 		this.createTime = createTime;
 		this.createTime = createTime;
 	}
 	}
-	
+
 	public java.util.Date getCreateTime(){
 	public java.util.Date getCreateTime(){
 		return this.createTime;
 		return this.createTime;
 	}
 	}
-			
+
 	public void setUpdateTime(java.util.Date updateTime){
 	public void setUpdateTime(java.util.Date updateTime){
 		this.updateTime = updateTime;
 		this.updateTime = updateTime;
 	}
 	}
-	
+
 	public java.util.Date getUpdateTime(){
 	public java.util.Date getUpdateTime(){
 		return this.updateTime;
 		return this.updateTime;
 	}
 	}
-			
+
 	public void setParentsName(String parentsName){
 	public void setParentsName(String parentsName){
 		this.parentsName = parentsName;
 		this.parentsName = parentsName;
 	}
 	}
-	
+
 	public String getParentsName(){
 	public String getParentsName(){
 		return this.parentsName;
 		return this.parentsName;
 	}
 	}
-			
+
 	public void setParentsCompany(String parentsCompany){
 	public void setParentsCompany(String parentsCompany){
 		this.parentsCompany = parentsCompany;
 		this.parentsCompany = parentsCompany;
 	}
 	}
-	
+
 	public String getParentsCompany(){
 	public String getParentsCompany(){
 		return this.parentsCompany;
 		return this.parentsCompany;
 	}
 	}
@@ -218,15 +224,15 @@ public class StudentRegistration {
 	public void setLastPaymentDate(java.util.Date lastPaymentDate){
 	public void setLastPaymentDate(java.util.Date lastPaymentDate){
 		this.lastPaymentDate = lastPaymentDate;
 		this.lastPaymentDate = lastPaymentDate;
 	}
 	}
-	
+
 	public java.util.Date getLastPaymentDate(){
 	public java.util.Date getLastPaymentDate(){
 		return this.lastPaymentDate;
 		return this.lastPaymentDate;
 	}
 	}
-			
+
 	public void setNextPaymentDate(java.util.Date nextPaymentDate){
 	public void setNextPaymentDate(java.util.Date nextPaymentDate){
 		this.nextPaymentDate = nextPaymentDate;
 		this.nextPaymentDate = nextPaymentDate;
 	}
 	}
-	
+
 	public java.util.Date getNextPaymentDate(){
 	public java.util.Date getNextPaymentDate(){
 		return this.nextPaymentDate;
 		return this.nextPaymentDate;
 	}
 	}
@@ -246,10 +252,25 @@ public class StudentRegistration {
 	public void setName(String name) {
 	public void setName(String name) {
 		this.name = name;
 		this.name = name;
 	}
 	}
-			
+
+	public String getIdCardNo() {
+		return idCardNo;
+	}
+
+	public void setIdCardNo(String idCardNo) {
+		this.idCardNo = idCardNo;
+	}
+
+	public String getGender() {
+		return gender;
+	}
+
+	public void setGender(String gender) {
+		this.gender = gender;
+	}
+
 	@Override
 	@Override
 	public String toString() {
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 		return ToStringBuilder.reflectionToString(this);
 	}
 	}
-
 }
 }

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

@@ -11,16 +11,25 @@ public interface GoodsService extends BaseService<Integer, Goods> {
 
 
     /**
     /**
      * 通过科目编号查询商品(教材、辅件)列表
      * 通过科目编号查询商品(教材、辅件)列表
+     *
      * @param subjectId
      * @param subjectId
      * @return
      * @return
      */
      */
-    List<Goods> findGoodsBySubId(Integer subjectId,Integer goodsCategoryId);
+    List<Goods> findGoodsBySubId(Integer subjectId, Integer goodsCategoryId);
 
 
     /**
     /**
      * 根据商品分类id查找商品数量
      * 根据商品分类id查找商品数量
+     *
      * @param goodsCategoryId
      * @param goodsCategoryId
      * @return
      * @return
      */
      */
     int findGoodsNumByCategoryId(@Param("goodsCategoryId") Integer goodsCategoryId);
     int findGoodsNumByCategoryId(@Param("goodsCategoryId") Integer goodsCategoryId);
 
 
+    /**
+     * 根据ids获取商品信息
+     * @param ids
+     * @return
+     */
+    List<Goods> findGoodsByIds(String ids);
+
 }
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupSubjectGoodsGroupService.java

@@ -3,6 +3,16 @@ package com.ym.mec.biz.service;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.common.service.BaseService;
 
 
+import java.util.List;
+
 public interface MusicGroupSubjectGoodsGroupService extends BaseService<Long, MusicGroupSubjectGoodsGroup> {
 public interface MusicGroupSubjectGoodsGroupService extends BaseService<Long, MusicGroupSubjectGoodsGroup> {
 
 
+    /**
+     * 获取乐团声部对应的商品
+     * @param musicGroupId
+     * @param subId
+     * @return
+     */
+    List<MusicGroupSubjectGoodsGroup> findGoodsGroup(Integer musicGroupId, Integer subId);
+
 }
 }

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

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service;
 package com.ym.mec.biz.service;
 
 
+import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfo;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.common.service.BaseService;
 
 
@@ -11,9 +12,28 @@ public interface MusicGroupSubjectPlanService extends BaseService<Integer, Music
 
 
     /**
     /**
      * 获取乐团声部招生计划
      * 获取乐团声部招生计划
+     *
      * @param musicGroupId
      * @param musicGroupId
      * @return
      * @return
      */
      */
-    List<MusicGroupSubjectPlan> getMusicSubjectClassPlan(@Param("musicGroupId") int musicGroupId);
+    List<MusicGroupSubjectPlan> getMusicSubjectClassPlan(int musicGroupId);
+
+
+    /**
+     * 获取单一乐团声部招生计划
+     *
+     * @param musicGroupId
+     * @return
+     */
+    MusicGroupSubjectPlan getMusicOneSubjectClassPlan(int musicGroupId, int subjectId);
+
+    /**
+     * 获取乐团声部报名缴费商品信息
+     *
+     * @param musicGroupId
+     * @param subjectId
+     * @return
+     */
+    MusicGroupSubjectGoodsAndInfo getSubjectGoodsAndInfo(Integer musicGroupId, Integer subjectId);
 
 
 }
 }

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

@@ -3,6 +3,7 @@ package com.ym.mec.biz.service;
 import com.ym.mec.biz.dal.dto.ConditionDto;
 import com.ym.mec.biz.dal.dto.ConditionDto;
 import com.ym.mec.biz.dal.dto.QueryConditionDto;
 import com.ym.mec.biz.dal.dto.QueryConditionDto;
 import com.ym.mec.biz.dal.dto.SubjectApplyDetailDto;
 import com.ym.mec.biz.dal.dto.SubjectApplyDetailDto;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
 import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.entity.SubjectGoodsMapper;
 import com.ym.mec.biz.dal.entity.SubjectGoodsMapper;
 import com.ym.mec.biz.dal.page.SubjectQueryInfo;
 import com.ym.mec.biz.dal.page.SubjectQueryInfo;
@@ -17,6 +18,7 @@ public interface SubjectService extends BaseService<Integer, Subject> {
 
 
     /**
     /**
      * 通过乐团编号查询科目列表
      * 通过乐团编号查询科目列表
+     *
      * @param musicGroupId
      * @param musicGroupId
      * @return
      * @return
      */
      */
@@ -24,6 +26,7 @@ public interface SubjectService extends BaseService<Integer, Subject> {
 
 
     /**
     /**
      * 分页查询科目树状列表
      * 分页查询科目树状列表
+     *
      * @param queryInfo
      * @param queryInfo
      * @return
      * @return
      */
      */
@@ -31,6 +34,7 @@ public interface SubjectService extends BaseService<Integer, Subject> {
 
 
     /**
     /**
      * 通过乐团收费类型,获取默认的声部列表
      * 通过乐团收费类型,获取默认的声部列表
+     *
      * @param musicGroupId
      * @param musicGroupId
      * @return
      * @return
      */
      */
@@ -38,6 +42,7 @@ public interface SubjectService extends BaseService<Integer, Subject> {
 
 
     /**
     /**
      * 通过乐团编号获取声部列表以及声部报名、缴费、计划人数
      * 通过乐团编号获取声部列表以及声部报名、缴费、计划人数
+     *
      * @param musicGroupId
      * @param musicGroupId
      * @return
      * @return
      */
      */
@@ -45,12 +50,14 @@ public interface SubjectService extends BaseService<Integer, Subject> {
 
 
     /**
     /**
      * 修改、新增科目树状列表
      * 修改、新增科目树状列表
+     *
      * @param subject
      * @param subject
      */
      */
     void upSetSubject(Subject subject);
     void upSetSubject(Subject subject);
 
 
     /**
     /**
      * 修改、保存声部与乐器关联
      * 修改、保存声部与乐器关联
+     *
      * @param subjectGoodsMappers
      * @param subjectGoodsMappers
      */
      */
     void markGoods(List<SubjectGoodsMapper> subjectGoodsMappers);
     void markGoods(List<SubjectGoodsMapper> subjectGoodsMappers);

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

@@ -30,4 +30,9 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 	public int findGoodsNumByCategoryId(Integer goodsCategoryId){
 	public int findGoodsNumByCategoryId(Integer goodsCategoryId){
 		return goodsDao.findGoodsNumByCategoryId(goodsCategoryId);
 		return goodsDao.findGoodsNumByCategoryId(goodsCategoryId);
 	}
 	}
+
+	@Override
+	public List<Goods> findGoodsByIds(String ids) {
+		return goodsDao.findGoodsByIds(ids);
+	}
 }
 }

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

@@ -9,6 +9,8 @@ import com.ym.mec.biz.service.MusicGroupSubjectGoodsGroupService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 
 
+import java.util.List;
+
 @Service
 @Service
 public class MusicGroupSubjectGoodsGroupServiceImpl extends BaseServiceImpl<Long, MusicGroupSubjectGoodsGroup>  implements MusicGroupSubjectGoodsGroupService {
 public class MusicGroupSubjectGoodsGroupServiceImpl extends BaseServiceImpl<Long, MusicGroupSubjectGoodsGroup>  implements MusicGroupSubjectGoodsGroupService {
 	
 	
@@ -19,5 +21,9 @@ public class MusicGroupSubjectGoodsGroupServiceImpl extends BaseServiceImpl<Long
 	public BaseDAO<Long, MusicGroupSubjectGoodsGroup> getDAO() {
 	public BaseDAO<Long, MusicGroupSubjectGoodsGroup> getDAO() {
 		return musicGroupSubjectGoodsGroupDao;
 		return musicGroupSubjectGoodsGroupDao;
 	}
 	}
-	
+
+	@Override
+    public List<MusicGroupSubjectGoodsGroup> findGoodsGroup(Integer musicGroupId, Integer subId) {
+        return musicGroupSubjectGoodsGroupDao.findGoodsGroup(musicGroupId, subId);
+    }
 }
 }

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

@@ -1,17 +1,24 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
+import com.alibaba.fastjson.JSON;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
+import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfo;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
+import com.ym.mec.biz.dal.enums.GoodsType;
+import com.ym.mec.biz.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import com.ym.mec.biz.dal.dao.MusicGroupSubjectPlanDao;
 import com.ym.mec.biz.dal.dao.MusicGroupSubjectPlanDao;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
-import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
-import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 @Service
 @Service
 public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, MusicGroupSubjectPlan> implements MusicGroupSubjectPlanService {
 public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, MusicGroupSubjectPlan> implements MusicGroupSubjectPlanService {
@@ -20,7 +27,16 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
     private MusicGroupSubjectPlanDao musicGroupSubjectPlanDao;
     private MusicGroupSubjectPlanDao musicGroupSubjectPlanDao;
 
 
     @Autowired
     @Autowired
-	private StudentRegistrationService studentRegistrationService;
+    private StudentRegistrationService studentRegistrationService;
+
+    @Autowired
+    private GoodsService goodsService;
+
+    @Autowired
+    private MusicGroupSubjectGoodsGroupService musicGroupSubjectGoodsGroupService;
+
+    @Autowired
+    private MusicGroupService musicGroupService;
 
 
     @Override
     @Override
     public BaseDAO<Integer, MusicGroupSubjectPlan> getDAO() {
     public BaseDAO<Integer, MusicGroupSubjectPlan> getDAO() {
@@ -31,9 +47,40 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
     public List<MusicGroupSubjectPlan> getMusicSubjectClassPlan(int musicGroupId) {
     public List<MusicGroupSubjectPlan> getMusicSubjectClassPlan(int musicGroupId) {
         List<MusicGroupSubjectPlan> musicSubjectClassPlans = musicGroupSubjectPlanDao.getMusicSubjectClassPlan(musicGroupId);
         List<MusicGroupSubjectPlan> musicSubjectClassPlans = musicGroupSubjectPlanDao.getMusicSubjectClassPlan(musicGroupId);
         for (MusicGroupSubjectPlan musicSubjectClassPlan : musicSubjectClassPlans) {
         for (MusicGroupSubjectPlan musicSubjectClassPlan : musicSubjectClassPlans) {
-			Integer noClassStuCount = studentRegistrationService.getNoClassStuCountBySubjectId(musicGroupId, musicSubjectClassPlan.getSubjectId());
-			musicSubjectClassPlan.setNoClassStudentNum(noClassStuCount);
-		}
+            Integer noClassStuCount = studentRegistrationService.getNoClassStuCountBySubjectId(musicGroupId, musicSubjectClassPlan.getSubjectId());
+            musicSubjectClassPlan.setNoClassStudentNum(noClassStuCount);
+        }
         return musicSubjectClassPlans;
         return musicSubjectClassPlans;
     }
     }
+
+    @Override
+    public MusicGroupSubjectPlan getMusicOneSubjectClassPlan(int musicGroupId, int subjectId) {
+        return musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, subjectId);
+    }
+
+    @Override
+    public MusicGroupSubjectGoodsAndInfo getSubjectGoodsAndInfo(Integer musicGroupId, Integer subjectId) {
+        MusicGroup musicGroup = musicGroupService.get(musicGroupId.toString());
+
+        //课程形态
+        Map<String, Object> courseForm = JSON.parseObject(musicGroup.getCourseForm(), Map.class);
+
+        //乐团计划及收费信息
+        MusicGroupSubjectPlan musicOneSubjectClassPlan = this.getMusicOneSubjectClassPlan(musicGroupId, subjectId);
+
+        //乐团乐器及辅件信息
+        List<MusicGroupSubjectGoodsGroup> goodsGroups = musicGroupSubjectGoodsGroupService.findGoodsGroup(musicGroupId, subjectId);
+        goodsGroups.forEach(goodsGroup -> {
+            if (goodsGroup.getType().equals(GoodsType.INSTRUMENT)) {
+                goodsGroup.getGoodsList().forEach(goods -> {
+                    goods.setGoodsList(goodsService.findGoodsByIds(goods.getComplementGoodsIdList()));
+                });
+            }
+        });
+        MusicGroupSubjectGoodsAndInfo musicGroupSubjectGoodsAndInfo = new MusicGroupSubjectGoodsAndInfo();
+        musicGroupSubjectGoodsAndInfo.setMusicGroupSubjectPlan(musicOneSubjectClassPlan);
+        musicGroupSubjectGoodsAndInfo.setCourseScheduleInfo(courseForm);
+        musicGroupSubjectGoodsAndInfo.setMusicGroupSubjectGoodsGroupList(goodsGroups);
+        return musicGroupSubjectGoodsAndInfo;
+    }
 }
 }

+ 99 - 99
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SubjectServiceImpl.java

@@ -26,67 +26,67 @@ import java.util.List;
 @Service
 @Service
 public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject>  implements SubjectService {
 public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject>  implements SubjectService {
 
 
-	@Autowired
-	private SubjectDao subjectDao;
-	@Autowired
-	private StudentRegistrationDao studentRegistrationDao;
-	@Autowired
-	private SubjectGoodsMapperDao subjectGoodsMapperDao;
-	@Autowired
-	private SysUserFeignService sysUserFeignService;
-
-	@Override
-	public BaseDAO<Integer, Subject> getDAO() {
-		return subjectDao;
-	}
-
-	@Override
-	public List<Subject> findSubByMusicGroupId(Integer musicGroupId) {
-		return subjectDao.findSubByMusicGroupId(musicGroupId);
-	}
-
-	@Override
-	public PageInfo<Subject> queryPageTree(SubjectQueryInfo queryInfo) {
-		PageInfo<Subject> pageInfo = queryPage(queryInfo);
-		for (Subject subject:pageInfo.getRows()) {
-			subject = getTree(subject,queryInfo.getDelFlag());
-		}
-		return pageInfo;
-	}
-
-	@Override
-	public List<Subject> findDefaultSubByGroupId(Integer musicGroupId) {
-		return subjectDao.findDefaultSubByGroupId(musicGroupId);
-	}
-
-	@Override
-	public List<SubjectApplyDetailDto> findSubApplyDetail(Integer musicGroupId) {
-		List<SubjectApplyDetailDto> subApplyDetail = subjectDao.findSubApplyDetail(musicGroupId);
-		subApplyDetail.forEach(detail ->{
-			detail.setPayNum(studentRegistrationDao.countPayNum(musicGroupId,detail.getSubjectId()));
-		});
-		return subApplyDetail;
-	}
-
-	@Override
-	public void upSetSubject(Subject subject) {
-		Integer parentId = upset(subject, null);
-		List<Subject> subjects = subject.getSubjects();
-		if(subjects != null && subjects.size() > 0){
-			subjects.forEach(e->{
-				upset(e, parentId);
-			});
-		}
-	}
-
-	@Override
-	public void markGoods(List<SubjectGoodsMapper> subjectGoodsMappers) {
-		subjectGoodsMappers.forEach(e->{
+    @Autowired
+    private SubjectDao subjectDao;
+    @Autowired
+    private StudentRegistrationDao studentRegistrationDao;
+    @Autowired
+    private SubjectGoodsMapperDao subjectGoodsMapperDao;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @Override
+    public BaseDAO<Integer, Subject> getDAO() {
+        return subjectDao;
+    }
+
+    @Override
+    public List<Subject> findSubByMusicGroupId(Integer musicGroupId) {
+        return subjectDao.findSubByMusicGroupId(musicGroupId);
+    }
+
+    @Override
+    public PageInfo<Subject> queryPageTree(SubjectQueryInfo queryInfo) {
+        PageInfo<Subject> pageInfo = queryPage(queryInfo);
+        for (Subject subject:pageInfo.getRows()) {
+            subject = getTree(subject,queryInfo.getDelFlag());
+        }
+        return pageInfo;
+    }
+
+    @Override
+    public List<Subject> findDefaultSubByGroupId(Integer musicGroupId) {
+        return subjectDao.findDefaultSubByGroupId(musicGroupId);
+    }
+
+    @Override
+    public List<SubjectApplyDetailDto> findSubApplyDetail(Integer musicGroupId) {
+        List<SubjectApplyDetailDto> subApplyDetail = subjectDao.findSubApplyDetail(musicGroupId);
+        subApplyDetail.forEach(detail ->{
+            detail.setPayNum(studentRegistrationDao.countPayNum(musicGroupId,detail.getSubjectId()));
+        });
+        return subApplyDetail;
+    }
+
+    @Override
+    public void upSetSubject(Subject subject) {
+        Integer parentId = upset(subject, null);
+        List<Subject> subjects = subject.getSubjects();
+        if(subjects != null && subjects.size() > 0){
+            subjects.forEach(e->{
+                upset(e, parentId);
+            });
+        }
+    }
+
+    @Override
+    public void markGoods(List<SubjectGoodsMapper> subjectGoodsMappers) {
+        subjectGoodsMappers.forEach(e->{
             upsetGoods(e);
             upsetGoods(e);
         });
         });
-	}
+    }
 
 
-	private void upsetGoods(SubjectGoodsMapper subjectGoodsMapper){
+    private void upsetGoods(SubjectGoodsMapper subjectGoodsMapper){
         if(subjectGoodsMapper.getId() != null){
         if(subjectGoodsMapper.getId() != null){
             if(subjectGoodsMapper.getDelFlag()){
             if(subjectGoodsMapper.getDelFlag()){
                 subjectGoodsMapperDao.delete(subjectGoodsMapper.getId());
                 subjectGoodsMapperDao.delete(subjectGoodsMapper.getId());
@@ -97,45 +97,45 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject>  imple
         }else {
         }else {
             subjectGoodsMapperDao.insert(subjectGoodsMapper);
             subjectGoodsMapperDao.insert(subjectGoodsMapper);
         }
         }
-	}
-
-
-	private Integer upset(Subject subject,Integer parentId){
-		if(parentId != null){
-			subject.setParentSubjectId(parentId);
-		}
-		if(subject.getId() != null){
-			subject.setUpdateTime(new Date());
-			subjectDao.update(subject);
-		}else {
-			subjectDao.insert(subject);
-		}
-		return subject.getId();
-	}
-
-	private Subject getTree(Subject sub,YesOrNoEnum yesOrNoEnum){
-		//得到根节点对象
-		//获取子节点list
-		List<Subject> subjects = subjectDao.findByParentId(sub.getCode(),yesOrNoEnum);
-		//如果存在子节点
-		if(subjects != null && subjects.size() > 0) {
-			//将子节点list放入父节点对象
-			sub.setSubjects(subjects);
-			//遍历子节点....
-			for (Subject subject : subjects) {
-				getTree(subject,yesOrNoEnum);
-			}
-		}
-		return sub;
-	}
-
-	@Override
-	public List<Subject> findTeacherSubjects() {
-		return subjectDao.findTeacherSubjects(sysUserFeignService.queryUserInfo().getId().longValue());
-	}
-
-	@Override
-	public List<ConditionDto> findSubjectConditions() {
-		return subjectDao.findSubjectConditions();
-	}
+    }
+
+
+    private Integer upset(Subject subject,Integer parentId){
+        if(parentId != null){
+            subject.setParentSubjectId(parentId);
+        }
+        if(subject.getId() != null){
+            subject.setUpdateTime(new Date());
+            subjectDao.update(subject);
+        }else {
+            subjectDao.insert(subject);
+        }
+        return subject.getId();
+    }
+
+    private Subject getTree(Subject sub,YesOrNoEnum yesOrNoEnum){
+        //得到根节点对象
+        //获取子节点list
+        List<Subject> subjects = subjectDao.findByParentId(sub.getCode(),yesOrNoEnum);
+        //如果存在子节点
+        if(subjects != null && subjects.size() > 0) {
+            //将子节点list放入父节点对象
+            sub.setSubjects(subjects);
+            //遍历子节点....
+            for (Subject subject : subjects) {
+                getTree(subject,yesOrNoEnum);
+            }
+        }
+        return sub;
+    }
+
+    @Override
+    public List<Subject> findTeacherSubjects() {
+        return subjectDao.findTeacherSubjects(sysUserFeignService.queryUserInfo().getId().longValue());
+    }
+
+    @Override
+    public List<ConditionDto> findSubjectConditions() {
+        return subjectDao.findSubjectConditions();
+    }
 }
 }

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

@@ -143,4 +143,7 @@
     <select id="findGoodsNumByCategoryId" resultType="int">
     <select id="findGoodsNumByCategoryId" resultType="int">
         SELECT COUNT(*) FROM goods WHERE goods_category_id_ = #{goodsCategoryId}
         SELECT COUNT(*) FROM goods WHERE goods_category_id_ = #{goodsCategoryId}
     </select>
     </select>
+    <select id="findGoodsByIds" resultMap="Goods">
+        SELECT * FROM goods WHERE FIND_IN_SET(id_,#{ids})
+    </select>
 </mapper>
 </mapper>

+ 89 - 90
mec-biz/src/main/resources/config/mybatis/MusicGroupSubjectGoodsGroupMapper.xml

@@ -3,106 +3,105 @@
 <!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
 <!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
 <mapper namespace="com.ym.mec.biz.dal.dao.MusicGroupSubjectGoodsGroupDao">
 <mapper namespace="com.ym.mec.biz.dal.dao.MusicGroupSubjectGoodsGroupDao">
 
 
-	<resultMap type="com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup"
-		id="MusicGroupSubjectGoodsGroup">
-		<result column="id_" property="id" />
-		<result column="name_" property="name" />
-		<result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
-		<result column="music_group_id_" property="musicGroupId" />
-		<result column="subject_id_" property="subjectId" />
-		<result column="goods_id_list_" property="goodsIdList" />
-		<result column="create_time_" property="createTime" />
-		<result column="update_time_" property="updateTime" />
-		<result column="price_" property="price" />
-	</resultMap>
+    <resultMap type="com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup"
+               id="MusicGroupSubjectGoodsGroup">
+        <result column="id_" property="id"/>
+        <result column="name_" property="name"/>
+        <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="music_group_id_" property="musicGroupId"/>
+        <result column="subject_id_" property="subjectId"/>
+        <result column="goods_id_list_" property="goodsIdList"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+        <result column="price_" property="price"/>
+    </resultMap>
 
 
-	<!-- 根据主键查询一条记录 -->
-	<select id="get" resultMap="MusicGroupSubjectGoodsGroup">
-		SELECT
-		* FROM music_group_subject_goods_group WHERE id_ = #{id}
-	</select>
+    <!-- 根据主键查询一条记录 -->
+    <select id="get" resultMap="MusicGroupSubjectGoodsGroup">
+        SELECT
+        * FROM music_group_subject_goods_group WHERE id_ = #{id}
+    </select>
 
 
-	<!-- 全查询 -->
-	<select id="findAll" resultMap="MusicGroupSubjectGoodsGroup">
-		SELECT * FROM
-		music_group_subject_goods_group ORDER BY id_
-	</select>
+    <!-- 全查询 -->
+    <select id="findAll" resultMap="MusicGroupSubjectGoodsGroup">
+        SELECT *
+        FROM music_group_subject_goods_group
+        ORDER BY id_
+    </select>
 
 
-	<!-- 向数据库增加一条记录 -->
-	<insert id="insert"
-		parameterType="com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup"
-		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO music_group_subject_goods_group
-		(id_,name_,type_,music_group_id_,subject_id_,goods_id_list_,create_time_,update_time_,price_)
-		VALUES(#{id},#{name},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{musicGroupId},#{subjectId},#{goodsIdList},NOW(),NOW(),#{price})
-	</insert>
+    <!-- 向数据库增加一条记录 -->
+    <insert id="insert"
+            parameterType="com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup"
+            useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+        INSERT INTO music_group_subject_goods_group
+        (id_,name_,type_,music_group_id_,subject_id_,goods_id_list_,create_time_,update_time_,price_)
+        VALUES(#{id},#{name},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{musicGroupId},#{subjectId},#{goodsIdList},NOW(),NOW(),#{price})
+    </insert>
 
 
     <insert id="batchInsert" parameterType="java.util.List">
     <insert id="batchInsert" parameterType="java.util.List">
-		INSERT INTO music_group_subject_goods_group (id_,name_,type_,music_group_id_,subject_id_,goods_id_list_,create_time_,update_time_,price_) VALUES
-		<foreach collection="mappers" item="item" index="index" separator=",">
-			VALUES(#{item.id},#{item.name},#{item.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.musicGroupId},#{item.subjectId},#{item.goodsIdList},NOW(),NOW(),#{item.price})
-		</foreach>
-	</insert>
+        INSERT INTO music_group_subject_goods_group
+        (id_,name_,type_,music_group_id_,subject_id_,goods_id_list_,create_time_,update_time_,price_) VALUES
+        <foreach collection="mappers" item="item" index="index" separator=",">
+            VALUES(#{item.id},#{item.name},#{item.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.musicGroupId},#{item.subjectId},#{item.goodsIdList},NOW(),NOW(),#{item.price})
+        </foreach>
+    </insert>
 
 
     <!-- 根据主键查询一条记录 -->
     <!-- 根据主键查询一条记录 -->
-	<update id="update"
-		parameterType="com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup">
-		UPDATE music_group_subject_goods_group
-		<set>
-			<if test="price != null">
-				price_ = #{price},
-			</if>
-			<if test="subjectId != null">
-				subject_id_ = #{subjectId},
-			</if>
-			<if test="goodsIdList != null">
-				goods_id_list_ = #{goodsIdList},
-			</if>
-			<if test="updateTime != null">
-				update_time_ = #{updateTime},
-			</if>
-			<if test="type != null">
-				type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-			</if>
-			<if test="musicGroupId != null">
-				music_group_id_ = #{musicGroupId},
-			</if>
-			<if test="name != null">
-				name_ = #{name},
-			</if>
-		</set>
-		WHERE id_ = #{id}
-	</update>
+    <update id="update"
+            parameterType="com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup">
+        UPDATE music_group_subject_goods_group
+        <set>
+            <if test="price != null">
+                price_ = #{price},
+            </if>
+            <if test="subjectId != null">
+                subject_id_ = #{subjectId},
+            </if>
+            <if test="goodsIdList != null">
+                goods_id_list_ = #{goodsIdList},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = #{updateTime},
+            </if>
+            <if test="type != null">
+                type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="musicGroupId != null">
+                music_group_id_ = #{musicGroupId},
+            </if>
+            <if test="name != null">
+                name_ = #{name},
+            </if>
+        </set>
+        WHERE id_ = #{id}
+    </update>
 
 
-	<!-- 根据主键删除一条记录 -->
-	<delete id="delete">
-		DELETE FROM music_group_subject_goods_group
-		WHERE id_ = #{id}
-	</delete>
+    <!-- 根据主键删除一条记录 -->
+    <delete id="delete">
+        DELETE FROM music_group_subject_goods_group
+        WHERE id_ = #{id}
+    </delete>
 
 
-	<!-- 分页查询 -->
-	<select id="queryPage" resultMap="MusicGroupSubjectGoodsGroup"
-		parameterType="map">
-		SELECT * FROM music_group_subject_goods_group ORDER BY id_
-		<include refid="global.limit" />
-	</select>
+    <!-- 分页查询 -->
+    <select id="queryPage" resultMap="MusicGroupSubjectGoodsGroup"
+            parameterType="map">
+        SELECT * FROM music_group_subject_goods_group ORDER BY id_
+        <include refid="global.limit"/>
+    </select>
 
 
-	<!-- 查询当前表的总记录数 -->
-	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM
-		music_group_subject_goods_group
-	</select>
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount" resultType="int">
+        SELECT COUNT(*)
+        FROM music_group_subject_goods_group
+    </select>
 
 
-	<resultMap type="com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup" id="findGoodsGroupMap">
-		<result column="name_" property="name" />
-		<result column="type_" property="type" />
-		<result column="price_" property="price" />
-		<result column="id_" property="id" />
-		<collection property="goodsName" column="goods_name_" ofType="java.lang.String" javaType="java.util.List"/>
-	</resultMap>
+    <resultMap type="com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup" extends="MusicGroupSubjectGoodsGroup" id="findGoodsGroupMap">
+        <collection property="goodsList" resultMap="com.ym.mec.biz.dal.dao.GoodsDao.Goods" columnPrefix="g_" />
+    </resultMap>
     <select id="findGoodsGroup" resultMap="findGoodsGroupMap">
     <select id="findGoodsGroup" resultMap="findGoodsGroupMap">
-		SELECT mgs.name_,mgs.type_,mgs.price_,g.name_ goods_name_,mgs.id_ FROM music_group_subject_goods_group mgs
-		LEFT JOIN goods g ON g.id_ IN (mgs.goods_id_list_)
-		WHERE mgs.music_group_id_ = #{musicGroupId} AND mgs.subject_id_ = #{subId}
-	</select>
+        SELECT mgs.*, g.id_ g_id_,g.name_ g_name_,g.market_price_  g_market_price_,g.complement_goods_id_list_ g_complement_goods_id_list_
+        FROM music_group_subject_goods_group mgs,goods g
+        WHERE FIND_IN_SET (g.id_ ,mgs.goods_id_list_)
+        AND mgs.music_group_id_ = #{musicGroupId} AND mgs.subject_id_ = #{subId}
+    </select>
 </mapper>
 </mapper>

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

@@ -97,4 +97,10 @@
         LEFT JOIN subject sb ON sb.id_ = sp.subject_id_
         LEFT JOIN subject sb ON sb.id_ = sp.subject_id_
         WHERE sp.music_group_id_=#{musicGroupId}
         WHERE sp.music_group_id_=#{musicGroupId}
     </select>
     </select>
+    <select id="getMusicOneSubjectClassPlan" resultMap="MusicGroupSubjectPlan">
+        SELECT sp.*, sb.name_
+        FROM music_group_subject_plan sp
+        LEFT JOIN subject sb ON sb.id_ = sp.subject_id_
+        WHERE sp.music_group_id_=#{musicGroupId} AND sp.subject_id_=#{subjectId}
+    </select>
 </mapper>
 </mapper>

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java

@@ -22,7 +22,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 
 
 	@Override
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
 	public void configure(HttpSecurity http) throws Exception {
-		http.csrf().disable().authorizeRequests().antMatchers("/v2/api-docs", "/register/findSubByMusicGroupId").permitAll().anyRequest().authenticated().and().httpBasic();
+		http.csrf().disable().authorizeRequests().antMatchers("/v2/api-docs", "/register/findSubByMusicGroupId","/register/findGoodsGroups").permitAll().anyRequest().authenticated().and().httpBasic();
 	}
 	}
 
 
 	@Override
 	@Override

+ 25 - 0
mec-student/src/main/java/com/ym/mec/student/controller/RegisterController.java

@@ -1,7 +1,14 @@
 package com.ym.mec.student.controller;
 package com.ym.mec.student.controller;
 
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfo;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.entity.Subject;
+import com.ym.mec.biz.service.MusicGroupSubjectGoodsGroupService;
+import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
 import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.biz.service.SubjectService;
 import com.ym.mec.biz.service.SubjectService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.controller.BaseController;
@@ -12,6 +19,9 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
+import javax.annotation.Resource;
+import java.util.List;
+
 @RequestMapping("register")
 @RequestMapping("register")
 @Api(tags = "乐团注册")
 @Api(tags = "乐团注册")
 @RestController
 @RestController
@@ -21,6 +31,10 @@ public class RegisterController extends BaseController {
     private StudentRegistrationService studentRegistrationService;
     private StudentRegistrationService studentRegistrationService;
     @Autowired
     @Autowired
     private SubjectService subjectService;
     private SubjectService subjectService;
+    @Autowired
+    private MusicGroupSubjectPlanService musicGroupSubjectPlanService;
+    @Resource
+    private SysUserFeignService sysUserFeignService;
 
 
 
 
     @ApiOperation(value = "新增学生报名信息")
     @ApiOperation(value = "新增学生报名信息")
@@ -36,4 +50,15 @@ public class RegisterController extends BaseController {
     public Object findSubByMusicGroupId(Integer musicGroupId) {
     public Object findSubByMusicGroupId(Integer musicGroupId) {
         return succeed(subjectService.findSubByMusicGroupId(musicGroupId));
         return succeed(subjectService.findSubByMusicGroupId(musicGroupId));
     }
     }
+
+
+    @ApiOperation(value = "获取乐团声部的乐器和辅件")
+    @GetMapping("/findGoodsGroups")
+    @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "Integer")})
+    public Object findGoodsGroups(Integer musicGroupId) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        MusicGroupSubjectGoodsAndInfo subjectGoodsAndInfo = musicGroupSubjectPlanService.getSubjectGoodsAndInfo(musicGroupId, 1);
+        return succeed(subjectGoodsAndInfo);
+    }
+
 }
 }