|
@@ -1,9 +1,11 @@
|
|
|
package com.zhongzheng.modules.grade.service.impl;
|
|
package com.zhongzheng.modules.grade.service.impl;
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
+import cn.hutool.core.convert.Convert;
|
|
|
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.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
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.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
@@ -12,26 +14,41 @@ import com.zhongzheng.common.core.redis.RedisCache;
|
|
|
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.SecurityUtils;
|
|
import com.zhongzheng.common.utils.SecurityUtils;
|
|
|
|
|
+import com.zhongzheng.common.utils.ToolsUtils;
|
|
|
|
|
+import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.modules.base.service.ICertificateTpService;
|
|
import com.zhongzheng.modules.base.service.ICertificateTpService;
|
|
|
|
|
+import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
|
|
|
import com.zhongzheng.modules.course.domain.CourseBusiness;
|
|
import com.zhongzheng.modules.course.domain.CourseBusiness;
|
|
|
-import com.zhongzheng.modules.course.service.ICourseBusinessService;
|
|
|
|
|
|
|
+import com.zhongzheng.modules.course.domain.CourseEducationType;
|
|
|
|
|
+import com.zhongzheng.modules.course.domain.CourseProjectType;
|
|
|
|
|
+import com.zhongzheng.modules.course.service.*;
|
|
|
|
|
+import com.zhongzheng.modules.course.vo.CourseMenuVo;
|
|
|
|
|
+import com.zhongzheng.modules.course.vo.CourseModuleChapterVo;
|
|
|
|
|
+import com.zhongzheng.modules.course.vo.CourseVo;
|
|
|
|
|
+import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
|
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
|
|
|
+import com.zhongzheng.modules.goods.service.IGoodsCourseService;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
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.domain.ClassGrade;
|
|
|
import com.zhongzheng.modules.grade.domain.ClassGradeUser;
|
|
import com.zhongzheng.modules.grade.domain.ClassGradeUser;
|
|
|
import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
|
|
import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
|
|
|
import com.zhongzheng.modules.grade.mapper.ClassGradeUserMapper;
|
|
import com.zhongzheng.modules.grade.mapper.ClassGradeUserMapper;
|
|
|
|
|
+import com.zhongzheng.modules.grade.service.IClassGradeService;
|
|
|
import com.zhongzheng.modules.grade.service.IClassGradeUserService;
|
|
import com.zhongzheng.modules.grade.service.IClassGradeUserService;
|
|
|
import com.zhongzheng.modules.grade.service.IUserPeriodStatusService;
|
|
import com.zhongzheng.modules.grade.service.IUserPeriodStatusService;
|
|
|
-import com.zhongzheng.modules.grade.vo.ClassPeriodStudentVo;
|
|
|
|
|
-import com.zhongzheng.modules.grade.vo.UserPeriodStatusVo;
|
|
|
|
|
|
|
+import com.zhongzheng.modules.grade.vo.*;
|
|
|
import com.zhongzheng.modules.inform.bo.InformUserAddBo;
|
|
import com.zhongzheng.modules.inform.bo.InformUserAddBo;
|
|
|
import com.zhongzheng.modules.inform.service.IInformRemindService;
|
|
import com.zhongzheng.modules.inform.service.IInformRemindService;
|
|
|
import com.zhongzheng.modules.inform.service.IInformUserService;
|
|
import com.zhongzheng.modules.inform.service.IInformUserService;
|
|
|
import com.zhongzheng.modules.inform.vo.InformRemindVo;
|
|
import com.zhongzheng.modules.inform.vo.InformRemindVo;
|
|
|
|
|
+import com.zhongzheng.modules.order.domain.OrderGoods;
|
|
|
|
|
+import com.zhongzheng.modules.order.service.IOrderGoodsService;
|
|
|
import com.zhongzheng.modules.user.domain.User;
|
|
import com.zhongzheng.modules.user.domain.User;
|
|
|
|
|
+import com.zhongzheng.modules.user.domain.UserStudyRecordPhoto;
|
|
|
import com.zhongzheng.modules.user.service.IUserService;
|
|
import com.zhongzheng.modules.user.service.IUserService;
|
|
|
|
|
+import com.zhongzheng.modules.user.service.IUserStudyRecordPhotoService;
|
|
|
import com.zhongzheng.modules.user.vo.UserVo;
|
|
import com.zhongzheng.modules.user.vo.UserVo;
|
|
|
import com.zhongzheng.modules.wx.service.IWxLoginService;
|
|
import com.zhongzheng.modules.wx.service.IWxLoginService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -46,10 +63,10 @@ import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
|
|
|
import com.zhongzheng.modules.grade.bo.UserPeriodEditBo;
|
|
import com.zhongzheng.modules.grade.bo.UserPeriodEditBo;
|
|
|
import com.zhongzheng.modules.grade.domain.UserPeriod;
|
|
import com.zhongzheng.modules.grade.domain.UserPeriod;
|
|
|
import com.zhongzheng.modules.grade.mapper.UserPeriodMapper;
|
|
import com.zhongzheng.modules.grade.mapper.UserPeriodMapper;
|
|
|
-import com.zhongzheng.modules.grade.vo.UserPeriodVo;
|
|
|
|
|
import com.zhongzheng.modules.grade.service.IUserPeriodService;
|
|
import com.zhongzheng.modules.grade.service.IUserPeriodService;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -111,6 +128,35 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ICourseBusinessService iCourseBusinessService;
|
|
private ICourseBusinessService iCourseBusinessService;
|
|
|
|
|
|
|
|
|
|
+ @Value("${aliyun.oss.endpoint}")
|
|
|
|
|
+ private String ossHost;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IOrderGoodsService iOrderGoodsService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IClassGradeService iClassGradeService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IGoodsCourseService iGoodsCourseService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ICourseMenuService iCourseMenuService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ICourseModuleChapterService iCourseModuleChapterService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IUserStudyRecordPhotoService userStudyRecordPhotoService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ICourseEducationTypeService iCourseEducationTypeService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ICourseProjectTypeService iCourseProjectTypeService;
|
|
|
|
|
+
|
|
|
|
|
+ @Value("${oldStudySys.syncPath}")
|
|
|
|
|
+ private String SYNC_PATH;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public UserPeriodVo queryById(Long id) {
|
|
public UserPeriodVo queryById(Long id) {
|
|
@@ -221,14 +267,14 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
classGradeUserQueryBo.setGoodsId(userPeriodVo.getGoodsId());
|
|
classGradeUserQueryBo.setGoodsId(userPeriodVo.getGoodsId());
|
|
|
Integer gradePeriodStatus = iClassGradeUserService.updateUserPeriodStatus(classGradeUserQueryBo);
|
|
Integer gradePeriodStatus = iClassGradeUserService.updateUserPeriodStatus(classGradeUserQueryBo);
|
|
|
//发送审核不通过消息
|
|
//发送审核不通过消息
|
|
|
|
|
+ bo.setStatus(gradePeriodStatus);
|
|
|
|
|
+ bo.setGoodsId(userPeriodVo.getGoodsId());
|
|
|
|
|
+ bo.setUserId(userPeriodVo.getUserId());
|
|
|
|
|
+ bo.setGradeId(userPeriodVo.getGradeId());
|
|
|
if (gradePeriodStatus == 0) {
|
|
if (gradePeriodStatus == 0) {
|
|
|
- bo.setStatus(gradePeriodStatus);
|
|
|
|
|
- bo.setGoodsId(userPeriodVo.getGoodsId());
|
|
|
|
|
- bo.setUserId(userPeriodVo.getUserId());
|
|
|
|
|
- bo.setGradeId(userPeriodVo.getGradeId());
|
|
|
|
|
sendPeriodSMS(bo);
|
|
sendPeriodSMS(bo);
|
|
|
sendPeriodSevenSMS(bo);
|
|
sendPeriodSevenSMS(bo);
|
|
|
- }else {
|
|
|
|
|
|
|
+ }else if(gradePeriodStatus == 3){
|
|
|
if (ObjectUtils.isNotNull(business.getPeriodNumber()) && business.getPeriodNumber() == 1){
|
|
if (ObjectUtils.isNotNull(business.getPeriodNumber()) && business.getPeriodNumber() == 1){
|
|
|
//只需要初审,不用复审
|
|
//只需要初审,不用复审
|
|
|
this.confirmPeriod(bo);
|
|
this.confirmPeriod(bo);
|
|
@@ -257,6 +303,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean editPeriodAll(UserPeriodEditBo bo) {
|
|
public boolean editPeriodAll(UserPeriodEditBo bo) {
|
|
|
|
|
+ CourseBusiness business = null;
|
|
|
for (Long id : bo.getIds()) {
|
|
for (Long id : bo.getIds()) {
|
|
|
UserPeriodStatusVo oldData = userPeriodStatusService.queryById(id);
|
|
UserPeriodStatusVo oldData = userPeriodStatusService.queryById(id);
|
|
|
Long goodsId;
|
|
Long goodsId;
|
|
@@ -269,7 +316,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
}
|
|
}
|
|
|
//获取业务学时审核数据
|
|
//获取业务学时审核数据
|
|
|
Goods goods = iGoodsService.getById(goodsId);
|
|
Goods goods = iGoodsService.getById(goodsId);
|
|
|
- CourseBusiness business = iCourseBusinessService.getById(goods.getBusinessId());
|
|
|
|
|
|
|
+ business = iCourseBusinessService.getById(goods.getBusinessId());
|
|
|
if (ObjectUtils.isNull(business.getPeriodType()) || business.getPeriodType() == 1){
|
|
if (ObjectUtils.isNull(business.getPeriodType()) || business.getPeriodType() == 1){
|
|
|
//人工审核
|
|
//人工审核
|
|
|
//查询此人学时审核是否有权限
|
|
//查询此人学时审核是否有权限
|
|
@@ -322,6 +369,11 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
bo.setStatus(gradePeriodStatus);
|
|
bo.setStatus(gradePeriodStatus);
|
|
|
sendPeriodSMS(bo);
|
|
sendPeriodSMS(bo);
|
|
|
sendPeriodSevenSMS(bo);
|
|
sendPeriodSevenSMS(bo);
|
|
|
|
|
+ }else if(gradePeriodStatus == 3) {
|
|
|
|
|
+ if (ObjectUtils.isNotNull(business.getPeriodNumber()) && business.getPeriodNumber() == 1){
|
|
|
|
|
+ //只需要初审,不用复审
|
|
|
|
|
+ this.confirmPeriod(bo);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
return true;
|
|
@@ -386,9 +438,193 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
bo.setStatus(1);
|
|
bo.setStatus(1);
|
|
|
sendPeriodSMS(bo);
|
|
sendPeriodSMS(bo);
|
|
|
sendPeriodSevenSMS(bo);
|
|
sendPeriodSevenSMS(bo);
|
|
|
|
|
+ syncStudyLogToOld(bo);
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean confirmRollbackPeriod(UserPeriodEditBo bo) {
|
|
|
|
|
+ if(Validator.isEmpty(bo.getOrderGoodsId())){
|
|
|
|
|
+ throw new CustomException("参数错误");
|
|
|
|
|
+ }
|
|
|
|
|
+ ClassGradeUser classGradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>()
|
|
|
|
|
+ .eq(ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId())
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderGoodsId,bo.getOrderGoodsId()).last("limit 1"));
|
|
|
|
|
+ if(Validator.isEmpty(classGradeUser)||Validator.isEmpty(orderGoods)){
|
|
|
|
|
+ throw new CustomException("数据错误");
|
|
|
|
|
+ }
|
|
|
|
|
+ bo.setGoodsId(orderGoods.getGoodsId());
|
|
|
|
|
+ CourseEducationType educationType = iCourseEducationTypeService.getOne(new LambdaQueryWrapper<CourseEducationType>().eq(CourseEducationType::getStatus, 1).eq(CourseEducationType::getEducationName,"继续教育").last("limit 1"));
|
|
|
|
|
+ CourseProjectType projectType = iCourseProjectTypeService.getOne(new LambdaQueryWrapper<CourseProjectType>().eq(CourseProjectType::getStatus, 1).eq(CourseProjectType::getEducationId,educationType.getId()).eq(CourseProjectType::getProjectName,"建造师").last("limit 1"));
|
|
|
|
|
+ CourseBusiness business = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getProjectId,projectType.getId()).eq(CourseBusiness::getBusinessName,"二级").last("limit 1"));
|
|
|
|
|
+
|
|
|
|
|
+ GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());
|
|
|
|
|
+ if(goodsVo.getBusinessId().longValue()!=business.getId().longValue()){
|
|
|
|
|
+ throw new CustomException("非继续二建无法打回");
|
|
|
|
|
+ }
|
|
|
|
|
+ //查询此人学时审核是否有权限,老系统不进行权限校验
|
|
|
|
|
+ if (bo.getRollBackPlat()!=2) {
|
|
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
|
|
+ if(!loginUser.getUser().isAdmin()){
|
|
|
|
|
+ if (baseMapper.selectCountConfirmPeriod(loginUser.getUser().getUserId(), bo.getGoodsId()) < 1) {
|
|
|
|
|
+ throw new CustomException("您没有打回权限");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ LambdaUpdateWrapper<ClassGradeUser> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
|
|
|
+ objectLambdaUpdateWrapper.eq(ClassGradeUser::getId, classGradeUser.getId());
|
|
|
|
|
+ objectLambdaUpdateWrapper.set(ClassGradeUser::getPeriodStatus, 3);
|
|
|
|
|
+ objectLambdaUpdateWrapper.set(ClassGradeUser::getUpdateTime, DateUtils.getNowTime());
|
|
|
|
|
+ //判断结业
|
|
|
|
|
+ long nowTime = System.currentTimeMillis() / 1000;
|
|
|
|
|
+ ClassGradeUserQueryBo queryBo = new ClassGradeUserQueryBo();
|
|
|
|
|
+ queryBo.setGradeId(bo.getGradeId());
|
|
|
|
|
+ queryBo.setUserId(bo.getUserId());
|
|
|
|
|
+ ClassPeriodStudentVo classPeriodStudentVo = classGradeUserMapper.userPeriodStatus(queryBo);
|
|
|
|
|
+ if (Validator.isEmpty(classPeriodStudentVo.getClassStartTime())) {
|
|
|
|
|
+ //没设置永久有效
|
|
|
|
|
+ objectLambdaUpdateWrapper.set(ClassGradeUser::getFinishStatus, 0);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Validator.isNotEmpty(classPeriodStudentVo.getClassEndTime()) && Validator.isNotEmpty(classPeriodStudentVo.getClassStartTime())) {
|
|
|
|
|
+ if (nowTime < classPeriodStudentVo.getClassEndTime() && nowTime > classPeriodStudentVo.getClassStartTime()) {
|
|
|
|
|
+ objectLambdaUpdateWrapper.set(ClassGradeUser::getFinishStatus, 0);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ iClassGradeUserService.update(null, objectLambdaUpdateWrapper);
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public SyncUserCourseStudyRec syncStudyLogToOld(UserPeriodEditBo bo) {
|
|
|
|
|
+ CourseEducationType educationType = iCourseEducationTypeService.getOne(new LambdaQueryWrapper<CourseEducationType>().eq(CourseEducationType::getStatus, 1).eq(CourseEducationType::getEducationName,"继续教育").last("limit 1"));
|
|
|
|
|
+ CourseProjectType projectType = iCourseProjectTypeService.getOne(new LambdaQueryWrapper<CourseProjectType>().eq(CourseProjectType::getStatus, 1).eq(CourseProjectType::getEducationId,educationType.getId()).eq(CourseProjectType::getProjectName,"建造师").last("limit 1"));
|
|
|
|
|
+ CourseBusiness business = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getProjectId,projectType.getId()).eq(CourseBusiness::getBusinessName,"二级").last("limit 1"));
|
|
|
|
|
+
|
|
|
|
|
+ GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());
|
|
|
|
|
+ if(goodsVo.getBusinessId().longValue()!=business.getId().longValue()){
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ UserVo userVo = iUserService.queryById(bo.getUserId());
|
|
|
|
|
+ ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId,bo.getUserId()).eq(ClassGradeUser::getGradeId,bo.getGradeId()).last("limit 1"));
|
|
|
|
|
+ OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderGoodsId,gradeUser.getOrderGoodsId()).last("limit 1"));
|
|
|
|
|
+ ClassGrade classGrade = iClassGradeService.getOne(new LambdaQueryWrapper<ClassGrade>().eq(ClassGrade::getGradeId,gradeUser.getGradeId()).last("limit 1"));
|
|
|
|
|
+ SyncUserCourseStudyRec studyRec = new SyncUserCourseStudyRec();
|
|
|
|
|
+ studyRec.setName(userVo.getRealname());
|
|
|
|
|
+ studyRec.setIdNum(userVo.getIdCard());
|
|
|
|
|
+ studyRec.setMobile(userVo.getTelphone());
|
|
|
|
|
+ studyRec.setGender(userVo.getSex()==1?"男":"女");
|
|
|
|
|
+ studyRec.setRecentPhotoSrc(Validator.isNotEmpty(userVo.getOneInchPhotos())?ossHost+"/"+userVo.getOneInchPhotos():"");
|
|
|
|
|
+ studyRec.setIdcardPhotoSrc(Validator.isNotEmpty(userVo.getIdCardImg1())?ossHost+"/"+userVo.getIdCardImg1():"");
|
|
|
|
|
+ studyRec.setIdcardPhotoSrc2(Validator.isNotEmpty(userVo.getIdCardImg2())?ossHost+"/"+userVo.getIdCardImg2():"");
|
|
|
|
|
+ studyRec.setCourseId(bo.getGoodsId());
|
|
|
|
|
+ studyRec.setCourseBuyTime(DateUtils.timestampToDateFormat(orderGoods.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
|
|
|
+ studyRec.setClassNo(classGrade.getOfficialName());
|
|
|
|
|
+ studyRec.setOrderGoodsId(orderGoods.getOrderGoodsId());
|
|
|
|
|
+ List<SyncUserChapterList> ChapterList = new ArrayList<>();
|
|
|
|
|
+ GoodsCourseQueryBo goodsCourseQueryBo = new GoodsCourseQueryBo();
|
|
|
|
|
+ goodsCourseQueryBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
|
|
+ List<CourseVo> courseVoList = iGoodsCourseService.selectList(goodsCourseQueryBo);
|
|
|
|
|
+ for(CourseVo courseVo : courseVoList){
|
|
|
|
|
+ CourseMenuQueryBo menuQueryBo = new CourseMenuQueryBo();
|
|
|
|
|
+ menuQueryBo.setCourseId(courseVo.getCourseId());
|
|
|
|
|
+ List<CourseMenuVo> courseMenuVoList = iCourseMenuService.selectList(menuQueryBo);
|
|
|
|
|
+ courseMenuVoList.forEach(courseMenuVo -> {
|
|
|
|
|
+ if(courseMenuVo.getType()==1){
|
|
|
|
|
+ //获取章信息
|
|
|
|
|
+ List<CourseModuleChapterVo> courseModuleChapterVoList = iCourseModuleChapterService.getListById(courseMenuVo.getMenuId());
|
|
|
|
|
+ courseModuleChapterVoList.forEach(courseModuleChapterVo -> {
|
|
|
|
|
+ SyncUserChapterList syncUserChapterItem = new SyncUserChapterList();
|
|
|
|
|
+ syncUserChapterItem.setChapterId(courseModuleChapterVo.getChapterId());
|
|
|
|
|
+ syncUserChapterItem.setChapterName(courseModuleChapterVo.getName());
|
|
|
|
|
+
|
|
|
|
|
+ UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
|
|
|
|
|
+ userPeriodQueryBo.setCourseId(courseVo.getCourseId());
|
|
|
|
|
+ userPeriodQueryBo.setGoodsId(bo.getGoodsId());
|
|
|
|
|
+ userPeriodQueryBo.setUserId(bo.getUserId());
|
|
|
|
|
+ userPeriodQueryBo.setChapterId(courseModuleChapterVo.getChapterId());
|
|
|
|
|
+ userPeriodQueryBo.setModuleId(courseMenuVo.getMenuId());
|
|
|
|
|
+ userPeriodQueryBo.setGradeId(bo.getGradeId());
|
|
|
|
|
+ userPeriodQueryBo.setType(2);
|
|
|
|
|
+ List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(userPeriodStatusVos)&&userPeriodStatusVos.size()>0) {
|
|
|
|
|
+ int numIndex = userPeriodStatusVos.size() - 1;
|
|
|
|
|
+ UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos.get(numIndex);
|
|
|
|
|
+ LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
|
|
|
|
|
+ lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
|
|
|
|
|
+ List<UserStudyRecordPhoto> examPhoto = userStudyRecordPhotoService.list(lqw);
|
|
|
|
|
+ if(Validator.isNotEmpty(examPhoto)&&examPhoto.size()>0){
|
|
|
|
|
+ UserStudyRecordPhoto photo = examPhoto.get(0);
|
|
|
|
|
+ syncUserChapterItem.setImageSrc(ossHost+"/"+photo.getPhoto());
|
|
|
|
|
+ syncUserChapterItem.setImageTime(DateUtils.timestampToDateFormat(photo.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
|
|
|
+ syncUserChapterItem.setMatchData(Validator.isNotEmpty(photo.getSimilarity())?photo.getSimilarity().toString():null);
|
|
|
|
|
+ syncUserChapterItem.setExamTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
|
|
|
+ syncUserChapterItem.setExamScore(userPeriodStatusVo.getPerformance().toString());
|
|
|
|
|
+ syncUserChapterItem.setStudyIP(userPeriodStatusVo.getIp());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ List<ClassPeriodSectionVo> classPeriodSectionVos = classGradeUserMapper.listPeriodSection(courseModuleChapterVo.getChapterId(), bo.getGoodsId(), courseVo.getCourseId(), bo.getUserId());
|
|
|
|
|
+ Collections.sort(classPeriodSectionVos);
|
|
|
|
|
+ List<SyncUserStudyRec> RecList = new ArrayList<>();
|
|
|
|
|
+ for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
|
|
|
|
|
+ SyncUserStudyRec syncUserStudyRec = new SyncUserStudyRec();
|
|
|
|
|
+ syncUserStudyRec.setVideoId(classPeriodSectionVo.getId());
|
|
|
|
|
+ syncUserStudyRec.setVideoKey(classPeriodSectionVo.getRecordingUrl());
|
|
|
|
|
+
|
|
|
|
|
+ UserPeriodQueryBo userPeriodQueryBo2 = new UserPeriodQueryBo();
|
|
|
|
|
+ userPeriodQueryBo2.setSectionId(classPeriodSectionVo.getId());
|
|
|
|
|
+ userPeriodQueryBo2.setCourseId(courseVo.getCourseId());
|
|
|
|
|
+ userPeriodQueryBo2.setGoodsId(bo.getGoodsId());
|
|
|
|
|
+ userPeriodQueryBo2.setUserId(bo.getUserId());
|
|
|
|
|
+ userPeriodQueryBo2.setChapterId(courseModuleChapterVo.getChapterId());
|
|
|
|
|
+ userPeriodQueryBo2.setModuleId(courseMenuVo.getMenuId());
|
|
|
|
|
+ userPeriodQueryBo2.setGradeId(bo.getGradeId());
|
|
|
|
|
+ List<UserPeriodStatusVo> userPeriodStatusVos2 = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo2);
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(userPeriodStatusVos2)) {
|
|
|
|
|
+ int numIndex2 = userPeriodStatusVos2.size() - 1;
|
|
|
|
|
+ UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos2.get(numIndex2);
|
|
|
|
|
+ LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
|
|
|
|
|
+ lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
|
|
|
|
|
+ List<UserStudyRecordPhoto> videoPhoto2 = userStudyRecordPhotoService.list(lqw);
|
|
|
|
|
+ syncUserStudyRec.setCreateTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
|
|
|
+ syncUserStudyRec.setEndTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordEndTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
|
|
|
+ syncUserStudyRec.setStudyIP(userPeriodStatusVo.getIp());
|
|
|
|
|
+ List<SyncUserImageRc> ImgList = new ArrayList<>();
|
|
|
|
|
+ for (UserStudyRecordPhoto videoPhoto : videoPhoto2) {
|
|
|
|
|
+ SyncUserImageRc imageRc = new SyncUserImageRc();
|
|
|
|
|
+ imageRc.setImgSrc(ossHost+"/"+videoPhoto.getPhoto());
|
|
|
|
|
+ imageRc.setCreateTime(DateUtils.timestampToDateFormat(videoPhoto.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
|
|
|
+ imageRc.setMatchData(Validator.isNotEmpty(videoPhoto.getSimilarity())?videoPhoto.getSimilarity().toString():null);
|
|
|
|
|
+ ImgList.add(imageRc);
|
|
|
|
|
+ }
|
|
|
|
|
+ syncUserStudyRec.setImgList(ImgList);
|
|
|
|
|
+ }
|
|
|
|
|
+ RecList.add(syncUserStudyRec);
|
|
|
|
|
+ }
|
|
|
|
|
+ syncUserChapterItem.setRecList(RecList);
|
|
|
|
|
+ ChapterList.add(syncUserChapterItem);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ studyRec.setChapterList(ChapterList);
|
|
|
|
|
+ //学习记录推送到旧系统
|
|
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
|
|
+ Long nowTime = DateUtils.getNowTime();
|
|
|
|
|
+ String sign = ToolsUtils.EncoderByMd5(nowTime.toString()+"pubilc2022");
|
|
|
|
|
+ params.put("stamp", nowTime.toString());
|
|
|
|
|
+ params.put("sign", sign);
|
|
|
|
|
+ params.put("jsonstr", JSONObject.toJSONString(studyRec));
|
|
|
|
|
+ String respone = "";
|
|
|
|
|
+ try {
|
|
|
|
|
+ respone = HttpUtils.postFormBody(SYNC_PATH, params);
|
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
|
+ throw new CustomException("同步请求错误"+e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ return studyRec;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 打回操作
|
|
* 打回操作
|
|
|
*
|
|
*
|
|
@@ -444,6 +680,8 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
return baseMapper.todayStudySectionNum(bo);
|
|
return baseMapper.todayStudySectionNum(bo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//学时通过处理事件
|
|
//学时通过处理事件
|
|
|
private void periodPass(ClassGradeUserQueryBo classGradeUserQueryBo) {
|
|
private void periodPass(ClassGradeUserQueryBo classGradeUserQueryBo) {
|
|
|
//生成证书
|
|
//生成证书
|