Browse Source

增加删除班级学生接口

周箭河 5 years ago
parent
commit
f343fc64c5

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -154,9 +154,16 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 
     /**
      * 根据userId 和班级id查询学生
+     *
      * @param userId
      * @param classGroupId
      * @return
      */
     StudentRegistration findStudentByClassGroupIdAndUserId(@Param("userId") Integer userId, @Param("classGroupId") Integer classGroupId);
+
+    /**
+     * 查询乐团声部下的学生
+     * @return
+     */
+    List<StudentRegistration> findMusicGroupStudent(String musicGroupId,Integer actualSubjectId);
 }

+ 44 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ClassGroup4MixDto.java

@@ -0,0 +1,44 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+public class ClassGroup4MixDto {
+
+    @ApiModelProperty(value = "乐团id", required = true)
+    private String musicGroupId;
+
+    @ApiModelProperty(value = "班级名称", required = true)
+    private String classGroupName;
+
+    @ApiModelProperty(value = "班级id", required = true)
+    private Integer classGroupId;
+
+    @ApiModelProperty(value = "学生-班级", required = true)
+    private List<ClassGroupStudentMapperDto> classGroupStudentMapperDtoList;
+
+    @ApiModelProperty(value = "老师设置", required = true)
+    private List<ClassGroupTeacherMapper> classGroupTeacherMapperList;
+
+    @ApiModelProperty(value = "是否永久 方式1-永久 0-临时", required = true)
+    private YesOrNoEnum type;
+
+    @ApiModelProperty(value = "开始时间", required = true)
+    private String startDate;
+
+    @ApiModelProperty(value = "排课星期几",required = true)
+    private Integer dayOfWeek;
+
+    @ApiModelProperty(value = "上课开始时间",required = true)
+    private String startClassTime;
+
+    @ApiModelProperty(value = "上课结束时间",required = true)
+    private String endClassTime;
+
+    @ApiModelProperty(value = "排课次数", required = true)
+    private Integer courseTimes;
+
+}

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

@@ -182,4 +182,12 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
 	StudentRegistration findStudentByClassGroupIdAndUserId(Integer userId, Integer classGroupId);
 
 
+
+	/**
+	 * 查询乐团声部下的学生
+	 * @return
+	 */
+	List<StudentRegistration> findMusicGroupStudent(String musicGroupId,Integer actualSubjectId);
+
+
 }

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

@@ -483,4 +483,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     public StudentRegistration findStudentByClassGroupIdAndUserId(Integer userId, Integer classGroupId) {
         return studentRegistrationDao.findStudentByClassGroupIdAndUserId(userId, classGroupId);
     }
+
+    @Override
+    public List<StudentRegistration> findMusicGroupStudent(String musicGroupId, Integer actualSubjectId) {
+        return studentRegistrationDao.findMusicGroupStudent(musicGroupId,actualSubjectId);
+    }
 }

+ 10 - 0
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -328,6 +328,16 @@
         AND payment_status_ = 1 AND class_group_id_ IS NULL;
     </select>
 
+
+    <!-- 获取乐团未分班的学生 -->
+    <select id="findMusicGroupStudent" resultMap="StudentRegistration">
+        SELECT * FROM student_registration WHERE music_group_id_ = #{musicGroupId}
+        <if test="actualSubjectId != null and actualSubjectId !=''">
+            AND actual_subject_id_ = #{actualSubjectId}
+        </if>
+        AND payment_status_ = 1;
+    </select>
+
     <!-- 根据注册id list查询报名学生的信息 -->
     <select id="findStudentListByIdList" resultMap="StudentRegistration">
         SELECT * FROM student_registration WHERE id_ IN

+ 12 - 4
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -157,8 +157,8 @@ public class ClassGroupController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('classGroup/findMusicGroupClassTeacher')")
     @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String"),
             @ApiImplicitParam(name = "classGroupId", value = "班级编号", required = false, dataType = "Integer")})
