Commit 9a3106a2 by 杨树贤

自动创建时机修改

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