Commit 6936c1c4 by 杨树贤

实体化修改逻辑修改

parent 89b4f401
Showing with 3 additions and 14 deletions
...@@ -185,28 +185,17 @@ class SyncSupplierService ...@@ -185,28 +185,17 @@ class SyncSupplierService
if ($companyCategory == '黑名单供应商') { if ($companyCategory == '黑名单供应商') {
$data['status'] = SupplierChannelModel::STATUS_BLOCK; $data['status'] = SupplierChannelModel::STATUS_BLOCK;
$data['block_reason'] = '一体化系统黑名单供应商'; $data['block_reason'] = '一体化系统黑名单供应商';
}else if ($companyCategory == '实体名单供应商') { } else if ($companyCategory == '实体名单供应商') {
$status = $supplier['status']; $this->receiveEntityResult($supplier['supplier_name'], -1);
//加入实体化之前,要先记录原来的状态
if (!$redis->hget('supplier_status_before_disable', $supplierId)) {
$redis->hset('supplier_status_before_disable', $supplierId, $status);
}
$data['status'] = SupplierChannelModel::STATUS_DISABLE;
$data['is_entity'] = SupplierChannelModel::IS_ENTITY_TRUE;
$data['block_reason'] = '';
$data['disable_reason'] = '一体化系统实体名单供应商';
} 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); $this->receiveEntityResult($supplier['supplier_name'], 1);
$data['status'] = $cacheStatus ?: SupplierChannelModel::STATUS_IN_REVIEW;
$data['is_entity'] = -1;
} }
} }
} }
......
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