|
@@ -442,6 +442,59 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
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"));
|