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
24340f5d
authored
May 28, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' into ysx-共用申请优化-20250524
parents
49541a37
c84b9b59
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
30 deletions
app/Http/Controllers/Filter/SupplierContractFilter.php
app/Http/Services/DataService.php
app/Http/Services/SupplierContractService.php
app/Http/routes.php
resources/views/web/SupplierContractList.blade.php
app/Http/Controllers/Filter/SupplierContractFilter.php
View file @
24340f5d
...
...
@@ -12,7 +12,12 @@ class SupplierContractFilter
{
$map
=
$request
->
all
();
$model
=
new
SupplierContractModel
();
$query
=
$model
->
with
(
'supplier'
)
->
where
(
'create_uid'
,
$request
->
user
->
userId
)
->
orderBy
(
'id'
,
'desc'
);
$query
=
$model
->
with
(
'supplier'
);
$userId
=
$request
->
user
->
userId
;
if
(
$userId
!=
1000
)
{
$query
=
$query
->
where
(
'create_uid'
,
$userId
);
}
$query
=
$query
->
orderBy
(
'id'
,
'desc'
);
if
(
!
empty
(
$map
[
'supplier_code'
]))
{
$supplierId
=
SupplierChannelModel
::
where
(
'supplier_code'
,
$map
[
'supplier_code'
])
->
value
(
'supplier_id'
);
$query
->
where
(
'supplier_id'
,
$supplierId
);
...
...
app/Http/Services/DataService.php
View file @
24340f5d
...
...
@@ -3,31 +3,32 @@
namespace
App\Http\Services
;
//后台用户相关信息服务
use
App\Http\Transformers\SupplierTransformer
;
use
App\Model\BigData\DataManageModel
;
use
App\Model\DepartmentModel
;
use
App\Model\IntracodeModel
;
use
Carbon\Carbon
;
use
GuzzleHttp\Client
;
use
App\Model\LogModel
;
use
App\Model\Purchase\PurchaseOrderModel
;
use
App\Model\RedisModel
;
use
App\Model\SkuUploadItem
;
use
App\Model\SkuUploadLogModel
;
use
App\Model\SpuBrandModel
;
use
App\Model\StandardBrandMappingModel
;
use
App\Model\UserInfoModel
;
use
App\Model\IntracodeModel
;
use
App\Model\DepartmentModel
;
use
GuzzleHttp\RequestOptions
;
use
App\Model\SkuUploadLogModel
;
use
App\Model\StandardBrandModel
;
use
Illuminate\Support\Facades\DB
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierAddressModel
;
use
App\Model\SupplierAttachmentsModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierContactModel
;
use
App\Model\SupplierReceiptModel
;
use
App\Model\UserInfoModel
;
use
Carbon\Carbon
;
use
GuzzleHttp\Client
;
use
GuzzleHttp\RequestOptions
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\Redis
;
use
App\Model\SupplierContractModel
;
use
Maatwebsite\Excel\Facades\Excel
;
use
Illuminate\Support\Facades\Redis
;
use
App\Model\BigData\DataManageModel
;
use
App\Model\SupplierAttachmentsModel
;
use
App\Model\StandardBrandMappingModel
;
use
App\Model\Purchase\PurchaseOrderModel
;
use
App\Http\Transformers\SupplierTransformer
;
//这个服务是处理数据的,比如导出信息,或者临时修复数据,所以代码会比较多
class
DataService
...
...
@@ -724,4 +725,9 @@ class DataService
}
public
static
function
deleteSupplierContract
()
{
SupplierContractModel
::
where
(
'id'
,
10
)
->
delete
();
}
}
app/Http/Services/SupplierContractService.php
View file @
24340f5d
...
...
@@ -7,11 +7,12 @@ use Barryvdh\DomPDF\PDF;
use
App\Model\SupplierLogModel
;
use
App\Http\Services\LogService
;
use
App\Model\SupplierExtendModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierReceiptModel
;
use
App\Model\SupplierContractModel
;
use
TijsVerkoyen\CssToInlineStyles\Exception
;
use
App\Http\Transformers\SupplierContractTransformer
;
use
App\Http\Controllers\Filter\SupplierContractFilter
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierReceiptModel
;
class
SupplierContractService
{
...
...
@@ -81,12 +82,13 @@ class SupplierContractService
(
new
LogService
())
->
addLog
(
$data
[
'supplier_id'
],
LogModel
::
ADD_OPERATE
,
'合同日志'
,
'新增合同'
);
}
$insertId
=
0
;
if
(
empty
(
$data
[
'id'
]))
{
$data
[
'create_time'
]
=
time
();
$data
[
'create_uid'
]
=
request
()
->
user
->
userId
;
$data
[
'create_name'
]
=
request
()
->
user
->
name
;
$
result
=
SupplierContractModel
::
insertGetId
(
$data
);
$
data
[
'id'
]
=
$result
;
$
insertId
=
SupplierContractModel
::
insertGetId
(
$data
);
$
result
=
$insertId
;
}
else
{
$data
[
'update_time'
]
=
time
();
$data
[
'update_uid'
]
=
request
()
->
user
->
userId
;
...
...
@@ -98,23 +100,31 @@ class SupplierContractService
if
(
$fileData
[
'code'
]
==
0
)
{
$data
[
'contract_file'
]
=
$fileData
[
'data'
][
'oss_file_url'
];
if
(
!
empty
(
$data
[
'id'
]))
{
SupplierContractModel
::
where
(
'id'
,
$data
[
'id'
])
->
update
(
[
$udpateData
=
[
'contract_file'
=>
$fileData
[
'data'
][
'oss_file_url'
],
]);
];
$contractNo
=
SupplierContractModel
::
where
(
'id'
,
$data
[
'id'
])
->
value
(
'contract_no'
);
if
(
empty
(
$contractNo
))
{
$contractNo
=
$this
->
generateContractNo
(
$data
[
'id'
]);
$udpateData
[
'contract_no'
]
=
$contractNo
;
}
SupplierContractModel
::
where
(
'id'
,
$data
[
'id'
])
->
update
(
$udpateData
);
}
else
{
SupplierContractModel
::
insert
([
SupplierContractModel
::
where
(
'id'
,
$insertId
)
->
update
([
'contract_file'
=>
$fileData
[
'data'
][
'oss_file_url'
],
'contract_no'
=>
$this
->
generateContractNo
(
$
data
[
'id'
]
)
'contract_no'
=>
$this
->
generateContractNo
(
$
insertId
)
]);
}
}
else
{
throw
new
Exception
(
$fileData
[
'msg'
]);
}
}
\DB
::
connection
(
'web'
)
->
commit
();
return
true
;
}
catch
(
\Exception
$e
)
{
\DB
::
connection
(
'web'
)
->
rollBack
();
\Log
::
error
(
json_encode
(
$e
->
getMessage
()));
return
false
;
\Log
::
error
(
json_encode
(
$e
->
getMessage
())
.
' '
.
$e
->
getLine
()
);
return
$e
->
getMessage
()
;
}
}
...
...
app/Http/routes.php
View file @
24340f5d
...
...
@@ -17,6 +17,7 @@ use App\Http\Services\CrmService;
use
App\Http\Services\SkuService
;
use
App\Model\SupplierChannelModel
;
use
App\Http\Services\CompanyService
;
use
App\Http\Services\DataService
;
use
Illuminate\Support\Facades\Route
;
use
App\Http\Services\DepartmentService
;
...
...
@@ -89,8 +90,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
SupplierChannelModel
::
where
(
'supplier_id'
,
8956
)
->
update
([
'status'
=>
SupplierChannelModel
::
STATUS_PASSED
,
'is_entity'
=>
SupplierChannelModel
::
IS_ENTITY_FALSE
]);
DataService
::
deleteSupplierContract
();
});
resources/views/web/SupplierContractList.blade.php
View file @
24340f5d
...
...
@@ -58,7 +58,7 @@
<div
class=
"layui-btn-group demoTable"
style=
"margin-top: 15px"
>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"create_contract"
>
生成寄售合同
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"upload_sign_contract_file"
>
上传签署合同
</button>
@if (checkPerm('
Edit
Contract') || isAdmin())
@if (checkPerm('
SaveSupplier
Contract') || isAdmin())
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"edit_contract"
>
编辑
</button>
@endif
</div>
...
...
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