|
@@ -19,6 +19,8 @@ import com.zhongzheng.modules.bank.vo.QuestionModuleVo;
|
|
import com.zhongzheng.modules.course.domain.CourseModule;
|
|
import com.zhongzheng.modules.course.domain.CourseModule;
|
|
import com.zhongzheng.modules.goods.domain.GoodsAttached;
|
|
import com.zhongzheng.modules.goods.domain.GoodsAttached;
|
|
import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
|
|
import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
|
|
|
|
+import com.zhongzheng.modules.user.bo.CheckUserExamRecordBo;
|
|
|
|
+import com.zhongzheng.modules.user.service.IUserExamRecordService;
|
|
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.extension.service.impl.ServiceImpl;
|
|
@@ -54,6 +56,9 @@ public class QuestionModuleServiceImpl extends ServiceImpl<QuestionModuleMapper,
|
|
@Autowired
|
|
@Autowired
|
|
private IGoodsAttachedService iGoodsAttachedService;
|
|
private IGoodsAttachedService iGoodsAttachedService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IUserExamRecordService iUserExamRecordService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public QuestionModuleVo queryById(Long questionModuleId){
|
|
public QuestionModuleVo queryById(Long questionModuleId){
|
|
QuestionModule db = this.baseMapper.selectById(questionModuleId);
|
|
QuestionModule db = this.baseMapper.selectById(questionModuleId);
|
|
@@ -186,12 +191,19 @@ public class QuestionModuleServiceImpl extends ServiceImpl<QuestionModuleMapper,
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public boolean batchDelModuleExam(QuestionBatchDelBo bo) {
|
|
public boolean batchDelModuleExam(QuestionBatchDelBo bo) {
|
|
if (CollectionUtils.isEmpty(bo.getIds())){
|
|
if (CollectionUtils.isEmpty(bo.getIds())){
|
|
throw new CustomException("模块卷ID不能为空");
|
|
throw new CustomException("模块卷ID不能为空");
|
|
}
|
|
}
|
|
|
|
+ CheckUserExamRecordBo checkBo = new CheckUserExamRecordBo();
|
|
|
|
+ checkBo.setModuleExamIds(bo.getIds());
|
|
|
|
+ if (iUserExamRecordService.checkBatchUserExamRecord(checkBo) > 0){
|
|
|
|
+ throw new CustomException("存在学员已做过的模块卷,不能删除,请检查!");
|
|
|
|
+ }
|
|
return update(new LambdaUpdateWrapper<QuestionModule>()
|
|
return update(new LambdaUpdateWrapper<QuestionModule>()
|
|
.set(QuestionModule::getStatus,bo.getStatus())
|
|
.set(QuestionModule::getStatus,bo.getStatus())
|
|
|
|
+ .set(QuestionModule::getUpdateTime,DateUtils.getNowTime())
|
|
.in(QuestionModule::getModuleExamId,bo.getIds()));
|
|
.in(QuestionModule::getModuleExamId,bo.getIds()));
|
|
}
|
|
}
|
|
}
|
|
}
|