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
Jan 26, 2021
by
lzxry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adi查用户bug
parent
ccce33dd
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 {
...
@@ -652,7 +652,8 @@ public class ContractServiceImpl implements ContractService {
}
}
}
else
if
(
"cas"
.
equals
(
resource
.
getPlatform
())){
}
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
())){
if
(
adiUser
==
null
||
StringUtils
.
isEmpty
(
adiUser
.
getSendTime
())){
resource
.
setShareSign
(
0
);
resource
.
setShareSign
(
0
);
}
else
{
}
else
{
...
@@ -927,6 +928,26 @@ public class ContractServiceImpl implements ContractService {
...
@@ -927,6 +928,26 @@ public class ContractServiceImpl implements ContractService {
contractExist
.
setErroMessage
(
"补充协议开始日期不能晚于原始合同的结束日期"
);
contractExist
.
setErroMessage
(
"补充协议开始日期不能晚于原始合同的结束日期"
);
return
contractExist
;
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
()))
{
if
(
resource
.
getContractCode
()
!=
null
&&
!
resource
.
getContractCode
().
equals
(
contract
.
getContractCode
()))
{
...
...
src/main/java/track/task/CASIPSendTimeTask.java
View file @
586a98c6
...
@@ -3,7 +3,9 @@ package track.task;
...
@@ -3,7 +3,9 @@ package track.task;
import
adi.model.ADIUser
;
import
adi.model.ADIUser
;
import
adi.service.ADIAccountService
;
import
adi.service.ADIAccountService
;
import
common.model.Contract
;
import
common.model.Contract
;
import
common.model.PackageBase
;
import
common.repository.ContractRepository
;
import
common.repository.ContractRepository
;
import
common.repository.PackageBaseRepository
;
import
org.joda.time.DateTime
;
import
org.joda.time.DateTime
;
import
org.joda.time.Days
;
import
org.joda.time.Days
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -12,7 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -12,7 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
util.DateUtil
;
import
util.DateUtil
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author liyin
* @author liyin
...
@@ -26,13 +30,21 @@ public class CASIPSendTimeTask {
...
@@ -26,13 +30,21 @@ public class CASIPSendTimeTask {
ADIAccountService
adiAccountService
;
ADIAccountService
adiAccountService
;
@Autowired
@Autowired
ContractRepository
contractRepository
;
ContractRepository
contractRepository
;
@Autowired
PackageBaseRepository
packageBaseRepository
;
public
void
task
(){
public
void
task
(){
logger
.
info
(
"CAS的IP定制发送日定时任务"
);
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
);
List
<
Contract
>
contracts
=
contractRepository
.
findByPlatformAndShareSign
(
"cas"
,
0
);
for
(
Contract
contract
:
contracts
)
{
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
())){
if
(
adiUser
!=
null
&&!
StringUtils
.
isEmpty
(
adiUser
.
getSendTime
())){
contract
.
setShareSign
(
1
);
contract
.
setShareSign
(
1
);
DateTime
sendTime
=
new
DateTime
(
DateUtil
.
parseDate
(
DateUtil
.
C_TIME_PATTON_DEFAULT
,
adiUser
.
getSendTime
()));
DateTime
sendTime
=
new
DateTime
(
DateUtil
.
parseDate
(
DateUtil
.
C_TIME_PATTON_DEFAULT
,
adiUser
.
getSendTime
()));
...
...
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