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
89ce695b
Commit
89ce695b
authored
Jun 02, 2021
by
季圣华
Browse files
单据的账户进行非空判断
parent
6d7cbe76
Changes
1
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
89ce695b
...
...
@@ -531,9 +531,14 @@ public class DepotHeadService {
HttpServletRequest
request
)
throws
Exception
{
/**处理单据主表数据*/
DepotHead
depotHead
=
JSONObject
.
parseObject
(
beanJson
,
DepotHead
.
class
);
if
(
StringUtil
.
isEmpty
(
depotHead
.
getAccountIdList
())
&&
depotHead
.
getAccountId
()==
null
)
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_ACCOUNT_FAILED_CODE
,
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_ACCOUNT_FAILED_MSG
));
String
subType
=
depotHead
.
getSubType
();
if
(
"零售"
.
equals
(
subType
)
||
"零售退货"
.
equals
(
subType
)
||
"采购"
.
equals
(
subType
)
||
"采购退货"
.
equals
(
subType
)
||
"销售"
.
equals
(
subType
)
||
"销售退货"
.
equals
(
subType
))
{
if
(
StringUtil
.
isEmpty
(
depotHead
.
getAccountIdList
())
&&
depotHead
.
getAccountId
()
==
null
)
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_ACCOUNT_FAILED_CODE
,
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_ACCOUNT_FAILED_MSG
));
}
}
//判断用户是否已经登录过,登录过不再处理
User
userInfo
=
userService
.
getCurrentUser
();
...
...
@@ -598,9 +603,14 @@ public class DepotHeadService {
BigDecimal
preTotalPrice
,
Long
tenantId
,
HttpServletRequest
request
)
throws
Exception
{
/**更新单据主表信息*/
DepotHead
depotHead
=
JSONObject
.
parseObject
(
beanJson
,
DepotHead
.
class
);
if
(
StringUtil
.
isEmpty
(
depotHead
.
getAccountIdList
())
&&
depotHead
.
getAccountId
()==
null
)
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_ACCOUNT_FAILED_CODE
,
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_ACCOUNT_FAILED_MSG
));
String
subType
=
depotHead
.
getSubType
();
if
(
"零售"
.
equals
(
subType
)
||
"零售退货"
.
equals
(
subType
)
||
"采购"
.
equals
(
subType
)
||
"采购退货"
.
equals
(
subType
)
||
"销售"
.
equals
(
subType
)
||
"销售退货"
.
equals
(
subType
))
{
if
(
StringUtil
.
isEmpty
(
depotHead
.
getAccountIdList
())
&&
depotHead
.
getAccountId
()
==
null
)
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_ACCOUNT_FAILED_CODE
,
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_ACCOUNT_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