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
8a3bb2d6
authored
Mar 02, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
fb0a82ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
31 deletions
app/Http/Services/SupplierService.php
app/Http/Services/SupplierService.php
View file @
8a3bb2d6
...
...
@@ -1334,12 +1334,13 @@ class SupplierService
foreach
(
$suppliers
as
$supplier
)
{
try
{
$result
[
'total'
]
++
;
$supplierId
=
$supplier
->
supplier_id
;
$yunxinChannelUid
=
$supplier
->
yunxin_channel_uid
;
// 实时输出进度
echo
"[
{
$result
[
'total'
]
}
] ID:
{
$supplierId
}
{
$supplier
->
supplier_name
}
... "
;
// 调用autoAssignPurchaseUser处理分配逻辑
$assignResult
=
$supplierService
->
autoAssignPurchaseUser
(
$supplierId
,
$yunxinChannelUid
,
$isProdMode
);
...
...
@@ -1347,21 +1348,13 @@ class SupplierService
// 判断是跳过还是真正分配了
if
(
strpos
(
$assignResult
[
'reason'
],
'跳过'
)
!==
false
)
{
$result
[
'skipped'
]
++
;
echo
"跳过
\n
"
;
$result
[
'debug_info'
][]
=
[
'supplier_id'
=>
$supplierId
,
'supplier_code'
=>
$supplier
->
supplier_code
,
'supplier_name'
=>
$supplier
->
supplier_name
,
'skip_reason'
=>
$assignResult
[
'reason'
],
];
if
(
$progressCallback
)
{
$progressCallback
([
'supplier_id'
=>
$supplierId
,
'supplier_name'
=>
$supplier
->
supplier_name
,
'action'
=>
'跳过:'
.
$assignResult
[
'reason'
],
'status'
=>
'skip'
,
]);
}
}
else
{
$result
[
'success'
]
++
;
$assignCodeIds
=
isset
(
$assignResult
[
'debug_info'
][
'assign_code_ids'
])
?
$assignResult
[
'debug_info'
][
'assign_code_ids'
]
:
[];
...
...
@@ -1380,6 +1373,8 @@ class SupplierService
$isNew
=
(
$liexinCount
==
count
(
$assignCodeIds
)
&&
$followerCount
==
count
(
$assignCodeIds
));
$action
=
'新增'
.
$liexinCount
.
'个猎芯采购,'
.
$followerCount
.
'个数据跟单员'
;
echo
"成功
{
$action
}
采购员:"
.
implode
(
','
,
$assignNames
)
.
"
\n
"
;
$result
[
'details'
][]
=
[
'supplier_id'
=>
$supplierId
,
'supplier_code'
=>
$supplier
->
supplier_code
,
...
...
@@ -1391,38 +1386,20 @@ class SupplierService
'need_assign_liexin'
=>
$liexinCount
,
'need_assign_follower'
=>
$followerCount
,
];
// 回调进度
if
(
$progressCallback
)
{
$progressCallback
([
'supplier_id'
=>
$supplierId
,
'supplier_name'
=>
$supplier
->
supplier_name
,
'action'
=>
'成功:'
.
$action
,
'status'
=>
'success'
,
]);
}
}
}
else
{
$result
[
'failed'
]
++
;
echo
"失败:
{
$assignResult
[
'reason'
]
}
\n
"
;
$result
[
'debug_info'
][]
=
[
'supplier_id'
=>
$supplierId
,
'supplier_code'
=>
$supplier
->
supplier_code
,
'supplier_name'
=>
$supplier
->
supplier_name
,
'fail_reason'
=>
$assignResult
[
'reason'
],
];
// 回调进度
if
(
$progressCallback
)
{
$progressCallback
([
'supplier_id'
=>
$supplierId
,
'supplier_name'
=>
$supplier
->
supplier_name
,
'action'
=>
'失败:'
.
$assignResult
[
'reason'
],
'status'
=>
'failed'
,
]);
}
}
}
catch
(
\Exception
$e
)
{
$result
[
'failed'
]
++
;
echo
"异常: "
.
$e
->
getMessage
()
.
"
\n
"
;
$result
[
'debug_info'
][]
=
[
'supplier_id'
=>
isset
(
$supplierId
)
?
$supplierId
:
0
,
'supplier_code'
=>
isset
(
$supplier
->
supplier_code
)
?
$supplier
->
supplier_code
:
''
,
...
...
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