Browse Source

Merge remote-tracking branch 'origin/master'

Joburgess 4 years ago
parent
commit
ffc356a562

+ 7 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java

@@ -116,6 +116,9 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
                                                                               @Param("userId") Integer userId);
 
     /**
+     * @describe 统计团体下为开始课程学生数量
+     * @author Joburgess
+     * @date 2020.09.27
      * @param groupId:
      * @param groupType:
      * @return int
@@ -317,12 +320,12 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
     String getMidiByCourseIdAndUserId(@Param("courseScheduleId") String courseScheduleId, @Param("userId") String userId);
 
     /**
-     * @param groupType:
-     * @param groupIds:
-     * @return java.util.List<java.util.Map < java.lang.String, java.math.BigDecimal>>
      * @describe 统计课程组下的课程单价
      * @author Joburgess
      * @date 2020.06.11
+     * @param groupType:
+     * @param groupIds:
+     * @return java.util.List<java.util.Map<java.lang.String,java.math.BigDecimal>>
      */
     List<Map<String, BigDecimal>> findGroupCoursesUnitPrice(@Param("groupType") GroupType groupType,
                                                             @Param("groupIds") List<String> groupIds);
@@ -350,6 +353,7 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      */
     List<CourseScheduleStudentPayment> getClassGroupNoStartCourse(@Param("classGroupIds") List<Integer> classGroupIds);
 
