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
8d0c13e8
authored
May 29, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
审批流重新生成问题
parent
0ba3f372
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
15 deletions
app/Http/Controllers/Sync/SupplierSyncController.php
app/Http/Services/SupplierAuditService.php
app/Http/Controllers/Sync/SupplierSyncController.php
View file @
8d0c13e8
...
...
@@ -170,7 +170,7 @@ class SupplierSyncController extends BaseSyncController
'creator_name'
=>
'required'
,
'apply_uid'
=>
'required'
,
];
Log
::
info
(
'[CRM同步]参数'
,
$data
);
$validator
=
Validator
::
make
(
$data
,
$rules
);
if
(
$validator
->
fails
())
{
$error
=
$validator
->
errors
()
->
first
();
...
...
@@ -193,16 +193,18 @@ class SupplierSyncController extends BaseSyncController
&&
$existingSupplier
[
'status'
]
==
SupplierChannelModel
::
STATUS_CRM_REJECTED
)
{
try
{
// 先更新状态为待确认
SupplierChannelModel
::
where
(
'supplier_id'
,
$existingSupplier
[
'supplier_id'
])
->
update
([
'status'
=>
SupplierChannelModel
::
STATUS_CONFIRM
,
'update_time'
=>
time
(),
]);
// 然后更新供应商信息
$this
->
updateCrmSupplier
(
$existingSupplier
,
$data
);
// 重新发起审核流(addApproveForCustomerConvert 内部已处理幂等:旧单据终态时会创建新单据)
$auditService
=
new
SupplierAuditService
();
$auditService
->
addApproveForCustomerConvert
(
$existingSupplier
[
'supplier_id'
],
$data
[
'apply_uid'
],
'客户转化供应商审核'
);
DB
::
connection
(
'web'
)
->
transaction
(
function
()
use
(
$existingSupplier
,
$data
)
{
// 先更新状态为待确认
SupplierChannelModel
::
where
(
'supplier_id'
,
$existingSupplier
[
'supplier_id'
])
->
update
([
'status'
=>
SupplierChannelModel
::
STATUS_CONFIRM
,
'update_time'
=>
time
(),
]);
// 然后更新供应商信息
$this
->
updateCrmSupplier
(
$existingSupplier
,
$data
);
// 重新发起审核流(addApproveForCustomerConvert 内部已处理幂等:旧单据终态时会创建新单据)
$auditService
=
new
SupplierAuditService
();
$auditService
->
addApproveForCustomerConvert
(
$existingSupplier
[
'supplier_id'
],
$data
[
'apply_uid'
],
'客户转化供应商审核'
);
});
$this
->
syncResponse
(
0
,
'CRM重新同步,状态已恢复为待确认并更新信息,已重新发起审核'
,
[
'supplier_id'
=>
$existingSupplier
[
'supplier_id'
]]);
LogService
::
AddLog
(
$existingSupplier
[
'supplier_id'
],
LogModel
::
UPDATE_OPERATE
,
'CRM重新同步'
,
'CRM重新同步,状态已恢复为待确认并更新信息,已重新发起审核'
);
}
catch
(
\Exception
$e
)
{
...
...
@@ -540,4 +542,4 @@ class SupplierSyncController extends BaseSyncController
$this
->
syncResponse
(
-
1
,
'更新失败: '
.
$e
->
getMessage
());
}
}
}
}
\ No newline at end of file
app/Http/Services/SupplierAuditService.php
View file @
8d0c13e8
...
...
@@ -583,9 +583,10 @@ class SupplierAuditService
// 先获取审核流节点数据
$flowInfo
=
AuditCenterService
::
getAuditFlowInfo
(
AuditCenterService
::
TYPE_CUSTOMER_CONVERT_SUPPLIER_AUDIT
,
array_get
(
request
()
->
user
,
'userId'
,
1000
)
,
$applyUid
,
1
);
// dd($flowInfo);
// 创建审批单据
$billInfo
=
AuditCenterService
::
addAudit
([
"flow_id"
=>
$flowInfo
[
'flow_info'
][
'id'
],
...
...
@@ -732,4 +733,4 @@ class SupplierAuditService
);
return
$flowInfo
;
}
}
\ No newline at end of file
}
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