he2802 пре 2 година
родитељ
комит
d0a913133b

+ 65 - 7
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -1637,6 +1637,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         List<ClassPeriodVo> classPeriodVos = baseMapper.listPeriodAudit(bo);
         classPeriodVos.addAll(baseMapper.listPeriodAuditSection(bo));
         Collections.sort(classPeriodVos);
+        Long startTotalTime = 0L;
+        Long endTotalTime = 0L;
         for (ClassPeriodVo classPeriodVo : classPeriodVos) {
             //为模块搜索下面的章 和节 并搜索学时记录
             if (classPeriodVo.getType() == 1) {
@@ -1645,6 +1647,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 classPeriodChapterVos.addAll(baseMapper.listperiodModuleExam( bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), classPeriodVo.getId()));
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
                     if (classPeriodChapterVo.getType() == 2) {
+                        Long ChapterEndTime = 0L;
                         List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
                         Collections.sort(classPeriodSectionVos);
                         classPeriodSectionVos.addAll(baseMapper.listperiodExam(classPeriodChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), classPeriodVo.getId()));
@@ -1665,18 +1668,29 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                     UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos.get(numIndex);
                                     LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
                                     lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
-                                    classPeriodSectionVo.setUserStudyRecordPhotoList(entity2PhotoVo(userStudyRecordPhotoService.list(lqw)));
+                                    List<UserStudyRecordPhotoVo> photoList = entity2PhotoVo(userStudyRecordPhotoService.list(lqw));
+                                    classPeriodSectionVo.setUserStudyRecordPhotoList(photoList);
                                     classPeriodSectionVo.setNumIndex(Convert.toLong(userPeriodStatusVos.size()));
                                     classPeriodSectionVo.setStatus(userPeriodStatusVo.getStatus());
                                     classPeriodSectionVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
-                                    classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
+                //                    classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
+                                    classPeriodSectionVo.setStudyEndTime(photoList.get(photoList.size()-1).getCreateTime());
                                     classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
+                                    if(startTotalTime==0L||startTotalTime.longValue()>classPeriodSectionVo.getStudyStartTime().longValue()){
+                                        startTotalTime = classPeriodSectionVo.getStudyStartTime();
+                                    }
+                                    if(endTotalTime==0L||endTotalTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue()){
+                                        endTotalTime = classPeriodSectionVo.getStudyEndTime();
+                                    }
                                     classPeriodSectionVo.setPeriodStatus(userPeriodStatusVo.getPeriodStatus());
                                     classPeriodSectionVo.setPeriodId(userPeriodStatusVo.getPeriodId());
                                     classPeriodSectionVo.setPeriodStatusId(userPeriodStatusVo.getId());
                                     classPeriodSectionVo.setAuditTime(userPeriodStatusVo.getAuditTime());
                                     classPeriodSectionVo.setAuditUserName(userPeriodStatusVo.getAuditUserName());
                                     classPeriodSectionVo.setDurationTime(userPeriodStatusVo.getDurationTime());
+                                    if(ChapterEndTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue()){
+                                        ChapterEndTime = classPeriodSectionVo.getStudyEndTime();
+                                    }
                                 }
                                 if(userPeriodStatusVos.size()>1){
                             //        int preIndex = userPeriodStatusVos.size() - 2;
@@ -1710,12 +1724,21 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                     classPeriodSectionVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
                                     classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
                                     classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
+                                    if(startTotalTime==0L||startTotalTime.longValue()>classPeriodSectionVo.getStudyStartTime().longValue()){
+                                        startTotalTime = classPeriodSectionVo.getStudyStartTime();
+                                    }
+                                    if(endTotalTime==0L||endTotalTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue()){
+                                        endTotalTime = classPeriodSectionVo.getStudyEndTime();
+                                    }
                                     classPeriodSectionVo.setPeriodStatus(userPeriodStatusVo.getPeriodStatus());
                                     classPeriodSectionVo.setPeriodId(userPeriodStatusVo.getPeriodId());
                                     classPeriodSectionVo.setAuditTime(userPeriodStatusVo.getAuditTime());
                                     classPeriodSectionVo.setAuditUserName(userPeriodStatusVo.getAuditUserName());
                                     classPeriodSectionVo.setPeriodStatusId(userPeriodStatusVo.getId());
                                     classPeriodSectionVo.setPerformance(Convert.toBigDecimal(userPeriodStatusVo.getPerformance()));
+                                    if(ChapterEndTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue()){
+                                        ChapterEndTime = classPeriodSectionVo.getStudyEndTime();
+                                    }
                                 }
                                 classPeriodSectionVo.setModuleId(classPeriodVo.getId());
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
@@ -1723,7 +1746,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 classPeriodSectionVo.setGradeId(bo.getGradeId());
                             }
                         }
-
+                        classPeriodChapterVo.setStudyEndTime(ChapterEndTime);
                         classPeriodChapterVo.setClassPeriodSectionList(classPeriodSectionVos);
                     }
                     else if (classPeriodChapterVo.getType() == 5) {
@@ -1761,6 +1784,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             }
             //为章搜索节记录和学时记录
             if (classPeriodVo.getType() == 2) {
+                Long ChapterEndTime = 0L;
                 List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
                 Collections.sort(classPeriodSectionVos);
                 for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
@@ -1778,18 +1802,29 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                         UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos.get(numIndex);
                         LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
                         lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
-                        classPeriodSectionVo.setUserStudyRecordPhotoList(entity2PhotoVo(userStudyRecordPhotoService.list(lqw)));
+                        List<UserStudyRecordPhotoVo> photoList = entity2PhotoVo(userStudyRecordPhotoService.list(lqw));
+                        classPeriodSectionVo.setUserStudyRecordPhotoList(photoList);
                         classPeriodSectionVo.setNumIndex(Convert.toLong(userPeriodStatusVos.size()));
                         classPeriodSectionVo.setStatus(userPeriodStatusVo.getStatus());
                         classPeriodSectionVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
-                        classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
+                //        classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
+                        classPeriodSectionVo.setStudyEndTime(photoList.get(photoList.size()-1).getCreateTime());
                         classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
+                        if(startTotalTime==0L||startTotalTime.longValue()>classPeriodSectionVo.getStudyStartTime().longValue()){
+                            startTotalTime = classPeriodSectionVo.getStudyStartTime();
+                        }
+                        if(endTotalTime==0L||endTotalTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue()){
+                            endTotalTime = classPeriodSectionVo.getStudyEndTime();
+                        }
                         classPeriodSectionVo.setPeriodStatus(userPeriodStatusVo.getPeriodStatus());
                         classPeriodSectionVo.setPeriodId(userPeriodStatusVo.getPeriodId());
                         classPeriodSectionVo.setPeriodStatusId(userPeriodStatusVo.getId());
                         classPeriodSectionVo.setAuditTime(userPeriodStatusVo.getAuditTime());
                         classPeriodSectionVo.setAuditUserName(userPeriodStatusVo.getAuditUserName());
                         classPeriodSectionVo.setDurationTime(userPeriodStatusVo.getDurationTime());
+                        if(ChapterEndTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue()){
+                            ChapterEndTime = classPeriodSectionVo.getStudyEndTime();
+                        }
                     }
                     if(userPeriodStatusVos.size()>1){
                 //        int preIndex = userPeriodStatusVos.size() - 2;
@@ -1824,6 +1859,12 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                         classPeriodSectionVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
                         classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
                         classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
+                        if(startTotalTime==0L||startTotalTime.longValue()>classPeriodSectionVo.getStudyStartTime().longValue()){
+                            startTotalTime = classPeriodSectionVo.getStudyStartTime();
+                        }
+                        if(endTotalTime==0L||endTotalTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue()){
+                            endTotalTime = classPeriodSectionVo.getStudyEndTime();
+                        }
                         classPeriodSectionVo.setPeriodStatus(userPeriodStatusVo.getPeriodStatus());
                         classPeriodSectionVo.setPeriodId(userPeriodStatusVo.getPeriodId());
                         classPeriodSectionVo.setPeriodStatusId(userPeriodStatusVo.getId());
@@ -1831,6 +1872,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                         classPeriodSectionVo.setAuditUserName(userPeriodStatusVo.getAuditUserName());
                         classPeriodSectionVo.setPerformance(Convert.toBigDecimal(userPeriodStatusVo.getPerformance()));
                         classPeriodVo.setPerformance(Convert.toBigDecimal(userPeriodStatusVo.getPerformance()));
+                        if(ChapterEndTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue()){
+                            ChapterEndTime = classPeriodSectionVo.getStudyEndTime();
+                        }
                     }
                     classPeriodSectionVo.setModuleId(0L);
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
@@ -1839,6 +1883,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 }
                 classPeriodSectionVos.addAll(classPeriodSectionVos1);
                 classPeriodVo.setClassPeriodSectionList(classPeriodSectionVos);
+                classPeriodVo.setStudyEndTime(ChapterEndTime);
             }
 
             //为节搜索学时记录
