Browse Source

Merge remote-tracking branch 'origin/master'

周箭河 5 years ago
parent
commit
0080e401ce

+ 16 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -1309,7 +1309,22 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
      */
     List<Map<Integer, Long>> countStudentVipCoursesWithDate(@Param("studentIds") List<Integer> studentIds,
                                                                @Param("startTime") Date startTime,
-                                                               @Param("endTime") Date endTime);
+                                                               @Param("endTime") Date endTime,
+                                                            @Param("groupType") GroupType groupType);
+
+
+    /**
+     * @describe 统计学生在指定周期内的付费网管课数量
+     * @author Joburgess
+     * @date 2020.05.06
+     * @param studentIds:
+     * @param startTime:
+     * @param endTime:
+     * @return java.util.List<java.util.Map<java.lang.Integer,java.lang.Long>>
+     */
+    List<Map<Integer, Long>> countStudentPayPracticeCoursesWithDate(@Param("studentIds") List<Integer> studentIds,
+                                                            @Param("startTime") Date startTime,
+                                                            @Param("endTime") Date endTime);
 
     /**
      * @describe 统计学生在未来的vip课数量

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentExercisesSituationDto.java

@@ -16,6 +16,16 @@ public class StudentExercisesSituationDto extends StudentExtracurricularExercise
 
     private Integer existVipCourse;
 
+    private Integer existPracticeCourse;
+
+    public Integer getExistPracticeCourse() {
+        return existPracticeCourse;
+    }
+
+    public void setExistPracticeCourse(Integer existPracticeCourse) {
+        this.existPracticeCourse = existPracticeCourse;
+    }
+
     public Integer getExistVipCourse() {
         return existVipCourse;
     }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentExercisesSituationQueryInfo.java

@@ -39,6 +39,17 @@ public class StudentExercisesSituationQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "是否存在vip课")
     private Integer existVipCourse;
 
+    @ApiModelProperty(value = "是否存在网管课")
+    private Integer existPracticeCourse;
+
+    public Integer getExistPracticeCourse() {
+        return existPracticeCourse;
+    }
+
+    public void setExistPracticeCourse(Integer existPracticeCourse) {
+        this.existPracticeCourse = existPracticeCourse;
+    }
+
     public Integer getExistVipCourse() {
         return existVipCourse;
     }

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

@@ -66,6 +66,5 @@ public interface ExtracurricularExercisesReplyService extends BaseService<Long,
      * @return void
      */
     void exercisesSituationStatistics();
-
     void exercisesSituationStatistics2();
 }

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

@@ -789,6 +789,8 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 
     @Override
     public List<ExportTeacherSalaryDto> exportTeacherSalary(ExportTeacherSalaryQueryInfo queryInfo) {
+        //4月份之后的需要扣异常考勤的课酬
+        //扣除有异常考勤的课酬
         Map<String, Object> params = new HashMap<>();
         MapUtil.populateMap(params, queryInfo);
         String firstDayOfMonth = DateUtil.format(DateUtil.getFirstDayOfMonth(queryInfo.getDate()),DateUtil.ISO_EXPANDED_DATE_FORMAT);

+ 8 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dto.StudentExercisesSituationDto;
 import com.ym.mec.biz.dal.dto.StudentServiceDetailDto;
 import com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation;
+import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.page.StudentExercisesSituationQueryInfo;
 import com.ym.mec.biz.dal.page.StudentServiceDetailQueryInfo;
 import com.ym.mec.biz.service.StudentExtracurricularExercisesSituationService;
@@ -51,15 +52,15 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 			dataList = studentExtracurricularExercisesSituationDao.findExercisesSituations(params);
 			if(Objects.isNull(queryInfo.getExistVipCourse())){
 				List<Integer> studentIds = dataList.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
-				List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday());
+				List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday(), GroupType.VIP);
+				List<Map<Integer, Long>> studentPracticeCoursesMaps = courseScheduleDao.countStudentPayPracticeCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday());
 				Map<Integer, Long> studentVipCourseMap = MapUtil.convertIntegerMap(studentVipCoursesMaps);
