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