Commit d5b8cbec by 杨树贤

同步逻辑

parent f8d5505d
......@@ -112,6 +112,12 @@ class SupplierAuditService
}
}
}
if (!empty($supplier['group_code'])) {
//同步到一体化
(new SyncSupplierService())->syncSupplierToErp($supplierId);
}
return $result;
}
......
......@@ -33,7 +33,7 @@ class SyncSupplierService
return false;
}
if (!$supplier['group_code']) {
if (!$supplier['group_code'] && $supplier['status'] != SupplierChannelModel::STATUS_PASSED) {
return true;
}
......@@ -124,7 +124,7 @@ class SyncSupplierService
'recid' => $receipt['receipt_id'],
'intermediaryBank' => $receipt['intermediary_bank'],
'remark' => $receipt['remark'],
'country_isocode' => !empty($receipt['nation']['international_code']) ? $receipt['nation']['international_code']: "",
'country_isocode' => !empty($receipt['nation']['international_code']) ? $receipt['nation']['international_code'] : "",
];
}
}
......@@ -365,14 +365,14 @@ class SyncSupplierService
}
//修改供应商的状态
SupplierChannelModel::where('supplier_id', $supplierId)
->update([
'is_entity' => $isEntityResult,
'update_time' => time(),
//这里的逻辑是,因为取消实体名单以后,如果之前的状态是黑名单的话,直接变成待提审
'status' => $isEntity ? SupplierChannelModel::STATUS_DISABLE : ($preStatus == SupplierChannelModel::STATUS_BLOCK ? SupplierChannelModel::STATUS_IN_REVIEW : $preStatus),
'disable_reason' => $reason,
'united_tags' => !empty($tagList) ? implode(',', $tagList) : '',
]);
->update([
'is_entity' => $isEntityResult,
'update_time' => time(),
//这里的逻辑是,因为取消实体名单以后,如果之前的状态是黑名单的话,直接变成待提审
'status' => $isEntity ? SupplierChannelModel::STATUS_DISABLE : ($preStatus == SupplierChannelModel::STATUS_BLOCK ? SupplierChannelModel::STATUS_IN_REVIEW : $preStatus),
'disable_reason' => $reason,
'united_tags' => !empty($tagList) ? implode(',', $tagList) : '',
]);
$isYunxinSupplier = false;
//还要去修改对应的供应商账号,也是要记录禁用前的状态
$supplierAccount = SupplierAccountModel::where('supplier_id', $supplierId)->first();
......
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