Browse Source

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

zouxuan 4 years ago
parent
commit
2f90f56b89

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

@@ -138,6 +138,7 @@ public interface StudentExtracurricularExercisesSituationDao extends BaseDAO<Lon
 
 
     List<IndexBaseMonthData> getHomeworkData(@Param("startDay") String startDay,
     List<IndexBaseMonthData> getHomeworkData(@Param("startDay") String startDay,
                                              @Param("endDay") String endDay,
                                              @Param("endDay") String endDay,
+                                             @Param("musicGroupId") String musicGroupId,
                                              @Param("type") String type,
                                              @Param("type") String type,
                                              @Param("studentIds") List<Integer> studentIds);
                                              @Param("studentIds") List<Integer> studentIds);
 
 

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -1070,9 +1070,9 @@ public class StudentServeServiceImpl implements StudentServeService {
         List<IndexBaseMonthData> d2 = new ArrayList<>();
         List<IndexBaseMonthData> d2 = new ArrayList<>();
         List<IndexBaseMonthData> d3 = new ArrayList<>();
         List<IndexBaseMonthData> d3 = new ArrayList<>();
         if(StringUtils.isNotBlank(musicGroupId) && !CollectionUtils.isEmpty(studentIds)){
         if(StringUtils.isNotBlank(musicGroupId) && !CollectionUtils.isEmpty(studentIds)){
-            d1 = studentExtracurricularExercisesSituationDao.getHomeworkData(startDayStr, endDayStr, null, studentIds);
-            d2 = studentExtracurricularExercisesSituationDao.getHomeworkData(startDayStr, endDayStr, "submit", studentIds);
-            d3 = studentExtracurricularExercisesSituationDao.getHomeworkData(startDayStr, endDayStr, "comment", studentIds);
+            d1 = studentExtracurricularExercisesSituationDao.getHomeworkData(startDayStr, endDayStr, musicGroupId,null, studentIds);
+            d2 = studentExtracurricularExercisesSituationDao.getHomeworkData(startDayStr, endDayStr, musicGroupId, "submit", studentIds);
+            d3 = studentExtracurricularExercisesSituationDao.getHomeworkData(startDayStr, endDayStr, musicGroupId, "comment", studentIds);
         }
         }
         musicGroupHomeworkDataDeal(d1, mondayDateStrs, IndexDataType.HOMEWORK_CREATE_RATE);
         musicGroupHomeworkDataDeal(d1, mondayDateStrs, IndexDataType.HOMEWORK_CREATE_RATE);
         typeDateMap.put(IndexDataType.HOMEWORK_CREATE_RATE, d1);
         typeDateMap.put(IndexDataType.HOMEWORK_CREATE_RATE, d1);

+ 3 - 1
mec-biz/src/main/resources/config/mybatis/MusicGroupQuestionnaireMapper.xml

@@ -20,7 +20,9 @@
 	
 	
 	<!-- 根据主键查询一条记录 -->
 	<!-- 根据主键查询一条记录 -->
 	<select id="get" resultMap="MusicGroupQuestionnaire" >
 	<select id="get" resultMap="MusicGroupQuestionnaire" >
-		SELECT * FROM music_group_questionnaire WHERE id_ = #{id} 
+		SELECT mgq.*,su.real_name_ FROM music_group_questionnaire mgq
+		LEFT JOIN sys_user su ON su.id_ = mgq.operator_id_
+		WHERE mgq.id_ = #{id}
 	</select>
 	</select>
 	
 	
 	<!-- 全查询 -->
 	<!-- 全查询 -->

+ 1 - 0
mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml

@@ -710,6 +710,7 @@
 		WHERE tea.job_nature_='FULL_TIME'
 		WHERE tea.job_nature_='FULL_TIME'
 		AND DATE_FORMAT(sees.monday_, '%Y-%m-%d')&gt;=#{startDay}
 		AND DATE_FORMAT(sees.monday_, '%Y-%m-%d')&gt;=#{startDay}
 		AND DATE_FORMAT(sees.sunday_, '%Y-%m-%d')&lt;=#{endDay}
 		AND DATE_FORMAT(sees.sunday_, '%Y-%m-%d')&lt;=#{endDay}
+		AND (sees.serve_type_ = 'EXERCISE' OR EXISTS (SELECT id_ FROM course_schedule WHERE group_type_='MUSIC' AND music_group_id_=#{musicGroupId} AND FIND_IN_SET(id_, sees.course_ids_)))
 		AND sees.student_id_ IN
 		AND sees.student_id_ IN
 		<foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
 		<foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
 			#{studentId}
 			#{studentId}

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

@@ -2,6 +2,9 @@ package com.ym.mec.student.controller;
 
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.ClassGroupDao;
+import com.ym.mec.biz.dal.dto.Mapper;
+import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.MusicGroupTrainPlanSaveDto;
 import com.ym.mec.biz.dal.entity.MusicGroupTrainPlanSaveDto;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.MusicGroupPerformanceQueryInfo;
 import com.ym.mec.biz.dal.page.MusicGroupPerformanceQueryInfo;
@@ -13,8 +16,12 @@ import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
+import java.util.List;
+
 @RequestMapping("musicGroupDetail")
 @RequestMapping("musicGroupDetail")
 @Api(tags = "乐团档案服务")
 @Api(tags = "乐团档案服务")
 @RestController
 @RestController
@@ -32,6 +39,8 @@ public class MusicGroupDetailController extends BaseController {
     private MusicGroupTrainPlanService musicGroupTrainPlanService;
     private MusicGroupTrainPlanService musicGroupTrainPlanService;
     @Autowired
     @Autowired
     private MusicGroupService musicGroupService;
     private MusicGroupService musicGroupService;
+    @Autowired
+    private ClassGroupDao classGroupDao;
 
 
     @ApiOperation("获取学员退团页面数据")
     @ApiOperation("获取学员退团页面数据")
     @RequestMapping(value = "getQuitGroupDetail")
     @RequestMapping(value = "getQuitGroupDetail")
@@ -72,4 +81,15 @@ public class MusicGroupDetailController extends BaseController {
         return succeed(photoService.queryPhotoPage(queryInfo));
         return succeed(photoService.queryPhotoPage(queryInfo));
     }
     }
 
 
+    @ApiOperation(value = "查询学员班级列表")
+    @GetMapping("/queryStudentAndTeacher")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupRecord/queryStudentAndTeacher')")
+    public Object queryStudentAndTeacher(String musicGroupId) {
+        MusicGroup musicGroup = musicGroupService.get(musicGroupId);
+        if(musicGroup == null){
+            return failed("乐团信息查询失败");
+        }
+        List<Mapper> mappers = classGroupDao.countTeacherByMusicGroupId(musicGroupId);
+        return succeed(mappers);
+    }
 }
 }

+ 21 - 2
mec-student/src/main/java/com/ym/mec/student/controller/StudentCourseHomeworkController.java

@@ -11,10 +11,13 @@ import com.ym.mec.biz.service.StudentCourseHomeworkService;
 import com.ym.mec.biz.service.StudentServeService;
 import com.ym.mec.biz.service.StudentServeService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.util.date.DateUtil;
 import com.yonge.log.model.AuditLogAnnotation;
 import com.yonge.log.model.AuditLogAnnotation;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
 import org.springframework.http.MediaType;
@@ -125,12 +128,28 @@ public class StudentCourseHomeworkController extends BaseController {
 
 
     @ApiOperation(value = "乐团作业情况")
     @ApiOperation(value = "乐团作业情况")
     @GetMapping("/musicGroupHomeworkStat")
     @GetMapping("/musicGroupHomeworkStat")
-    @PreAuthorize("@pcs.hasPermissions('exercisesSituation/musicGroupHomeworkStat')")
-    public HttpResponseResult musicGroupHomeworkStat(String musicGroupId, String startDay, String endDay) {
+    public HttpResponseResult musicGroupHomeworkStat(String musicGroupId, String year, Integer term) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {
         if (sysUser == null) {
             return failed("用户信息获取失败");
             return failed("用户信息获取失败");
         }
         }
+
+        if(StringUtils.isEmpty(year)){
+            throw new BizException("请录入年份");
+        }
+        if(term == null){
+            throw new BizException("请录入学期");
+        }
+        String startDay = "";
+        String endDay = "";
+        if(term == 0){
+            startDay = year + "-03-01";
+            endDay = year + "-08-31";
+        }else {
+            startDay = year + "-09-01";
+            endDay = (Integer.valueOf(year) + 1) + "-02-01";
+        }
+
         return succeed(studentServeService.musicGroupHomeworkStat(musicGroupId, sysUser.getId(), startDay, endDay));
         return succeed(studentServeService.musicGroupHomeworkStat(musicGroupId, sysUser.getId(), startDay, endDay));
     }
     }