Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
410da8a8
authored
May 19, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
部分
parent
7115c632
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
app/Http/Services/SupplierAuditService.php
app/Http/Services/SupplierAuditService.php
View file @
410da8a8
...
...
@@ -8,6 +8,7 @@ use App\Model\LogModel;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierContactModel
;
use
App\Http\Services\CrmService
;
use
Illuminate\Support\Facades\DB
;
class
SupplierAuditService
{
...
...
@@ -603,23 +604,40 @@ class SupplierAuditService
*/
public
function
auditCustomerConvertSupplier
(
$supplierId
,
$approvalStatus
,
$remark
,
$channelUid
=
''
)
{
// 获取审核单据信息
$auditBillInfo
=
AuditCenterService
::
getAuditInfoByIdAndType
(
$supplierId
,
AuditCenterService
::
TYPE_CUSTOMER_CONVERT_SUPPLIER_AUDIT
);
if
(
empty
(
$auditBillInfo
))
{
throw
new
\Exception
(
"客户转化供应商审核单据不存在"
);
}
// 使用审核中心流程
$result
=
$this
->
auditCustomerConvertByAuditCenter
(
$auditBillInfo
[
'id'
],
$approvalStatus
,
$remark
,
$channelUid
);
return
$result
?
true
:
false
;
}
/**
* 客户转化供应商 - 通过审核中心审核
*/
private
function
auditCustomerConvertByAuditCenter
(
$billId
,
$approvalStatus
,
$remark
,
$channelUid
=
''
)
{
$billInfo
=
AuditCenterService
::
getAuditInfoByBillId
(
$billId
);
if
(
empty
(
$billInfo
))
{
throw
new
\Exception
(
"单据不存在"
);
}
$approvalUid
=
request
()
->
user
->
userId
;
// 调用审核中心审核接口
if
(
in_array
(
$
auditB
illInfo
[
'approval_status'
],
[
if
(
in_array
(
$
b
illInfo
[
'approval_status'
],
[
AuditCenterService
::
APPROVAL_STATUS_WAIT
,
AuditCenterService
::
APPROVAL_STATUS_ING
]))
{
$
auditBillInfo
=
AuditCenterService
::
audit
(
$auditBillInfo
[
'id'
]
,
$approvalUid
,
$approvalStatus
,
$remark
);
$
billInfo
=
AuditCenterService
::
audit
(
$billId
,
$approvalUid
,
$approvalStatus
,
$remark
);
}
// 处理审核结果
$this
->
handleCustomerConvertAuditResult
(
$
supplierId
,
$auditB
illInfo
,
$approvalStatus
,
$remark
,
$channelUid
);
$this
->
handleCustomerConvertAuditResult
(
$
billInfo
[
'source_id'
],
$b
illInfo
,
$approvalStatus
,
$remark
,
$channelUid
);
return
true
;
}
...
...
@@ -629,6 +647,7 @@ class SupplierAuditService
*/
private
function
handleCustomerConvertAuditResult
(
$supplierId
,
$billInfo
,
$approvalStatus
,
$remark
,
$channelUid
=
''
)
{
DB
::
connection
(
'web'
)
->
transaction
(
function
()
use
(
$supplierId
,
$billInfo
,
$approvalStatus
,
$remark
,
$channelUid
)
{
$approverName
=
request
()
->
user
->
name
;
if
(
$approvalStatus
==
1
)
{
// 通过
if
(
$billInfo
[
'approval_status'
]
==
AuditCenterService
::
APPROVAL_STATUS_FINISH
)
{
...
...
@@ -688,6 +707,7 @@ class SupplierAuditService
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'客户转化供应商审核'
,
$logContent
);
}
}
});
}
//获取审核流程
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment