|
@@ -89,15 +89,14 @@ public class BizSupplierController extends BaseController
|
|
|
@Transactional
|
|
|
public AjaxResult add(@RequestBody BizSupplier bizSupplier) throws NoSuchFieldException, IllegalAccessException
|
|
|
{
|
|
|
- if(bizSupplier.getJdId() == null||bizSupplier.getCode() == null || bizSupplier.getCode() == ""||bizSupplier.getName() == null || bizSupplier.getName() == "" ||bizSupplier.getSettlementType() == null || bizSupplier.getSettlementType() == ""){
|
|
|
- return error("新增供应商失败,必填项:金蝶id,供应商编码,供应商名称,结算方式不能为空");
|
|
|
+ if(bizSupplier.getJdId() == null || bizSupplier.getTenantId() == null||bizSupplier.getCode() == null || bizSupplier.getCode() == ""||bizSupplier.getName() == null || bizSupplier.getName() == "" ||bizSupplier.getSettlementType() == null || bizSupplier.getSettlementType() == ""){
|
|
|
+ return error("新增供应商失败,必填项:金蝶id,厂别id,供应商编码,供应商名称,结算方式不能为空");
|
|
|
}
|
|
|
- if (bizSupplier.getTenantId() != null) {
|
|
|
List<BizTenant> tenantList = bizTenantService.query().eq("id", bizSupplier.getTenantId()).list();
|
|
|
if(tenantList.isEmpty()){
|
|
|
return error("新增供应商失败,租户ID不存在");
|
|
|
}
|
|
|
- }
|
|
|
+
|
|
|
if(!bizSupplier.getSettlementType().equals("1") && !bizSupplier.getSettlementType().equals("2")){
|
|
|
return error("新增供应商失败,结算方式只能为1或2");
|
|
|
}
|
|
@@ -107,7 +106,7 @@ public class BizSupplierController extends BaseController
|
|
|
if(bizSupplier.getDeliveryMethod()!=null &&bizSupplier.getDeliveryMethod()!="" && !(bizSupplier.getDeliveryMethod().equals("0") || bizSupplier.getDeliveryMethod().equals("1"))){
|
|
|
return error("新增供应商失败,送货方式只能为0或1");
|
|
|
}
|
|
|
- List<BizSupplier> supplierList = bizSupplierService.query().eq("code", bizSupplier.getCode()).list();
|
|
|
+ List<BizSupplier> supplierList = bizSupplierService.query().eq("code", bizSupplier.getCode()).eq("tenant_id", bizSupplier.getTenantId()).list();
|
|
|
if (!supplierList.isEmpty()) {
|
|
|
return AjaxResult.error("供应商编号不能重复");
|
|
|
}
|