Parcourir la source

乐团档案学生端

zouxuan il y a 3 ans
Parent
commit
85bfe31c5c

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

@@ -457,6 +457,15 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
     List<ConditionDto> queryStudentClassGroup(@Param("musicGroupId") String musicGroupId, @Param("teacherId") Integer teacherId);
 
     /**
+     * 获取学员班级列表
+     *
+     * @param musicGroupId
+     * @param studentId
+     * @return
+     */
+    List<ClassGroup> queryStudentClassGroups(@Param("musicGroupId") String musicGroupId, @Param("studentId") Integer studentId);
+
+    /**
      * 批量新增班级上的课次数
      *
      * @param classGroupList

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupTrainPlanSaveDto.java

@@ -34,6 +34,16 @@ public class MusicGroupTrainPlanSaveDto {
 	@ApiModelProperty(value = "课程上课时间",required = false)
 	private Date courseClassTime;
 
+	private Boolean studentFlag = false;
+
+	public Boolean getStudentFlag() {
+		return studentFlag;
+	}
+
+	public void setStudentFlag(Boolean studentFlag) {
+		this.studentFlag = studentFlag;
+	}
+
 	public Date getCourseClassTime() {
 		return courseClassTime;
 	}

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

@@ -383,4 +383,11 @@ public interface MusicGroupService extends BaseService<String, MusicGroup> {
 	 * @return
 	 */
 	MusicGroupBasicDto queryBasicInfo(String id);
+
+	/**
+	 * 获取学员退团页面详情
+	 * @param musicGroupId
+	 * @return
+	 */
+    Object getQuitGroupDetail(String musicGroupId);
 }

+ 24 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -3431,4 +3431,28 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 	public MusicGroupBasicDto queryBasicInfo(String id) {
 		return musicGroupDao.queryBasicInfo(id);
 	}
+
+    @Override
+    public Object getQuitGroupDetail(String musicGroupId) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser == null){
+            throw new BizException("请登录");
+        }
+        Map<String,Object> resultMap = new HashMap<>(6);
+        String username = sysUser.getUsername();
+        resultMap.put("username",StringUtils.isEmpty(username)?sysUser.getRealName():username);
+        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+        resultMap.put("musicGroupName",musicGroup.getName());
+        int musicGroupStudentNum = studentRegistrationDao.findMusicGroupStudentNum(musicGroupId);
+        resultMap.put("musicGroupStudentNum",musicGroupStudentNum);
+        StudentRegistration studentRegistration = studentRegistrationDao.findStudentByMusicGroupIdAndUserId(musicGroupId, sysUser.getId());
+        int daysBetween = DateUtil.daysBetween(new Date(), studentRegistration.getCreateTime());
+        resultMap.put("days",daysBetween);
+        MusicGroupQuit musicGroupQuit = musicGroupQuitDao.queryByUserIdAndMusicGroupId(sysUser.getId(), musicGroupId);
+        if(musicGroupQuit != null){
+            resultMap.put("memo",musicGroupQuit.getReason());
+        }
+        resultMap.put("studentMobile",musicGroup.getEducationalTeacherId());
+        return resultMap;
+    }
 }

+ 14 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupTrainPlanServiceImpl.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.ClassGroupDao;
 import com.ym.mec.biz.dal.dao.CourseScheduleDao;
 import com.ym.mec.biz.dal.dao.MusicGroupTrainPlanDao;
