update:法规释疑库保存前校验(未具体实现)

This commit is contained in:
sunzheng
2024-09-26 10:04:32 +08:00
parent 7c116ee80f
commit fb3559aadb
3 changed files with 20 additions and 2 deletions
@@ -70,6 +70,13 @@ public class LawsRegulationsQuestionLibraryController {
return lawsRegulationsQuestionLibraryService.add(lawsRegulationsQuestionLibrary);
}
@AutoLog(value = "法规释疑库-保存/发布前校验")
@ApiOperation(value = "法规释疑库-保存/发布前校验", notes = "法规释疑库-保存/发布前校验")
@PostMapping(value = "/check")
public Result<?> check(@RequestBody LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary) {
return lawsRegulationsQuestionLibraryService.check(lawsRegulationsQuestionLibrary);
}
@AutoLog(value = "法规释疑库-通过id删除")
@ApiOperation(value = "法规释疑库-通过id删除", notes = "法规释疑库-通过id删除")
@PostMapping(value = "/delete")
@@ -30,6 +30,13 @@ public interface ILawsRegulationsQuestionLibraryService extends IService<LawsReg
*/
Result<?> add(LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary);
/**
* 保存前校验
* @param lawsRegulationsQuestionLibrary
* @return
*/
Result<?> check(LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary);
/**
* 通过id删除
*
@@ -62,6 +62,11 @@ public class LawsRegulationsQuestionLibraryServiceImpl extends ServiceImpl<LawsR
// 编辑后更新创建时间为最新时间,让其排在最前面
lawsRegulationsQuestionLibrary.setCreateTime(new Date());
saveOrUpdate(lawsRegulationsQuestionLibrary); // 不影响数据的正常保存或更新
return Result.OK(ResultCommon.OK);
}
@Override
public Result<?> check(LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary) {
// 校验标准编号和条款号是否存在,并给出提示信息
String standardNumber = lawsRegulationsQuestionLibrary.getStandardNumber();
String regulationNumber = lawsRegulationsQuestionLibrary.getRegulationNumber();
@@ -77,9 +82,8 @@ public class LawsRegulationsQuestionLibraryServiceImpl extends ServiceImpl<LawsR
StringBuilder msg = new StringBuilder();
if (StringUtils.isNotEmpty(msg.toString())) {
Result<String> result = new Result<>();
result.setCode(61010); // 规定一个特殊的code码,前端会根据这个code码展示提示的消息
result.setMessage(msg.toString());
result.setSuccess(true);
result.setSuccess(false); // 前端根据success判断是否通过验证
return result;
}else {
return Result.OK(ResultCommon.OK);