From b56c3c0f1bc87935a8b59f6ee39f78b4796250ff Mon Sep 17 00:00:00 2001 From: “djh” <“3298565835@qq.com”> Date: 星期三, 06 十一月 2024 15:01:02 +0800 Subject: [PATCH] 修改前台页面对应的后台效果,新增学习记录的自然时间差 --- exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/query/ThCertQuery.java | 3 + exam-system/src/main/resources/mapper/institutionaccess/ThCertMapper.xml | 3 + exam-system/src/main/resources/mapper/institutionaccess/ThStudyDetailMapper.xml | 7 +++ exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/vo/ThStudyDetailVO.java | 2 + exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/TripartiteInterfaceServiceImpl.java | 68 +++++++++++++++++----------------- exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudyRecordManagerServiceImpl.java | 4 ++ exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/query/ThStudyDetailQuery.java | 4 ++ 7 files changed, 57 insertions(+), 34 deletions(-) diff --git a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/query/ThCertQuery.java b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/query/ThCertQuery.java index 7e610dd..6cc7f54 100644 --- a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/query/ThCertQuery.java +++ b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/query/ThCertQuery.java @@ -15,6 +15,9 @@ //证书生成结束时间 private String endTime; + //身份证号 + private String idcard; + //机构代码 private String trainOrgName; diff --git a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/query/ThStudyDetailQuery.java b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/query/ThStudyDetailQuery.java index 1b67ddc..ce50c8e 100644 --- a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/query/ThStudyDetailQuery.java +++ b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/query/ThStudyDetailQuery.java @@ -17,6 +17,10 @@ @DateTimeFormat(pattern = "yyyy-MM-dd") private Date endTime; + //0 全部 1正常记录 2异常记录 + private Long status; + + private Integer pageNum; /** 每页显示记录数 */ diff --git a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/vo/ThStudyDetailVO.java b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/vo/ThStudyDetailVO.java index 84ebf89..2430a2f 100644 --- a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/vo/ThStudyDetailVO.java +++ b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/model/vo/ThStudyDetailVO.java @@ -29,6 +29,8 @@ private Byte finishStatus; private Long duration; private String durationDesc; + private Long difference; + private String differenceDesc; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime startTime; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") diff --git a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudyRecordManagerServiceImpl.java b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudyRecordManagerServiceImpl.java index 0d5d89f..2cd842a 100644 --- a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudyRecordManagerServiceImpl.java +++ b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/ThStudyRecordManagerServiceImpl.java @@ -28,6 +28,7 @@ import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; +import java.time.Duration; import java.util.*; import java.util.stream.Collectors; @@ -78,6 +79,9 @@ List<String> idcards = thStudyDetailVOS.stream().map(ThStudyDetailVO::getIdcard).collect(Collectors.toList()); List<ThStudent> studentList = studentService.getNameByIdcards(idcards); for(ThStudyDetailVO thStudyDetailVO : thStudyDetailVOS){ + Duration between = Duration.between(thStudyDetailVO.getStartTime(), thStudyDetailVO.getFinishTime()); + thStudyDetailVO.setDifference(between.getSeconds()); + thStudyDetailVO.setDifferenceDesc(ConvertTimeUtils.convertTimeToString(thStudyDetailVO.getDifference())); thStudyDetailVO.setDurationDesc(ConvertTimeUtils.convertTimeToString(thStudyDetailVO.getDuration())); thStudyDetailVO.setStartPositionDesc(ConvertTimeUtils.convertTimeToString(thStudyDetailVO.getStartPosition())); thStudyDetailVO.setFinishPositionDesc(ConvertTimeUtils.convertTimeToString(thStudyDetailVO.getFinishPosition())); diff --git a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/TripartiteInterfaceServiceImpl.java b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/TripartiteInterfaceServiceImpl.java index e6d9fff..b2fd30d 100644 --- a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/TripartiteInterfaceServiceImpl.java +++ b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/service/serviceImpl/TripartiteInterfaceServiceImpl.java @@ -1363,20 +1363,20 @@ errorDataRespDTOS.add(new ThErrorDataRespDTO(studentDetailReqDTO.getUuid(),"结束位置不可为空")); continue; } - if(StringUtils.isEmpty(studentDetailReqDTO.getLessonReportUrl())){ - errorDataRespDTOS.add(new ThErrorDataRespDTO(studentDetailReqDTO.getUuid(),"学时报告不可为空")); - continue; - } +// if(StringUtils.isEmpty(studentDetailReqDTO.getLessonReportUrl())){ +// errorDataRespDTOS.add(new ThErrorDataRespDTO(studentDetailReqDTO.getUuid(),"学时报告不可为空")); +// continue; +// } //认证记录集合 // if(CollectionUtils.isEmpty(studentDetailReqDTO.getAuthList())){ // errorDataRespDTOS.add(new ThErrorDataRespDTO(studentDetailReqDTO.getUuid(),"认证记录集合不可为空")); // continue; // } //学习轨迹集合 - if(CollectionUtils.isEmpty(studentDetailReqDTO.getTrackList())){ - errorDataRespDTOS.add(new ThErrorDataRespDTO(studentDetailReqDTO.getUuid(),"学习轨迹集合不可为空")); - continue; - } +// if(CollectionUtils.isEmpty(studentDetailReqDTO.getTrackList())){ +// errorDataRespDTOS.add(new ThErrorDataRespDTO(studentDetailReqDTO.getUuid(),"学习轨迹集合不可为空")); +// continue; +// } /*boolean authFlag = false; for(ThStudytAuthReqDTO item : studentDetailReqDTO.getAuthList()){ @@ -1409,32 +1409,32 @@ if(authFlag){ continue; }*/ - boolean trackFlag = false; - for(ThStudyTrackReqDTO item : studentDetailReqDTO.getTrackList()){ - if(StringUtils.isEmpty(item.getUuid()) || !UUID.checkIsUuid(item.getUuid())){ - trackFlag = true; - errorDataRespDTOS.add(new ThErrorDataRespDTO(studentDetailReqDTO.getUuid(),"学习轨迹uuid("+item.getUuid()+")不符合规范")); - break; - } - if(item.getStartTime() == null){ - trackFlag = true; - errorDataRespDTOS.add(new ThErrorDataRespDTO(studentDetailReqDTO.getUuid(),"学习轨迹uuid("+item.getUuid()+"),轨迹开始时间不可为空")); - break; - } - if(item.getEndTime() == null){ - trackFlag = true; - errorDataRespDTOS.add(new ThErrorDataRespDTO(studentDetailReqDTO.getUuid(),"学习轨迹uuid("+item.getUuid()+"),轨迹结束时间不可为空")); - break; - } - if(item.getTimeInterval() == null) { - trackFlag = true; - errorDataRespDTOS.add(new ThErrorDataRespDTO(studentDetailReqDTO.getUuid(),"学习轨迹uuid("+item.getUuid()+"),时间间隔(秒)不可为空")); - break; - } - } - if(trackFlag){ - continue; - } +// boolean trackFlag = false; +// for(ThStudyTrackReqDTO item : studentDetailReqDTO.getTrackList()){ +// if(StringUtils.isEmpty(item.getUuid()) || !UUID.checkIsUuid(item.getUuid())){ +// trackFlag = true; +// errorDataRespDTOS.add(new ThErrorDataRespDTO(studentDetailReqDTO.getUuid(),"学习轨迹uuid("+item.getUuid()+")不符合规范")); +// break; +// } +// if(item.getStartTime() == null){ +// trackFlag = true; +// errorDataRespDTOS.add(new ThErrorDataRespDTO(studentDetailReqDTO.getUuid(),"学习轨迹uuid("+item.getUuid()+"),轨迹开始时间不可为空")); +// break; +// } +// if(item.getEndTime() == null){ +// trackFlag = true; +// errorDataRespDTOS.add(new ThErrorDataRespDTO(studentDetailReqDTO.getUuid(),"学习轨迹uuid("+item.getUuid()+"),轨迹结束时间不可为空")); +// break; +// } +// if(item.getTimeInterval() == null) { +// trackFlag = true; +// errorDataRespDTOS.add(new ThErrorDataRespDTO(studentDetailReqDTO.getUuid(),"学习轨迹uuid("+item.getUuid()+"),时间间隔(秒)不可为空")); +// break; +// } +// } +// if(trackFlag){ +// continue; +// } saveStudyDetailReqDTOS.add(studentDetailReqDTO); //判断需要修改的批次学生 diff --git a/exam-system/src/main/resources/mapper/institutionaccess/ThCertMapper.xml b/exam-system/src/main/resources/mapper/institutionaccess/ThCertMapper.xml index 6763a25..ae52354 100644 --- a/exam-system/src/main/resources/mapper/institutionaccess/ThCertMapper.xml +++ b/exam-system/src/main/resources/mapper/institutionaccess/ThCertMapper.xml @@ -20,6 +20,9 @@ <if test="trainOrgName!=null and trainOrgName!=''"> and a.train_org_name =#{trainOrgName} </if> + <if test="idcard!=null and idcard!=''"> + and a.idcard like concat('%',#{idcard},'%') + </if> </where> order by a.create_time desc </select> diff --git a/exam-system/src/main/resources/mapper/institutionaccess/ThStudyDetailMapper.xml b/exam-system/src/main/resources/mapper/institutionaccess/ThStudyDetailMapper.xml index 19c708b..cd6c189 100644 --- a/exam-system/src/main/resources/mapper/institutionaccess/ThStudyDetailMapper.xml +++ b/exam-system/src/main/resources/mapper/institutionaccess/ThStudyDetailMapper.xml @@ -37,6 +37,13 @@ <if test="query.endTime != null"><!-- 结束时间检索 --> and date_format(d.create_time,'%y-%m-%d') <= date_format(#{query.endTime},'%y-%m-%d') </if> + <if test="query.status == 0"></if> + <if test="query.status == 1"> + and TIMESTAMPDIFF(SECOND, start_time, finish_time) = d.duration + </if> + <if test="query.status == 2"> + and TIMESTAMPDIFF(SECOND, start_time, finish_time) < d.duration + </if> ORDER BY d.id DESC -- Gitblit v1.9.2