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
Mar 26, 2018
by
manxiaoqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户表
parent
8c1fae39
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
11 deletions
+22
-11
workspace.xml
.idea/workspace.xml
+0
-0
AccountTask.java
src/main/java/tkio/task/AccountTask.java
+22
-11
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;
...
@@ -17,6 +17,7 @@ import tkio.service.AccountFlowRestrictService;
import
util.DateUtil
;
import
util.DateUtil
;
import
util.ValidateUtil
;
import
util.ValidateUtil
;
import
java.math.BigInteger
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -45,6 +46,12 @@ public class AccountTask {
...
@@ -45,6 +46,12 @@ public class AccountTask {
public
void
task
(){
public
void
task
(){
logger
.
info
(
"tkio task start :"
+
System
.
currentTimeMillis
());
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
();
account4WebRepository
.
deleteAll
();
List
<
Account4Web
>
list
=
new
ArrayList
<>();
List
<
Account4Web
>
list
=
new
ArrayList
<>();
...
@@ -52,17 +59,21 @@ public class AccountTask {
...
@@ -52,17 +59,21 @@ public class AccountTask {
List
<
Account
>
accountValidList
=
accountRepository
.
findRootParentsUnPast
(
DateUtil
.
getBeforeDays
(
1
));
List
<
Account
>
accountValidList
=
accountRepository
.
findRootParentsUnPast
(
DateUtil
.
getBeforeDays
(
1
));
if
(
ValidateUtil
.
isValid
(
accountValidList
)){
if
(
ValidateUtil
.
isValid
(
accountValidList
)){
for
(
Account
ac
:
accountValidList
){
for
(
Account
ac
:
accountValidList
){
try
{
AccountRestrict4Web
restrict4Web
=
accountFlowRestrictService
.
findRestrictByAccount
(
ac
.
getId
());
Account4Web
account4Web
=
new
Account4Web
();
Account4Web
account4Web
=
new
Account4Web
();
account4Web
.
setAccountId
(
ac
.
getId
());
account4Web
.
setAccountId
(
ac
.
getId
());
account4Web
.
setEmail
(
ac
.
getEmail
());
account4Web
.
setEmail
(
ac
.
getEmail
());
account4Web
.
setCompany
(
ac
.
getCompany
());
account4Web
.
setCompany
(
ac
.
getCompany
());
account4Web
.
setCreateDate
(
ac
.
getPubDate
());
account4Web
.
setCreateDate
(
ac
.
getPubDate
());
account4Web
.
setCreateDs
(
DateUtil
.
getFormatDate
(
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
.
setStatus
(
null
==
restrict4Web
.
getIOFlowNotified
()
?
"已激活"
:
(
restrict4Web
.
getIOFlowNotified
()
?
"已激活"
:
"流量用尽"
));
account4Web
.
setStatus
(
null
==
restrict4Web
.
getIOFlowNotified
()
?
"已激活"
:
(
restrict4Web
.
getIOFlowNotified
()
?
"已激活"
:
"流量用尽"
));
account4Web
.
setPackageType
(
restrict4Web
.
getPackageName
());
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
)){
if
(
ac
.
getPricelevel
().
equals
(
7L
)
||
ac
.
getPricelevel
().
equals
(
8L
)
||
ac
.
getPricelevel
().
equals
(
5L
)
||
ac
.
getPricelevel
().
equals
(
6L
)){
account4Web
.
setIo
(
restrict4Web
.
getThisMonthIOFlow
());
account4Web
.
setIo
(
restrict4Web
.
getThisMonthIOFlow
());
account4Web
.
setTrack
(
restrict4Web
.
getTrackTotalFlow
());
account4Web
.
setTrack
(
restrict4Web
.
getTrackTotalFlow
());
...
@@ -95,11 +106,15 @@ public class AccountTask {
...
@@ -95,11 +106,15 @@ public class AccountTask {
}
}
}
}
account4Web
.
setUser
(
ac
.
getName
());
account4Web
.
setTell
(
ac
.
getPhone
());
account4Web
.
setBussinessMan
(
ac
.
getBussinessman
());
list
.
add
(
account4Web
);
list
.
add
(
account4Web
);
}
catch
(
Exception
e
){
}
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
());
logger
.
error
(
"tkio task error :"
+
ac
.
getEmail
());
}
}
...
@@ -107,11 +122,7 @@ public class AccountTask {
...
@@ -107,11 +122,7 @@ public class AccountTask {
}
}
//已过期的直接设置成过期
//已过期的直接设置成过期
List
<
Account
>
pastAccountList
=
accountRepository
.
findRootParentsPast
(
DateUtil
.
getBeforeDays
(
0
));
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
)){
if
(
ValidateUtil
.
isValid
(
pastAccountList
)){
for
(
Account
ac
:
pastAccountList
){
for
(
Account
ac
:
pastAccountList
){
Account4Web
account4Web
=
new
Account4Web
();
Account4Web
account4Web
=
new
Account4Web
();
...
...
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