浏览代码

Merge remote-tracking branch 'origin/master'

Joburgess 5 年之前
父节点
当前提交
67a05236b5

+ 18 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleEvaluateDao.java

@@ -25,11 +25,26 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
     List<PracticeGroupsDto> getOrganMoney();
 
     /**
+     * @param expiredDate:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseScheduleEvaluate>
      * @describe 推送指定时间及之前的未推送的报告
      * @author Joburgess
      * @date 2020/2/28
-     * @param expiredDate:
-     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseScheduleEvaluate>
      */
-    List<CourseScheduleEvaluate> findExpiredDateBeforeReport(@Param("expiredDate")Date expiredDate);
+    List<CourseScheduleEvaluate> findExpiredDateBeforeReport(@Param("expiredDate") Date expiredDate);
+
+    /**
+     * 根据课程组id获取报告列表
+     *
+     * @param groupId
+     * @return
+     */
+    List<CourseScheduleEvaluate> findByGroupId(@Param("groupId") Integer groupId);
+
+    /**
+     * 根据id获取报告
+     *
+     * @return
+     */
+    CourseScheduleEvaluate findById(@Param("id") Integer id);
 }

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

@@ -45,6 +45,8 @@ public class CourseScheduleEvaluate {
 
     private Integer isPushed;
 
+    private String month;
+
     public Integer getIsPushed() {
         return isPushed;
     }
@@ -164,4 +166,12 @@ public class CourseScheduleEvaluate {
     public void setTotalMinutes(Integer totalMinutes) {
         this.totalMinutes = totalMinutes;
     }
+
+    public String getMonth() {
+        return month;
+    }
+
+    public void setMonth(String month) {
+        this.month = month;
+    }
 }

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleEvaluateService.java

@@ -5,6 +5,9 @@ import com.ym.mec.biz.dal.entity.TeacherCourseStatistics;
 import com.ym.mec.biz.dal.page.TeacherCourseStatisticsQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 public interface CourseScheduleEvaluateService extends BaseService<Long, CourseScheduleEvaluate> {
@@ -13,4 +16,19 @@ public interface CourseScheduleEvaluateService extends BaseService<Long, CourseS
 
     CourseScheduleEvaluate getStudyReport(Integer classGroupId);
 
+    /**
+     * 根据课程组id获取报告列表
+     *
+     * @param groupId
+     * @return
+     */
+    List<CourseScheduleEvaluate> findByGroupId(@Param("groupId") Integer groupId);
+
+    /**
+     * 根据id获取报告
+     *
+     * @return
+     */
+    CourseScheduleEvaluate findById(@Param("id") Integer id);
+
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupService.java

@@ -270,4 +270,6 @@ public interface PracticeGroupService extends BaseService<Long, PracticeGroup> {
 	 */
 	PageInfo<PracticeGroupDto> findPracticeGroupReviews(PracticeGroupQueryInfo queryInfo);
 
+
+
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleEvaluateServiceImpl.java

@@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Date;
+import java.util.List;
 
 
 @Service
@@ -89,4 +90,14 @@ public class CourseScheduleEvaluateServiceImpl extends BaseServiceImpl<Long, Cou
         return studyReport;
 
     }
+
+    @Override
+    public List<CourseScheduleEvaluate> findByGroupId(Integer groupId) {
+        return courseScheduleEvaluateDao.findByGroupId(groupId);
+    }
+
+    @Override
+    public CourseScheduleEvaluate findById(Integer id) {
+        return courseScheduleEvaluateDao.findById(id);
+    }
 }

+ 15 - 1
mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml

@@ -13,6 +13,7 @@
         <result column="student_id_" jdbcType="INTEGER" property="studentId"/>
         <result column="subject_name_" jdbcType="VARCHAR" property="subjectName"/>
         <result column="is_pushed_" jdbcType="INTEGER" property="isPushed"/>
+        <result column="month_" jdbcType="VARCHAR" property="month"/>
     </resultMap>
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleEvaluate" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
@@ -33,7 +34,7 @@
         FROM course_schedule_evaluate cse
                  LEFT JOIN practice_group pg ON pg.id_ = cse.music_group_id_
                  LEFT JOIN subject s on s.id_ = pg.subject_id_
-        WHERE cse.class_group_id_ = #{classGroupId}
+        WHERE cse.class_group_id_ = #{classGroupId} LIMIT 1
     </select>
 
     <select id="findByClassGroupIds" resultMap="CourseScheduleEvaluate">
@@ -108,4 +109,17 @@
       WHERE create_time_ &lt;= #{expiredDate}
       AND (is_pushed_ = 0 OR is_pushed_ IS NULL)
     </select>
+
+    <select id="findByGroupId" resultMap="CourseScheduleEvaluate">
+        SELECT id_,DATE_FORMAT(create_time_, '%Y年%m月') month_ FROM course_schedule_evaluate WHERE music_group_id_ = #{groupId}
+        ORDER BY create_time_ ASC
+    </select>
+
+    <select id="findById" resultMap="CourseScheduleEvaluate">
+        SELECT cse.*, s.name_ subject_name_, pg.student_id_
+        FROM course_schedule_evaluate cse
+        LEFT JOIN practice_group pg ON pg.id_ = cse.music_group_id_
+        LEFT JOIN subject s on s.id_ = pg.subject_id_
+        WHERE cse.id_ = #{id}
+    </select>
 </mapper>

+ 17 - 0
mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.page.PracticeGroupQueryInfo;
+import com.ym.mec.biz.service.CourseScheduleEvaluateService;
 import com.ym.mec.biz.service.GroupClassService;
 import com.ym.mec.biz.service.PracticeGroupService;
 import com.ym.mec.common.controller.BaseController;
@@ -41,6 +42,8 @@ public class PracticeGroupManageController extends BaseController {
     private EmployeeDao employeeDao;
     @Autowired
     private GroupClassService groupService;
+    @Autowired
+    private CourseScheduleEvaluateService courseScheduleEvaluateService;
 
     @ApiOperation(value = "全查询")
     @GetMapping("/queryAll")
@@ -111,4 +114,18 @@ public class PracticeGroupManageController extends BaseController {
         }
         return succeed(practiceGroupService.findPracticeGroupReviews(queryInfo));
     }
+
+    @ApiOperation(value = "课程组评论列表")
+    @GetMapping("getGroupReviews")
+    @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/getGroupReviews')")
+    public Object getGroupReviews(Integer groupId) {
+        return succeed(courseScheduleEvaluateService.findByGroupId(groupId));
+    }
+
+    @ApiOperation(value = "评论详情")
+    @GetMapping("getReviewsInfo")
+    @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/getReviewsInfo')")
+    public Object getReviewsInfo(Integer id) {
+        return succeed(courseScheduleEvaluateService.findById(id));
+    }
 }