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
586a98c6
Commit
586a98c6
authored
4 years ago
by
lzxry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adi查用户bug
parent
ccce33dd
master
…
0727_bugfix
2578_bugfix
2580_fix
master_mv
mobvista_master
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+22
-1
CASIPSendTimeTask.java
src/main/java/track/task/CASIPSendTimeTask.java
+13
-1
No files found.
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
586a98c6
...
...
@@ -652,7 +652,8 @@ public class ContractServiceImpl implements ContractService {
}
}
else
if
(
"cas"
.
equals
(
resource
.
getPlatform
())){
ADIUser
adiUser
=
adiAccountService
.
findOne
(
resource
.
getEmail
(),
resource
.
getContractType
());
PackageBase
one
=
packageBaseRepository
.
findOne
(
resource
.
getPriceLevel
());
ADIUser
adiUser
=
adiAccountService
.
findOne
(
resource
.
getEmail
(),
one
.
getPackageName
());
if
(
adiUser
==
null
||
StringUtils
.
isEmpty
(
adiUser
.
getSendTime
())){
resource
.
setShareSign
(
0
);
}
else
{
...
...
@@ -927,6 +928,26 @@ public class ContractServiceImpl implements ContractService {
contractExist
.
setErroMessage
(
"补充协议开始日期不能晚于原始合同的结束日期"
);
return
contractExist
;
}
}
else
if
(
"cas"
.
equals
(
resource
.
getPlatform
())){
PackageBase
one
=
packageBaseRepository
.
findOne
(
resource
.
getPriceLevel
());
ADIUser
adiUser
=
adiAccountService
.
findOne
(
resource
.
getEmail
(),
one
.
getPackageName
());
if
(
adiUser
==
null
||
StringUtils
.
isEmpty
(
adiUser
.
getSendTime
())){
resource
.
setShareSign
(
0
);
}
else
{
resource
.
setShareSign
(
1
);
DateTime
sendTime
=
new
DateTime
(
DateUtil
.
parseDate
(
DateUtil
.
C_TIME_PATTON_DEFAULT
,
adiUser
.
getSendTime
()));
DateTime
startDate
=
new
DateTime
(
resource
.
getStartDate
());
if
(
sendTime
.
isBefore
(
startDate
)){
sendTime
=
startDate
;
}
DateTime
endDate
=
new
DateTime
(
resource
.
getEndDate
());
String
validStartDateStr
=
sendTime
.
toString
(
DateUtil
.
C_DATE_PATTON_DEFAULT
);
int
contractAllDay
=
Days
.
daysBetween
(
startDate
,
endDate
).
getDays
();
//合同总天数-1 ,用于计算结束日期
String
validEndDateStr
=
sendTime
.
plusDays
(
contractAllDay
).
toString
(
"yyyy-MM-dd"
);
resource
.
setValidStartDate
(
validStartDateStr
);
resource
.
setValidEndDate
(
validEndDateStr
);
}
}
if
(
resource
.
getContractCode
()
!=
null
&&
!
resource
.
getContractCode
().
equals
(
contract
.
getContractCode
()))
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/track/task/CASIPSendTimeTask.java
View file @
586a98c6
...
...
@@ -3,7 +3,9 @@ package track.task;
import
adi.model.ADIUser
;
import
adi.service.ADIAccountService
;
import
common.model.Contract
;
import
common.model.PackageBase
;
import
common.repository.ContractRepository
;
import
common.repository.PackageBaseRepository
;
import
org.joda.time.DateTime
;
import
org.joda.time.Days
;
import
org.slf4j.Logger
;
...
...
@@ -12,7 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.util.StringUtils
;
import
util.DateUtil
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author liyin
...
...
@@ -26,13 +30,21 @@ public class CASIPSendTimeTask {
ADIAccountService
adiAccountService
;
@Autowired
ContractRepository
contractRepository
;
@Autowired
PackageBaseRepository
packageBaseRepository
;
public
void
task
(){
logger
.
info
(
"CAS的IP定制发送日定时任务"
);
List
<
PackageBase
>
packageBases
=
packageBaseRepository
.
findByPlatAndStatus
(
"cas"
,
1
);
Map
<
Long
,
PackageBase
>
packageBaseMap
=
new
HashMap
<>();
for
(
PackageBase
base
:
packageBases
)
{
packageBaseMap
.
put
(
base
.
getId
(),
base
);
}
List
<
Contract
>
contracts
=
contractRepository
.
findByPlatformAndShareSign
(
"cas"
,
0
);
for
(
Contract
contract
:
contracts
)
{
ADIUser
adiUser
=
adiAccountService
.
findOne
(
contract
.
getEmail
(),
contract
.
getContractType
());
PackageBase
packageBase
=
packageBaseMap
.
get
(
contract
.
getPriceLevel
());
ADIUser
adiUser
=
adiAccountService
.
findOne
(
contract
.
getEmail
(),
packageBase
==
null
?
""
:
packageBase
.
getPackageName
());
if
(
adiUser
!=
null
&&!
StringUtils
.
isEmpty
(
adiUser
.
getSendTime
())){
contract
.
setShareSign
(
1
);
DateTime
sendTime
=
new
DateTime
(
DateUtil
.
parseDate
(
DateUtil
.
C_TIME_PATTON_DEFAULT
,
adiUser
.
getSendTime
()));
...
...
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