Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
ufo-platform
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
LUOXC
5 years ago
Commit
be3a23e7e79bfe9295c3d955fc2df635ab895372
1 parent
d6401666
add switch
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
6 deletions
product/src/main/java/com/yoho/ufo/service/scheduled/ScheduledProductChain.java
product/src/main/java/com/yoho/ufo/service/scheduled/ScheduledTransactionChain.java
product/src/main/java/com/yoho/ufo/service/scheduled/ScheduledProductChain.java
View file @
be3a23e
package
com
.
yoho
.
ufo
.
service
.
scheduled
;
import
com.yoho.core.config.ConfigReader
;
import
com.yoho.product.model.ProductInfo
;
import
com.yoho.quartz.annotation.JobType
;
import
com.yoho.quartz.annotation.MisfiredPolicy
;
...
...
@@ -26,17 +27,25 @@ import java.util.List;
public
class
ScheduledProductChain
implements
YhJob
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
"scheduledLog"
);
@Autowired
private
ConfigReader
configReader
;
@Autowired
private
ProductChainService
productChainService
;
public
JobProcessResult
process
(
String
jobContext
)
{
LOGGER
.
info
(
"scheduledProductChain begin."
);
List
<
ProductInfo
>
productInfos
=
productChainService
.
queryIsuploadIsZero
();
boolean
open
=
configReader
.
getBoolean
(
"ufo.product.chain.switch.close"
,
false
);
if
(
open
){
List
<
ProductInfo
>
productInfos
=
productChainService
.
queryIsuploadIsZero
();
productInfos
.
stream
().
forEach
(
item
->
{
productChainService
.
postChainInfoEx
(
item
);
});
productInfos
.
stream
().
forEach
(
item
->
{
productChainService
.
postChainInfoEx
(
item
);
});
}
JobProcessResult
result
=
new
JobProcessResult
();
...
...
product/src/main/java/com/yoho/ufo/service/scheduled/ScheduledTransactionChain.java
View file @
be3a23e
package
com
.
yoho
.
ufo
.
service
.
scheduled
;
import
com.yoho.core.config.ConfigReader
;
import
com.yoho.product.model.ProductChain
;
import
com.yoho.quartz.annotation.JobType
;
import
com.yoho.quartz.annotation.MisfiredPolicy
;
...
...
@@ -28,14 +29,21 @@ public class ScheduledTransactionChain implements YhJob {
@Autowired
private
ProductChainService
productChainService
;
@Autowired
private
ConfigReader
configReader
;
public
JobProcessResult
process
(
String
jobContext
)
{
LOGGER
.
info
(
"scheduledTransactionChain begin."
);
List
<
ProductChain
>
productChains
=
productChainService
.
queryProductChain
();
boolean
open
=
configReader
.
getBoolean
(
"ufo.product.chain.switch.close"
,
false
);
if
(
open
)
{
List
<
ProductChain
>
productChains
=
productChainService
.
queryProductChain
();
productChains
.
stream
().
forEach
(
item
->
productChainService
.
postQuery
(
item
.
getChainId
(),
item
.
getTagId
()));
productChains
.
stream
().
forEach
(
item
->
productChainService
.
postQuery
(
item
.
getChainId
(),
item
.
getTagId
()));
}
JobProcessResult
result
=
new
JobProcessResult
();
result
.
setJobResultCode
(
JobResultCode
.
SUCCESS
);
LOGGER
.
info
(
"scheduledTransactionChain end."
);
...
...
Please
register
or
login
to post a comment