app安全教育完成

This commit is contained in:
2025-02-18 11:56:03 +08:00
parent 1d01fb0b3c
commit 39ed23e9d4
25 changed files with 368 additions and 140 deletions

View File

@ -8,15 +8,16 @@ import com.ruoyi.common.domain.Annex;
import com.ruoyi.common.service.IAnnexService;
import com.ruoyi.system.service.ISysDictTypeService;
import com.ruoyi.wgz.bo.res.WgzAppGetTestPaperRes;
import com.ruoyi.wgz.bo.res.WgzAppSubmitATestPaperRes;
import com.ruoyi.wgz.bo.rests.WgzAppGetTestPaperThree;
import com.ruoyi.wgz.bo.rests.WgzAppGetTestPaperTwo;
import com.ruoyi.wgz.bo.rests.WgzAutonymAnnex;
import com.ruoyi.wgz.bo.req.*;
import com.ruoyi.wgz.bo.res.WgzAppAttachmentAcquisitionRes;
import com.ruoyi.wgz.bo.res.WgzAppPersonalBasicInformationRes;
import com.ruoyi.wgz.domain.WgzQuestionBank;
import com.ruoyi.wgz.domain.WgzQuestionsConfiguration;
import com.ruoyi.wgz.service.IWgzQuestionBankService;
import com.ruoyi.wgz.service.IWgzQuestionSaveService;
import com.ruoyi.wgz.service.IWgzQuestionsConfigurationService;
import com.ruoyi.wgz.service.IWgzUserService;
import io.swagger.annotations.Api;
@ -54,6 +55,12 @@ public class WgzAppController {
@Autowired
private IWgzQuestionBankService iWgzQuestionBankService;
@Autowired
private IWgzQuestionsConfigurationService iWgzQuestionsConfigurationService;
@Autowired
private IWgzQuestionSaveService iWgzQuestionSaveService;
/**
@ -141,13 +148,19 @@ public class WgzAppController {
@ApiOperation("APP务工者-实名认证")
@PreAuthorize("@ss.hasPermi('wgzApp:user:userRealNameAuthentication')")
@PutMapping("/wgzUserRealNameAuthentication")
public AjaxResult<Boolean> userRealNameAuthentication(@Validated @RequestBody WgzRealNameAuthenticationReq req) {
public AjaxResult<Boolean> userRealNameAuthentication(@Validated @RequestBody WgzAppRealNameAuthenticationReq req) {
return AjaxResult.success(iWgzUserService.userRealNameAuthentication(req));
}
@Autowired
private IWgzQuestionsConfigurationService iWgzQuestionsConfigurationService;
/**
* 【我的】【签协议】协议列表(无任何实际操作目前只是查看)
*/
@ApiOperation("APP务工者-签协议·协议列表")
@PreAuthorize("@ss.hasPermi('wgzApp:user:userSignAnAgreement')")
@GetMapping("/WgzUserSignAnAgreement")
public AjaxResult<WgzAppSubmitATestPaperRes> userSignAnAgreement(@Validated WgzAppSubmitATestPaperReq req) {
return AjaxResult.success(iWgzQuestionSaveService.userSubmitATestPaper(req));
}
/**
* 【我的】【岗前培训】获取安全教育考试试卷(随机获取)
@ -157,16 +170,14 @@ public class WgzAppController {
@GetMapping("/WgzUserGetTestPaper")
public AjaxResult<WgzAppGetTestPaperRes> userGetTestPaper() {
//1、获取配置信息
WgzQuestionsConfiguration configuration = iWgzQuestionsConfigurationService.appQueryById(2L);
WgzQuestionsConfiguration configuration = iWgzQuestionsConfigurationService.appQueryLimitOne();
if (configuration == null) {
throw new RuntimeException("未查询到配置信息");
}
//2、随机获取数据返回id和score
Integer s = configuration.getSingleChoice();
Integer m = configuration.getMultipleChoice();
Integer e = configuration.getEstimate();
List<WgzAppGetTestPaperThree> sEntity = iWgzQuestionBankService.appQueryList(1, s);
List<WgzAppGetTestPaperThree> mEntity = iWgzQuestionBankService.appQueryList(2, m);
List<WgzAppGetTestPaperThree> eEntity = iWgzQuestionBankService.appQueryList(3, e);
@ -175,34 +186,21 @@ public class WgzAppController {
res.setSingleList(createQuestionSection("一、单选题", sEntity, configuration.getSingleScore(), s));
res.setMultipleList(createQuestionSection("二、多选题", mEntity, configuration.getMultipleScore(), m));
res.setEstimateList(createQuestionSection("三、判断题", eEntity, configuration.getEstimateScore(), e));
// WgzAppGetTestPaperTwo one = new WgzAppGetTestPaperTwo();
// one.setTopic("一、单选题,共" + s + "道题,每小题" + configuration.getSingleScore() + "分,共计" + s * configuration.getSingleScore() + "分");
// sEntity.forEach(item -> {
// item.setScore(configuration.getSingleScore());
// });
// one.setList(sEntity);
// res.setSingleList(one);
//
// WgzAppGetTestPaperTwo two = new WgzAppGetTestPaperTwo();
// two.setTopic("二、多选题,共" + m + "道题,每小题" + configuration.getMultipleScore() + "分,共计" + m * configuration.getMultipleScore() + "分");
// mEntity.forEach(item -> {
// item.setScore(configuration.getMultipleScore());
// });
// two.setList(mEntity);
// res.setMultipleList(two);
//
// WgzAppGetTestPaperTwo three = new WgzAppGetTestPaperTwo();
// three.setTopic("三、判断题,共" + e + "道题,每小题" + configuration.getEstimateScore() + "分,共计" + e * configuration.getEstimateScore() + "分");
// eEntity.forEach(item -> {
// item.setScore(configuration.getEstimateScore());
// });
// three.setList(eEntity);
// res.setMultipleList(three);
//4、设置最大考试时间
res.setMaximum(configuration.getAnswerTime());
return AjaxResult.success(res);
}
/**
* 【我的】【岗前培训】提交用户的试卷(只保存最高分的试卷信息)
*/
@ApiOperation("APP务工者-岗前培训·提交试卷")
@PreAuthorize("@ss.hasPermi('wgzApp:user:userSubmitATestPaper')")
@PostMapping("/WgzUserSubmitATestPaper")
public AjaxResult<WgzAppSubmitATestPaperRes> userSubmitATestPaper(@Validated @RequestBody WgzAppSubmitATestPaperReq req) {
return AjaxResult.success(iWgzQuestionSaveService.userSubmitATestPaper(req));
}
/**
* 控制层业务
* =================================================================================================================