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
49541a37
authored
May 24, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
共用申请部分逻辑修改
parent
bcd14c91
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
app/Http/Controllers/Api/SupplierShareApplyApiController.php
app/Http/Services/SupplierShareApplyService.php
app/Http/Controllers/Api/SupplierShareApplyApiController.php
View file @
49541a37
...
...
@@ -32,6 +32,7 @@ class SupplierShareApplyApiController extends Controller
* 如果该供应商没有sku采购员,有其他采购员,则显示其他采购员对应的采购部门(有几个部门就显示几个部门,不显示运营部)
* 如果该供应商没有sku采购员,也没有采购员,有运营部人员,则显示运营部;
* PS:该供应商完全没有人员,则无法申请共用(同现有流程)
* 如果被申请的供应商类型为待转正,校验后的提示改为:该供应商为待转正的历史数据,无法申请共用,请联系采购总监直接分配采购员
**/
public
function
CheckApplySupplierShare
(
$request
)
{
...
...
@@ -40,14 +41,15 @@ class SupplierShareApplyApiController extends Controller
$this
->
response
(
-
1
,
'供应商名称不能为空'
);
}
$supplierModel
=
new
SupplierChannelModel
();
//下面的处理是为了兼容有问题的数据
if
(
!
empty
(
$supplier
=
$supplierModel
->
where
(
'supplier_name'
,
$supplierName
)
->
where
(
'group_code'
,
'!='
,
''
)
->
first
()))
{
// $supplier = $supplierModel->where('supplier_name', 'like', "%$supplierName%")->whereNotIn('status',
// [SupplierChannelModel::STATUS_DISABLE, SupplierChannelModel::STATUS_REJECT])->first();
}
$supplier
=
$supplierModel
->
where
(
'supplier_name'
,
$supplierName
)
->
first
();
if
(
empty
(
$supplier
))
{
$this
->
response
(
-
1
,
'该供应商名称不存在,请输入正确供应商名称'
);
}
if
(
$supplier
[
'is_type'
]
==
1
)
{
$this
->
response
(
-
1
,
'该供应商为待转正的历史数据,无法申请共用,请联系采购总监直接分配采购员'
);
}
$hasYunxinChannelUid
=
$supplier
[
'yunxin_channel_uid'
]
?
1
:
0
;
$userId
=
$request
->
user
->
userId
;
$codeId
=
$request
->
user
->
codeId
;
...
...
@@ -143,5 +145,4 @@ class SupplierShareApplyApiController extends Controller
}
return
$this
->
response
(
0
,
'审核操作成功'
);
}
}
app/Http/Services/SupplierShareApplyService.php
View file @
49541a37
...
...
@@ -177,9 +177,12 @@ class SupplierShareApplyService
$supplierService
->
autoChangeIsType
(
$supplier
);
//最后同步到erp
$syncService
=
new
SyncSupplierService
();
$syncService
->
syncSupplierToErp
(
$apply
[
'supplier_id'
]);
//如果供应商有集团编码,那么就同步到erp
if
(
!
empty
(
$supplier
[
'group_code'
]))
{
$syncService
->
syncSupplierToErp
(
$apply
[
'supplier_id'
]);
}
}
}
return
$applyModel
->
where
(
'id'
,
$id
)
->
update
(
$apply
);
}
}
\ 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