+				Map<Integer, Long> studentPracticeCourseMap = MapUtil.convertIntegerMap(studentPracticeCoursesMaps);
 				for (StudentExercisesSituationDto exercisesSituationDto : dataList) {
 					Long vipCourses=studentVipCourseMap.get(exercisesSituationDto.getStudentId());
-					if(Objects.isNull(vipCourses)||vipCourses<=0){
-						exercisesSituationDto.setExistVipCourse(0);
-					}else{
-						exercisesSituationDto.setExistVipCourse(1);
-					}
+					Long practiceCourses=studentPracticeCourseMap.get(exercisesSituationDto.getStudentId());
+					exercisesSituationDto.setExistVipCourse(Objects.isNull(vipCourses)?0:vipCourses.intValue());
+					exercisesSituationDto.setExistPracticeCourse(Objects.isNull(practiceCourses)?0:practiceCourses.intValue());
 				}
 			}
 		}
@@ -84,7 +85,7 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 			dataList = studentExtracurricularExercisesSituationDao.findExercisesSituations(params);
 			if(Objects.isNull(queryInfo.getExistVipCourse())){
 				List<Integer> studentIds = dataList.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
-				List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday());
+				List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday(),GroupType.VIP);
 				Map<Integer, Long> studentVipCourseMap = MapUtil.convertIntegerMap(studentVipCoursesMaps);
 				for (StudentExercisesSituationDto exercisesSituationDto : dataList) {
 					Long vipCourses=studentVipCourseMap.get(exercisesSituationDto.getStudentId());

+ 21 - 1
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -3004,11 +3004,31 @@
             <foreach collection="studentIds" item="studentId" separator="," open="(" close=")">
                 #{studentId}
             </foreach>
-            AND cssp.group_type_ = 'VIP'
+            AND cssp.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             AND cs.class_date_ BETWEEN #{startTime} AND #{endTime}
         GROUP BY
         cssp.user_id_
     </select>
+    <select id="countStudentPayPracticeCoursesWithDate" resultType="map">
+        SELECT
+        cssp.user_id_ as 'key',
+        COUNT( cs.id_ ) as 'value'
+        FROM
+        course_schedule_student_payment cssp
+        LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
+        LEFT JOIN practice_group pg ON pg.id_=cssp.music_group_id_
+        WHERE
+        cssp.user_id_ IN
+        <foreach collection="studentIds" item="studentId" separator="," open="(" close=")">
+            #{studentId}
+        </foreach>
+        AND cssp.group_type_ = 'PRACTICE'
+        AND pg.type_='CHARGE'
+        AND cs.class_date_ BETWEEN #{startTime} AND #{endTime}
+        GROUP BY
+        cssp.user_id_
+    </select>
+
     <select id="countStudentVipCoursesInFuture" resultType="map">
         SELECT
           cssp.user_id_ as 'key',

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

@@ -158,6 +158,12 @@
 			<if test="existVipCourse!=null and existVipCourse==0">
 				AND NOT EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='VIP' AND class_date_ BETWEEN #{monday} AND #{sunday})
 			</if>
+			<if test="existPracticeCourse!=null and existPracticeCourse==1">
+				AND EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ LEFT JOIN practice_group pg ON pg.id_=cssp.music_group_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='PRACTICE' AND pg.type_='CHARGE' AND class_date_ BETWEEN #{monday} AND #{sunday})
+			</if>
+			<if test="existPracticeCourse!=null and existPracticeCourse==0">
+				AND NOT EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ LEFT JOIN practice_group pg ON pg.id_=cssp.music_group_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='PRACTICE' AND pg.type_='CHARGE' AND class_date_ BETWEEN #{monday} AND #{sunday})
+			</if>
 			GROUP BY
 			student_id_,teacher_id_
 			<trim prefix="HAVING" suffixOverrides="and">
@@ -218,6 +224,12 @@
 			<if test="existVipCourse!=null and existVipCourse==0">
 				AND NOT EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='VIP' AND class_date_ BETWEEN #{monday} AND #{sunday})
 			</if>
+			<if test="existPracticeCourse!=null and existPracticeCourse==1">
+				AND EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ LEFT JOIN practice_group pg ON pg.id_=cssp.music_group_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='PRACTICE' AND pg.type_='CHARGE' AND class_date_ BETWEEN #{monday} AND #{sunday})
+			</if>
+			<if test="existPracticeCourse!=null and existPracticeCourse==0">
+				AND NOT EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ LEFT JOIN practice_group pg ON pg.id_=cssp.music_group_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='PRACTICE' AND pg.type_='CHARGE' AND class_date_ BETWEEN #{monday} AND #{sunday})
+			</if>
 			GROUP BY
 			student_id_,teacher_id_
 			<trim prefix="HAVING" suffixOverrides="and">

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

@@ -222,9 +222,9 @@ public class RoomController{
 
     @RequestMapping(value = "/members/online-status", method = RequestMethod.POST)
     public Object memberOnlineStatus(@RequestBody List<ReqMemberOnlineStatus> statusList,
-                                                    @RequestParam(value = "timestamp", required = false) String timestamp,
-                                                    @RequestParam(value = "nonce", required = false) String nonce,
-                                                    @RequestParam(value = "signature", required = false) String signature)
+                                     @RequestParam(value = "timestamp", required = false) String timestamp,
+                                     @RequestParam(value = "nonce", required = false) String nonce,
+                                     @RequestParam(value = "signature", required = false) String signature)
             throws ApiException, Exception {
         Boolean result = roomService.memberOnlineStatus(statusList, nonce, timestamp, signature);
         return new BaseResponse<>(result);

+ 6 - 6
mec-im/src/main/java/com/ym/pojo/ReqDeviceControlData.java

@@ -7,11 +7,11 @@ import lombok.Data;
  */
 @Data
 public class ReqDeviceControlData {
-    private Boolean cameraOn;
-    private Boolean microphoneOn;
-    private String roomId;
-    private String userId;
-    private String ticket;
+	private Boolean cameraOn;
+	private Boolean microphoneOn;
+	private String roomId;
+	private String userId;
+	private String ticket;
 	public Boolean getCameraOn() {
 		return cameraOn;
 	}
@@ -42,5 +42,5 @@ public class ReqDeviceControlData {
 	public void setTicket(String ticket) {
 		this.ticket = ticket;
 	}
-    
+
 }

+ 5 - 5
mec-im/src/main/java/com/ym/pojo/ReqUserData.java

@@ -7,10 +7,10 @@ import lombok.Data;
  */
 @Data
 public class ReqUserData {
-    private String userName;
-    private String roomId;
-    private String userId;
-    private boolean audience;
+	private String userName;
+	private String roomId;
+	private String userId;
+	private boolean audience;
 	private boolean disableCamera;
 	public String getUserName() {
 		return userName;
@@ -42,5 +42,5 @@ public class ReqUserData {
 	public void setDisableCamera(boolean disableCamera) {
 		this.disableCamera = disableCamera;
 	}
-	
+
 }

+ 5 - 4
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -753,16 +753,16 @@ public class RoomServiceImpl implements RoomService {
             taskInfo.setRoomId(roomId);
             taskInfo.setTypeEnum(typeEnum);
             taskInfo.setOnOff(true);
-            taskInfo.setApplyUserId(authUser.getId().toString());
+            taskInfo.setApplyUserId(userId);
             taskInfo.setTargetUserId(userId);
             taskInfo.setTicket(ticket);
             scheduleManager.addTask(taskInfo);
             ControlDeviceNotifyMessage msg = new ControlDeviceNotifyMessage(ActionEnum.Invite.ordinal());
             msg.setTicket(ticket);
             msg.setType(taskInfo.getTypeEnum().ordinal());
-            msg.setOpUserId(authUser.getId().toString());
+            msg.setOpUserId(userId);
             msg.setOpUserName(authUser.getUsername());
-            imHelper.publishMessage(authUser.getId().toString(), userId, roomId, msg);
+            imHelper.publishMessage(userId, userId, roomId, msg);
         } else {
             if (typeEnum.equals(DeviceTypeEnum.Camera)) {
                 roomMemberDao.updateCameraByRidAndUid(roomId, userId, false);
@@ -1238,13 +1238,14 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    @Transactional(rollbackFor = Exception.class)
+    @Transactional(rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED)
     public boolean statusSync(String roomId,String userId) throws Exception {
         log.info("statusSync: roomId={}, userId={}", roomId, userId);
         List<RoomMember> byRidAndUid = roomMemberDao.findByRidAndUid(roomId, userId);
         if(byRidAndUid.size() > 0){
 //            SysUser sysUser = sysUserFeignService.queryUserById(Integer.parseInt(userId));
             SysUser sysUser = teacherDao.getUser(Integer.parseInt(userId));
+            studentDao.lockUser(Integer.parseInt(userId));
             Teacher teacher = teacherDao.get(sysUser.getId());
             CourseSchedule courseSchedule = courseScheduleDao.get(Long.parseLong(roomId.substring(1)));
             log.info("statusSyncLevelRoom: roomId={}, userId={}", roomId, userId);

+ 3 - 3
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -1223,8 +1223,8 @@ public class ExportController extends BaseController {
         OutputStream ouputStream = null;
         try {
             HSSFWorkbook workbook = POIUtil.exportExcel(
-                    new String[]{"学员编号", "学员姓名", "所属分部", "指导老师", "预期安排", "实际安排", "提交次数", "评价次数", "及时评价次数"},
-                    new String[]{"studentId", "studentName", "organName", "teacherName", "expectExercisesNum", "actualExercisesNum", "exercisesReplyNum", "exercisesMessageNum", "exercisesMessageTimelyNum"}, rows);
+                    new String[]{"学员编号", "学员姓名", "所属分部", "指导老师", "预期安排", "实际安排", "提交次数", "评价次数", "及时评价次数", "付费网管课", "VIP课"},
+                    new String[]{"studentId", "studentName", "organName", "teacherName", "expectExercisesNum", "actualExercisesNum", "exercisesReplyNum", "exercisesMessageNum", "exercisesMessageTimelyNum", "existPracticeCourse", "existVipCourse"}, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             ouputStream = response.getOutputStream();
@@ -1243,7 +1243,7 @@ public class ExportController extends BaseController {
         }
     }
 
-    @ApiOperation(value = "课外训练-教学导出")
+    @ApiOperation(value = "教师课酬导出")
     @GetMapping("export/isSettlementCourseSalarys")
     @PreAuthorize("@pcs.hasPermissions('export/isSettlementCourseSalarys')")
     public void isSettlementCourseSalarys(CourseSalaryQueryInfo4Web queryInfo, HttpServletResponse response) throws IOException {

+ 19 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentExtracurricularExercisesSituationController.java

@@ -4,8 +4,11 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.page.StudentCourseHomeworkReplyQueryInfo;
 import com.ym.mec.biz.dal.page.StudentExercisesSituationQueryInfo;
 import com.ym.mec.biz.dal.page.StudentServiceDetailQueryInfo;
+import com.ym.mec.biz.service.ExtracurricularExercisesMessageService;
+import com.ym.mec.biz.service.StudentCourseHomeworkReplyService;
 import com.ym.mec.biz.service.StudentExtracurricularExercisesSituationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -37,6 +40,12 @@ public class StudentExtracurricularExercisesSituationController extends BaseCont
     private SysUserFeignService sysUserFeignService;
 
     @Autowired
+    private ExtracurricularExercisesMessageService extracurricularExercisesMessageService;
+
+    @Autowired
+    private StudentCourseHomeworkReplyService studentCourseHomeworkReplyService;
+
+    @Autowired
     private EmployeeDao employeeDao;
 
     @ApiOperation(value = "课外训练-教学")
@@ -70,4 +79,14 @@ public class StudentExtracurricularExercisesSituationController extends BaseCont
         return succeed(studentExtracurricularExercisesSituationService.findServiceStudentDetail(queryInfo));
     }
 
+    @ApiOperation(value = "回复查询")
+    @GetMapping("/findStudentHomeworkComments")
+    public Object findStudentHomeworkComments(StudentCourseHomeworkReplyQueryInfo queryInfo){
+        if(!queryInfo.isExtra()){
+            return succeed(studentCourseHomeworkReplyService.queryPage(queryInfo));
+        }else{
+            return succeed(extracurricularExercisesMessageService.findStudentExtraExerciseComments(queryInfo));
+        }
+    }
+
 }

+ 0 - 6
mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

@@ -214,12 +214,6 @@ public class TaskController extends BaseController {
 	//学生服务信息统计
 	@GetMapping("/exercisesSituationStatistics")
 	public void exercisesSituationStatistics(){
-		extracurricularExercisesReplyService.exercisesSituationStatistics();
-	}
-
-	//学生服务信息统计2
-	@GetMapping("/exercisesSituationStatistics2")
-	public void exercisesSituationStatistics2(){
 		extracurricularExercisesReplyService.exercisesSituationStatistics2();
 	}