Browse Source

Merge branch 'dev' into release
123

wangliang 4 years ago
parent
commit
1f6ec678ff

+ 2 - 23
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeReportController.java

@@ -179,30 +179,9 @@ public class TIeReportController {
     @RequestMapping(value = "/patrol", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "在线巡考报表信息", response = InvigilateListPatrolReportBean.class)})
     public Result patrolReport(@ApiParam(value = "考试批次id", required = false) @RequestParam(required = false) Long examId) {
-        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-        AuthDto authDto = (AuthDto) redisUtil.get(SystemConstant.userOauth + "::" + tbUser.getId());
-        //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
-        Long userId = null;
-        if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
-            userId = tbUser.getId();
-        }
-        return ResultUtil.ok(reportService.patrolReport(examId, userId));
-    }
-
-    @ApiOperation(value = "考情监控报表接口")
-    @RequestMapping(value = "/exam/invigilate", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "考情监控报表信息", response = InvigilateListPatrolReportBean.class)})
-    public Result examInvigilateReport(@ApiParam(value = "考试批次id", required = false) @RequestParam(required = false) Long examId) {
-        TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
-        AuthDto authDto = (AuthDto) redisUtil.get(SystemConstant.userOauth + "::" + tbUser.getId());
-        //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
-        Long userId = null;
-        if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
-            userId = tbUser.getId();
-        }
-        return ResultUtil.ok(reportService.examInvigilateReport(examId, userId));
+        return ResultUtil.ok(reportService.patrolReport(examId, null));
     }
-    
+
     @ApiOperation(value = "考情监控-人数")
     @RequestMapping(value = "/examination_monitor/count", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})

+ 0 - 9
themis-business/src/main/java/com/qmth/themis/business/service/TIeReportService.java

