Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
f7e1fb5c
Commit
f7e1fb5c
authored
Jul 11, 2021
by
季圣华
Browse files
对欠款进行校验
parent
b2603aec
Changes
2
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/constants/ExceptionConstants.java
View file @
f7e1fb5c
...
...
@@ -318,6 +318,9 @@ public class ExceptionConstants {
//单据录入-请修改多账户的结算金额
public
static
final
int
DEPOT_HEAD_MANY_ACCOUNT_FAILED_CODE
=
8500008
;
public
static
final
String
DEPOT_HEAD_MANY_ACCOUNT_FAILED_MSG
=
"请修改多账户的结算金额"
;
//单据录入-退货单不能欠款
public
static
final
int
DEPOT_HEAD_BACK_BILL_DEBT_FAILED_CODE
=
8500009
;
public
static
final
String
DEPOT_HEAD_BACK_BILL_DEBT_FAILED_MSG
=
"退货单不能欠款"
;
/**
* 单据明细信息
* type = 90
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
f7e1fb5c
...
...
@@ -629,6 +629,13 @@ public class DepotHeadService {
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_ACCOUNT_FAILED_MSG
));
}
}
//欠款校验
if
(
"采购退货"
.
equals
(
subType
)
||
"销售退货"
.
equals
(
subType
))
{
if
(
depotHead
.
getChangeAmount
().
abs
().
compareTo
(
depotHead
.
getDiscountLastMoney
().
add
(
depotHead
.
getOtherMoney
()))!=
0
)
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_BACK_BILL_DEBT_FAILED_CODE
,
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_BACK_BILL_DEBT_FAILED_MSG
));
}
}
//判断用户是否已经登录过,登录过不再处理
User
userInfo
=
userService
.
getCurrentUser
();
depotHead
.
setCreator
(
userInfo
==
null
?
null
:
userInfo
.
getId
());
...
...
@@ -708,6 +715,13 @@ public class DepotHeadService {
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_ACCOUNT_FAILED_MSG
));
}
}
//欠款校验
if
(
"采购退货"
.
equals
(
subType
)
||
"销售退货"
.
equals
(
subType
))
{
if
(
depotHead
.
getChangeAmount
().
abs
().
compareTo
(
depotHead
.
getDiscountLastMoney
().
add
(
depotHead
.
getOtherMoney
()))!=
0
)
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_BACK_BILL_DEBT_FAILED_CODE
,
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_BACK_BILL_DEBT_FAILED_MSG
));
}
}
if
(
StringUtil
.
isNotEmpty
(
depotHead
.
getAccountIdList
())){
depotHead
.
setAccountIdList
(
depotHead
.
getAccountIdList
().
replace
(
"["
,
""
).
replace
(
"]"
,
""
).
replaceAll
(
"\""
,
""
));
}
...
...
Write
Preview
Supports
Markdown
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