Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manager
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
reyun
manager
Commits
0589fce8
Commit
0589fce8
authored
7 years ago
by
manxiaoqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户表
parent
8c1fae39
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
15 deletions
+26
-15
workspace.xml
.idea/workspace.xml
+0
-0
AccountTask.java
src/main/java/tkio/task/AccountTask.java
+26
-15
No files found.
.idea/workspace.xml
View file @
0589fce8
This diff is collapsed.
Click to expand it.
src/main/java/tkio/task/AccountTask.java
View file @
0589fce8
...
...
@@ -17,6 +17,7 @@ import tkio.service.AccountFlowRestrictService;
import
util.DateUtil
;
import
util.ValidateUtil
;
import
java.math.BigInteger
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -45,6 +46,12 @@ public class AccountTask {
public
void
task
(){
logger
.
info
(
"tkio task start :"
+
System
.
currentTimeMillis
());
List
<
PackageType
>
packageTypeList
=
packageTypeRepository
.
findAll
();
Map
<
Long
,
String
>
map
=
new
HashMap
<>();
for
(
PackageType
pt
:
packageTypeList
){
map
.
put
(
pt
.
getId
(),
pt
.
getPackageName
());
}
//清空前一天数据
account4WebRepository
.
deleteAll
();
List
<
Account4Web
>
list
=
new
ArrayList
<>();
...
...
@@ -52,17 +59,21 @@ public class AccountTask {
List
<
Account
>
accountValidList
=
accountRepository
.
findRootParentsUnPast
(
DateUtil
.
getBeforeDays
(
1
));
if
(
ValidateUtil
.
isValid
(
accountValidList
)){
for
(
Account
ac
:
accountValidList
){
Account4Web
account4Web
=
new
Account4Web
();
account4Web
.
setAccountId
(
ac
.
getId
());
account4Web
.
setEmail
(
ac
.
getEmail
());
account4Web
.
setCompany
(
ac
.
getCompany
());
account4Web
.
setCreateDate
(
ac
.
getPubDate
());
account4Web
.
setCreateDs
(
DateUtil
.
getFormatDate
(
ac
.
getPubDate
()));
account4Web
.
setPastDate
(
ac
.
getPastDate
());
account4Web
.
setUser
(
ac
.
getName
());
account4Web
.
setTell
(
ac
.
getPhone
());
account4Web
.
setBussinessMan
(
ac
.
getBussinessman
());
try
{
AccountRestrict4Web
restrict4Web
=
accountFlowRestrictService
.
findRestrictByAccount
(
ac
.
getId
());
Account4Web
account4Web
=
new
Account4Web
();
account4Web
.
setAccountId
(
ac
.
getId
());
account4Web
.
setEmail
(
ac
.
getEmail
());
account4Web
.
setCompany
(
ac
.
getCompany
());
account4Web
.
setCreateDate
(
ac
.
getPubDate
());
account4Web
.
setCreateDs
(
DateUtil
.
getFormatDate
(
ac
.
getPubDate
()));
account4Web
.
setStatus
(
null
==
restrict4Web
.
getIOFlowNotified
()
?
"已激活"
:
(
restrict4Web
.
getIOFlowNotified
()
?
"已激活"
:
"流量用尽"
));
account4Web
.
setPackageType
(
restrict4Web
.
getPackageName
());
account4Web
.
setPastDate
(
ac
.
getPastDate
());
if
(
ac
.
getPricelevel
().
equals
(
7L
)
||
ac
.
getPricelevel
().
equals
(
8L
)
||
ac
.
getPricelevel
().
equals
(
5L
)
||
ac
.
getPricelevel
().
equals
(
6L
)){
account4Web
.
setIo
(
restrict4Web
.
getThisMonthIOFlow
());
account4Web
.
setTrack
(
restrict4Web
.
getTrackTotalFlow
());
...
...
@@ -95,11 +106,15 @@ public class AccountTask {
}
}
account4Web
.
setUser
(
ac
.
getName
());
account4Web
.
setTell
(
ac
.
getPhone
());
account4Web
.
setBussinessMan
(
ac
.
getBussinessman
());
list
.
add
(
account4Web
);
}
catch
(
Exception
e
){
account4Web
.
setPackageType
(
map
.
get
(
ac
.
getPricelevel
()));
account4Web
.
setIoStatus
(
true
);
account4Web
.
setTrackStatus
(
true
);
account4Web
.
setStatus
(
"已激活"
);
account4Web
.
setIo
(
new
BigInteger
(
"0"
));
account4Web
.
setTrack
(
new
BigInteger
(
"0"
));
list
.
add
(
account4Web
);
logger
.
error
(
"tkio task error :"
+
ac
.
getEmail
());
}
...
...
@@ -107,11 +122,7 @@ public class AccountTask {
}
//已过期的直接设置成过期
List
<
Account
>
pastAccountList
=
accountRepository
.
findRootParentsPast
(
DateUtil
.
getBeforeDays
(
0
));
List
<
PackageType
>
packageTypeList
=
packageTypeRepository
.
findAll
();
Map
<
Long
,
String
>
map
=
new
HashMap
<>();
for
(
PackageType
pt
:
packageTypeList
){
map
.
put
(
pt
.
getId
(),
pt
.
getPackageName
());
}
if
(
ValidateUtil
.
isValid
(
pastAccountList
)){
for
(
Account
ac
:
pastAccountList
){
Account4Web
account4Web
=
new
Account4Web
();
...
...
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