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
daa43adc
Commit
daa43adc
authored
May 15, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
店铺ip续费不更新bug
parent
c4c3f082
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
IpResourceServiceImpl.java
...erbackend/browser/service/Impl/IpResourceServiceImpl.java
+40
-0
No files found.
src/main/java/com/edgec/browserbackend/browser/service/Impl/IpResourceServiceImpl.java
View file @
daa43adc
...
...
@@ -398,6 +398,46 @@ public class IpResourceServiceImpl implements IpResourceService {
accountService
.
chargeByMoney
(
username
,
newprice1
*
ipResourceRequestDto
.
getPeriod
()
*
ipResourceRequestDto
.
getAmount
(),
ipChargeRequestDto
);
ipResource
.
setValidTime
(
Instant
.
parse
(
x
.
getValidTill
()).
toEpochMilli
());
if
(
StringUtils
.
isNotBlank
(
ipResource
.
getAddr
()))
{
if
(
ipResource
.
getLockTimestamp
()
>=
Instant
.
now
().
minusSeconds
(
120
).
toEpochMilli
()
&&
ipResource
.
getIpType
()
==
IpType
.
VENDOR
&&
(
ipResource
.
getStatus
()
==
0
||
ipResource
.
getStatus
()
==
2
))
{
ipResource
.
setStatus
(
3
);
}
else
if
(
ipResource
.
getValidTime
()
<=
Instant
.
now
().
plusSeconds
(
60
*
60
*
24
*
7
).
toEpochMilli
()
&&
ipResource
.
getValidTime
()
>
Instant
.
now
().
toEpochMilli
())
{
if
(
ipResource
.
getStatus
()
!=
5
&&
ipResource
.
getStatus
()
!=
3
&&
ipResource
.
getStatus
()
!=
6
)
{
ipResource
.
setStatus
(
2
);
ipResourceRepository
.
save
(
ipResource
);
}
}
else
if
(
ipResource
.
getValidTime
()
<=
Instant
.
now
().
minusSeconds
(
60
*
60
*
24
*
7
).
toEpochMilli
()
&&
ipResource
.
getStatus
()
!=
3
&&
ipResource
.
getStatus
()
!=
6
)
{
if
(
ipResource
.
getIpType
()
==
IpType
.
VENDOR
)
{
IpResourceRequestDto
ipResourceRequestDto1
=
new
IpResourceRequestDto
();
ipResourceRequestDto1
.
setAddr
(
Arrays
.
asList
(
ipResource
.
getAddr
()));
try
{
deleteIp
(
username
,
ipResourceRequestDto1
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
}
else
{
IpResourceRequestDto
ipResourceRequestDto1
=
new
IpResourceRequestDto
();
ipResourceRequestDto1
.
setIpId
(
Arrays
.
asList
(
ipResource
.
getId
()));
try
{
deleteIp
(
username
,
ipResourceRequestDto1
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
}
return
;
}
else
if
(
ipResource
.
getValidTime
()
<=
Instant
.
now
().
toEpochMilli
()
&&
ipResource
.
getStatus
()
!=
3
&&
ipResource
.
getStatus
()
!=
6
)
{
ipResource
.
setStatus
(
1
);
ipResourceRepository
.
save
(
ipResource
);
}
else
{
if
((
ipResource
.
getStatus
()
==
0
||
ipResource
.
getStatus
()
==
1
||
ipResource
.
getStatus
()
==
2
)
&&
!
ipResource
.
getVendor
().
equals
(
Vendor
.
local
))
{
ipResource
.
setStatus
(
0
);
ipResourceRepository
.
save
(
ipResource
);
}
else
if
(
ipResource
.
getIpType
().
equals
(
IpType
.
LOCAL
)
&&
(
ipResource
.
getStatus
()
==
1
||
ipResource
.
getStatus
()
==
2
)
&&
ipResource
.
getAddr
().
equals
(
"本地Ip未使用"
))
{
ipResource
.
setStatus
(
4
);
ipResourceRepository
.
save
(
ipResource
);
}
}
}
ipResourceRepository
.
save
(
ipResource
);
ipOperationResultDto
.
getSuccessList
().
add
(
x
.
getIp
());
...
...
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