浏览代码

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 5 年之前
父节点
当前提交
9618d1e4ee
共有 16 个文件被更改,包括 306 次插入21 次删除
  1. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupRelationDao.java
  2. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDetailDao.java
  3. 12 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java
  4. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupRelationService.java
  5. 19 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupStudentMapperService.java
  6. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleStudentPaymentService.java
  7. 17 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderDetailService.java
  8. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupRelationServiceImpl.java
  9. 110 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java
  10. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java
  11. 36 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderDetailServiceImpl.java
  12. 5 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupRelationMapper.xml
  13. 20 8
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderDetailMapper.xml
  14. 5 2
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  15. 24 0
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupStudentController.java
  16. 14 0
      mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentOrderController.java

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

@@ -12,6 +12,7 @@ public interface ClassGroupRelationDao extends BaseDAO<Integer, ClassGroupRelati
 
     /**
      * 批量插入班级关联关系
+     *
      * @param classGroupRelationList
      * @return
      */
@@ -19,7 +20,15 @@ public interface ClassGroupRelationDao extends BaseDAO<Integer, ClassGroupRelati
 
     /**
      * 删除班级关系
+     *
      * @param classGroupId
      */
     void deleteByClassId(Integer classGroupId);
+
+    /**
+     * 根据子班id'查询父班id
+     * @param subClassGroupId
+     * @return
+     */
+    ClassGroupRelation findClassGroupRelation(@Param("subClassGroupId") Integer subClassGroupId);
 }

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

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 
@@ -16,4 +17,12 @@ public interface StudentPaymentOrderDetailDao extends BaseDAO<Long, StudentPayme
      * @return
      */
     int batchAdd(@Param("studentPaymentOrderDetailList") List<StudentPaymentOrderDetail> studentPaymentOrderDetailList);
+
+    /**
+     * 查询注册支付的订单详情
+     * @param musicGroupId
+     * @param status
+     * @return
+     */
+    List<StudentPaymentOrderDetail> findApplyOrderSuccess(@Param("musicGroupId") String musicGroupId, @Param("status") DealStatusEnum status);
 }

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

@@ -85,9 +85,12 @@ public class StudentRegistration {
     @ApiModelProperty(value = "用户所在乐团状态)",required = false)
     private ClassGroupStudentStatusEnum musicGroupStatus;
 
-    @ApiModelProperty(value = "班级ids", required = true)
+    @ApiModelProperty(value = "班级id", required = true)
     private Integer classGroupId;
 
+    @ApiModelProperty(value = "班级名称", required = true)
+    private String classGroupName;
+
     @ApiModelProperty(value = "零时课程费用", required = true)
     private BigDecimal temporaryCourseFee;
 
@@ -293,6 +296,14 @@ public class StudentRegistration {
         this.subjectName = subjectName;
     }
 
+    public String getClassGroupName() {
+        return classGroupName;
+    }
+
+    public void setClassGroupName(String classGroupName) {
+        this.classGroupName = classGroupName;
+    }
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupRelationService.java

@@ -17,4 +17,10 @@ public interface ClassGroupRelationService extends BaseService<Integer, ClassGro
      */
     int classGroupRelationsInsert(List<ClassGroupRelation> classGroupRelationList);
 
+    /**
+     * 查询班级父班级id
+     */
+
+    ClassGroupRelation findClassGroupRelation(Integer subClassGroupId);
+
 }

+ 19 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupStudentMapperService.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service;
 
+import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
@@ -35,4 +36,22 @@ public interface ClassGroupStudentMapperService extends BaseService<Long, ClassG
      * @return
      */
     List<StudentRegistration> findClassStudentList(Integer classGroupId, ClassGroupStudentStatusEnum status);
+
+    /**
+     * 调整班级
+     * @param userId
+     * @param oldClassGroupId
+     * @param classGroupId
+     * @return
+     */
+    boolean adjustClassGroup(Integer userId,Integer oldClassGroupId,Integer classGroupId) throws Exception;
+
+    /**
+     * 添加学员
+     * @param classGroupId
+     * @param userIdsStr
+     * @return
+     * @throws Exception
+     */
+    boolean addStudents(Integer classGroupId,String userIdsStr) throws Exception;
 }

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

