Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
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
Administrator
browser-backend
Commits
3ad8d2b4
Commit
3ad8d2b4
authored
Apr 11, 2020
by
jim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
error
parent
4d090d85
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
AccountServiceImpl.java
...owserbackend/account/service/impl/AccountServiceImpl.java
+11
-11
No files found.
src/main/java/com/edgec/browserbackend/account/service/impl/AccountServiceImpl.java
View file @
3ad8d2b4
...
...
@@ -205,7 +205,7 @@ public class AccountServiceImpl implements AccountService {
PrePaidBillingPageResultDto
prePaidBillingPageResultDto
=
new
PrePaidBillingPageResultDto
();
prePaidBillingPageResultDto
.
setBillingList
(
userPrePaidBillings
.
getContent
());
PageInfo
pageInfo
=
new
PageInfo
();
pageInfo
.
setTotalItems
((
int
)
userPrePaidBillings
.
getTotalElements
());
pageInfo
.
setTotalItems
((
int
)
userPrePaidBillings
.
getTotalElements
());
pageInfo
.
setTotalPages
(
userPrePaidBillings
.
getTotalPages
());
pageInfo
.
setCurrentPage
(
userPrePaidBillings
.
getNumber
());
prePaidBillingPageResultDto
.
setBillingPage
(
pageInfo
);
...
...
@@ -241,7 +241,7 @@ public class AccountServiceImpl implements AccountService {
bill
.
setAdministrator
(
account
.
getParent
());
else
bill
.
setAdministrator
(
account
.
getName
());
bill
.
setTradeNo
(
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
).
format
(
new
Date
())+
SmsUtils
.
createRandom
(
true
,
4
));
bill
.
setTradeNo
(
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
).
format
(
new
Date
())
+
SmsUtils
.
createRandom
(
true
,
4
));
bill
.
setChargeType
(
requestDto
.
getChargeType
());
bill
.
setAmount
(
requestDto
.
getAmount
());
bill
.
setUnit
(
requestDto
.
getUnit
());
...
...
@@ -402,11 +402,11 @@ public class AccountServiceImpl implements AccountService {
for
(
Account
promote
:
promotes
)
{
List
<
UserPrePaidBilling
>
userPrePaidBillings
=
prePaidBillingRepository
.
findByUsernameAndYearAndMonthAndPayMethodIn
(
promote
.
getName
(),
YearMonth
.
now
().
getYear
(),
YearMonth
.
now
().
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
YearMonth
.
now
().
getMonthValue
(),
Arrays
.
asList
(
1
,
2
,
3
));
totalCommission
+=
userPrePaidBillings
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
}
account
.
getPromotion
().
setCommission
((
int
)
totalCommission
);
account
.
getPromotion
().
setCommission
((
int
)
totalCommission
);
account
.
getPromotion
().
setInvitedUsers
(
invitedUsers
);
repository
.
save
(
account
);
...
...
@@ -414,7 +414,7 @@ public class AccountServiceImpl implements AccountService {
resultDto
.
setStatus
(
0
);
resultDto
.
setData
(
current
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
log
.
error
(
e
.
getMessage
()
,
e
);
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
AccountErrorCode
.
NAMENOTEXIST
);
...
...
@@ -501,7 +501,7 @@ public class AccountServiceImpl implements AccountService {
Account
pExisting
=
null
;
String
random
=
null
;
do
{
random
=
String
.
valueOf
((
int
)
((
Math
.
random
()*
9
+
1
)*
100000
));
random
=
String
.
valueOf
((
int
)
((
Math
.
random
()
*
9
+
1
)
*
100000
));
pExisting
=
repository
.
findByPromotion
(
random
);
}
while
(
pExisting
!=
null
);
...
...
@@ -561,7 +561,7 @@ public class AccountServiceImpl implements AccountService {
if
(
StringUtils
.
isEmpty
(
parentName
))
{
account
.
setAllowedToCreateSubUser
(
true
);
account
.
setPermission
(
Integer
.
valueOf
(
"1111"
,
2
));
account
.
setPermission
(
Integer
.
valueOf
(
"1111"
,
2
));
}
else
{
account
.
setAllowedToCreateSubUser
(
user
.
isAllowedToCreateSubUser
());
account
.
setPermission
(
user
.
getPermission
());
...
...
@@ -653,7 +653,7 @@ public class AccountServiceImpl implements AccountService {
subUserPageResultDto
.
setUserList
(
subUsersDtoList
);
PageInfo
pageInfo
=
new
PageInfo
();
pageInfo
.
setTotalItems
((
int
)
accounts
.
getTotalElements
());
pageInfo
.
setTotalItems
((
int
)
accounts
.
getTotalElements
());
pageInfo
.
setCurrentPage
(
accounts
.
getNumber
());
pageInfo
.
setTotalPages
(
accounts
.
getTotalPages
());
subUserPageResultDto
.
setUserPage
(
pageInfo
);
...
...
@@ -717,7 +717,7 @@ public class AccountServiceImpl implements AccountService {
return
account
;
}
public
static
String
makeRandomPassword
(
int
len
){
public
static
String
makeRandomPassword
(
int
len
)
{
char
charr
[]
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
.
toCharArray
();
StringBuilder
sb
=
new
StringBuilder
();
Random
r
=
new
Random
();
...
...
@@ -747,7 +747,7 @@ public class AccountServiceImpl implements AccountService {
AccountDto
user
=
new
AccountDto
();
if
(
i
<
10
)
user
.
setName
(
existing
.
getName
()
+
"00"
+
i
);
else
if
(
i
<
100
)
else
if
(
i
<
100
)
user
.
setName
(
existing
.
getName
()
+
"0"
+
i
);
else
user
.
setName
(
existing
.
getName
()
+
i
);
...
...
@@ -823,7 +823,7 @@ public class AccountServiceImpl implements AccountService {
@Override
public
void
saveSubUsers
(
String
name
,
SubUsersRequestDto
subUsersRequestDto
)
{
for
(
String
username:
subUsersRequestDto
.
getUsernames
())
{
for
(
String
username
:
subUsersRequestDto
.
getUsernames
())
{
Account
childAccount
=
repository
.
findByName
(
username
);
if
(
childAccount
==
null
||
!
name
.
equals
(
childAccount
.
getParent
()))
{
throw
new
ClientRequestException
(
AccountErrorCode
.
UNKNOWN
,
"Invalid Request"
);
...
...
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