Commit dea62669 by 杨树贤

日志结果

parent c9087824
Showing with 5 additions and 3 deletions
...@@ -15,6 +15,7 @@ use App\Model\SupplierSyncModel; ...@@ -15,6 +15,7 @@ use App\Model\SupplierSyncModel;
use App\Model\UserInfoModel; use App\Model\UserInfoModel;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use PhpAmqpLib\Connection\AMQPStreamConnection; use PhpAmqpLib\Connection\AMQPStreamConnection;
use PhpAmqpLib\Message\AMQPMessage; use PhpAmqpLib\Message\AMQPMessage;
...@@ -196,14 +197,14 @@ class SyncSupplierService ...@@ -196,14 +197,14 @@ class SyncSupplierService
} else { } else {
$preIsEntity = $supplier['is_entity']; $preIsEntity = $supplier['is_entity'];
//判断原来是拉黑状态,才变成审核中,因为有可能不是修改公司类型,只是修改公司性质 //判断原来是拉黑状态,才变成审核中,因为有可能不是修改公司类型,只是修改公司性质
if ($supplier['status'] == SupplierChannelModel::STATUS_BLOCK ) { if ($supplier['status'] == SupplierChannelModel::STATUS_BLOCK) {
$data['status'] = SupplierChannelModel::STATUS_IN_REVIEW; $data['status'] = SupplierChannelModel::STATUS_IN_REVIEW;
} }
//如果之前是禁用,并且是实体名单,那么就要恢复之前的状态 //如果之前是禁用,并且是实体名单,那么就要恢复之前的状态
if ($supplier['status'] === SupplierChannelModel::STATUS_DISABLE && $preIsEntity == SupplierChannelModel::IS_ENTITY_TRUE) { if ($supplier['status'] === SupplierChannelModel::STATUS_DISABLE && $preIsEntity == SupplierChannelModel::IS_ENTITY_TRUE) {
$cacheStatus = $redis->hget('supplier_status_before_disable', $supplierId); $cacheStatus = $redis->hget('supplier_status_before_disable', $supplierId);
$data['status'] = $cacheStatus?:SupplierChannelModel::STATUS_IN_REVIEW; $data['status'] = $cacheStatus ?: SupplierChannelModel::STATUS_IN_REVIEW;
} }
} }
} }
...@@ -231,9 +232,10 @@ class SyncSupplierService ...@@ -231,9 +232,10 @@ class SyncSupplierService
//加入实体名单后,要做很多事情,比如禁用供应商,也要禁用供应商账号等等,还要记录禁用之前的状态,等到移除实体名单以后,要恢复之前的状态 //加入实体名单后,要做很多事情,比如禁用供应商,也要禁用供应商账号等等,还要记录禁用之前的状态,等到移除实体名单以后,要恢复之前的状态
public function receiveEntityResult($supplierName, $result) public function receiveEntityResult($supplierName, $result)
{ {
Log::warning('一体化拉黑结果 : ' . ($supplierName . '---' . $result));
//先找到对应的供应商(草稿的跳过),如果没有那跳过 //先找到对应的供应商(草稿的跳过),如果没有那跳过
$supplier = SupplierChannelModel::where('supplier_name', $supplierName) $supplier = SupplierChannelModel::where('supplier_name', $supplierName)
->where('status','!=',SupplierChannelModel::STATUS_PENDING)->first(); ->where('status', '!=', SupplierChannelModel::STATUS_PENDING)->first();
if (empty($supplier)) { if (empty($supplier)) {
return; 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