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
df1ecafe
authored
Mar 14, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
全量同步脚本
parent
5fbf44e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
app/Console/Commands/SyncAllSupplierToErp.php
app/Http/Controllers/Api/SupplierReceiptApiController.php
app/Console/Commands/SyncAllSupplierToErp.php
0 → 100644
View file @
df1ecafe
<?php
namespace
App\Console\Commands
;
use
App\Http\Services\DataService
;
use
App\Http\Services\StatisticsSkuUploadService
;
use
App\Http\Services\SupplierService
;
use
App\Http\Services\SyncSupplierService
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Console\Command
;
use
Illuminate\Foundation\Inspiring
;
//设置供应商是否需要跟进
class
SyncAllSupplierToErp
extends
Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected
$signature
=
'sync_all_supplier_to_erp'
;
/**
* The console command description.
*
* @var string
*/
protected
$description
=
'Display an inspiring quote'
;
/**
* Execute the console command.
*
* @return mixed
*/
public
function
handle
()
{
$supplierIds
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
get
();
foreach
(
$supplierIds
as
$supplierId
)
{
(
new
SyncSupplierService
())
->
syncSupplierToErp
(
$supplierId
);
}
}
}
app/Http/Controllers/Api/SupplierReceiptApiController.php
View file @
df1ecafe
...
...
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Api;
use
App\Http\Controllers\Controller
;
use
App\Http\Services\LogService
;
use
App\Http\Services\SupplierAuditService
;
use
App\Http\Services\SyncSupplierService
;
use
App\Http\Transformers\LogTransformer
;
use
App\Http\Transformers\ReceiptTransformer
;
use
App\Http\Validators\ReceiptValidator
;
...
...
@@ -91,6 +92,7 @@ class SupplierReceiptApiController extends Controller
$content
=
!
empty
(
$receipt
[
'receipt_id'
])
?
'修改银行信息'
:
'添加银行信息'
;
$remark
=
json_encode
(
$receipt
);
$logService
->
AddLog
(
$receipt
[
'supplier_id'
],
LogModel
::
UPDATE_OPERATE
,
'修改供应商基本资料'
,
$content
,
$remark
);
(
new
SyncSupplierService
())
->
syncSupplierToErp
(
$supplierId
);
$this
->
response
(
0
,
'操作成功'
);
}
$this
->
response
(
-
1
,
'操作失败'
);
...
...
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