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
8098c69b
Commit
8098c69b
authored
5 years ago
by
kangxiaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
先回款
parent
b997e771
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
20 deletions
+43
-20
ContractController.java
src/main/java/common/controller/ContractController.java
+8
-8
Contract.java
src/main/java/common/model/Contract.java
+10
-0
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+25
-12
No files found.
src/main/java/common/controller/ContractController.java
View file @
8098c69b
...
...
@@ -137,14 +137,14 @@ public class ContractController {
if
(
ValidateUtil
.
isValid
(
moneyList
)){
for
(
ContractMoney
c
:
moneyList
){
sb
.
append
(
c
.
getDs
()).
append
(
","
)
.
append
(
c
.
getContractCode
()).
append
(
","
)
.
append
(
c
.
getEmail
()).
append
(
","
)
.
append
(
c
.
getCompany
()).
append
(
","
)
.
append
(
c
.
getPackageName
()).
append
(
","
)
.
append
(
c
.
getSalseName
()).
append
(
","
)
.
append
(
map
.
get
(
c
.
getType
())).
append
(
","
)
.
append
(
c
.
getMoney
()).
append
(
","
)
.
append
(
c
.
getCreateName
()).
append
(
"\r\n"
);
.
append
(
c
.
getContractCode
()
==
null
?
""
:
c
.
getContractCode
()
).
append
(
","
)
.
append
(
c
.
getEmail
()
==
null
?
""
:
c
.
getEmail
()
).
append
(
","
)
.
append
(
c
.
getCompany
()
==
null
?
""
:
c
.
getCompany
()
).
append
(
","
)
.
append
(
c
.
getPackageName
()
==
null
?
""
:
c
.
getPackageName
()
).
append
(
","
)
.
append
(
c
.
getSalseName
()
==
null
?
""
:
c
.
getSalseName
()
).
append
(
","
)
.
append
(
map
.
get
(
c
.
getType
()
==
null
?
""
:
c
.
getType
()
)).
append
(
","
)
.
append
(
c
.
getMoney
()
==
null
?
""
:
c
.
getMoney
()
).
append
(
","
)
.
append
(
c
.
getCreateName
()
==
null
?
""
:
c
.
getCreateName
()
).
append
(
"\r\n"
);
if
(
"pay"
.
equals
(
c
.
getType
())){
// 付款
...
...
This diff is collapsed.
Click to expand it.
src/main/java/common/model/Contract.java
View file @
8098c69b
...
...
@@ -53,6 +53,8 @@ public class Contract {
private
String
ds
;
private
Boolean
virtual
;
private
Long
firstBackId
;
//先回款记录的id
/**
* 新增字段 20190427
*/
...
...
@@ -88,6 +90,14 @@ public class Contract {
this
.
virtual
=
virtual
;
}
public
Long
getFirstBackId
()
{
return
firstBackId
;
}
public
void
setFirstBackId
(
Long
firstBackId
)
{
this
.
firstBackId
=
firstBackId
;
}
public
String
getProduct
()
{
return
product
;
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
8098c69b
...
...
@@ -666,6 +666,14 @@ public class ContractServiceImpl implements ContractService {
resource
.
setModifyAccount
(
loginUser
.
getId
());
}
if
(
ContractStatusEnum
.
MONEY_BACK_FIRST
.
getKey
().
equals
(
contract
.
getStatus
()))
{
ContractMoney
contractMoney
=
contractMoneyRepository
.
findOne
(
contract
.
getFirstBackId
());
if
(
contractMoney
!=
null
)
{
contractMoney
.
setContractCode
(
resource
.
getContractCode
());
contractMoneyRepository
.
save
(
contractMoney
);
}
}
resource
.
setId
(
contract
.
getId
());
return
contractRepository
.
save
(
resource
);
...
...
@@ -887,21 +895,22 @@ public class ContractServiceImpl implements ContractService {
private
void
dealContractStatus
(
Contract
resource
,
User
loginUser
,
String
type
)
{
ContractMoney
money
=
new
ContractMoney
();
if
(
resource
.
getPayMoney
()
!=
null
)
{
if
(
resource
.
getMoney
()
==
null
)
{
resource
.
setMoney
(
0L
);
}
if
(
ContractStatusEnum
.
MONEY_BACK_FIRST
.
getKey
().
equals
(
resource
.
getStatus
()))
{
resource
.
setStatus
(
ContractStatusEnum
.
MONEY_BACK_FIRST
.
getKey
());
//记录收款记录
ContractMoney
money
=
new
ContractMoney
();
money
.
setType
(
"pay"
);
saveContractMoney
(
money
,
loginUser
,
resource
,
type
);
money
.
setType
(
"pay"
);
money
=
saveContractMoney
(
money
,
loginUser
,
resource
,
type
);
}
else
if
(
resource
.
getPayMoney
().
longValue
()
<=
0
)
{
//未回款
...
...
@@ -912,17 +921,15 @@ public class ContractServiceImpl implements ContractService {
resource
.
setStatus
(
ContractStatusEnum
.
MONEY_BACK_PART
.
getKey
());
//记录收款记录
ContractMoney
money
=
new
ContractMoney
();
money
.
setType
(
"pay"
);
saveContractMoney
(
money
,
loginUser
,
resource
,
type
);
money
=
saveContractMoney
(
money
,
loginUser
,
resource
,
type
);
}
else
{
// 已回款
resource
.
setStatus
(
ContractStatusEnum
.
MONEY_BACK_ALL
.
getKey
());
ContractMoney
money
=
new
ContractMoney
();
money
.
setType
(
"pay"
);
saveContractMoney
(
money
,
loginUser
,
resource
,
type
);
money
=
saveContractMoney
(
money
,
loginUser
,
resource
,
type
);
}
...
...
@@ -931,6 +938,12 @@ public class ContractServiceImpl implements ContractService {
resource
.
setStatus
(
ContractStatusEnum
.
MONEY_BACK_NONE
.
getKey
());
}
if
(
money
.
getId
()!=
null
){
resource
.
setFirstBackId
(
money
.
getId
());
}
else
{
resource
.
setFirstBackId
(
0L
);
}
if
(
resource
.
getPayMoney
()
==
null
)
{
resource
.
setPayMoney
(
0L
);
}
...
...
@@ -939,7 +952,6 @@ public class ContractServiceImpl implements ContractService {
resource
.
setInvoiceMoney
(
new
BigDecimal
(
0
));
}
else
{
// 记录发票记录
ContractMoney
money
=
new
ContractMoney
();
money
.
setType
(
"invoice"
);
saveContractMoney
(
money
,
loginUser
,
resource
,
type
);
}
...
...
@@ -967,10 +979,10 @@ public class ContractServiceImpl implements ContractService {
//保存开票收款记录
private
void
saveContractMoney
(
ContractMoney
money
,
User
loginUser
,
Contract
contract
,
String
type
)
{
private
ContractMoney
saveContractMoney
(
ContractMoney
money
,
User
loginUser
,
Contract
contract
,
String
type
)
{
if
(!
"save"
.
equals
(
type
))
{
return
;
return
money
;
}
if
(
ContractStatusEnum
.
MONEY_BACK_FIRST
.
getKey
().
equals
(
contract
.
getStatus
())){
...
...
@@ -1003,7 +1015,8 @@ public class ContractServiceImpl implements ContractService {
money
.
setUser
(
loginUser
.
getId
());
money
.
setCreateName
(
loginUser
.
getName
());
money
.
setDs
(
new
DateTime
().
toString
(
"yyyy-MM-dd"
));
contractMoneyRepository
.
save
(
money
);
money
=
contractMoneyRepository
.
save
(
money
);
return
money
;
}
// 保存优惠流量 优惠时长 记录
...
...
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