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
70849a07
Commit
70849a07
authored
Jan 18, 2018
by
manxiaoqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合同
parent
95709d18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
8 deletions
+18
-8
workspace.xml
.idea/workspace.xml
+0
-0
ContractController.java
src/main/java/common/controller/ContractController.java
+2
-2
Contract.java
src/main/java/common/model/Contract.java
+9
-0
ContractRepository.java
src/main/java/common/repository/ContractRepository.java
+2
-2
ContractService.java
src/main/java/common/service/ContractService.java
+1
-1
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+4
-3
No files found.
.idea/workspace.xml
View file @
70849a07
This diff is collapsed.
Click to expand it.
src/main/java/common/controller/ContractController.java
View file @
70849a07
...
...
@@ -27,8 +27,8 @@ public class ContractController {
@RequestMapping
(
value
=
"find"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
ResultModel
findAll
(
@CurrentAccount
User
loginAccount
,
@RequestParam
String
startDate
)
{
return
ResultModel
.
OK
(
service
.
findAll
(
startDate
));
public
ResultModel
findAll
(
@CurrentAccount
User
loginAccount
,
@RequestParam
String
startDate
,
@RequestParam
String
endDate
)
{
return
ResultModel
.
OK
(
service
.
findAll
(
startDate
,
endDate
));
}
@RequestMapping
(
value
=
"checkAccount"
,
method
=
RequestMethod
.
GET
)
...
...
src/main/java/common/model/Contract.java
View file @
70849a07
...
...
@@ -29,6 +29,7 @@ public class Contract {
private
String
status
;
private
String
saleName
;
private
String
priceLevelName
;
private
Long
payMoney
;
private
Long
modifyAccount
;
private
Long
createAccount
;
...
...
@@ -206,6 +207,14 @@ public class Contract {
this
.
status
=
status
;
}
public
Long
getPayMoney
()
{
return
payMoney
;
}
public
void
setPayMoney
(
Long
payMoney
)
{
this
.
payMoney
=
payMoney
;
}
@Transient
public
String
getSaleName
()
{
return
saleName
;
...
...
src/main/java/common/repository/ContractRepository.java
View file @
70849a07
...
...
@@ -18,6 +18,6 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query
(
value
=
"select count(*) from contract where email = ?1"
,
nativeQuery
=
true
)
BigInteger
countNumByEmail
(
String
email
);
@Query
(
value
=
"select * from contract where
start_date = ?1 order by start_date
desc"
,
nativeQuery
=
true
)
List
<
Contract
>
findByDs
(
String
ds
);
@Query
(
value
=
"select * from contract where
ds >= ?1 and ds <= ?2 order by ds
desc"
,
nativeQuery
=
true
)
List
<
Contract
>
findByDs
(
String
startDate
,
String
endDate
);
}
src/main/java/common/service/ContractService.java
View file @
70849a07
...
...
@@ -29,6 +29,6 @@ public interface ContractService {
Contract
update
(
User
loginUser
,
Contract
resource
);
List
<
Contract
>
findAll
(
String
ds
);
List
<
Contract
>
findAll
(
String
startDate
,
String
endDate
);
}
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
70849a07
...
...
@@ -94,7 +94,8 @@ public class ContractServiceImpl implements ContractService{
resource
.
setDs
(
DateUtil
.
getBeforeDays
(
0
));
resource
.
setStatus
(
"executing"
);
}
Double
rebat
=
getRebat
(
resource
.
getProduct
(),
resource
.
getPriceLevel
().
intValue
(),
resource
.
getMoney
());
resource
.
setRebate
(
rebat
);
return
contractRepository
.
save
(
resource
);
}
...
...
@@ -104,7 +105,7 @@ public class ContractServiceImpl implements ContractService{
}
@Override
public
List
<
Contract
>
findAll
(
String
ds
)
{
public
List
<
Contract
>
findAll
(
String
startDate
,
String
endDate
)
{
List
<
Contract
>
result
=
new
ArrayList
<>();
List
<
User
>
sales
=
userRepository
.
findAllSales
();
Map
<
Long
,
String
>
saleMap
=
new
HashMap
<>();
...
...
@@ -120,7 +121,7 @@ public class ContractServiceImpl implements ContractService{
typeMap
.
put
(
s
.
getId
(),
s
.
getPackageName
());
}
}
List
<
Contract
>
contractList
=
contractRepository
.
findByDs
(
ds
);
List
<
Contract
>
contractList
=
contractRepository
.
findByDs
(
startDate
,
endDate
);
if
(
ValidateUtil
.
isValid
(
contractList
)){
for
(
Contract
c
:
contractList
){
c
.
setSaleName
(
saleMap
.
containsKey
(
c
.
getSale
())
?
saleMap
.
get
(
c
.
getSale
())
:
""
);
...
...
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