认证-参数项-标题类型校验修改

This commit is contained in:
liyawei
2022-08-09 10:38:10 +08:00
parent 262e36e498
commit bc3f1be1a0
@@ -10,6 +10,7 @@ import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.system.base.controller.JeroController;
import com.jero.modules.cert.template.entity.ParamsInfoEO;
import com.jero.modules.cert.template.enums.ControlTypeEnum;
import com.jero.modules.cert.template.service.IParamsInfoEOService;
import com.jero.modules.cert.template.service.IParamsInfoPublishEOService;
import com.jero.modules.cert.template.vo.ParamsInfoVO;
@@ -136,7 +137,8 @@ public class ParamsInfoEOController extends JeroController<ParamsInfoEO, IParams
@PostMapping(value = "/add")
// @RequiresPermissions("params:paramsInfo:add")
public Result<?> add(@Validated @RequestBody ParamsInfoEO paramsInfoEO) {
if (StringUtils.isEmpty(paramsInfoEO.getCertCategory())) {
if (StringUtils.isEmpty(paramsInfoEO.getCertCategory())
&& !ControlTypeEnum.Title.getValue().equals(paramsInfoEO.getControlType())) {
return Result.error("认证类别不能为空!");
}
boolean isSuccess = paramsInfoEOService.add(paramsInfoEO);
@@ -158,7 +160,8 @@ public class ParamsInfoEOController extends JeroController<ParamsInfoEO, IParams
@PostMapping(value = "/edit")
@RequiresPermissions("params:paramsInfo:edit")
public Result<?> edit(@Validated @RequestBody ParamsInfoEO paramsInfoEO) {
if (StringUtils.isEmpty(paramsInfoEO.getCertCategory())) {
if (StringUtils.isEmpty(paramsInfoEO.getCertCategory())
&& !ControlTypeEnum.Title.getValue().equals(paramsInfoEO.getControlType())) {
return Result.error("认证类别不能为空!");
}
boolean isSuccess = paramsInfoEOService.editById(paramsInfoEO);