@@ -35,4 +35,14 @@ public interface CourseScheduleStudentPaymentService extends BaseService<Long, C
 	 */
 	void createCourseScheduleStudentPaymentByCourseSchedules(List<CourseSchedule> courseSchedules);
 
+
+	/**
+	 * @return int
+	 * @Author: Joburgess
+	 * @Date: 2019/10/10
+	 * @params [courseScheduleStudentPayments]
+	 * @describe 批量插入
+	 */
+	int batchInsert(List<CourseScheduleStudentPayment> courseScheduleStudentPayments);
+
 }

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

@@ -1,6 +1,8 @@
 package com.ym.mec.biz.service;
 
+import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.common.service.BaseService;
 import org.apache.ibatis.annotations.Param;
 
@@ -17,4 +19,19 @@ public interface StudentPaymentOrderDetailService extends BaseService<Long, Stud
      */
     int batchAdd(List<StudentPaymentOrderDetail> studentPaymentOrderDetailList);
 
+    /**
+     * 查询注册支付的订单详情
+     * @param musicGroupId
+     * @param status
+     * @return
+     */
+    List<StudentPaymentOrderDetail> findApplyOrderSuccess(String musicGroupId, DealStatusEnum status);
+
+    /**
+     * 获取乐器的采购清单
+     * @param musicGroupId
+     * @return
+     */
+    List<Goods> getMusicalList(String musicGroupId);
+
 }

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

@@ -26,4 +26,9 @@ public class ClassGroupRelationServiceImpl extends BaseServiceImpl<Integer, Clas
     public int classGroupRelationsInsert(List<ClassGroupRelation> classGroupRelationList) {
 		return classGroupRelationDao.classGroupRelationsInsert(classGroupRelationList);
     }
+
+    @Override
+    public ClassGroupRelation findClassGroupRelation(Integer subClassGroupId) {
+	    return classGroupRelationDao.findClassGroupRelation(subClassGroupId);
+    }
 }

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

@@ -1,22 +1,18 @@
 package com.ym.mec.biz.service.impl;
 
