Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
openApi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hj
openApi
Commits
bbb50c62
Commit
bbb50c62
authored
Oct 18, 2024
by
hj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新提交
parent
226388d4
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
680 additions
and
3 deletions
+680
-3
server/app/Console/Commands/WuxiLabNewJobCommand.php
server/app/Console/Commands/WuxiLabNewJobCommand.php
+116
-0
server/app/Providers/AppServiceProvider.php
server/app/Providers/AppServiceProvider.php
+2
-1
server/app/Services/ThirdPlatform/Api/WuxiApiService.php
server/app/Services/ThirdPlatform/Api/WuxiApiService.php
+0
-2
server/app/Services/ThirdPlatform/WuxiLabNewService.php
server/app/Services/ThirdPlatform/WuxiLabNewService.php
+562
-0
No files found.
server/app/Console/Commands/WuxiLabNewJobCommand.php
0 → 100644
View file @
bbb50c62
<?php
namespace
App\Console\Commands
;
use
App\Jobs\WuxiLabJob
;
use
App\Services\ThirdPlatform\WuxiLabNewService
;
use
App\Services\ThirdPlatform\WuxiLabService
;
use
Illuminate\Console\Command
;
use
Illuminate\Console\ConfirmableTrait
;
class
WuxiLabNewJobCommand
extends
Command
{
use
ConfirmableTrait
;
/**
* 命令行的名称及用法。
*
* @var string
*/
protected
$signature
=
'wuxilabnew:job
{--action_type= : 任务操作类型}
{--params= : 任务参数}'
;
/**
* 命令行的概述。
*
* @var string
*/
protected
$description
=
'药名康德任务命令行'
;
/**
* 创建新的命令实例。
*
* @return void
*/
public
function
__construct
()
{
parent
::
__construct
();
}
/**
* 运行命令。
* @throws \Exception
*/
public
function
handle
()
{
if
(
!
$this
->
confirmToProceed
())
{
return
1
;
}
if
(
$this
->
hasArgument
(
'help'
)){
$this
->
help
();
}
else
{
$action_type
=
$this
->
option
(
'action_type'
);
$params
=
$this
->
option
(
'params'
);
if
(
empty
(
$action_type
)){
$this
->
error
(
'缺少命令参数,请输入具体的参数命令.如需帮助请输入 --help'
);
exit
;
}
$service
=
app
(
WuxiLabNewService
::
class
);
switch
(
$action_type
){
case
'initProductToExcel'
:
if
(
!
isset
(
$params
)
||
$params
==
0
){
$params
[
'limit'
]
=
1000
;
}
$service
->
initCreateProductsToExcel
(
$params
[
'limit'
]);
break
;
case
'batchUpdatePackages'
:
if
(
!
isset
(
$params
)
||
$params
==
0
){
$params
[
'limit'
]
=
1000
;
}
$service
->
batchUpdatePackagesInfo
(
$params
);
break
;
case
'batchUploadProducts'
:
$service
->
batchUploadProducts
();
break
;
case
'batchUpdateToWuxiLab'
:
$service
->
batchUpdateToWuxiLab
();
break
;
case
'batchUpdateProduct'
:
$service
->
batchUpdateProducts
();
break
;
case
'test'
:
$service
->
test
(
$params
);
break
;
case
'test1'
:
$service
->
test1
();
break
;
case
'batchUploadNewProducts'
:
$service
->
batchUploadNewProducts
();
break
;
case
'batchUpdateProductPackages'
:
$service
->
batchUploadPackages
();
break
;
case
'batchUpdateProductsShelves'
:
$service
->
batchUpdateProductsShelves
();
break
;
case
'initToken'
:
$service
->
initToken
();
break
;
default
:
}
/*$productUpdateJob = (new WuxiLabJob($action_type,$params))->delay(100)->onQueue('slow');
app('Illuminate\Contracts\Bus\Dispatcher')->dispatch($productUpdateJob);*/
}
}
public
function
help
()
{
$helpStr
=
"参数帮助说明"
;
$this
->
comment
(
$this
->
setHelp
(
$helpStr
)
->
getProcessedHelp
());
$this
->
line
(
"action_type: 具体动作参数
\n\n
initProductToExcel => 初始化批量商品
\n
batchUpdateProduct => 批量更新商品
\n\n
params : 操作需要传入的参数.非必填项"
);
}
}
server/app/Providers/AppServiceProvider.php
View file @
bbb50c62
...
@@ -78,7 +78,8 @@ class AppServiceProvider extends ServiceProvider
...
@@ -78,7 +78,8 @@ class AppServiceProvider extends ServiceProvider
\App\Console\Commands\KafkaConsumerCommand
::
class
,
\App\Console\Commands\KafkaConsumerCommand
::
class
,
\App\Console\Commands\TestJobCommand
::
class
,
\App\Console\Commands\TestJobCommand
::
class
,
\App\Console\Commands\RhawnToolsJobCommand
::
class
,
\App\Console\Commands\RhawnToolsJobCommand
::
class
,
\App\Console\Commands\InvoiceJobCommand
::
class
\App\Console\Commands\InvoiceJobCommand
::
class
,
\App\Console\Commands\WuxiLabNewJobCommand
::
class
]);
]);
}
}
...
...
server/app/Services/ThirdPlatform/Api/WuxiApiService.php
View file @
bbb50c62
...
@@ -41,8 +41,6 @@ class WuxiApiService extends PlatformAbstractService
...
@@ -41,8 +41,6 @@ class WuxiApiService extends PlatformAbstractService
$params
=
[];
$params
=
[];
$params
[
'chemicalProducts'
]
=
$this
->
mergeApiMetaData
(
$product
);
$params
[
'chemicalProducts'
]
=
$this
->
mergeApiMetaData
(
$product
);
$response
=
$this
->
getPostClient
(
$this
->
platformInfo
[
'platform_url'
]
.
'/api/v1/update'
,
$params
,
[
$response
=
$this
->
getPostClient
(
$this
->
platformInfo
[
'platform_url'
]
.
'/api/v1/update'
,
$params
,
[
$this
->
platformInfo
[
'platform_params'
][
'username'
],
$this
->
platformInfo
[
'platform_params'
][
'password'
]
$this
->
platformInfo
[
'platform_params'
][
'username'
],
$this
->
platformInfo
[
'platform_params'
][
'password'
]
]);
]);
...
...
server/app/Services/ThirdPlatform/WuxiLabNewService.php
0 → 100644
View file @
bbb50c62
This diff is collapsed.
Click to expand it.
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