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
3f0a2e94
authored
Aug 22, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
a4d055e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
app/Http/Services/DataService.php
app/Http/routes.php
app/Http/Services/DataService.php
View file @
3f0a2e94
...
...
@@ -7,6 +7,7 @@ use Carbon\Carbon;
use
GuzzleHttp\Client
;
use
App\Model\LogModel
;
use
App\Model\RedisModel
;
use
App\Model\NationModel
;
use
App\Model\SkuUploadItem
;
use
App\Model\SpuBrandModel
;
use
App\Model\UserInfoModel
;
...
...
@@ -29,7 +30,7 @@ use App\Model\SupplierAttachmentsModel;
use
App\Model\StandardBrandMappingModel
;
use
App\Model\Purchase\PurchaseOrderModel
;
use
App\Http\Transformers\SupplierTransformer
;
use
App\Model\NationModel
;
use
PhpAmqpLib\Connection\AMQPStreamConnection
;
//这个服务是处理数据的,比如导出信息,或者临时修复数据,所以代码会比较多
class
DataService
...
...
@@ -874,10 +875,16 @@ class DataService
public
static
function
repaireSkuUploadRuler
()
{
ini_set
(
'memory_limit'
,
'2048M'
);
$supplierList
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
orderBy
(
'supplier_id'
,
'desc'
)
->
get
()
->
toArray
();
foreach
(
$supplierList
as
$supplier
)
{
(
new
SupplierService
())
->
saveSkuUploadRulerToRedis
(
$supplier
[
'supplier_id'
],
$supplier
[
'sku_upload_ruler'
]);
$conn
=
new
AMQPStreamConnection
(
config
(
'database.connections.rabbitmq.host'
),
config
(
'database.connections.rabbitmq.port'
),
config
(
'database.connections.rabbitmq.login'
),
config
(
'database.connections.rabbitmq.password'
)
);
$supplierIds
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'group_code'
,
'!='
,
''
)
->
pluck
(
'supplier_id'
)
->
toArray
();
foreach
(
$supplierIds
as
$supplierId
)
{
(
new
SyncSupplierService
())
->
syncSupplierToErp
(
$supplierId
,
$conn
);
}
}
}
app/Http/routes.php
View file @
3f0a2e94
...
...
@@ -69,7 +69,6 @@ Route::group(['middleware' => ['web'], 'namespace' => 'Api'], function () {
Route
::
match
([
'get'
,
'post'
],
'/api/supplier_contract/{key}'
,
'SupplierContractApiController@Entrance'
);
//单独的统计接口
Route
::
match
([
'get'
,
'post'
],
'/statisticsSkuNumber'
,
function
()
{
(
new
\App\Http\Services\DataService
())
->
statisticsSkuNumberFromSKu
();
});
});
...
...
@@ -94,7 +93,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
// DataService::initSupplierNationId();
// DataService::initSupplierReceiptNationId();
\App\Model\NationModel
::
where
(
'nation_id'
,
0
)
->
update
([
'nation_id'
=>
'1'
,
]);
DataService
::
syncSupplierToErp
();
});
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