Commit 2600ef53 by 杨树贤

优化接收

parent 52f32859
......@@ -98,7 +98,7 @@ class SupplierSyncController extends BaseSyncController
$this->syncResponse(0, '获取审核结果广播成功');
}
(new SyncSupplierService())->receiveEntityResult($resultData['company_name'], $resultData['result'], $resultData['tag_list']);
(new SyncSupplierService())->receiveEntityResult($resultData);
$this->syncResponse(0, '获取审核结果广播成功');
}
......
......@@ -93,7 +93,7 @@ class SupplierAddressService
if ($oldSupplierAddress != $supplierAddress) {
$changedAddress[] = [
'source_id' => $supplierId,
'source_code' => $supplierId,
'source_code' => $supplier['supplier_code'],
'address_type' => '供应商地址',
'address' => $supplierAddress,
];
......@@ -125,10 +125,11 @@ class SupplierAddressService
'address_data' => $changedAddress,
];
$url = config('website.UnitedDataDomain') . '/sync/updateAddress';
$url = config('website.UnitedDataDomain') . '/sync/Address/updateAddress';
//dd($params);
$result = curl($url, $params);
$result = json_decode($result, true);
\Log::error($result);
if (array_get($result, 'code') != 0) {
\Log::error('更新一体化地址库失败 : ' . json_encode($result));
}
......
......@@ -254,7 +254,9 @@ class SyncSupplierService
//根据result,修改供应商的是否是实体名单字段
$isEntity = ($result == 1) ? false : true;
$isEntityResult = SupplierChannelModel::IS_ENTITY_FALSE; //默认不是实体名单
$resultData['warning_type'] = $resultData['warning_type'] == 1 ? '供应商名称' : '地址';
$warningType = array_get($resultData, 'warning_type') == 1 ? '供应商名称' : '地址';
$warningKeyword = array_get($resultData, 'warning_keyword', '无');
$warningData = array_get($resultData, 'warning_data', '无');
//我这里的状态和一体化的结果判断有点对不上,因为我这把是(是否实体名单),而一体化那边是实体名单是否通过,所以要转换
if ($result == 1) {
$isEntityResult = SupplierChannelModel::IS_ENTITY_FALSE;
......@@ -262,15 +264,15 @@ class SyncSupplierService
} else {
if ($result == -1) {
$isEntityResult = SupplierChannelModel::IS_ENTITY_TRUE;
$logContent = $reason = "属于实体名单,系统自动拉入黑名单. 风险类型 : {$resultData['warning_type']} 风险词 : {$resultData['warning_keyword']} 风险数据 : {$resultData['warning_data']}";
$logContent = $reason = "属于实体名单,系统自动拉入黑名单. 风险类型 : $warningType 风险词 : $warningKeyword 风险数据 : $warningData";
}
if ($result == 0) {
$isEntityResult = SupplierChannelModel::IS_ENTITY_NEED_CONFIRM;
$logContent = $reason = "待确认实体名单,系统自动拉入禁止交易,请联系“风控部门”进行确认. 风险类型 : {$resultData['warning_type']} 风险词 : {$resultData['warning_keyword']} 风险数据 : {$resultData['warning_data']}";
$logContent = $reason = "待确认实体名单,系统自动拉入禁止交易,请联系“风控部门”进行确认. 风险类型 : {$resultData['warning_type']} 风险词 : $warningKeyword 风险数据 : $warningData";
}
if ($result == -3) {
$isEntityResult = SupplierChannelModel::IS_ENTITY_REJECT;
$logContent = $reason = "被驳回供应商,系统自动拉入禁止交易,请联系“风控部门”进行确认. 风险类型 : {$resultData['warning_type']} 风险词 : {$resultData['warning_keyword']} 风险数据 : {$resultData['warning_data']}";
$logContent = $reason = "被驳回供应商,系统自动拉入禁止交易,请联系“风控部门”进行确认. 风险类型 : {$resultData['warning_type']} 风险词 : $warningKeyword 风险数据 : $warningData";
}
}
......
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