@@ -1857,12 +1902,21 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos.get(numIndex);
                     LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
                     lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
-                    classPeriodVo.setUserStudyRecordPhotoList(entity2PhotoVo(userStudyRecordPhotoService.list(lqw)));
+
+                    List<UserStudyRecordPhotoVo> photoList = entity2PhotoVo(userStudyRecordPhotoService.list(lqw));
+                    classPeriodVo.setUserStudyRecordPhotoList(photoList);
                     classPeriodVo.setNumIndex(Convert.toLong(userPeriodStatusVos.size()));
                     classPeriodVo.setStatus(userPeriodStatusVo.getStatus());
                     classPeriodVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
-                    classPeriodVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
+    //                classPeriodVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
+                    classPeriodVo.setStudyEndTime(photoList.get(photoList.size()-1).getCreateTime());
                     classPeriodVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
+                    if(startTotalTime==0L||startTotalTime.longValue()>classPeriodVo.getStudyStartTime().longValue()){
+                        startTotalTime = classPeriodVo.getStudyStartTime();
+                    }
+                    if(endTotalTime==0L||endTotalTime.longValue()<classPeriodVo.getStudyEndTime().longValue()){
+                        endTotalTime = classPeriodVo.getStudyEndTime();
+                    }
                     classPeriodVo.setPeriodStatus(userPeriodStatusVo.getPeriodStatus());
                     classPeriodVo.setPeriodId(userPeriodStatusVo.getPeriodId());
                     classPeriodVo.setPeriodStatusId(userPeriodStatusVo.getId());
@@ -1883,6 +1937,10 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             }
 
         }
+        if(classPeriodVos.size()>0){
+            classPeriodVos.get(0).setStartTotalTime(startTotalTime);
+            classPeriodVos.get(0).setEndTotalTime(endTotalTime);
+        }
         return classPeriodVos;
     }
 

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodUserVo.java

@@ -138,4 +138,8 @@ public class ClassPeriodUserVo {
 
 	@ApiModelProperty("已完成总视频秒数")
 	private Long finishSectionDuration;
+
+	private Long classStartTime;
+
+	private Long classEndTime;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodVo.java

@@ -210,4 +210,6 @@ public class ClassPeriodVo implements Comparable<ClassPeriodVo> {
 		}
 
 	}
+	private Long startTotalTime;
+	private Long endTotalTime;
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/order/service/impl/TopOrderRecNoteServiceImpl.java

@@ -10,6 +10,7 @@ import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ToolsUtils;
 import com.zhongzheng.common.utils.http.HttpUtils;
 import com.zhongzheng.modules.bank.domain.ExamQuestion;
+import com.zhongzheng.modules.base.domain.ShoppingCart;
 import com.zhongzheng.modules.grade.domain.ClassGradeUser;
 import com.zhongzheng.modules.top.order.bo.TopOrderRecNoteAddBo;
 import com.zhongzheng.modules.top.order.bo.TopOrderRecNoteEditBo;
@@ -100,6 +101,9 @@ public class TopOrderRecNoteServiceImpl extends ServiceImpl<TopOrderRecNoteMappe
         if(Validator.isEmpty(bo.getOrderSn())||Validator.isEmpty(bo.getTenantId())||Validator.isEmpty(bo.getId())){
             throw new CustomException("参数缺失");
         }
+        if(Validator.isNotEmpty(bo.getStatus())&&bo.getStatus()==-1){
+            return this.remove(new LambdaQueryWrapper<TopOrderRecNote>().eq(TopOrderRecNote::getId,bo.getId()));
+        }
         if (getOne(new LambdaQueryWrapper<TopOrderRecNote>().ne(TopOrderRecNote::getId, bo.getId()).eq(TopOrderRecNote::getOrderSn, bo.getOrderSn()).eq(TopOrderRecNote::getTenantId, bo.getTenantId()).last("limit 1")) != null) {
             throw new CustomException("该订单已经配置提醒了");
         }

+ 4 - 0
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -158,6 +158,8 @@
         <result property="className" column="class_name"/>
         <result property="classHours" column="class_hours"/>
         <result property="orderGoodsId" column="order_goods_id"/>
+        <result property="classStartTime" column="class_start_time"/>
+        <result property="classEndTime" column="class_end_time"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodVo" id="ClassPeriodVo">
@@ -646,6 +648,8 @@
         g.goods_id,
         g.goods_name,
         cg.class_name,
+        cg.class_start_time,
+        cg.class_end_time,
         g.class_hours,
         u.one_inch_photos,
         u.id_card_img1,