diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StepController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StepController.java index 46eafb6..f319675 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StepController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StepController.java @@ -3,6 +3,7 @@ package com.hxhq.business.controller; import java.util.Arrays; import java.util.List; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.hxhq.common.security.annotation.Logical; import com.hxhq.common.security.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -56,6 +57,14 @@ public class StepController extends BaseController @RequiresPermissions("business:step:list") public AjaxResult save(@RequestBody Step step) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("sn",step.getSn()); + if(step.getId()!=null){ + queryWrapper.ne("id",step.getId()); + } + if(stepService.count(queryWrapper)>0){ + return AjaxResult.error("编号已存在"); + } return toAjax(stepService.saveOrUpdate(step)); }