Commit 84c407e6 by 杨树贤

Merge branch 'master' into ysx-供应商需求-20220707

parents d75fe64a 3d9b3d91
...@@ -297,6 +297,9 @@ class SupplierApiController extends Controller ...@@ -297,6 +297,9 @@ class SupplierApiController extends Controller
{ {
$supplierName = trim($request->get('supplier_name')); $supplierName = trim($request->get('supplier_name'));
$taxNumber = $request->get('tax_number'); $taxNumber = $request->get('tax_number');
if (empty($supplierName) && empty($taxNumber)) {
$this->response(0, 'ok');
}
$supplierId = $request->get('supplier_id'); $supplierId = $request->get('supplier_id');
$region = $request->get('region'); $region = $request->get('region');
$model = new SupplierChannelModel(); $model = new SupplierChannelModel();
......
...@@ -20,6 +20,7 @@ class SupplierStatisticsApiController extends Controller ...@@ -20,6 +20,7 @@ class SupplierStatisticsApiController extends Controller
public function GetSupplierStatistics($request) public function GetSupplierStatistics($request)
{ {
ini_set('memory_limit', -1);
$service = new SupplierStatisticsService(); $service = new SupplierStatisticsService();
$statistics = $service->getSupplierListStatistics(); $statistics = $service->getSupplierListStatistics();
$data = []; $data = [];
......
...@@ -168,7 +168,10 @@ class SyncSupplierService ...@@ -168,7 +168,10 @@ class SyncSupplierService
$data['status'] = SupplierChannelModel::STATUS_BLOCK; $data['status'] = SupplierChannelModel::STATUS_BLOCK;
$data['block_reason'] = '一体化系统黑名单供应商'; $data['block_reason'] = '一体化系统黑名单供应商';
} else { } else {
$data['status'] = SupplierChannelModel::STATUS_IN_REVIEW; //判断原来是拉黑状态,才变成审核中,因为有可能不是修改公司类型,只是修改公司性质
if ($supplier['status'] == SupplierChannelModel::STATUS_BLOCK) {
$data['status'] = SupplierChannelModel::STATUS_IN_REVIEW;
}
} }
} }
$data['sync_united_status'] = SupplierChannelModel::SYNC_UNITED_STATUS_OK; $data['sync_united_status'] = SupplierChannelModel::SYNC_UNITED_STATUS_OK;
......
...@@ -25,24 +25,26 @@ class SupplierValidator ...@@ -25,24 +25,26 @@ class SupplierValidator
return null; return null;
} }
$isAdd = empty($supplier['supplier_id']) ? true : false; $isAdd = empty($validateData['supplier_id']) ? true : false;
//新增的时候要先去检验下一体化的数据,如果是实体黑名单用户,那么就不允许新增 if ($validateData['supplier_name']) {
$regionType = $validateData['region'] == SupplierChannelModel::REGION_CN ? 1 : 2; //新增的时候要先去检验下一体化的数据,如果是实体黑名单用户,那么就不允许新增
//还要校验提交上来的公司是否有合法信息 $regionType = $validateData['region'] == SupplierChannelModel::REGION_CN ? 1 : 2;
$unitedCompanyInfo = (new CompanyService())->getUnitedCompanyInfo($validateData['supplier_name'], //还要校验提交上来的公司是否有合法信息
$validateData['tax_number'], $unitedCompanyInfo = (new CompanyService())->getUnitedCompanyInfo($validateData['supplier_name'],
$regionType); $validateData['tax_number'],
$unitedInfo = $unitedCompanyInfo['united_company_info']; $regionType);
if ($unitedInfo && $isAdd) { $unitedInfo = $unitedCompanyInfo['united_company_info'];
if ($unitedInfo['is_entity'] == 1) { if ($unitedInfo && $isAdd) {
return '该供应商已经被一体化系统加入黑名单,不能新增'; if ($unitedInfo['is_entity'] == 1) {
}
if ($unitedInfo['company_category'] != '') {
if ($unitedInfo['company_category'] != '普通供应商') {
return '该供应商已经被一体化系统加入黑名单,不能新增'; return '该供应商已经被一体化系统加入黑名单,不能新增';
} }
if ($unitedInfo['company_category'] != '') {
if ($unitedInfo['company_category'] != '普通供应商') {
return '该供应商已经被一体化系统加入黑名单,不能新增';
}
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment