diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/controller/OnlCgformTagController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/controller/OnlCgformTagController.java index 756c094b2..854c0f18a 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/controller/OnlCgformTagController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/controller/OnlCgformTagController.java @@ -12,6 +12,7 @@ import com.jero.modules.tag.service.IOnlCgformTagService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -115,14 +116,18 @@ public class OnlCgformTagController extends JeroController delete(@RequestParam(name="id",required=true) String id) { + public Result delete(@RequestParam(name="id",required=true) String id) { + Result result = new Result<>(); OnlCgformTag onlCgformTag = onlCgformTagService.queryById(id); - if(onlCgformTag.getIsReadOnly() == 1 || onlCgformTag.getIsReadOnly()==2){ - return Result.error("固定字段,不可删除"); - }else{ - onlCgformTagService.deleteById(id); - return Result.OK("删除成功!"); + if(StringUtils.isNotBlank(String.valueOf(onlCgformTag.getIsReadOnly()))) { + if (onlCgformTag.getIsReadOnly() == 1 || onlCgformTag.getIsReadOnly() == 2) { + result.error("固定字段,不可删除"); + } else { + onlCgformTagService.deleteById(id); + result.OK("删除成功!"); + } } + return result; } /**