-    public HttpResponseResult findMusicGroupClassTeacher(String musicGroupId,Integer classGroupId) {
-        return succeed(classGroupService.getClassGroupAndTeachers(musicGroupId, "NORMAL,MIX",classGroupId));
+    public HttpResponseResult findMusicGroupClassTeacher(String musicGroupId, Integer classGroupId) {
+        return succeed(classGroupService.getClassGroupAndTeachers(musicGroupId, "NORMAL,MIX", classGroupId));
     }
 
     @ApiOperation(value = "获取乐团班级老师课酬")
@@ -167,9 +167,9 @@ public class ClassGroupController extends BaseController {
     @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String"),
             @ApiImplicitParam(name = "type", value = "结算类型(1-基准课酬,4-梯度课酬)", required = true, dataType = "Integer"),
             @ApiImplicitParam(name = "classGroupId", value = "班级编号", required = false, dataType = "Integer")})
-    public HttpResponseResult findMusicGroupClassTeacherSalary(String musicGroupId, SalarySettlementTypeEnum type,Integer classGroupId) {
+    public HttpResponseResult findMusicGroupClassTeacherSalary(String musicGroupId, SalarySettlementTypeEnum type, Integer classGroupId) {
         try {
-            return succeed(classGroupService.getClassGroupAndTeacherSalary(musicGroupId, type,classGroupId));
+            return succeed(classGroupService.getClassGroupAndTeacherSalary(musicGroupId, type, classGroupId));
         } catch (Exception e) {
             return failed(e.getMessage());
         }
@@ -201,6 +201,14 @@ public class ClassGroupController extends BaseController {
 
 
     @ApiOperation(value = "调整班级(添加班级)")
+    @PostMapping("/revisionAddClassGroup")
+    @PreAuthorize("@pcs.hasPermissions('classGroup/revisionAddClassGroup')")
+    @ApiImplicitParams({@ApiImplicitParam(name = "classGroupIds", value = "班级编号,号分割", required = true, dataType = "String")})
+    public HttpResponseResult revisionAddClassGroup(@RequestBody ClassGroupAdjustDto classGroupAdjustDto) throws Exception {
+        return succeed(classGroupService.classGroupAdjust(classGroupAdjustDto));
+    }
+
+    @ApiOperation(value = "调整班级(临时调整)")
     @PostMapping("/revisionClassGroup")
     @PreAuthorize("@pcs.hasPermissions('classGroup/revisionClassGroup')")
     @ApiImplicitParams({@ApiImplicitParam(name = "classGroupIds", value = "班级编号,号分割", required = true, dataType = "String")})

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

@@ -97,12 +97,21 @@ public class StudentRegistrationController extends BaseController {
         return succeed(studentRegistrationService.findClassGroupStu(musicGroupId, classGroupId));
     }
 
+    @ApiOperation(value = "获取乐团(声部)的学生")
+    @GetMapping("/getMusicGroupStu")
+    @PreAuthorize("@pcs.hasPermissions('studentRegistration/getMusicGroupStu')")
+    @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "actualSubjectId", value = "科目(声部)id,", required = false, dataType = "int")})
+    public HttpResponseResult getMusicGroupStu(String musicGroupId, Integer actualSubjectId) {
+        return succeed(studentRegistrationService.findMusicGroupStudent(musicGroupId, actualSubjectId));
+    }
+
     @ApiOperation(value = "获取乐团未分班的学生")
     @GetMapping("/getMusicGroupNoClassStu")
     @PreAuthorize("@pcs.hasPermissions('studentRegistration/getMusicGroupNoClassStu')")
     @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String"),
             @ApiImplicitParam(name = "actualSubjectId", value = "科目(声部)id,", required = false, dataType = "int")})
-    public HttpResponseResult getMusicGroupStu(String musicGroupId, Integer actualSubjectId) {
+    public HttpResponseResult getMusicGroupNoClassStu(String musicGroupId, Integer actualSubjectId) {
         return succeed(studentRegistrationService.findMusicGroupNoClassGroupStudent(musicGroupId, actualSubjectId));
     }