|
@@ -3,36 +3,39 @@ package com.zhongzheng.modules.course.service.impl;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.lang.Validator;
|
|
import cn.hutool.core.lang.Validator;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
-import com.zhongzheng.common.core.page.TableDataInfo;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.github.pagehelper.Page;
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
-import com.zhongzheng.modules.bank.domain.ExamQuestion;
|
|
|
|
-import com.zhongzheng.modules.bank.domain.Question;
|
|
|
|
-import com.zhongzheng.modules.course.bo.*;
|
|
|
|
|
|
+import com.zhongzheng.modules.course.bo.CourseAddBo;
|
|
|
|
+import com.zhongzheng.modules.course.bo.CourseEditBo;
|
|
|
|
+import com.zhongzheng.modules.course.bo.CourseQueryBo;
|
|
import com.zhongzheng.modules.course.domain.Course;
|
|
import com.zhongzheng.modules.course.domain.Course;
|
|
-import com.zhongzheng.modules.course.domain.CourseBusiness;
|
|
|
|
import com.zhongzheng.modules.course.domain.CoursePhotoLog;
|
|
import com.zhongzheng.modules.course.domain.CoursePhotoLog;
|
|
import com.zhongzheng.modules.course.mapper.CourseMapper;
|
|
import com.zhongzheng.modules.course.mapper.CourseMapper;
|
|
-import com.zhongzheng.modules.course.mapper.CourseSectionMapper;
|
|
|
|
import com.zhongzheng.modules.course.service.ICoursePhotoLogService;
|
|
import com.zhongzheng.modules.course.service.ICoursePhotoLogService;
|
|
-import com.zhongzheng.modules.course.service.ICourseSectionBusinessService;
|
|
|
|
import com.zhongzheng.modules.course.service.ICourseService;
|
|
import com.zhongzheng.modules.course.service.ICourseService;
|
|
import com.zhongzheng.modules.course.vo.CourseUserVo;
|
|
import com.zhongzheng.modules.course.vo.CourseUserVo;
|
|
import com.zhongzheng.modules.course.vo.CourseVo;
|
|
import com.zhongzheng.modules.course.vo.CourseVo;
|
|
-import com.zhongzheng.modules.exam.domain.*;
|
|
|
|
-import com.zhongzheng.modules.exam.service.*;
|
|
|
|
|
|
+import com.zhongzheng.modules.exam.domain.ExamApplyUser;
|
|
|
|
+import com.zhongzheng.modules.exam.domain.ExamBefore;
|
|
|
|
+import com.zhongzheng.modules.exam.domain.ExamBeforeApply;
|
|
|
|
+import com.zhongzheng.modules.exam.service.IExamApplyGoodsService;
|
|
|
|
+import com.zhongzheng.modules.exam.service.IExamApplyUserService;
|
|
|
|
+import com.zhongzheng.modules.exam.service.IExamBeforeApplyService;
|
|
|
|
+import com.zhongzheng.modules.exam.service.IExamBeforeService;
|
|
import com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo;
|
|
import com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo;
|
|
import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
|
|
import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
|
|
-import com.zhongzheng.modules.goods.domain.Goods;
|
|
|
|
import com.zhongzheng.modules.goods.domain.GoodsCourse;
|
|
import com.zhongzheng.modules.goods.domain.GoodsCourse;
|
|
import com.zhongzheng.modules.goods.service.IGoodsCourseService;
|
|
import com.zhongzheng.modules.goods.service.IGoodsCourseService;
|
|
import com.zhongzheng.modules.goods.vo.GoodsPeriodStatusVo;
|
|
import com.zhongzheng.modules.goods.vo.GoodsPeriodStatusVo;
|
|
import com.zhongzheng.modules.goods.vo.GoodsPeriodVo;
|
|
import com.zhongzheng.modules.goods.vo.GoodsPeriodVo;
|
|
import com.zhongzheng.modules.goods.vo.GoodsUserVo;
|
|
import com.zhongzheng.modules.goods.vo.GoodsUserVo;
|
|
-import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
|
|
import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
|
|
import com.zhongzheng.modules.grade.bo.UserPeriodStatusAddBo;
|
|
import com.zhongzheng.modules.grade.bo.UserPeriodStatusAddBo;
|
|
@@ -56,16 +59,13 @@ import com.zhongzheng.modules.user.vo.SubjectStudyRecordVo;
|
|
import com.zhongzheng.modules.user.vo.UserStudyRecordPhotoVo;
|
|
import com.zhongzheng.modules.user.vo.UserStudyRecordPhotoVo;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
-import com.github.pagehelper.Page;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.text.ParseException;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.Collection;
|
|
-import java.util.Collections;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -580,6 +580,23 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
|
return courseUserVos;
|
|
return courseUserVos;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public Boolean checkTime() {
|
|
|
|
+ try {
|
|
|
|
+ String startTime = "2023-3-16 00:00:00";
|
|
|
|
+ String endTime = "2023-4-01 00:00:00";
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ Long startDate = sdf.parse(startTime).getTime()/1000;
|
|
|
|
+ Long endDate = sdf.parse(endTime).getTime()/1000;
|
|
|
|
+ if (DateUtils.getNowTime() < startDate || DateUtils.getNowTime() > endDate){
|
|
|
|
+ throw new CustomException("活动已过期");
|
|
|
|
+ }
|
|
|
|
+ } catch (ParseException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
private List<UserStudyRecordPhotoVo> entity2PhotoVo(Collection<UserStudyRecordPhoto> collection) {
|
|
private List<UserStudyRecordPhotoVo> entity2PhotoVo(Collection<UserStudyRecordPhoto> collection) {
|
|
List<UserStudyRecordPhotoVo> voList = collection.stream()
|
|
List<UserStudyRecordPhotoVo> voList = collection.stream()
|
|
.map(any -> BeanUtil.toBean(any, UserStudyRecordPhotoVo.class))
|
|
.map(any -> BeanUtil.toBean(any, UserStudyRecordPhotoVo.class))
|