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
e5a97e7d
authored
Jun 25, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
解决冲突
parents
9898f02a
c3643f04
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
113 additions
and
10 deletions
app/Console/Commands/SetSupplierFollowUp.php
app/Http/Services/AdminUserService.php
app/Http/Services/DataService.php
app/Http/Services/SupplierAttachmentService.php
app/Http/Services/SupplierService.php
app/Http/Validators/SupplierValidator.php
config/field.php
resources/views/web/PrintSupplier.blade.php
app/Console/Commands/SetSupplierFollowUp.php
View file @
e5a97e7d
...
...
@@ -38,7 +38,7 @@ class SetSupplierFollowUp extends Command
// $service->importSupplierGroup(true);
// $service->changeSupplierType();
// $service->generateYunxinAccount(true);
$service
->
dealYunxinAccountCreateTime
();
$service
->
exportSupplierForUnionData
();
// $service->makeSupplierSystemTagAbnormal();
}
}
app/Http/Services/AdminUserService.php
View file @
e5a97e7d
...
...
@@ -20,6 +20,14 @@ class AdminUserService
return
$userInfoModel
->
where
(
'userId'
,
$adminId
)
->
first
();
}
public
function
getAdminUserListByCodeIds
(
$codeIds
=
[])
{
$intraCodeModel
=
new
IntracodeModel
();
$userInfoModel
=
new
UserInfoModel
();
$adminIds
=
$intraCodeModel
->
whereIn
(
'code_id'
,
$codeIds
)
->
pluck
(
'admin_id'
);
return
$userInfoModel
->
whereIn
(
'userId'
,
$adminIds
)
->
get
()
->
toArray
();
}
public
function
getCodeIdByUserName
(
$userName
)
{
$userId
=
UserInfoModel
::
where
(
'name'
,
$userName
)
->
value
(
'userId'
);
...
...
@@ -54,7 +62,7 @@ class AdminUserService
{
$userInfoModel
=
new
UserInfoModel
();
$count
=
$userInfoModel
->
leftJoin
(
'lie_intracode'
,
'user_info.userId'
,
'='
,
'lie_intracode.admin_id'
)
->
where
(
'lie_intracode.code_id'
,
$codeId
)
->
where
(
'lie_intracode.code_id'
,
$codeId
)
->
where
(
'user_info.status'
,
4
)
->
where
(
'lie_intracode.code_id'
,
'!='
,
''
)
->
count
();
return
(
bool
)
$count
;
}
...
...
app/Http/Services/DataService.php
View file @
e5a97e7d
...
...
@@ -5,6 +5,7 @@ namespace App\Http\Services;
//后台用户相关信息服务
use
App\Http\Transformers\SupplierContactTransformer
;
use
App\Http\Transformers\SupplierTransformer
;
use
App\Model\DepartmentModel
;
use
App\Model\IntracodeModel
;
use
App\Model\LogModel
;
use
App\Model\RedisModel
;
...
...
@@ -461,6 +462,61 @@ class DataService
}
}
}
}
//导出供应商
public
function
exportSupplierForUnionData
()
{
$suppliers
=
SupplierChannelModel
::
select
([
'supplier_id'
,
'supplier_code'
,
'supplier_name'
,
'channel_uid'
,
'create_time'
,
])
->
where
(
'is_type'
,
0
)
->
whereRaw
(
'supplier_name NOT LIKE "%-1"'
)
->
get
();
$excelData
=
[];
$header
=
[
'ID'
,
'原系统供应商名称'
,
'标准供应商名称'
,
'创建时间'
,
'采购'
,
'部门组别'
,
'所有采购'
,
];
foreach
(
$suppliers
as
$supplier
)
{
$firstChannelUserName
=
$firstChannelUserDepartmentName
=
$allChannelUserName
=
''
;
$channelUids
=
$supplier
[
'channel_uid'
]
?
explode
(
','
,
$supplier
[
'channel_uid'
])
:
[];
if
(
$channelUids
)
{
$channelUsers
=
(
new
AdminUserService
())
->
getAdminUserListByCodeIds
(
$channelUids
);
if
(
!
empty
(
$channelUsers
))
{
$firstChannelUser
=
$channelUsers
[
0
];
$firstChannelUserDepartmentName
=
(
new
DepartmentModel
())
->
where
(
'department_id'
,
$firstChannelUser
[
'department_id'
])
->
value
(
'department_name'
);
$firstChannelUserName
=
$firstChannelUser
[
'name'
];
$allChannelUserName
=
implode
(
','
,
array_column
(
$channelUsers
,
'name'
));
}
}
$itemData
=
[
$supplier
[
'supplier_id'
],
$supplier
[
'supplier_name'
],
''
,
$supplier
[
'create_time'
]
?
date
(
'Y-m-d H:i:s'
,
$supplier
[
'create_time'
])
:
''
,
$firstChannelUserName
,
$firstChannelUserDepartmentName
,
$allChannelUserName
,
];
$excelData
[]
=
$itemData
;
}
array_unshift
(
$excelData
,
$header
);
Excel
::
create
(
'供应商导出'
,
function
(
$excel
)
use
(
$excelData
)
{
$excel
->
sheet
(
'sheet1'
,
function
(
$sheet
)
use
(
$excelData
)
{
$sheet
->
fromArray
(
$excelData
);
});
})
->
export
(
'csv'
);
}
}
app/Http/Services/SupplierAttachmentService.php
View file @
e5a97e7d
...
...
@@ -73,7 +73,7 @@ class SupplierAttachmentService
'create_uid'
=>
request
()
->
user
->
userId
,
'create_time'
=>
time
(),
'create_name'
=>
request
()
->
user
->
name
,
'description'
=>
$attachmentData
[
'description'
][
$key
]
,
'description'
=>
!
empty
(
$attachmentData
[
'description'
][
$key
])
?
$attachmentData
[
'description'
][
$key
]
:
' '
,
'type_name'
=>
array_get
(
config
(
'fixed.FileNameMapping'
),
$attachmentData
[
'field_name'
][
$key
]),
];
if
(
!
empty
(
$attachmentData
[
'validity_period'
][
$key
]))
{
...
...
app/Http/Services/SupplierService.php
View file @
e5a97e7d
...
...
@@ -500,6 +500,7 @@ class SupplierService
{
$model
=
new
SupplierChannelModel
();
$result
=
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'supplier_type'
=>
1
,
'update_time'
=>
time
(),
'is_type'
=>
$isType
,
'status'
=>
SupplierChannelModel
::
STATUS_PENDING
,
...
...
app/Http/Validators/SupplierValidator.php
View file @
e5a97e7d
...
...
@@ -36,6 +36,10 @@ class SupplierValidator
}
else
{
$count
=
SupplierChannelModel
::
where
(
'supplier_name'
,
$validateData
[
'supplier_name'
])
->
where
(
'supplier_id'
,
'!='
,
$supplierId
)
->
count
();
//特殊处理下一些已经重复的供应商,历史数据问题
if
(
in_array
(
$supplierId
,
config
(
'field.NeedSkipSupplierNameCheckIds'
)))
{
$count
=
0
;
}
}
if
(
$count
)
{
return
"该供应商名称已经存在,请核验后再提交"
;
...
...
@@ -235,6 +239,10 @@ class SupplierValidator
}
else
{
$count
=
SupplierChannelModel
::
where
(
'supplier_name'
,
$validateData
[
'supplier_name'
])
->
where
(
'supplier_id'
,
'!='
,
$supplierId
)
->
count
();
//特殊处理下一些已经重复的供应商,历史数据问题
if
(
in_array
(
$supplierId
,
config
(
'field.NeedSkipSupplierNameCheckIds'
)))
{
$count
=
0
;
}
}
if
(
$count
)
{
$errorMessageList
[]
=
"该供应商名称已经存在,请核验后再提交"
;
...
...
config/field.php
View file @
e5a97e7d
...
...
@@ -177,5 +177,10 @@ return [
'原厂'
=>
'原厂'
,
'分销平台'
=>
'分销平台'
,
'代工厂'
=>
'代工厂'
,
],
//需要跳过重复校验的供应商ID
'NeedSkipSupplierNameCheckIds'
=>
[
195
,
12263
]
];
\ No newline at end of file
resources/views/web/PrintSupplier.blade.php
View file @
e5a97e7d
...
...
@@ -7,7 +7,7 @@
</head>
<style>
td
{
height
:
3
5
px
!important
;
height
:
3
2
px
!important
;
}
/*.title-td {*/
...
...
@@ -89,6 +89,30 @@
style=
"text-align: left;padding-left: 20px"
>
{{$printData['tax_number']}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
注册资金
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['registered_capital']?$printData['registered_capital'].'万':''}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
是否历史经营异常
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
@if ($printData['is_business_abnormal']==1)
是
@elseif ($printData['is_business_abnormal']==-1)
否
@else
@endif
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
供应商营业税号
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['tax_number']}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
供应商成立时间*
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['established_time']}}
</td>
...
...
@@ -114,11 +138,11 @@
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
账期详情*
</td>
{{--
<td
width=
"20%"
colspan=
"1"
></td>
--}}
{{--
<td
width=
"20%"
colspan=
"1"
></td>
--}}
<td
width=
"80%"
colspan=
"5"
>
{{$printData['pay_type_name'] or ''}}
</td>
{{-- style="text-align: left;padding-left: 20px">{{$printData['pay_type_name'] or ''}}
</td>
--}}
{{--
<td
width=
"80%"
colspan=
"5"
--
}}
{{
--
style=
"text-align: left;padding-left: 20px"
></td>
--}}
{{-- style="text-align: left;padding-left: 20px">{{$printData['pay_type_name'] or ''}}
</td>
--}}
{{--
<td
width=
"80%"
colspan=
"5"
--
}}
{{
--
style=
"text-align: left;padding-left: 20px"
></td>
--}}
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
业务负责人
</td>
...
...
@@ -151,7 +175,7 @@
</tr>
</table>
<table
border=
"1"
style=
"width: 100%;"
>
<table
border=
"1"
style=
"width: 100%;"
>
<tr>
<td
width=
"16.6%"
colspan=
"1"
>
主管审批 :
</td>
<td
width=
"16.6%"
colspan=
"1"
></td>
...
...
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