@@ -31,6 +33,8 @@ public class MusicGroupTrainPlanServiceImpl extends BaseServiceImpl<Integer, Mus
 	private CourseScheduleDao courseScheduleDao;
 	@Autowired
 	private ClassGroupDao classGroupDao;
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
 
 	@Override
 	public BaseDAO<Integer, MusicGroupTrainPlan> getDAO() {
@@ -75,7 +79,16 @@ public class MusicGroupTrainPlanServiceImpl extends BaseServiceImpl<Integer, Mus
 
 	@Override
 	public List<ClassGroup> queryPlanCourseNum(MusicGroupTrainPlanSaveDto musicGroupTrainPlanSaveDto) {
-		List<ClassGroup> classGroups = classGroupDao.findClassGroups(musicGroupTrainPlanSaveDto.getMusicGroupId());
+		List<ClassGroup> classGroups;
+		if(musicGroupTrainPlanSaveDto.getStudentFlag()){
+			SysUser sysUser = sysUserFeignService.queryUserInfo();
+			if(sysUser == null){
+				throw new BizException("请登录");
+			}
+			classGroups = classGroupDao.queryStudentClassGroups(musicGroupTrainPlanSaveDto.getMusicGroupId(),sysUser.getId());
+		}else {
+			classGroups = classGroupDao.findClassGroups(musicGroupTrainPlanSaveDto.getMusicGroupId());
+		}
 		if(classGroups.size() == 0){
 			return null;
 		}

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

@@ -951,6 +951,12 @@
         where cg.music_group_id_ = #{musicGroupId} AND cgsm.user_id_ = #{teacherId}
         AND cg.del_flag_ = 0 AND cgsm.status_ != 'QUIT' AND cg.group_type_ = 'MUSIC'
     </select>
+    <select id="queryStudentClassGroups" resultMap="ClassGroup">
+        SELECT cg.* FROM class_group_student_mapper cgsm
+        LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
+        where cg.music_group_id_ = #{musicGroupId} AND cgsm.user_id_ = #{studentId}
+        AND cg.del_flag_ = 0 AND cgsm.status_ != 'QUIT' AND cg.group_type_ = 'MUSIC'
+    </select>
 
     <resultMap type="com.ym.mec.biz.dal.dto.CourseListDto" id="CourseListDto">
         <result column="class_group_id_" property="classGroupId"/>

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

@@ -113,8 +113,8 @@
 		<if test="search != null and search != ''">
 			AND (mg.id_ = #{search} OR mg.name_ LIKE CONCAT('%',#{search},'%'))
 		</if>
-		<if test="organIds != null and organIds != ''">
-			AND FIND_IN_SET(mg.organ_id_,#{organIds})
+		<if test="organId != null and organId != ''">
+			AND FIND_IN_SET(mg.organ_id_,#{organId})
 		</if>
 		<include refid="global.limit"/>
 	</select>
@@ -128,8 +128,8 @@
 		<if test="search != null and search != ''">
 			AND (mg.id_ = #{search} OR mg.name_ LIKE CONCAT('%',#{search},'%'))
 		</if>
-		<if test="organIds != null and organIds != ''">
-			AND FIND_IN_SET(mg.organ_id_,#{organIds})
+		<if test="organId != null and organId != ''">
+			AND FIND_IN_SET(mg.organ_id_,#{organId})
 		</if>
 	</select>
 </mapper>

+ 75 - 0
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupDetailController.java

@@ -0,0 +1,75 @@
+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.entity.MusicGroupTrainPlanSaveDto;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import com.ym.mec.biz.dal.page.MusicGroupPerformanceQueryInfo;
+import com.ym.mec.biz.dal.page.PhotoQueryInfo;
+import com.ym.mec.biz.service.*;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("musicGroupDetail")
+@Api(tags = "乐团档案服务")
+@RestController
+public class MusicGroupDetailController extends BaseController {
+
+    @Autowired
+    private MusicGroupNewsService musicGroupNewsService;
+    @Autowired
+    private MusicGroupPerformanceService musicGroupPerformanceService;
+    @Autowired
+    private PhotoAlbumService photoAlbumService;
+    @Autowired
+    private PhotoService photoService;
+    @Autowired
+    private MusicGroupTrainPlanService musicGroupTrainPlanService;
+    @Autowired
+    private MusicGroupService musicGroupService;
+
+    @ApiOperation("获取学员退团页面数据")
+    @RequestMapping(value = "getQuitGroupDetail")
+    public Object getQuitGroupDetail(String musicGroupId) {
+        return succeed(musicGroupService.getQuitGroupDetail(musicGroupId));
+    }
+
+    @ApiOperation("获取乐团训练规划课时")
+    @PostMapping(value = "queryPlanCourseNum")
+    public Object queryPlanCourseNum(@RequestBody MusicGroupTrainPlanSaveDto musicGroupTrainPlanSaveDto) {
+        musicGroupTrainPlanSaveDto.setStudentFlag(true);
+        return succeed(musicGroupTrainPlanService.queryPlanCourseNum(musicGroupTrainPlanSaveDto));
+    }
+
+    @ApiOperation(value = "分页查询乐团资讯")
+    @GetMapping("/queryNewsPage")
+    public Object queryNewsPage(QueryInfo queryInfo) {
+        return succeed(musicGroupNewsService.queryPage(queryInfo));
+    }
+
+    @ApiOperation("分页查询展演信息")
+    @PostMapping(value = "queryPerformancePage")
+    public Object queryPerformancePage(MusicGroupPerformanceQueryInfo queryInfo) {
+        return succeed(musicGroupPerformanceService.queryPage(queryInfo));
+    }
+
+    @ApiOperation("分页查询相册")
+    @PostMapping(value = "queryAlbumPage")
+    public Object queryAlbumPage(PhotoQueryInfo queryInfo) {
+        queryInfo.setClientShow(YesOrNoEnum.YES);
+        return succeed(photoAlbumService.queryAlbumPage(queryInfo));
+    }
+
+    @ApiOperation("分页查询照片")
+    @PostMapping(value = "queryPhotoPage")
+    public Object queryPhotoPage(PhotoQueryInfo queryInfo) {
+        queryInfo.setClientShow(YesOrNoEnum.YES);
+        return succeed(photoService.queryPhotoPage(queryInfo));
+    }
+
+}