+
     /**
      * @describe 获取指定学员的最后一节课时间
      * @author Joburgess

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

@@ -2318,13 +2318,14 @@
             cs.create_time_,
             s.name_ schoole_name_,
             o.name_ organ_name_,
-            CASE WHEN COUNT(sa.id_) > 0 THEN 1 ELSE 0 END isCallNames
+            CASE WHEN COUNT(sa.id_) > 0 THEN 1 ELSE 0 END isCallNames,
+            case when count(ta.id_) > 0 then '1' else '0' end is_complaints_
         FROM
             course_schedule cs
             LEFT JOIN school s ON cs.schoole_id_=s.id_
             LEFT JOIN organization o ON cs.organ_id_=o.id_
-            LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = (CASE WHEN cs.new_course_id_ IS NULL THEN cs.id_ ELSE cs.new_course_id_ END)
-            AND sa.remark_ IS NULL
+            left join teacher_attendance ta on ta.course_schedule_id_ = cs.id_ and ta.is_complaints_ = 1
+            LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cs.id_ AND sa.remark_ IS NULL
             <include refid="endFindCourseSchedulesCondition"/>
         GROUP BY cs.id_
         ORDER BY course_start_time_,cs.id_

+ 4 - 4
mec-im/src/main/java/com/ym/controller/RoomController.java

@@ -145,14 +145,14 @@ public class RoomController{
     }
 
     @RequestMapping(value = "pushDownloadExamSongMsg", method = RequestMethod.POST)
-    public Object pushDownloadExamSongMsg(Long roomId,Integer examSongId) throws Exception {
-        roomService.pushDownloadExamSongMsg(roomId,examSongId);
+    public Object pushDownloadExamSongMsg(@RequestBody ExamSongData examSongData) throws Exception {
+        roomService.pushDownloadExamSongMsg(examSongData.getRoomId(),examSongData.getExamSongId());
         return new BaseResponse<>();
     }
 
     @RequestMapping(value = "adjustExamSong", method = RequestMethod.POST)
-    public Object adjustExamSong(Long roomId,Integer status,Integer examSongId) throws Exception {
-        roomService.adjustExamSong(roomId,status,examSongId);
+    public Object adjustExamSong(@RequestBody ExamSongData examSongData) throws Exception {
+        roomService.adjustExamSong(examSongData.getRoomId(),examSongData.getStatus(),examSongData.getExamSongId());
         return new BaseResponse<>();
     }
 

+ 31 - 0
mec-im/src/main/java/com/ym/pojo/ExamSongData.java

@@ -0,0 +1,31 @@
+package com.ym.pojo;
+
+public class ExamSongData {
+	private String roomId;
+	private Integer examSongId;
+	private Integer status;
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public String getRoomId() {
+		return roomId;
+	}
+
+	public void setRoomId(String roomId) {
+		this.roomId = roomId;
+	}
+
+	public Integer getExamSongId() {
+		return examSongId;
+	}
+
+	public void setExamSongId(Integer examSongId) {
+		this.examSongId = examSongId;
+	}
+}

+ 13 - 8
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -264,7 +264,11 @@ public class RoomServiceImpl implements RoomService {
         if (room == null) {
             //如果房间不存在,删除除了自己之外的其他用户
 //            roomMemberDao.deleteRoomMember(roomId,userId);
-            saveRoom(roomId, roomId, curTime, display);
+            try {
+                saveRoom(roomId, roomId, curTime, display);
+            }catch (Exception e){
+                log.error("joinRoomSuccess saveRoom error: {}", e.getMessage());
+            }
             IMApiResultInfo resultInfo = imHelper.createGroup(new String[]{userId}, roomId, roomId);
             if (!resultInfo.isSuccess()) {
                 log.error("joinRoomSuccess createGroup error: roomId={}, {}", roomId, resultInfo.getErrorMessage());
@@ -1280,7 +1284,7 @@ public class RoomServiceImpl implements RoomService {
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void pushDownloadExamSongMsg(Long roomId, Integer examSongId) throws Exception {
+    public void pushDownloadExamSongMsg(String roomId, Integer examSongId) throws Exception {
         SysUser authUser = sysUserFeignService.queryUserInfo();
         ExamSongDownloadMessageMessage msg = new ExamSongDownloadMessageMessage();
         SysExamSong sysExamSong = sysExamSongDao.get(examSongId);
@@ -1289,29 +1293,30 @@ public class RoomServiceImpl implements RoomService {
         }
         msg.setSongName(sysExamSong.getName());
         msg.setUrl(sysExamSong.getUrl());
-        imHelper.publishMessage(authUser.getId().toString(), roomId.toString(), msg, 1);
+        imHelper.publishMessage(authUser.getId().toString(), roomId, msg, 1);
         //学员曲目下载状态改为未下载
         ExamSongDownloadData json = new ExamSongDownloadData();
         json.setSongName(sysExamSong.getName());
         json.setUrl(sysExamSong.getUrl());
         json.setStatus(0);
         json.setSongId(examSongId);
-        courseScheduleStudentPaymentDao.adjustExamSong(roomId,null, JSON.toJSONString(json));
+        courseScheduleStudentPaymentDao.adjustExamSong(Long.parseLong(roomId.substring(1)),null, JSON.toJSONString(json));
     }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void adjustExamSong(Long roomId, Integer status,Integer examSongId) throws Exception {
+    public void adjustExamSong(String roomId, Integer status,Integer examSongId) throws Exception {
         if(roomId == null || status == null || examSongId == null){
             throw new BizException("参数校验失败");
         }
         SysUser authUser = sysUserFeignService.queryUserInfo();
-        CourseSchedule courseSchedule = courseScheduleDao.get(roomId);
+        long scheduleId = Long.parseLong(roomId.substring(1));
+        CourseSchedule courseSchedule = courseScheduleDao.get(scheduleId);
 
         //给老师发送学员曲目下载状态
         DeviceStateChangedMessage deviceResourceMessage = new DeviceStateChangedMessage(DeviceTypeEnum.ExamSong.ordinal(), status==0?false:true);
         deviceResourceMessage.setUserId(courseSchedule.getActualTeacherId().toString());
-        imHelper.publishMessage(authUser.getId().toString(), roomId.toString(), deviceResourceMessage, 1);
+        imHelper.publishMessage(authUser.getId().toString(), roomId, deviceResourceMessage, 1);
 
         SysExamSong sysExamSong = sysExamSongDao.get(examSongId);
         if(sysExamSong == null){
@@ -1322,7 +1327,7 @@ public class RoomServiceImpl implements RoomService {
         msg.setUrl(sysExamSong.getUrl());
         msg.setStatus(status);
         msg.setSongId(examSongId);
-        courseScheduleStudentPaymentDao.adjustExamSong(roomId,authUser.getId(),JSON.toJSONString(msg));
+        courseScheduleStudentPaymentDao.adjustExamSong(scheduleId,authUser.getId(),JSON.toJSONString(msg));
     }
 
     public void updateDisplay(String roomId, String senderId, String display, Integer isIncludeSender) throws Exception {

+ 2 - 2
mec-im/src/main/java/com/ym/service/RoomService.java

@@ -84,7 +84,7 @@ public interface RoomService {
      * @param roomId
      * @param examSongId
      */
-    void pushDownloadExamSongMsg(Long roomId, Integer examSongId) throws Exception;
+    void pushDownloadExamSongMsg(String roomId, Integer examSongId) throws Exception;
 
     /**
      * 修改学员伴奏下载状态
@@ -92,5 +92,5 @@ public interface RoomService {
      * @param roomId
      * @param status
      */
-    void adjustExamSong(Long roomId,Integer status,Integer examSongId) throws Exception;
+    void adjustExamSong(String roomId,Integer status,Integer examSongId) throws Exception;
 }