-import com.ym.mec.biz.dal.entity.CourseSchedule;
-import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
-import com.ym.mec.biz.service.CourseScheduleService;
-import com.ym.mec.biz.service.CourseScheduleStudentPaymentService;
-import com.ym.mec.biz.service.StudentRegistrationService;
+import com.ym.mec.biz.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
-import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
-import com.ym.mec.biz.service.ClassGroupStudentMapperService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.List;
+import java.math.BigDecimal;
+import java.util.*;
 
 @Service
 public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, ClassGroupStudentMapper> implements ClassGroupStudentMapperService {
@@ -30,6 +26,10 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
     StudentRegistrationService studentRegistrationService;
     @Autowired
     private CourseScheduleStudentPaymentService courseScheduleStudentPaymentService;
+    @Autowired
+    private ClassGroupService classGroupService;
+    @Autowired
+    private ClassGroupRelationService classGroupRelationService;
 
     @Override
     public BaseDAO<Long, ClassGroupStudentMapper> getDAO() {
@@ -55,7 +55,10 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
         student.setClassGroupId(null);
         studentRegistrationService.update(student);
 
-        //2、删除学生对应班级的单技课程和对应合奏课程
+        //2、班级人数调整
+        classGroupService.updateClassStudentNum(classGroupId.longValue(), -1);
+
+        //3、删除学生对应班级的课程
         List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);
         courseScheduleStudentPaymentService.deleteStudentCourseSchedule(userId, courseScheduleList);
         return true;
@@ -63,6 +66,103 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
 
     @Override
     public List<StudentRegistration> findClassStudentList(Integer classGroupId, ClassGroupStudentStatusEnum status) {
-        return classGroupStudentMapperDao.findClassStudentList(classGroupId,status);
+        return classGroupStudentMapperDao.findClassStudentList(classGroupId, status);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean adjustClassGroup(Integer userId, Integer oldClassGroupId, Integer classGroupId) throws Exception {
+        ClassGroupStudentMapper classStudentMapper = findClassStudentMapperByUserIdAndClassGroupId(userId, oldClassGroupId);
+        if (classStudentMapper == null) {
+            throw new Exception("原班级学生不存在");
+        }
+        Date date = new Date();
+        //1、更新学生对应班级关系
+        classStudentMapper.setClassGroupId(classGroupId);
+        update(classStudentMapper);
+        //班级人数调整
+        classGroupService.updateClassStudentNum(oldClassGroupId.longValue(), -1);
+        classGroupService.updateClassStudentNum(classGroupId.longValue(), 1);
+
+        //2、删除学生对应原班级未开始课程
+        List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(oldClassGroupId);
+        courseScheduleStudentPaymentService.deleteStudentCourseSchedule(userId, courseScheduleList);
+
+        //3、学生加入新班级未开始课程
+        courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);
+
+        BigDecimal coursePrice = new BigDecimal("0");
+        List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
+        for (CourseSchedule courseSchedule : courseScheduleList) {
+            CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
+            courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
+            courseScheduleStudentPayment.setUserId(userId);
+            courseScheduleStudentPayment.setExpectPrice(coursePrice);
+            courseScheduleStudentPayment.setClassGroupId(classGroupId);
+            courseScheduleStudentPayment.setCreateTime(date);
+            courseScheduleStudentPayment.setUpdateTime(date);
+            courseScheduleStudentPayments.add(courseScheduleStudentPayment);
+        }
+
+        courseScheduleStudentPaymentService.batchInsert(courseScheduleStudentPayments);
+        return true;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean addStudents(Integer classGroupId, String userIdsStr) throws Exception {
+        ClassGroup classGroup = classGroupService.get(classGroupId);
+        if (classGroup == null) {
+            throw new Exception("添加学员的班级不存在");
+        }
+        Date nowDate = new Date();
+        HashSet<String> userIdStrSet = new HashSet<>(Arrays.asList(userIdsStr.split(",")));
+
+        //1、班级关系添加
+        List<ClassGroupStudentMapper> classGroupStudentMappers = new ArrayList<>();
+        for (String userIdStr : userIdStrSet) {
+            ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
+            classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
+            classGroupStudentMapper.setClassGroupId(classGroupId);
+            classGroupStudentMapper.setUserId(Integer.parseInt(userIdStr));
+            classGroupStudentMapper.setCreateTime(nowDate);
+            classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
+            classGroupStudentMappers.add(classGroupStudentMapper);
+        }
+        classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMappers);
+
+        //2、班级人数调整
+        classGroupService.updateClassStudentNum(classGroupId.longValue(), userIdStrSet.size());
+
+        //3、学生加入新班级未开始课程
+        List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);
+
+        //4、班级在合奏班、添加合奏课程
+        ClassGroupRelation classGroupRelation = classGroupRelationService.findClassGroupRelation(classGroupId);
+        if(classGroupRelation != null){
+            //合奏班增加人数
+            classGroupService.updateClassStudentNum(classGroupRelation.getClassGroupId().longValue(), userIdStrSet.size());
+            List<CourseSchedule> mixCourseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupRelation.getClassGroupId());
+            courseScheduleList.addAll(mixCourseScheduleList);
+        }
+
+        BigDecimal coursePrice = new BigDecimal("0");
+
+        List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
+        for (CourseSchedule courseSchedule : courseScheduleList) {
+            for (String userIdStr : userIdStrSet) {
+                CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
+                courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
+                courseScheduleStudentPayment.setUserId(Integer.parseInt(userIdStr));
+                courseScheduleStudentPayment.setExpectPrice(coursePrice);
+                courseScheduleStudentPayment.setClassGroupId(classGroupId);
+                courseScheduleStudentPayment.setCreateTime(nowDate);
+                courseScheduleStudentPayment.setUpdateTime(nowDate);
+                courseScheduleStudentPayments.add(courseScheduleStudentPayment);
+            }
+        }
+
+        courseScheduleStudentPaymentService.batchInsert(courseScheduleStudentPayments);
+        return true;
     }
 }

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

@@ -159,4 +159,9 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 		});
 		courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
 	}
+
+	@Override
+	public int batchInsert(List<CourseScheduleStudentPayment> courseScheduleStudentPayments) {
+		return courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
+	}
 }

+ 36 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderDetailServiceImpl.java

