|
@@ -19,6 +19,7 @@ import io.swagger.annotations.ApiResponses;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -41,6 +42,7 @@ public class SupplierMgrController extends BaseApiController {
|
|
|
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:supplier:add')")
|
|
|
@ApiOperation("添加供应商")
|
|
|
public AjaxResult createSupplier(@RequestBody @Validated SupplierCreateParam supplierCreateParam) {
|
|
|
int count = supplierService.count(new LambdaQueryWrapper<Supplier>().eq(Supplier::getName, supplierCreateParam.getName()));
|
|
@@ -53,6 +55,7 @@ public class SupplierMgrController extends BaseApiController {
|
|
|
}
|
|
|
|
|
|
@PostMapping("/update")
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:supplier:edit')")
|
|
|
@ApiOperation("编辑供应商")
|
|
|
public AjaxResult updateSupplier(@RequestBody @Validated SupplierUpdateParam supplierUpdateParam) {
|
|
|
int count = supplierService.count(new LambdaQueryWrapper<Supplier>().eq(Supplier::getName, supplierUpdateParam.getName()).notIn(Supplier::getId, supplierUpdateParam.getId()));
|
|
@@ -65,6 +68,7 @@ public class SupplierMgrController extends BaseApiController {
|
|
|
}
|
|
|
|
|
|
@PostMapping("/list")
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:supplier:list')")
|
|
|
@ApiOperation("供应商列表")
|
|
|
@ApiResponses(
|
|
|
@ApiResponse(code = 200, message = "供应商列表", response = Supplier.class)
|
|
@@ -83,6 +87,7 @@ public class SupplierMgrController extends BaseApiController {
|
|
|
}
|
|
|
|
|
|
@PostMapping("/detail/{id}")
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:supplier:query')")
|
|
|
@ApiOperation("供应商详情")
|
|
|
@ApiResponses(
|
|
|
@ApiResponse(code = 200, message = "供应商详情", response = Supplier.class)
|
|
@@ -92,6 +97,7 @@ public class SupplierMgrController extends BaseApiController {
|
|
|
}
|
|
|
|
|
|
@PostMapping("/delete/{id}")
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:supplier:remove')")
|
|
|
@ApiOperation("删除供应商")
|
|
|
public AjaxResult delete(@PathVariable("id") Long id) {
|
|
|
int count = goodsService.count(new LambdaQueryWrapper<Goods>().eq(Goods::getSupplerId, id));
|