|
|
@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.PathVariable; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
import com.ruoyi.common.annotation.Log; |
|
|
|
import com.ruoyi.common.annotation.Log; |
|
|
|
import com.ruoyi.common.core.controller.BaseController; |
|
|
|
import com.ruoyi.common.core.controller.BaseController; |
|
|
|
import com.ruoyi.common.core.domain.AjaxResult; |
|
|
|
import com.ruoyi.common.core.domain.AjaxResult; |
|
|
@ -41,6 +42,7 @@ public class SalesRegionController extends BaseController |
|
|
|
{ |
|
|
|
{ |
|
|
|
startPage(); |
|
|
|
startPage(); |
|
|
|
List<SalesRegion> list = salesRegionService.selectSalesRegionList(salesRegion); |
|
|
|
List<SalesRegion> list = salesRegionService.selectSalesRegionList(salesRegion); |
|
|
|
|
|
|
|
|
|
|
|
return getDataTable(list); |
|
|
|
return getDataTable(list); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -89,6 +91,22 @@ public class SalesRegionController extends BaseController |
|
|
|
return toAjax(salesRegionService.updateSalesRegion(salesRegion)); |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 删除销售区域 |
|
|
|
* 删除销售区域 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|