guoyujia há 2 meses atrás
pai
commit
af3ced8a7d

+ 7 - 1
src/main/java/cn/ezhizao/project/business/controller/BizSupplierController.java

@@ -49,7 +49,6 @@ public class BizSupplierController extends BaseController
             @ApiImplicitParam(name = "name", value = "供应商名称",  dataType = "String", paramType = "path", dataTypeClass = String.class),
             @ApiImplicitParam(name = "mnemonicCode", value = "供应商助记码", dataType = "String", paramType = "path", dataTypeClass = String.class),
    })
-    @PreAuthorize("@ss.hasPermi('business:supplier:list')")
     @GetMapping("/list")
     public TableDataInfo list(BizSupplier bizSupplier) throws NoSuchFieldException, IllegalAccessException
     {
@@ -65,6 +64,13 @@ public class BizSupplierController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody BizSupplier bizSupplier) throws NoSuchFieldException, IllegalAccessException
     {
+        if(bizSupplier.getCode() == null || bizSupplier.getCode() == ""||bizSupplier.getName() == null || bizSupplier.getName() == "" || bizSupplier.getMnemonicCode() == null
+                ||bizSupplier.getMnemonicCode() == null || bizSupplier.getMnemonicCode() == "" ||bizSupplier.getSettlementType() == null || bizSupplier.getSettlementType() == ""){
+            return error("新增供应商失败,必填项:供应商编码,供应商名称,供应商助记码,结算方式不能为空");
+        }
+        if(!bizSupplier.getSettlementType().equals("1") && !bizSupplier.getSettlementType().equals("2")){
+
+        }
         return toAjax(bizSupplierService.save(bizSupplier));
     }