@@ -1,5 +1,8 @@
 package com.ym.mec.biz.service.impl;
 
+import com.ym.mec.biz.dal.entity.Goods;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
+import com.ym.mec.biz.service.GoodsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -16,6 +19,8 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
 
     @Autowired
     private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
+    @Autowired
+    private GoodsService goodsService;
 
     @Override
     public BaseDAO<Long, StudentPaymentOrderDetail> getDAO() {
@@ -26,4 +31,35 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
     public int batchAdd(List<StudentPaymentOrderDetail> studentPaymentOrderDetailList) {
         return studentPaymentOrderDetailDao.batchAdd(studentPaymentOrderDetailList);
     }
+
+    @Override
+    public List<StudentPaymentOrderDetail> findApplyOrderSuccess(String musicGroupId, DealStatusEnum status) {
+        return studentPaymentOrderDetailDao.findApplyOrderSuccess(musicGroupId, status);
+    }
+
+    @Override
+    public List<Goods> getMusicalList(String musicGroupId) {
+        List<StudentPaymentOrderDetail> applyOrder = findApplyOrderSuccess(musicGroupId, DealStatusEnum.SUCCESS);
+        String goodsIdsStr = "";
+        for (StudentPaymentOrderDetail studentPaymentOrderDetail : applyOrder) {
+            if (studentPaymentOrderDetail.getGoodsIdList() != null && !studentPaymentOrderDetail.getGoodsIdList().isEmpty()) {
+                goodsIdsStr += studentPaymentOrderDetail.getGoodsIdList()+",";
+            }
+        }
+        goodsIdsStr = goodsIdsStr.substring(0, goodsIdsStr.length() - 1);
+
+        String[] goodSIdArr = goodsIdsStr.split(",");
+
+        List<Goods> goodies = goodsService.findGoodsByIds(goodsIdsStr);
+
+        for (Goods goods : goodies) {
+            goods.setSellCount(0);
+            for (String goodsIdStr : goodSIdArr) {
+                if(goods.getId().equals(Integer.parseInt(goodsIdStr))){
+                    goods.setSellCount(goods.getSellCount()+1);
+                }
+            }
+        }
+        return goodies;
+    }
 }

+ 5 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupRelationMapper.xml

