Sfoglia il codice sorgente

管乐迷评测记录详情

zouxuan 1 anno fa
parent
commit
701ee6ea5d

+ 12 - 0
mec-application/src/main/java/com/ym/mec/teacher/controller/TeacherController.java

@@ -128,6 +128,18 @@ public class TeacherController extends BaseController {
         return succeed(classGroupService.getTeacherMusicClass(queryInfo));
     }
 
+    @ApiOperation(value = "获取老师关联的乐团列表")
+    @GetMapping("/queryTeacherMusicGroup")
+    public HttpResponseResult<List<MusicGroup>> queryTeacherMusicGroup(){
+        return succeed(classGroupService.getDao().queryTeacherMusicGroup(sysUserService.getUserId()));
+    }
+
+    @ApiOperation(value = "获取老师所在乐团的班级列表")
+    @GetMapping("/queryTeacherMusicClass")
+    public HttpResponseResult<List<ClassGroup>> queryTeacherMusicClass(String musicGroupId){
+        return succeed(classGroupService.getDao().queryTeacherMusicClass(musicGroupId,sysUserService.getUserId()));
+    }
+
     @ApiOperation(value = "获取老师VIP课程信息列表")
     @GetMapping("/getTeacherVipClass")
     public HttpResponseResult<PageInfo<TeacherVipClassInfoDto>> getTeacherVipClass(VipClassQueryInfo queryInfo){

+ 13 - 5
mec-application/src/main/java/com/ym/mec/teacher/controller/TeacherSubjectController.java

@@ -2,16 +2,19 @@ package com.ym.mec.teacher.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.service.SubjectService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
+import java.util.List;
 import java.util.Objects;
 
 /**
@@ -23,14 +26,14 @@ import java.util.Objects;
 @RestController
 public class TeacherSubjectController extends BaseController {
 
-    @Autowired
+    @Resource
     private SubjectService subjectService;
-    @Autowired
+    @Resource
     private SysUserFeignService sysUserFeignService;
 
     @ApiOperation(value = "获取教师所在科目列表")
     @GetMapping("/findTeacherSubjets")
-    public Object findTeacherSubjets(){
+    public HttpResponseResult<List<Subject>> findTeacherSubjets(){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if(Objects.isNull(sysUser)){
             return failed(HttpStatus.FORBIDDEN,"请登录");
@@ -40,8 +43,13 @@ public class TeacherSubjectController extends BaseController {
 
     @ApiOperation(value = "获取子集科目列表")
     @GetMapping("/findSubSubjects")
-    public Object findSubSubjects(Integer tenantId){
+    public HttpResponseResult<List<Subject>> findSubSubjects(Integer tenantId){
         return succeed(subjectService.findSubSubjects(null));
     }
 
+    @ApiOperation(value = "获取指定名称的科目列表")
+    @GetMapping("/findByNames")
+    public HttpResponseResult<List<Subject>> findByNames() {
+        return succeed(subjectService.getDao().findByNames());
+    }
 }

+ 10 - 0
mec-application/src/main/java/com/ym/mec/web/controller/education/EduCooperationOrganController.java

@@ -1,5 +1,7 @@
 package com.ym.mec.web.controller.education;
 
+import com.ym.mec.biz.dal.dao.ClassGroupDao;
+import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.CooperationOrgan;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.page.CooperationOrganQueryInfo;
@@ -27,6 +29,8 @@ public class EduCooperationOrganController extends BaseController {
     private CooperationOrganService cooperationOrganService;
     @Resource
     private OrganizationService organizationService;
+    @Resource
+    private ClassGroupDao classGroupDao;
 
     @ApiOperation(value = "分页查询合作单位(教学点)列表")
     @GetMapping("/queryPage")
@@ -46,4 +50,10 @@ public class EduCooperationOrganController extends BaseController {
     public HttpResponseResult<List<MusicGroup>> musicGroupPage(String organId,String coopId) {
         return succeed(cooperationOrganService.musicGroupPage(organizationService.getEmployeeOrgan(organId),coopId));
     }
+
+    @ApiOperation(value = "获取乐团班级列表")
+    @GetMapping("/musicGroupClassPage")
+    public HttpResponseResult<List<ClassGroup>> musicGroupClassPage(String musicGroupId) {
+        return succeed(classGroupDao.findClassGroups(musicGroupId));
+    }
 }

+ 10 - 0
mec-application/src/main/java/com/ym/mec/web/controller/school/SchoolCooperationOrganController.java

@@ -1,5 +1,7 @@
 package com.ym.mec.web.controller.school;
 
+import com.ym.mec.biz.dal.dao.ClassGroupDao;
+import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.service.CooperationOrganService;
 import com.ym.mec.common.controller.BaseController;
@@ -21,6 +23,8 @@ public class SchoolCooperationOrganController extends BaseController {
 
     @Resource
     private CooperationOrganService cooperationOrganService;
+    @Resource
+    private ClassGroupDao classGroupDao;
 
     @ApiOperation(value = "合作单位的乐团")
     @GetMapping("/musicGroupPage")
@@ -30,4 +34,10 @@ public class SchoolCooperationOrganController extends BaseController {
         }
         return succeed(cooperationOrganService.musicGroupPage(coopId));
     }
+
+    @ApiOperation(value = "获取乐团班级列表")
+    @GetMapping("/musicGroupClassPage")
+    public HttpResponseResult<List<ClassGroup>> musicGroupClassPage(String musicGroupId) {
+        return succeed(classGroupDao.findClassGroups(musicGroupId));
+    }
 }

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

@@ -6,6 +6,7 @@ import java.util.Set;
 
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.CourseScheduleStatistics;
+import com.ym.mec.biz.dal.entity.MusicGroup;
 import org.apache.ibatis.annotations.Param;
 
 import com.ym.mec.biz.dal.entity.ClassGroup;
@@ -873,4 +874,10 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
     void modifyStudentNum(@Param("classGroupId") Integer classGroupId, @Param("num") int num);
 
     boolean checkStudentNum(@Param("classGroupId") Integer classGroupId);
+
+    //获取老师关联的乐团
+    List<MusicGroup> queryTeacherMusicGroup(@Param("teacherId") Integer teacherId);
+
+    //获取老师关联的乐团下的班级
+    List<ClassGroup> queryTeacherMusicClass(@Param("musicGroupId") String musicGroupId, @Param("teacherId") Integer teacherId);
 }

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

@@ -173,4 +173,5 @@ public interface SubjectDao extends BaseDAO<Integer, Subject> {
 
     List<StudentSubjectDto> getSubjectByStudentId(@Param("studentIds") Set studentIds);
 
+    List<Subject> findByNames();
 }

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

@@ -622,4 +622,5 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
     List<ClassGroup> getClassGroupByMusicIds(List<String> musicGroupIds);
 
     List<StudentAttendanceViewDto> getLiveCurrentCourseStudents(LiveGroupWrapper.LiveCourseStudentQuery query);
+
 }

+ 6 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/SubjectService.java

@@ -1,10 +1,6 @@
 package com.ym.mec.biz.service;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
+import com.ym.mec.biz.dal.dao.SubjectDao;
 import com.ym.mec.biz.dal.dto.ConditionDto;
 import com.ym.mec.biz.dal.dto.StudentSubjectDto;
 import com.ym.mec.biz.dal.dto.SubFeeSettingDto;
@@ -15,7 +11,12 @@ import com.ym.mec.biz.dal.page.SubjectQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 public interface SubjectService extends BaseService<Integer, Subject> {
+    SubjectDao getDao();
 
     /**
      * 通过乐团编号查询科目列表

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

@@ -1,21 +1,10 @@
 package com.ym.mec.biz.service.impl;
 
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-import com.ym.mec.biz.dal.dto.StudentSubjectDto;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-
-import com.ym.mec.biz.dal.dao.ChargeTypeOrganizationFeeDao;
 import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
 import com.ym.mec.biz.dal.dao.SubjectDao;
 import com.ym.mec.biz.dal.dao.SubjectGoodsMapperDao;
 import com.ym.mec.biz.dal.dto.ConditionDto;
+import com.ym.mec.biz.dal.dto.StudentSubjectDto;
 import com.ym.mec.biz.dal.dto.SubFeeSettingDto;
 import com.ym.mec.biz.dal.dto.SubjectApplyDetailDto;
 import com.ym.mec.biz.dal.entity.Subject;
@@ -27,24 +16,35 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 @Service
 public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject> implements SubjectService {
 
-    @Autowired
+    @Resource
     private SubjectDao subjectDao;
-    @Autowired
+    @Resource
     private StudentRegistrationDao studentRegistrationDao;
-    @Autowired
+    @Resource
     private SubjectGoodsMapperDao subjectGoodsMapperDao;
-    @Autowired
-    private ChargeTypeOrganizationFeeDao chargeTypeOrganizationFeeDao;
 
     @Override
     public BaseDAO<Integer, Subject> getDAO() {
         return subjectDao;
     }
 
+    public SubjectDao getDao() {
+        return subjectDao;
+    }
+
     @Override
     public List<Subject> findSubByMusicGroupId(String musicGroupId) {
         return subjectDao.findSubByMusicGroupId(musicGroupId);

+ 16 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -1691,4 +1691,20 @@
     <select id="checkStudentNum" resultType="java.lang.Boolean">
         select student_num_ >= expect_student_num_ from class_group where id_ = #{classGroupId}
     </select>
+    <select id="queryTeacherMusicGroup" resultMap="com.ym.mec.biz.dal.dao.MusicGroupDao.MusicGroup">
+        SELECT mg.*
+        FROM class_group_teacher_mapper cgtm
+        LEFT JOIN music_group mg ON cgtm.music_group_id_ = mg.id_
+        LEFT JOIN class_group cg ON cg.id_ = cgtm.class_group_id_
+        where cg.del_flag_ = 0 AND mg.status_ = 'PROGRESS' AND cgtm.user_id_ = #{teacherId}
+        GROUP BY mg.id_
+    </select>
+    <select id="queryTeacherMusicClass" resultMap="ClassGroup">
+        SELECT cg.*
+        FROM class_group_teacher_mapper cgtm
+        LEFT JOIN music_group mg ON cgtm.music_group_id_ = mg.id_
+        LEFT JOIN class_group cg ON cg.id_ = cgtm.class_group_id_
+        where cg.del_flag_ = 0 AND mg.status_ = 'PROGRESS' AND cgtm.user_id_ = #{teacherId}
+        GROUP BY cg.id_
+    </select>
 </mapper>

+ 1 - 4
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -1563,10 +1563,7 @@
         SELECT DISTINCT su.id_
         FROM `student` s
         LEFT JOIN `sys_user` su on s.`user_id_` = su.`id_`
-        WHERE su.del_flag_ = '0' AND su.organ_id_ IN
-        <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
-            #{organId}
-        </foreach>
+        WHERE su.del_flag_ = '0' AND FIND_IN_SET(su.organ_id_,#{organIds})
     </select>
     <select id="queryByCoopIds" resultType="java.lang.Integer">
         select distinct s.user_id_ from student s

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

@@ -302,4 +302,7 @@
                 AND mg.cooperation_organ_id_ = #{coopId}
             </if>
     </select>
+    <select id="findByNames" resultMap="Subject">
+        SELECT * FROM `subject` where name_ IN ('长笛','单簧管','萨克斯','小号','长号','圆号','上低音号','大号','打击乐') and del_flag_ = 0
+    </select>
 </mapper>