Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
aic_duty_strategy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yinxiaoling
aic_duty_strategy
Commits
13744288
Commit
13744288
authored
May 18, 2020
by
yinxiaoling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量任务新建
parent
747e9889
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
.env
.env
+3
-1
StrategyService.php
app/Service/StrategyService.php
+11
-5
queue.php
config/queue.php
+1
-1
No files found.
.env
View file @
13744288
...
...
@@ -14,8 +14,10 @@ DB_USERNAME=postgres
DB_PASSWORD=yhhl123
BROADCAST_DRIVER=log
CACHE_DRIVER=
file
CACHE_DRIVER=
array
QUEUE_CONNECTION=sync
QUEUE_DRIVER=redis
SESSION_DRIVER=file
SESSION_LIFETIME=120
...
...
app/Service/StrategyService.php
View file @
13744288
...
...
@@ -321,7 +321,10 @@ class StrategyService
}
//将处理的策略月份修改为最新
StrategyExcel
::
where
([[
'strategy_sn'
,
$strategySn
],[
'last_handle_month'
,
'<>'
,
$cmonth
]])
->
update
([
'last_handle_month'
=>
$cmonth
]);
$this
->
createdTask
(
$strategySn
);
//批量新建任务
$this
->
createdTask
(
$strategySn
);
//批量新建任务
$this
->
createdTask
(
$strategySn
);
//批量新建任务
$this
->
createdTask
(
$strategySn
);
//批量新建任务
}
//创建任务
...
...
@@ -332,9 +335,11 @@ class StrategyService
if
(
empty
(
$strategySn
)){
array_push
(
$whereArr
,
[
'strategy_sn'
,
$strategySn
]);
}
$taskInfo
=
StrategyTask
::
where
(
)
->
get
(
$whereArr
)
->
toArray
();
//获取当天需要新建任务的数据
$taskInfo
=
StrategyTask
::
where
(
$whereArr
)
->
get
(
)
->
toArray
();
//获取当天需要新建任务的数据
$url
=
"https://test117.ciopaas.com/api/addJsonNoLogin"
;
//dd($taskInfo);
if
(
empty
(
$taskInfo
)){
//没有需要处理的数据
return
true
;
}
foreach
(
$taskInfo
as
$k
=>
$v
){
//批量调用接口新建任务
$failLabTemp
=
0
;
$failReason
=
''
;
...
...
@@ -353,10 +358,11 @@ class StrategyService
'值班日期'
=>
$v
[
'duty_date'
]
]
];
$v
[
'user_sn'
]
=
trim
(
$v
[
'user_sn'
]);
$v
[
'project_sn'
]
=
trim
(
$v
[
'project_sn'
]);
$params
=
[
'user_sn'
=>
$v
[
'user_sn'
],
'project_sn'
=>
trim
(
$v
[
'project_sn'
])
,
'project_sn'
=>
$v
[
'project_sn'
]
,
'source'
=>
date
(
'YmdHis'
)
.
$k
,
//任务名称,年月日时分秒,加上循环键值避免重复任务名
'ai_user_sn'
=>
$v
[
'user_sn'
],
//$v['user_sn'],
'is_zidong'
=>
'off'
,
//是否自动启动,否,任务定时启动
...
...
config/queue.php
View file @
13744288
...
...
@@ -62,7 +62,7 @@ return [
'driver'
=>
'redis'
,
'connection'
=>
'default'
,
'queue'
=>
env
(
'REDIS_QUEUE'
,
'default'
),
'retry_after'
=>
90
,
'retry_after'
=>
3660
,
//90 默认
'block_for'
=>
null
,
],
...
...
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