@@ -78,4 +78,9 @@
             (#{item.classGroupId},#{item.subClassGroupId},now())
         </foreach>
     </insert>
+
+    <!-- 查询班级父班级id -->
+    <select id="findClassGroupRelation" resultMap="ClassGroupRelation">
+        SELECT * FROM class_group_relation WHERE sub_class_group_id_ = #{subClassGroupId}
+    </select>
 </mapper>

+ 20 - 8
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderDetailMapper.xml

@@ -18,13 +18,15 @@
 
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="StudentPaymentOrderDetail">
-		SELECT * FROM student_payment_order_detail WHERE id_ = #{id} 
-	</select>
+        SELECT * FROM student_payment_order_detail WHERE id_ = #{id}
+    </select>
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="StudentPaymentOrderDetail">
-		SELECT * FROM student_payment_order_detail ORDER BY id_
-	</select>
+        SELECT *
+        FROM student_payment_order_detail
+        ORDER BY id_
+    </select>
 
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail" useGeneratedKeys="true"
@@ -64,8 +66,8 @@
 
     <!-- 根据主键删除一条记录 -->
     <delete id="delete">
-		DELETE FROM student_payment_order_detail WHERE id_ = #{id} 
-	</delete>
+        DELETE FROM student_payment_order_detail WHERE id_ = #{id}
+    </delete>
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="StudentPaymentOrderDetail" parameterType="map">
@@ -75,8 +77,9 @@
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM student_payment_order_detail
-	</select>
+        SELECT COUNT(*)
+        FROM student_payment_order_detail
+    </select>
 
     <insert id="batchAdd" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
         INSERT INTO student_payment_order_detail
@@ -86,4 +89,13 @@
             (#{orderDetail.id},#{orderDetail.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{orderDetail.goodsIdList},#{orderDetail.price},#{orderDetail.createTime},#{orderDetail.updateTime},#{orderDetail.paymentOrderId})
         </foreach>
     </insert>
+
+    <!-- 查询注册订单详情 -->
+    <select id="findApplyOrderSuccess" resultMap="StudentPaymentOrderDetail">
+        SELECT spod.* FROM student_payment_order spo
+        LEFT JOIN student_payment_order_detail spod ON spo.id_ = spod.payment_order_id_
+        WHERE spo.music_group_id_ = #{musicGroupId}
+        AND spo.status_=#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+        AND spo.type_ = 'APPLY'
+    </select>
 </mapper>

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

@@ -29,6 +29,7 @@
         <result column="payment_status_" property="paymentStatus"
                 typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="music_group_status_" property="musicGroupStatus"/>
+        <result column="class_group_name_" property="classGroupName" />
     </resultMap>
 
     <resultMap type="com.ym.mec.biz.dal.dto.StudentInfo" id="StudentInfo">
@@ -331,9 +332,11 @@
 
     <!-- 获取乐团声部下的学生 -->
     <select id="findMusicGroupStudent" resultMap="StudentRegistration">
-        SELECT * FROM student_registration WHERE music_group_id_ = #{musicGroupId}
+        SELECT sr.*,cg.name_ class_group_name_  FROM student_registration sr
+        LEFT JOIN class_group cg ON cg.id_ = sr.class_group_id_
+        WHERE sr.music_group_id_ = #{musicGroupId}
         <if test="actualSubjectId != null and actualSubjectId !=''">
-            AND actual_subject_id_ = #{actualSubjectId}
+            AND sr.actual_subject_id_ = #{actualSubjectId}
         </if>
         AND payment_status_ = 1;
     </select>

+ 24 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupStudentController.java

@@ -40,4 +40,28 @@ public class ClassGroupStudentController extends BaseController {
         return succeed(classGroupStudentMapperService.findClassStudentList(classGroupId, ClassGroupStudentStatusEnum.NORMAL));
     }
 
+    @ApiOperation(value = "调整班级(小班课)")
+    @PostMapping("/adjustClassGroup")
+    @PreAuthorize("@pcs.hasPermissions('classGroupStudent/adjustClassGroup')")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "userId", value = "学生userId", required = true, dataType = "int"),
+            @ApiImplicitParam(name = "oldClassGroupId", value = "原班级id", required = true, dataType = "int"),
+            @ApiImplicitParam(name = "classGroupId", value = "新班级id", required = true, dataType = "int")
+    })
+    public HttpResponseResult adjustClassGroup(Integer userId, Integer oldClassGroupId, Integer classGroupId) throws Exception {
+        return succeed(classGroupStudentMapperService.adjustClassGroup(userId, oldClassGroupId, classGroupId));
+    }
+
+
+    @ApiOperation(value = "添加学生(小班课,单技班通用)")
+    @PostMapping("/addStudents")
+    @PreAuthorize("@pcs.hasPermissions('classGroupStudent/addStudents')")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "classGroupId", value = "小课班班级id", required = true, dataType = "int"),
+            @ApiImplicitParam(name = "userIdsStr", value = "学生UserId,逗号分隔", required = true, dataType = "String")
+    })
+    public HttpResponseResult addStudents(Integer classGroupId, String userIdsStr) throws Exception {
+        return succeed(classGroupStudentMapperService.addStudents(classGroupId, userIdsStr));
+    }
+
 }

+ 14 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentOrderController.java

@@ -1,6 +1,9 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -20,6 +23,8 @@ public class StudentPaymentOrderController extends BaseController {
 
     @Autowired
     private StudentPaymentOrderService studentPaymentOrderService;
+    @Autowired
+    private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
 
     @ApiOperation(value = "获取订单列表")
     @GetMapping("/queryPage")
@@ -28,4 +33,13 @@ public class StudentPaymentOrderController extends BaseController {
         return succeed(studentPaymentOrderService.queryPage(queryInfo));
     }
 
+    @ApiOperation(value = "获取乐器采购清单")
+    @GetMapping("/getMusicalList")
+    //@PreAuthorize("@pcs.hasPermissions('order/getMusicalList')")
+    @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团id", required = true, dataType = "String")})
+    public Object getMusicalList(String musicGroupId){
+        return succeed(studentPaymentOrderDetailService.getMusicalList(musicGroupId));
+    }
+
+
 }