Commit c34fc6f0 by 杨树贤

优化逻辑

parent 0b811c38
Showing with 18 additions and 14 deletions
......@@ -224,18 +224,10 @@ class SyncSupplierService
public function receiveEntityResult($supplierName, $result, $tagList)
{
Log::warning('一体化拉黑结果 : ' . ($supplierName . '---' . $result));
//先找到对应的供应商(草稿的跳过),如果没有那跳过
$supplier = SupplierChannelModel::where('supplier_name', $supplierName)
->where('status', '!=', SupplierChannelModel::STATUS_PENDING)->first();
if (empty($supplier)) {
return;
}
$supplier = $supplier->toArray();
$supplierId = $supplier['supplier_id'];
//先把修改之前的状态给记录下来
$status = $supplier['status'];
//然后根据result,修改供应商的是否是实体名单字段
//根据result,修改供应商的是否是实体名单字段
$isEntity = ($result == 1) ? false : true;
$isEntityResult = SupplierChannelModel::IS_ENTITY_FALSE; //默认不是实体名单
//我这里的状态和一体化的结果判断有点对不上,因为我这把是(是否实体名单),而一体化那边是实体名单是否通过,所以要转换
if ($result == 1) {
......@@ -255,6 +247,21 @@ class SyncSupplierService
$logContent = $reason = '被驳回供应商,系统自动拉入禁止交易,请联系“风控部门”进行确认';
}
}
//去修改供应商入驻相关的数据
(new ChainService())->changeChainIsEntity($supplierName, $isEntityResult);
//先找到对应的供应商(草稿的跳过),如果没有那跳过
$supplier = SupplierChannelModel::where('supplier_name', $supplierName)
->where('status', '!=', SupplierChannelModel::STATUS_PENDING)->first();
if (empty($supplier)) {
return true;
}
$supplier = $supplier->toArray();
$supplierId = $supplier['supplier_id'];
//先把修改之前的状态给记录下来
$status = $supplier['status'];
$preStatus = null;
$redis = new RedisModel();
if ($isEntity) {
......@@ -304,9 +311,6 @@ class SyncSupplierService
]);
}
//去修改供应商入驻相关的数据
(new ChainService())->changeChainIsEntity($supplierName, $isEntityResult);
//还要去打日志
$logService = new LogService();
$logService->AddAdminLog($supplierId, LogModel::UPDATE_OPERATE, '实体名单设置', $logContent);
......
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