Commit 9a3106a2 by 杨树贤

自动创建时机修改

parent ae9c9433
......@@ -33,6 +33,8 @@ class SupplierAuditService
'need_review' => 0,
'reject_reason' => $rejectReason,
];
//自动创建芯链账号
SupplierAccountService::autoCreateYunxinAccount($supplierId);
$result = $model->where('supplier_id', $supplierId)->update($update);
//如果是待复审状态,通过的话还要将是否需要复审状态置为0
......@@ -45,6 +47,8 @@ class SupplierAuditService
'need_review' => 0,
]);
$supplier['need_review'] = 0;
//自动创建芯链账号
SupplierAccountService::autoCreateYunxinAccount($supplierId);
} else {
$result = $model->where('supplier_id', $supplierId)->update([
'update_time' => time(),
......@@ -88,8 +92,11 @@ class SupplierAuditService
(new SyncSupplierService())->syncSupplierToUnited($supplierId);
} else {
$supplier['tax_number'] = $supplier['supplier_name'] ?: $supplier['tax_number'];
$company = (new CompanyService())->getCompanyInfo($supplier['supplier_name'],
$supplier['tax_number'], $regionType);
$company = (new CompanyService())->getCompanyInfo(
$supplier['supplier_name'],
$supplier['tax_number'],
$regionType
);
if (!empty($company)) {
if (!empty($company['tax_number'])) {
SupplierChannelModel::where('supplier_id', $supplierId)->update([
......@@ -171,8 +178,10 @@ class SupplierAuditService
$departmentService = new DepartmentService();
$subordinateUserIds = $departmentService->getSubordinateUserIds($auditUserId);
if (in_array($lastUpdateUserId, $subordinateUserIds) || in_array($supplier['create_uid'],
$subordinateUserIds)) {
if (in_array($lastUpdateUserId, $subordinateUserIds) || in_array(
$supplier['create_uid'],
$subordinateUserIds
)) {
return true;
}
return false;
......@@ -304,6 +313,5 @@ class SupplierAuditService
} else {
return false;
}
}
}
......@@ -340,9 +340,6 @@ class SupplierService
return $supplierId;
});
//自动创建芯链账号
SupplierAccountService::autoCreateYunxinAccount($supplierId);
//保存日志
$newSupplier = $model->where('supplier_id', $this->newSupplierId)->first();
$newSupplier = $supplierTransformer->transformInfo($newSupplier);
......
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