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
d40b99e5
Commit
d40b99e5
authored
Apr 23, 2018
by
manxiaoqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二版
parent
7f5e60bc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
0 deletions
+72
-0
workspace.xml
.idea/workspace.xml
+0
-0
ContractController.java
src/main/java/common/controller/ContractController.java
+7
-0
ContractRepository.java
src/main/java/common/repository/ContractRepository.java
+3
-0
ContractService.java
src/main/java/common/service/ContractService.java
+2
-0
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+43
-0
TkioAccountServiceImpl.java
src/main/java/tkio/service/impl/TkioAccountServiceImpl.java
+17
-0
No files found.
.idea/workspace.xml
View file @
d40b99e5
This diff is collapsed.
Click to expand it.
src/main/java/common/controller/ContractController.java
View file @
d40b99e5
...
...
@@ -144,6 +144,13 @@ public class ContractController {
return
ResultModel
.
OK
(
service
.
checkAccount
(
email
,
platform
));
}
@RequestMapping
(
value
=
"checkTime"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
ResultModel
checkTime
(
@RequestParam
String
type
,
@RequestParam
String
email
,
@RequestParam
String
platform
,
@RequestParam
(
required
=
false
)
String
product
)
{
return
ResultModel
.
OK
(
service
.
checkTime
(
email
,
platform
,
type
,
product
));
}
@RequestMapping
(
value
=
"find/body"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
ResultModel
findBody
(
@CurrentAccount
User
loginAccount
)
{
...
...
src/main/java/common/repository/ContractRepository.java
View file @
d40b99e5
...
...
@@ -36,6 +36,9 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query
(
value
=
"SELECT * from contract where platform = ?1 and email = ?2 and type = ?3 order by ds desc limit 1"
,
nativeQuery
=
true
)
Contract
findByPlatformAndEmailLimit1
(
String
platform
,
String
email
,
String
type
);
@Query
(
value
=
"SELECT * from contract where platform = ?1 and email = ?2 and type = ?3 and price_level = ?4 order by ds desc limit 1"
,
nativeQuery
=
true
)
Contract
findByPlatformAndEmailAndPricelevelLimit1
(
String
platform
,
String
email
,
String
type
,
Long
priceLevel
);
@Query
(
value
=
"SELECT * from contract where platform = ?1 and email = ?2 and (status = 'wait' or status = 'executing') and type = 'main' order by ds desc limit 1"
,
nativeQuery
=
true
)
Contract
findByPlatformAndEmailLimitVaild
(
String
platform
,
String
email
);
...
...
src/main/java/common/service/ContractService.java
View file @
d40b99e5
...
...
@@ -13,6 +13,8 @@ public interface ContractService {
Map
<
String
,
Object
>
checkAccount
(
String
email
,
String
platfrom
);
Boolean
checkTime
(
String
email
,
String
platfrom
,
String
type
,
String
product
);
List
<
ContractBody
>
findBody
();
String
getContractCode
(
String
code
);
...
...
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
d40b99e5
...
...
@@ -100,6 +100,35 @@ public class ContractServiceImpl implements ContractService{
}
@Override
public
Boolean
checkTime
(
String
email
,
String
platfrom
,
String
type
,
String
product
)
{
Boolean
flag
=
false
;
if
(
ContractTypeEnum
.
MAIN
.
getKey
().
equals
(
type
)){
Contract
contract
=
contractRepository
.
findByPlatformAndEmailLimit1
(
platfrom
,
email
,
type
);
if
(
null
==
contract
){
flag
=
true
;
}
else
{
String
beforeDay
=
DateUtil
.
getBeforeDays
(
180
);
if
(
beforeDay
.
compareTo
(
contract
.
getEndDate
())
>
0
){
flag
=
true
;
}
}
}
else
{
ContractIncrement
increment
=
contractIncrementRepository
.
findByCode
(
product
);
Contract
contract
=
contractRepository
.
findByPlatformAndEmailAndPricelevelLimit1
(
platfrom
,
email
,
type
,
increment
.
getId
());
if
(
null
==
contract
){
flag
=
true
;
}
else
{
String
beforeDay
=
DateUtil
.
getBeforeDays
(
180
);
String
endDate
=
contract
.
getEndDate
()
==
null
?
contract
.
getDs
()
:
contract
.
getEndDate
();
if
(
beforeDay
.
compareTo
(
endDate
)
>
0
){
flag
=
true
;
}
}
}
return
flag
;
}
@Override
public
List
<
ContractBody
>
findBody
()
{
return
contractBodyRepository
.
findAll
();
}
...
...
@@ -366,6 +395,7 @@ public class ContractServiceImpl implements ContractService{
List
<
User
>
userList
=
userService
.
findAllSons
(
loginAccount
.
getId
());
List
<
Long
>
idList
=
new
ArrayList
<>();
idList
.
add
(
loginAccount
.
getId
());
for
(
User
u
:
userList
){
idList
.
add
(
u
.
getId
());
}
...
...
@@ -414,6 +444,19 @@ public class ContractServiceImpl implements ContractService{
contract
.
setPriceLevelName
(
typeMap
.
containsKey
(
contract
.
getPriceLevel
())
?
typeMap
.
get
(
contract
.
getPriceLevel
())
:
""
);
contract
.
setCreateName
(
saleMap
.
containsKey
(
contract
.
getCreateAccount
())
?
saleMap
.
get
(
contract
.
getCreateAccount
())
:
""
);
Boolean
flag
=
null
;
if
(
contract
.
getPriceLevel
().
longValue
()
==
1
l
){
flag
=
checkTime
(
contract
.
getEmail
(),
contract
.
getPlatform
(),
contract
.
getType
(),
"black"
);
}
else
{
flag
=
checkTime
(
contract
.
getEmail
(),
contract
.
getPlatform
(),
contract
.
getType
(),
"analysis"
);
}
if
(
flag
){
contract
.
setContractType
(
"0"
);
}
else
{
contract
.
setContractType
(
"1"
);
}
return
contract
;
}
...
...
src/main/java/tkio/service/impl/TkioAccountServiceImpl.java
View file @
d40b99e5
...
...
@@ -213,6 +213,16 @@ public class TkioAccountServiceImpl implements TkioAccountService {
if
(
null
==
aw
){
return
null
;
}
List
<
SalesManLeader
>
roles
=
salesManLeaderRepository
.
findAll
();
Map
<
Long
,
String
>
busMap
=
new
HashMap
<>();
for
(
SalesManLeader
u
:
roles
){
busMap
.
put
((
long
)
u
.
getId
(),
u
.
getName
());
}
List
<
User
>
users
=
userRepository
.
findAll
();
Map
<
String
,
Long
>
saleMap
=
new
HashMap
<>();
for
(
User
u
:
users
){
saleMap
.
put
(
u
.
getEmail
(),
u
.
getId
());
}
List
<
BackVisit
>
backVisitList
=
backVisitRepository
.
findAllByPlatformAndEmail
(
"tkio"
,
email
);
if
(
ValidateUtil
.
isValid
(
backVisitList
)){
aw
.
setBackTime
(
backVisitList
.
size
());
...
...
@@ -234,6 +244,13 @@ public class TkioAccountServiceImpl implements TkioAccountService {
}
else
{
aw
.
setRemStatus
(
true
);
}
if
(
busMap
.
containsKey
(
aw
.
getBussinessMan
())){
aw
.
setSaleName
(
busMap
.
get
(
aw
.
getBussinessMan
()));
}
else
{
aw
.
setSaleName
(
""
);
}
return
aw
;
}
...
...
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