From 5cb38987d58babea3439653ae13948d48e737456 Mon Sep 17 00:00:00 2001 From: sunzheng Date: Wed, 25 Sep 2024 14:48:14 +0800 Subject: [PATCH] =?UTF-8?q?update:=E6=B3=95=E8=A7=84=E9=87=8A=E7=96=91?= =?UTF-8?q?=E5=BA=93=E4=BF=9D=E5=AD=98/=E5=8F=91=E5=B8=83=E5=89=8D?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=87=E5=87=86=E5=8F=B7=E5=92=8C=E6=9D=A1?= =?UTF-8?q?=E6=AC=BE=E5=8F=B7=E7=9A=84=E6=A0=A1=E9=AA=8C(=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=AE=8C=E6=88=90,=E5=B7=AE=E8=B0=83=E7=94=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sRegulationsQuestionLibraryController.java | 8 ++---- .../LawsRegulationsQuestionLibrary.java | 6 ++++ ...LawsRegulationsQuestionLibraryService.java | 3 +- ...RegulationsQuestionLibraryServiceImpl.java | 28 +++++++++++++++++-- 4 files changed, 37 insertions(+), 8 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/controller/LawsRegulationsQuestionLibraryController.java b/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/controller/LawsRegulationsQuestionLibraryController.java index 027e9150..c7cd549e 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/controller/LawsRegulationsQuestionLibraryController.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/controller/LawsRegulationsQuestionLibraryController.java @@ -56,8 +56,7 @@ public class LawsRegulationsQuestionLibraryController { public Result save(@RequestBody LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary) { // 第一次保存,附上初值 lawsRegulationsQuestionLibrary.setReleaseStatus(Constant.UN_PUBLISH); // 未发布 - lawsRegulationsQuestionLibraryService.add(lawsRegulationsQuestionLibrary); - return Result.OK(ResultCommon.OK); + return lawsRegulationsQuestionLibraryService.add(lawsRegulationsQuestionLibrary); } @AutoLog(value = "法规释疑库-发布") @@ -68,14 +67,13 @@ public class LawsRegulationsQuestionLibraryController { // 不管第几次发布,发布时间都更新 lawsRegulationsQuestionLibrary.setReleaseTime(new Date()); lawsRegulationsQuestionLibrary.setReleaseStatus(Constant.PUBLISH); - lawsRegulationsQuestionLibraryService.add(lawsRegulationsQuestionLibrary); - return Result.OK(ResultCommon.OK); + return lawsRegulationsQuestionLibraryService.add(lawsRegulationsQuestionLibrary); } @AutoLog(value = "法规释疑库-通过id删除") @ApiOperation(value = "法规释疑库-通过id删除", notes = "法规释疑库-通过id删除") @PostMapping(value = "/delete") -// @RequiresPermissions("legalClarificationDatabase:delete") + @RequiresPermissions("legalClarificationDatabase:delete") public Result delete(@RequestBody @ApiParam(name = "id", value = "主键") JSONObject jsonObject) { if (Objects.isNull(jsonObject) || StringUtils.isBlank(jsonObject.getString("id"))) { throw new JeroBootException(ResultCommon.SELECT_DATA); diff --git a/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/entity/LawsRegulationsQuestionLibrary.java b/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/entity/LawsRegulationsQuestionLibrary.java index 4d7aa851..e9a2e5f7 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/entity/LawsRegulationsQuestionLibrary.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/entity/LawsRegulationsQuestionLibrary.java @@ -43,9 +43,15 @@ public class LawsRegulationsQuestionLibrary implements Serializable { @ApiModelProperty(value = "标准编号") private String standardNumber; + @ApiModelProperty(value = "标准名称") + private String standardName; + @ApiModelProperty(value = "条款号") private String regulationNumber; + @ApiModelProperty(value = "条款名称") + private String regulationName; + @ApiModelProperty(value = "问题描述") private String problemDescription; diff --git a/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/service/ILawsRegulationsQuestionLibraryService.java b/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/service/ILawsRegulationsQuestionLibraryService.java index 474f42bd..e416d2fc 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/service/ILawsRegulationsQuestionLibraryService.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/service/ILawsRegulationsQuestionLibraryService.java @@ -2,6 +2,7 @@ package com.jero.modules.laws.businessSupport.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.common.api.vo.Result; import com.jero.modules.laws.businessSupport.entity.LawsRegulationsQuestionLibrary; /** @@ -27,7 +28,7 @@ public interface ILawsRegulationsQuestionLibraryService extends IService add(LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary); /** * 通过id删除 diff --git a/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/service/impl/LawsRegulationsQuestionLibraryServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/service/impl/LawsRegulationsQuestionLibraryServiceImpl.java index 3e2052a1..600aa2c8 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/service/impl/LawsRegulationsQuestionLibraryServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/businessSupport/service/impl/LawsRegulationsQuestionLibraryServiceImpl.java @@ -3,6 +3,7 @@ package com.jero.modules.laws.businessSupport.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jero.common.api.vo.Result; import com.jero.common.api.vo.ResultCommon; import com.jero.common.exception.JeroBootException; import com.jero.common.system.vo.LoginUser; @@ -15,6 +16,7 @@ import org.apache.shiro.SecurityUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Objects; @@ -49,7 +51,7 @@ public class LawsRegulationsQuestionLibraryServiceImpl extends ServiceImpl add(LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary) { if (StringUtils.isBlank(lawsRegulationsQuestionLibrary.getQuestionSpecializedModule())) { throw new JeroBootException(ResultCommon.EMPTY_COMMON, "questionSpecializedModule"); } @@ -59,7 +61,29 @@ public class LawsRegulationsQuestionLibraryServiceImpl extends ServiceImpl standardNumberList = Arrays.asList(standardNumber.split(",")); + } + if (StringUtils.isNotBlank(regulationNumber)) { + // 条款号 + List regulationNumberList = Arrays.asList(regulationNumber.split(",")); + } + // TODO 调用校验标准号和条款号的接口拿到结果的信息, 如:xxx条款不存在 + StringBuilder msg = new StringBuilder(); + if (StringUtils.isNotEmpty(msg.toString())) { + Result result = new Result<>(); + result.setCode(61010); // 规定一个特殊的code码,前端会根据这个code码展示提示的消息 + result.setMessage(msg.toString()); + result.setSuccess(true); + return result; + }else { + return Result.OK(ResultCommon.OK); + } } private void isHaveOperateAuth(LawsRegulationsQuestionLibrary lawsRegulationsQuestionLibrary) {