@ -1,4 +1,4 @@
@@ -1,4 +1,4 @@
package com.ruoyi.web.controller.system ;
package com.ruoyi.web.controller.system ;
import java.util.List ;
import org.springframework.security.access.prepost.PreAuthorize ;
@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.PathVariable;
@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody ;
import org.springframework.web.bind.annotation.RequestMapping ;
import org.springframework.web.bind.annotation.RestController ;
import org.springframework.web.bind.annotation.RequestParam ;
import com.ruoyi.common.annotation.Log ;
import com.ruoyi.common.core.controller.BaseController ;
import com.ruoyi.common.core.domain.AjaxResult ;
@ -41,6 +42,7 @@ public class SalesRegionController extends BaseController
@@ -41,6 +42,7 @@ public class SalesRegionController extends BaseController
{
startPage ( ) ;
List < SalesRegion > list = salesRegionService . selectSalesRegionList ( salesRegion ) ;
return getDataTable ( list ) ;
}
@ -89,6 +91,22 @@ public class SalesRegionController extends BaseController
@@ -89,6 +91,22 @@ public class SalesRegionController extends BaseController
return toAjax ( salesRegionService . updateSalesRegion ( salesRegion ) ) ;
}
/ * *
* 检查销售区域名称是否可用
* /
@GetMapping ( "/checkRegionNameUnique" )
public AjaxResult checkRegionNameUnique ( @RequestParam ( "regionName" ) String regionName )
{
// 创建查询对象
SalesRegion salesRegion = new SalesRegion ( ) ;
salesRegion . setRegionName ( regionName ) ;
// 使用精确匹配方法查询是否存在相同名称
boolean isUnique = salesRegionService . checkRegionNameUnique ( regionName ) ;
return AjaxResult . success ( isUnique ) ;
}
/ * *
* 删除销售区域
* /