|
@@ -14,7 +14,6 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -43,6 +42,7 @@ import com.qmth.themis.business.dao.TEExamStudentMapper;
|
|
|
import com.qmth.themis.business.dao.TIeInvigilateExceptionInfoMapper;
|
|
|
import com.qmth.themis.business.dao.TIeInvigilateWarnInfoMapper;
|
|
|
import com.qmth.themis.business.dao.TOeExamRecordMapper;
|
|
|
+import com.qmth.themis.business.entity.TBUser;
|
|
|
import com.qmth.themis.business.entity.TEExamActivity;
|
|
|
import com.qmth.themis.business.enums.BreachCancelTypeEnum;
|
|
|
import com.qmth.themis.business.enums.BreachTypeEnum;
|
|
@@ -53,6 +53,7 @@ import com.qmth.themis.business.service.TEExamActivityService;
|
|
|
import com.qmth.themis.business.service.TEExamService;
|
|
|
import com.qmth.themis.business.service.TIeReportService;
|
|
|
import com.qmth.themis.business.util.RedisUtil;
|
|
|
+import com.qmth.themis.business.util.ServletUtil;
|
|
|
|
|
|
@Service
|
|
|
public class TIeReportServiceImpl implements TIeReportService {
|
|
@@ -94,11 +95,11 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> examView(Long examId, Long examActivityId, String roomCode, String courseCode,
|
|
|
+ public Map<String, Object> examView(Long orgId,Long examId, Long examActivityId, String roomCode, String courseCode,
|
|
|
String name, String identity) {
|
|
|
// 应考人数
|
|
|
Long totalNum = 0L;
|
|
|
- List<Map<String, Object>> total = examStudentMapper.getTotalCount(examId, examActivityId, roomCode, courseCode);
|
|
|
+ List<Map<String, Object>> total = examStudentMapper.getTotalCount(orgId,examId, examActivityId, roomCode, courseCode);
|
|
|
Map<Long, Long> totalMap = new HashMap<Long, Long>();
|
|
|
for (Map<String, Object> map : total) {
|
|
|
Long acId = (Long) map.get("activityId");
|
|
@@ -108,7 +109,7 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
}
|
|
|
// 实考人数
|
|
|
Long doneNum = 0L;
|
|
|
- List<Map<String, Object>> doneCount = examRecordMapper.getDoneCount(examId, examActivityId, roomCode,
|
|
|
+ List<Map<String, Object>> doneCount = examRecordMapper.getDoneCount(orgId,examId, examActivityId, roomCode,
|
|
|
courseCode);
|
|
|
Map<Long, Long> doneMap = new HashMap<Long, Long>();
|
|
|
for (Map<String, Object> map : doneCount) {
|
|
@@ -122,7 +123,7 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
}
|
|
|
// 缺考人数
|
|
|
Map<Long, Long> absentMap = new HashMap<Long, Long>();
|
|
|
- Date now = new Date();
|
|
|
+// Date now = new Date();
|
|
|
for (Long acId : totalMap.keySet()) {
|
|
|
// ExamActivityCacheBean ac = examActivityService.getExamActivityCacheBean(acId);
|
|
|
// Long end = ac.getStartTime() + (ac.getOpeningSeconds() * 1000);
|
|
@@ -150,7 +151,7 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
}
|
|
|
}
|
|
|
// 每日已考人数
|
|
|
- List<Map<String, Object>> doneCountByDay = examRecordMapper.getDoneCountByDay(examId, examActivityId, roomCode,
|
|
|
+ List<Map<String, Object>> doneCountByDay = examRecordMapper.getDoneCountByDay(orgId,examId, examActivityId, roomCode,
|
|
|
courseCode);
|
|
|
|
|
|
Map<String, Object> ret = new HashMap<String, Object>();
|
|
@@ -164,11 +165,11 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public IPage examViewCount(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
|
|
|
+ public IPage<ExamViewCountListBean> examViewCount(Long orgId,Long examId, Long examActivityId, String roomCode, String courseCode, String name,
|
|
|
String identity, int pageNumber, int pageSize) {
|
|
|
// 应考人数
|
|
|
IPage<ExamViewCountListBean> total = examStudentMapper.getTotalCountInfo(new Page<>(pageNumber, pageSize),
|
|
|
- examId, examActivityId, roomCode, courseCode);
|
|
|
+ orgId,examId, examActivityId, roomCode, courseCode);
|
|
|
List<ExamViewCountListBean> data = total.getRecords();
|
|
|
if (data == null || data.size() == 0) {
|
|
|
return total;
|
|
@@ -225,14 +226,11 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public IPage examDeficiencyList(Long examId, Long examActivityId, String roomCode, String courseCode,
|
|
|
+ public IPage<ExamDeficiencyListBean> examDeficiencyList(Long orgId,Long examId, Long examActivityId, String roomCode, String courseCode,
|
|
|
String name, String identity, int pageNumber, int pageSize) {
|
|
|
- Page<ExamDeficiencyListBean> ipage = new Page<>(pageNumber, pageSize);
|
|
|
- ipage.addOrder(OrderItem.asc("t.exam_activity_id"));
|
|
|
- ipage.addOrder(OrderItem.asc("t.room_code"));
|
|
|
- QueryWrapper<TEExamActivity> wp = new QueryWrapper<>();
|
|
|
- wp.lambda().eq(TEExamActivity::getExamId, examId);
|
|
|
- List<TEExamActivity> acs = examActivityService.list(wp);
|
|
|
+
|
|
|
+ List<TEExamActivity> acs = examActivityService.findByExamIdAndOrgId(examId,orgId);
|
|
|
+
|
|
|
List<Long> absentActivityIds = new ArrayList<>();
|
|
|
Date now = new Date();
|
|
|
for (TEExamActivity ac : acs) {
|
|
@@ -244,7 +242,11 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
if (absentActivityIds.size() == 0) {
|
|
|
return new Page<>(pageNumber, pageSize);
|
|
|
}
|
|
|
- IPage<ExamDeficiencyListBean> total = examStudentMapper.getExamDeficiencyPage(ipage, examId, examActivityId,
|
|
|
+
|
|
|
+ Page<ExamDeficiencyListBean> ipage = new Page<>(pageNumber, pageSize);
|
|
|
+ ipage.addOrder(OrderItem.asc("t.exam_activity_id"));
|
|
|
+ ipage.addOrder(OrderItem.asc("t.room_code"));
|
|
|
+ IPage<ExamDeficiencyListBean> total = examStudentMapper.getExamDeficiencyPage(ipage,examId, examActivityId,
|
|
|
roomCode, courseCode, name, identity, absentActivityIds);
|
|
|
List<ExamDeficiencyListBean> data = total.getRecords();
|
|
|
if (data == null || data.size() == 0) {
|
|
@@ -258,11 +260,13 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public IPage examExceptionList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
|
|
|
+ public IPage<ExamExceptionListBean> examExceptionList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
|
|
|
String identity, int pageNumber, int pageSize) {
|
|
|
+ TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
+ Long orgId=tbUser.getOrgId();
|
|
|
Page<ExamExceptionListBean> ipage = new Page<>(pageNumber, pageSize);
|
|
|
ipage.addOrder(OrderItem.asc("f.exam_student_id"));
|
|
|
- IPage<ExamExceptionListBean> total = invigilateExceptionInfoMapper.getExamExceptionPage(ipage, examId,
|
|
|
+ IPage<ExamExceptionListBean> total = invigilateExceptionInfoMapper.getExamExceptionPage(ipage,orgId, examId,
|
|
|
examActivityId, roomCode, courseCode, name, identity);
|
|
|
List<ExamExceptionListBean> data = total.getRecords();
|
|
|
if (data == null || data.size() == 0) {
|
|
@@ -289,11 +293,13 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public IPage examReexamList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
|
|
|
+ public IPage<ExamReexamListBean> examReexamList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
|
|
|
String identity, int pageNumber, int pageSize) {
|
|
|
+ TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
+ Long orgId=tbUser.getOrgId();
|
|
|
Page<ExamReexamListBean> ipage = new Page<>(pageNumber, pageSize);
|
|
|
ipage.addOrder(OrderItem.asc("f.exam_student_id"));
|
|
|
- IPage<ExamReexamListBean> total = examReexamMapper.getExamReexamPage(ipage, examId, examActivityId, roomCode,
|
|
|
+ IPage<ExamReexamListBean> total = examReexamMapper.getExamReexamPage(ipage,orgId, examId, examActivityId, roomCode,
|
|
|
courseCode, name, identity);
|
|
|
List<ExamReexamListBean> data = total.getRecords();
|
|
|
if (data == null || data.size() == 0) {
|
|
@@ -307,11 +313,13 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public IPage examBreachList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
|
|
|
+ public IPage<ExamBreachListBean> examBreachList(Long examId, Long examActivityId, String roomCode, String courseCode, String name,
|
|
|
String identity, int pageNumber, int pageSize) {
|
|
|
+ TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
+ Long orgId=tbUser.getOrgId();
|
|
|
Page<ExamBreachListBean> ipage = new Page<>(pageNumber, pageSize);
|
|
|
ipage.addOrder(OrderItem.asc("f.exam_student_id"));
|
|
|
- IPage<ExamBreachListBean> total = examBreachLogMapper.getExamBreachPage(ipage, examId, examActivityId, roomCode,
|
|
|
+ IPage<ExamBreachListBean> total = examBreachLogMapper.getExamBreachPage(ipage, orgId,examId, examActivityId, roomCode,
|
|
|
courseCode, name, identity);
|
|
|
List<ExamBreachListBean> data = total.getRecords();
|
|
|
if (data == null || data.size() == 0) {
|
|
@@ -340,11 +348,13 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public IPage examRevokeBreachList(Long examId, Long examActivityId, String roomCode, String courseCode,
|
|
|
+ public IPage<ExamBreachListBean> examRevokeBreachList(Long examId, Long examActivityId, String roomCode, String courseCode,
|
|
|
String name, String identity, int pageNumber, int pageSize) {
|
|
|
+ TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
+ Long orgId=tbUser.getOrgId();
|
|
|
Page<ExamBreachListBean> ipage = new Page<>(pageNumber, pageSize);
|
|
|
ipage.addOrder(OrderItem.asc("f.exam_student_id"));
|
|
|
- IPage<ExamBreachListBean> total = examBreachLogMapper.getExamRevokeBreachPage(ipage, examId, examActivityId,
|
|
|
+ IPage<ExamBreachListBean> total = examBreachLogMapper.getExamRevokeBreachPage(ipage,orgId, examId, examActivityId,
|
|
|
roomCode, courseCode, name, identity);
|
|
|
List<ExamBreachListBean> data = total.getRecords();
|
|
|
if (data == null || data.size() == 0) {
|
|
@@ -373,11 +383,13 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public IPage examStudentLogList(Long examId, Long examActivityId, String roomCode, String courseCode,
|
|
|
+ public IPage<ExamStudentLogListBean> examStudentLogList(Long examId, Long examActivityId, String roomCode, String courseCode,
|
|
|
String name, String identity, int pageNumber, int pageSize) {
|
|
|
+ TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
+ Long orgId=tbUser.getOrgId();
|
|
|
Page<ExamStudentLogListBean> ipage = new Page<>(pageNumber, pageSize);
|
|
|
ipage.addOrder(OrderItem.asc("t.id"));
|
|
|
- IPage<ExamStudentLogListBean> total = examStudentMapper.getPageForStudentLog(ipage, examId, examActivityId,
|
|
|
+ IPage<ExamStudentLogListBean> total = examStudentMapper.getPageForStudentLog(ipage,orgId, examId, examActivityId,
|
|
|
roomCode, courseCode, name, identity);
|
|
|
List<ExamStudentLogListBean> data = total.getRecords();
|
|
|
if (data == null || data.size() == 0) {
|
|
@@ -404,7 +416,9 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<InvigilateListPatrolReportBean> patrolReport(Long examId, Long userId) {
|
|
|
- return tOeExamRecordMapper.patrolReport(examId, userId);
|
|
|
+ TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
+ Long orgId=tbUser.getOrgId();
|
|
|
+ return tOeExamRecordMapper.patrolReport(orgId,examId, userId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -412,15 +426,17 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
*/
|
|
|
@Override
|
|
|
public ExaminationMonitorCountBean examinationMonitorCount() {
|
|
|
+ TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
+ Long orgId=tbUser.getOrgId();
|
|
|
ExaminationMonitorCountBean ret = new ExaminationMonitorCountBean();
|
|
|
- Long onlineCount = tOeExamRecordMapper.getOnlineCount();
|
|
|
+ Long onlineCount = tOeExamRecordMapper.getOnlineCount(orgId);
|
|
|
if (onlineCount == null) {
|
|
|
onlineCount = 0L;
|
|
|
}
|
|
|
// 在线人数
|
|
|
ret.setOnlineCount(onlineCount);
|
|
|
// 考试人数
|
|
|
- Long examingCount = tOeExamRecordMapper.getExamingCount();
|
|
|
+ Long examingCount = tOeExamRecordMapper.getExamingCount(orgId);
|
|
|
if (examingCount == null) {
|
|
|
examingCount = 0L;
|
|
|
}
|
|
@@ -430,11 +446,11 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
ret.setWaitingCount(onlineCount - examingCount);
|
|
|
|
|
|
// 通讯故障人数
|
|
|
- ret.setExceptionCount(tOeExamRecordMapper.getExceptionCount());
|
|
|
+ ret.setExceptionCount(tOeExamRecordMapper.getExceptionCount(orgId));
|
|
|
// 预警人数
|
|
|
- ret.setWarnCount(tOeExamRecordMapper.getWarnCount());
|
|
|
+ ret.setWarnCount(tOeExamRecordMapper.getWarnCount(orgId));
|
|
|
// 机构在考人数
|
|
|
- ret.setOrgExamingCount(tOeExamRecordMapper.getOrgExamingCount());
|
|
|
+ ret.setOrgExamingCount(tOeExamRecordMapper.getOrgExamingCount(orgId));
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
@@ -443,9 +459,11 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
*/
|
|
|
@Override
|
|
|
public ExaminationMonitorWarnDistributionBean warnDistribution() {
|
|
|
+ TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
+ Long orgId=tbUser.getOrgId();
|
|
|
ExaminationMonitorWarnDistributionBean ret = new ExaminationMonitorWarnDistributionBean();
|
|
|
- ret.setOrgDistribution(tOeExamRecordMapper.getOrgDistribution());
|
|
|
- List<Map<String, Object>> typeList = tOeExamRecordMapper.getTypeDistribution();
|
|
|
+ ret.setOrgDistribution(tOeExamRecordMapper.getOrgDistribution(orgId));
|
|
|
+ List<Map<String, Object>> typeList = tOeExamRecordMapper.getTypeDistribution(orgId);
|
|
|
if (typeList != null && typeList.size() > 0) {
|
|
|
for (Map<String, Object> map : typeList) {
|
|
|
map.put("type", VerifyExceptionEnum.valueOf((String) map.get("type")).getCode());
|
|
@@ -460,6 +478,8 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<ExaminationMonitorHourWarnCountBean> warnTrend() {
|
|
|
+ TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
+ Long orgId=tbUser.getOrgId();
|
|
|
List<ExaminationMonitorHourWarnCountBean> ret = new ArrayList<ExaminationMonitorHourWarnCountBean>();
|
|
|
SimpleDateFormat sd = new SimpleDateFormat("HH");
|
|
|
Date start = null;
|
|
@@ -477,7 +497,7 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
start = DateUtils.setMinutes(start, 0);
|
|
|
start = DateUtils.setSeconds(start, 0);
|
|
|
start = DateUtils.setMilliseconds(start, 0);
|
|
|
- List<ExaminationMonitorHourWarnCountBean> list = tOeExamRecordMapper.getWarnTrend(start.getTime());
|
|
|
+ List<ExaminationMonitorHourWarnCountBean> list = tOeExamRecordMapper.getWarnTrend(orgId,start.getTime());
|
|
|
if (list != null && list.size() > 0) {
|
|
|
Map<String, Long> map = list.stream().collect(Collectors.toMap(ExaminationMonitorHourWarnCountBean::getHour,
|
|
|
ExaminationMonitorHourWarnCountBean::getCount, (key1, key2) -> key2));
|
|
@@ -494,8 +514,10 @@ public class TIeReportServiceImpl implements TIeReportService {
|
|
|
|
|
|
@Override
|
|
|
public List<ExaminationMonitorWarnMsgBean> warnMsg() {
|
|
|
+ TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
+ Long orgId=tbUser.getOrgId();
|
|
|
List<ExaminationMonitorWarnMsgBean> ret = new ArrayList<ExaminationMonitorWarnMsgBean>();
|
|
|
- List<WarningNotifyBean> list = invigilateWarnInfoMapper.findLastMsg(6);
|
|
|
+ List<WarningNotifyBean> list = invigilateWarnInfoMapper.findLastMsg(6,orgId);
|
|
|
if (list != null && list.size() > 0) {
|
|
|
for (WarningNotifyBean b : list) {
|
|
|
ExaminationMonitorWarnMsgBean bean = new ExaminationMonitorWarnMsgBean();
|