@@ -54,15 +54,6 @@ public interface TIeReportService {
      */
     public List<InvigilateListPatrolReportBean> patrolReport(Long examId, Long userId);
 
-    /**
-     * 考情监控报表接口
-     *
-     * @param examId
-     * @param userId
-     * @return
-     */
-    public List<InvigilateListPatrolReportBean> examInvigilateReport(Long examId, Long userId);
-
 	/**考情监控-人数
 	 * @return
 	 */

+ 0 - 12
themis-business/src/main/java/com/qmth/themis/business/service/impl/TIeReportServiceImpl.java

@@ -398,18 +398,6 @@ public class TIeReportServiceImpl implements TIeReportService {
 		return tOeExamRecordMapper.patrolReport(examId, userId);
 	}
 
-	/**
-	 * 考情监控报表接口
-	 *
-	 * @param examId
-	 * @param userId
-	 * @return
-	 */
-	@Override
-	public List<InvigilateListPatrolReportBean> examInvigilateReport(Long examId, Long userId) {
-		return tOeExamRecordMapper.examInvigilateReport(examId, userId);
-	}
-
 	/**
 	 * 考情监控-人数
 	 */

+ 9 - 3
themis-business/src/main/resources/db/init.sql

@@ -514,7 +514,9 @@ INSERT INTO `t_b_privilege` VALUES (147, '预警消息', '/api/admin/invigilate/
 INSERT INTO `t_b_privilege` VALUES (148, '预警修改阅读状态', '/api/admin/invigilate/warn/save/status', 'LINK', 60, 34, NULL, '2020-08-01 12:08:31');
 INSERT INTO `t_b_privilege` VALUES (149, '学生上传底照', '/api/admin/student/base_photo/upload', 'LINK', 6, 6, NULL, '2020-08-01 13:08:31');
 INSERT INTO `t_b_privilege` VALUES (150, '报表-在线巡考', '/api/admin/report/patrol', 'LINK', 60, 35, NULL, '2020-08-01 13:08:31');
-INSERT INTO `t_b_privilege` VALUES (151, '报表-考情监控', '/api/admin/report/exam/invigilate', 'LINK', 60, 36, NULL, '2020-08-01 13:08:31');
+INSERT INTO `t_b_privilege` VALUES (151, '报表-考情监控-人数', '/api/admin/report/examination_monitor/count', 'LINK', 60, 36, NULL, '2020-08-01 13:08:31');
+INSERT INTO `t_b_privilege` VALUES (152, '报表-考情监控-预警分布', '/api/admin/report/examination_monitor/warn_distribution', 'LINK', 60, 37, NULL, '2020-08-01 13:08:31');
+INSERT INTO `t_b_privilege` VALUES (153, '报表-考情监控-预警时间趋势', '/api/admin/report/examination_monitor/warn_trend', 'LINK', 60, 38, NULL, '2020-08-01 13:08:31');
 COMMIT;
 
 -- ----------------------------
@@ -732,8 +734,12 @@ INSERT INTO `t_b_role_privilege` VALUES (179, 'INVIGILATE', 111);
 INSERT INTO `t_b_role_privilege` VALUES (180, 'ADMIN', 149);
 INSERT INTO `t_b_role_privilege` VALUES (181, 'ADMIN', 150);
 INSERT INTO `t_b_role_privilege` VALUES (182, 'ADMIN', 151);
-INSERT INTO `t_b_role_privilege` VALUES (183, 'INVIGILATE', 150);
-INSERT INTO `t_b_role_privilege` VALUES (184, 'INVIGILATE', 151);
+INSERT INTO `t_b_role_privilege` VALUES (183, 'ADMIN', 152);
+INSERT INTO `t_b_role_privilege` VALUES (184, 'ADMIN', 153);
+INSERT INTO `t_b_role_privilege` VALUES (185, 'INSPECTION', 150);
+INSERT INTO `t_b_role_privilege` VALUES (186, 'INSPECTION', 151);
+INSERT INTO `t_b_role_privilege` VALUES (187, 'INSPECTION', 152);
+INSERT INTO `t_b_role_privilege` VALUES (188, 'INSPECTION', 153);
 COMMIT;
 
 -- ----------------------------

+ 0 - 59
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -536,65 +536,6 @@
 		order by t.roomCode
 	</select>
 
-	<select id="examInvigilateReport" resultType="com.qmth.themis.business.bean.backend.InvigilateListPatrolReportBean">
-		select
-		t.roomCode,
-		t.roomName,
-		sum(t.warningCount) as warningCount,
-		count(t.client_websocket_status) as clientWebsocketStatusCount
-		from
-		(
-		select
-		s.room_code roomCode, s.room_name roomName, IFNULL(t.warning_count,
-		0) as warningCount, t.client_websocket_status
-		from
-		t_oe_exam_record t
-		left join t_e_exam_student s on
-		t.exam_student_id = s.id
-		left join t_e_exam tee on
-		tee.id = t.exam_id
-		left join t_e_exam_activity teea on
-		teea.id = t.exam_activity_id
-		inner join (
-		select
-		toer.id
-		from
-		t_oe_exam_record toer
-		where
-		EXISTS(
-		select
-		tees.id
-		from
-		t_e_exam_student tees
-		where
-		EXISTS (
-		select
-		distinct tbeiu.room_code
-		from
-		t_b_exam_invigilate_user tbeiu
-		where
-		<if test="userId != null and userId != ''">
-			tbeiu.user_id = #{userId} and
-		</if>
-		tbeiu.room_code = tees.room_code
-		and toer.exam_student_id = tees.id))) t1 on
-		t1.id = t.id
-		<where> 1 = 1
-			<if test="examId != null and examId != ''">
-				and t.exam_id = #{examId}
-			</if>
-			and s.enable = 1
-			and tee.enable = 1
-			and teea.enable = 1
-			and teea.finish_time > now()
-			and t.client_websocket_status = 'OFF_LINE'
-		</where> ) t
-		group by
-		t.roomCode,
-		t.roomName
-		order by t.roomCode
-	</select>
-	
 	<select id="getExamingCount" resultType="java.lang.Long">
 		select count(1) from t_oe_exam_record f
 		where f.status != 'FINISHED' and f.status != 'PERSISTED'