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
97caee98
Commit
97caee98
authored
Jan 18, 2018
by
manxiaoqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合同
parent
70849a07
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
581 additions
and
13 deletions
+581
-13
workspace.xml
.idea/workspace.xml
+0
-0
ContractController.java
src/main/java/common/controller/ContractController.java
+39
-3
Contract.java
src/main/java/common/model/Contract.java
+18
-0
ContractChange.java
src/main/java/common/model/ContractChange.java
+151
-0
ContractMoney.java
src/main/java/common/model/ContractMoney.java
+133
-0
ContractChangeRepository.java
...main/java/common/repository/ContractChangeRepository.java
+19
-0
ContractMoneyRepository.java
src/main/java/common/repository/ContractMoneyRepository.java
+17
-0
ContractRepository.java
src/main/java/common/repository/ContractRepository.java
+3
-0
ContractService.java
src/main/java/common/service/ContractService.java
+10
-3
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+191
-7
No files found.
.idea/workspace.xml
View file @
97caee98
This diff is collapsed.
Click to expand it.
src/main/java/common/controller/ContractController.java
View file @
97caee98
package
common
.
controller
;
import
common.model.Contract
;
import
common.model.Menu
;
import
common.model.User
;
import
common.model.*
;
import
common.service.ContractService
;
import
common.service.MenuService
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -74,4 +72,42 @@ public class ContractController {
public
ResultModel
create
(
@CurrentAccount
User
loginAccount
,
@RequestBody
Contract
contract
)
{
return
ResultModel
.
OK
(
service
.
create
(
loginAccount
,
contract
));
}
@RequestMapping
(
value
=
"update"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
public
ResultModel
update
(
@CurrentAccount
User
loginAccount
,
@RequestBody
Contract
contract
)
{
return
ResultModel
.
OK
(
service
.
update
(
loginAccount
,
contract
));
}
@RequestMapping
(
value
=
"pay"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
ResultModel
pay
(
@CurrentAccount
User
loginAccount
,
@RequestBody
ContractMoney
contract
)
{
return
ResultModel
.
OK
(
service
.
pay
(
loginAccount
,
contract
));
}
@RequestMapping
(
value
=
"change"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
ResultModel
change
(
@CurrentAccount
User
loginAccount
,
@RequestBody
ContractChange
contract
)
{
return
ResultModel
.
OK
(
service
.
change
(
loginAccount
,
contract
));
}
@RequestMapping
(
value
=
"find/pay"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
ResultModel
findPay
(
@CurrentAccount
User
loginAccount
,
@RequestParam
String
startDate
,
@RequestParam
String
endDate
,
@RequestParam
String
code
)
{
return
ResultModel
.
OK
(
service
.
findPay
(
startDate
,
endDate
,
code
));
}
@RequestMapping
(
value
=
"find/change"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
ResultModel
findChange
(
@CurrentAccount
User
loginAccount
,
@RequestParam
String
startDate
,
@RequestParam
String
endDate
,
@RequestParam
String
code
)
{
return
ResultModel
.
OK
(
service
.
findChange
(
startDate
,
endDate
,
code
));
}
@RequestMapping
(
value
=
"update/pay"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
public
ResultModel
updatePay
(
@CurrentAccount
User
loginAccount
,
@RequestBody
ContractMoney
contract
)
{
return
ResultModel
.
OK
(
service
.
updatePay
(
loginAccount
,
contract
));
}
}
src/main/java/common/model/Contract.java
View file @
97caee98
...
...
@@ -30,6 +30,8 @@ public class Contract {
private
String
saleName
;
private
String
priceLevelName
;
private
Long
payMoney
;
private
Long
invoice
;
private
String
createName
;
private
Long
modifyAccount
;
private
Long
createAccount
;
...
...
@@ -215,6 +217,14 @@ public class Contract {
this
.
payMoney
=
payMoney
;
}
public
Long
getInvoice
()
{
return
invoice
;
}
public
void
setInvoice
(
Long
invoice
)
{
this
.
invoice
=
invoice
;
}
@Transient
public
String
getSaleName
()
{
return
saleName
;
...
...
@@ -232,6 +242,14 @@ public class Contract {
this
.
priceLevelName
=
priceLevelName
;
}
public
String
getCreateName
()
{
return
createName
;
}
public
void
setCreateName
(
String
createName
)
{
this
.
createName
=
createName
;
}
@Override
public
String
toString
()
{
return
"Contract{"
+
...
...
src/main/java/common/model/ContractChange.java
0 → 100644
View file @
97caee98
package
common
.
model
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
java.util.Date
;
/**
* Created by mxq on 2018/1/18.
*/
@Entity
public
class
ContractChange
{
private
Long
id
;
private
String
contractCode
;
private
String
email
;
private
String
company
;
private
String
ds
;
private
String
type
;
private
String
content
;
private
Long
level
;
private
Long
money
;
private
Long
user
;
private
String
createName
;
private
Long
modifyAccount
;
private
Long
createAccount
;
private
Date
modifyTime
;
private
Date
createTime
;
@Id
@GeneratedValue
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getDs
()
{
return
ds
;
}
public
void
setDs
(
String
ds
)
{
this
.
ds
=
ds
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
public
Long
getUser
()
{
return
user
;
}
public
void
setUser
(
Long
user
)
{
this
.
user
=
user
;
}
public
String
getContractCode
()
{
return
contractCode
;
}
public
void
setContractCode
(
String
contractCode
)
{
this
.
contractCode
=
contractCode
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
public
String
getCompany
()
{
return
company
;
}
public
void
setCompany
(
String
company
)
{
this
.
company
=
company
;
}
public
Long
getModifyAccount
()
{
return
modifyAccount
;
}
public
void
setModifyAccount
(
Long
modifyAccount
)
{
this
.
modifyAccount
=
modifyAccount
;
}
public
Long
getCreateAccount
()
{
return
createAccount
;
}
public
void
setCreateAccount
(
Long
createAccount
)
{
this
.
createAccount
=
createAccount
;
}
public
Date
getModifyTime
()
{
return
modifyTime
;
}
public
void
setModifyTime
(
Date
modifyTime
)
{
this
.
modifyTime
=
modifyTime
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Long
getLevel
()
{
return
level
;
}
public
void
setLevel
(
Long
level
)
{
this
.
level
=
level
;
}
public
Long
getMoney
()
{
return
money
;
}
public
void
setMoney
(
Long
money
)
{
this
.
money
=
money
;
}
public
String
getCreateName
()
{
return
createName
;
}
public
void
setCreateName
(
String
createName
)
{
this
.
createName
=
createName
;
}
}
src/main/java/common/model/ContractMoney.java
0 → 100644
View file @
97caee98
package
common
.
model
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
java.util.Date
;
/**
* Created by mxq on 2018/1/18.
*/
@Entity
public
class
ContractMoney
{
private
Long
id
;
private
String
contractCode
;
private
String
email
;
private
String
company
;
private
String
ds
;
private
String
type
;
private
Long
money
;
private
Long
user
;
private
String
createName
;
private
Long
modifyAccount
;
private
Long
createAccount
;
private
Date
modifyTime
;
private
Date
createTime
;
@Id
@GeneratedValue
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getContractCode
()
{
return
contractCode
;
}
public
void
setContractCode
(
String
contractCode
)
{
this
.
contractCode
=
contractCode
;
}
public
String
getDs
()
{
return
ds
;
}
public
void
setDs
(
String
ds
)
{
this
.
ds
=
ds
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
Long
getMoney
()
{
return
money
;
}
public
void
setMoney
(
Long
money
)
{
this
.
money
=
money
;
}
public
Long
getUser
()
{
return
user
;
}
public
void
setUser
(
Long
user
)
{
this
.
user
=
user
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
public
String
getCompany
()
{
return
company
;
}
public
void
setCompany
(
String
company
)
{
this
.
company
=
company
;
}
public
Long
getModifyAccount
()
{
return
modifyAccount
;
}
public
void
setModifyAccount
(
Long
modifyAccount
)
{
this
.
modifyAccount
=
modifyAccount
;
}
public
Long
getCreateAccount
()
{
return
createAccount
;
}
public
void
setCreateAccount
(
Long
createAccount
)
{
this
.
createAccount
=
createAccount
;
}
public
Date
getModifyTime
()
{
return
modifyTime
;
}
public
void
setModifyTime
(
Date
modifyTime
)
{
this
.
modifyTime
=
modifyTime
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getCreateName
()
{
return
createName
;
}
public
void
setCreateName
(
String
createName
)
{
this
.
createName
=
createName
;
}
}
src/main/java/common/repository/ContractChangeRepository.java
0 → 100644
View file @
97caee98
package
common
.
repository
;
import
common.model.Contract
;
import
common.model.ContractChange
;
import
common.model.ContractMoney
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigInteger
;
import
java.util.List
;
@Transactional
public
interface
ContractChangeRepository
extends
JpaRepository
<
ContractChange
,
Long
>
{
@Query
(
value
=
"select * from contract_change where ds >= ?1 and ds <= ?2 and contract_code = ?3 order by ds desc"
,
nativeQuery
=
true
)
List
<
ContractChange
>
findByDs
(
String
startDate
,
String
endDate
,
String
code
);
}
src/main/java/common/repository/ContractMoneyRepository.java
0 → 100644
View file @
97caee98
package
common
.
repository
;
import
common.model.Contract
;
import
common.model.ContractChange
;
import
common.model.ContractMoney
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
@Transactional
public
interface
ContractMoneyRepository
extends
JpaRepository
<
ContractMoney
,
Long
>
{
@Query
(
value
=
"select * from contract_money where ds >= ?1 and ds <= ?2 and contract_code = ?3 order by ds desc"
,
nativeQuery
=
true
)
List
<
ContractMoney
>
findByDs
(
String
startDate
,
String
endDate
,
String
code
);
}
src/main/java/common/repository/ContractRepository.java
View file @
97caee98
...
...
@@ -20,4 +20,7 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query
(
value
=
"select * from contract where ds >= ?1 and ds <= ?2 order by ds desc"
,
nativeQuery
=
true
)
List
<
Contract
>
findByDs
(
String
startDate
,
String
endDate
);
@Query
(
value
=
"select * from contract where contract_code = ?1"
,
nativeQuery
=
true
)
Contract
findByCode
(
String
contract_code
);
}
src/main/java/common/service/ContractService.java
View file @
97caee98
package
common
.
service
;
import
common.model.Contract
;
import
common.model.ContractBody
;
import
common.model.User
;
import
common.model.*
;
import
tkio.model.PackageType
;
import
java.util.List
;
...
...
@@ -31,4 +29,13 @@ public interface ContractService {
List
<
Contract
>
findAll
(
String
startDate
,
String
endDate
);
ContractMoney
pay
(
User
loginUser
,
ContractMoney
resource
);
Contract
change
(
User
loginUser
,
ContractChange
resource
);
List
<
ContractMoney
>
findPay
(
String
startDate
,
String
endDate
,
String
code
);
List
<
ContractChange
>
findChange
(
String
startDate
,
String
endDate
,
String
code
);
Contract
updatePay
(
User
loginUser
,
ContractMoney
resource
);
}
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
97caee98
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