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
5ffaf4ce
Commit
5ffaf4ce
authored
May 31, 2021
by
季圣华
Browse files
单据校验
parent
64d8e875
Changes
3
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/constants/ExceptionConstants.java
View file @
5ffaf4ce
...
...
@@ -306,6 +306,9 @@ public class ExceptionConstants {
//单据录入-调入仓库不能为空
public
static
final
int
DEPOT_HEAD_ANOTHER_DEPOT_FAILED_CODE
=
8500005
;
public
static
final
String
DEPOT_HEAD_ANOTHER_DEPOT_FAILED_MSG
=
"调入仓库不能为空"
;
//单据录入-明细不能为空
public
static
final
int
DEPOT_HEAD_ROW_FAILED_CODE
=
8500006
;
public
static
final
String
DEPOT_HEAD_ROW_FAILED_MSG
=
"单据明细不能为空"
;
/**
* 单据明细信息
* type = 90
...
...
@@ -332,6 +335,9 @@ public class ExceptionConstants {
//修改财务信息失败
public
static
final
int
ACCOUNT_HEAD_EDIT_FAILED_CODE
=
9500002
;
public
static
final
String
ACCOUNT_HEAD_EDIT_FAILED_MSG
=
"修改财务信息失败"
;
//单据录入-明细不能为空
public
static
final
int
ACCOUNT_HEAD_ROW_FAILED_CODE
=
9500003
;
public
static
final
String
ACCOUNT_HEAD_ROW_FAILED_MSG
=
"单据明细不能为空"
;
/**
* 财务明细信息
* type = 100
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/accountItem/AccountItemService.java
View file @
5ffaf4ce
...
...
@@ -3,12 +3,14 @@ package com.jsh.erp.service.accountItem;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.datasource.entities.AccountItem
;
import
com.jsh.erp.datasource.entities.AccountItemExample
;
import
com.jsh.erp.datasource.entities.User
;
import
com.jsh.erp.datasource.mappers.AccountItemMapper
;
import
com.jsh.erp.datasource.mappers.AccountItemMapperEx
;
import
com.jsh.erp.datasource.vo.AccountItemVo4List
;
import
com.jsh.erp.exception.BusinessRunTimeException
;
import
com.jsh.erp.exception.JshException
;
import
com.jsh.erp.service.log.LogService
;
import
com.jsh.erp.service.user.UserService
;
...
...
@@ -186,7 +188,7 @@ public class AccountItemService {
//删除单据的明细
deleteAccountItemHeadId
(
headerId
);
JSONArray
rowArr
=
JSONArray
.
parseArray
(
rows
);
if
(
null
!=
rowArr
)
{
if
(
null
!=
rowArr
&&
rowArr
.
size
()>
0
)
{
for
(
int
i
=
0
;
i
<
rowArr
.
size
();
i
++)
{
AccountItem
accountItem
=
new
AccountItem
();
JSONObject
tempInsertedJson
=
JSONObject
.
parseObject
(
rowArr
.
getString
(
i
));
...
...
@@ -209,6 +211,9 @@ public class AccountItemService {
accountItem
.
setRemark
(
tempInsertedJson
.
getString
(
"remark"
));
this
.
insertAccountItemWithObj
(
accountItem
);
}
}
else
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
ACCOUNT_HEAD_ROW_FAILED_CODE
,
String
.
format
(
ExceptionConstants
.
ACCOUNT_HEAD_ROW_FAILED_MSG
));
}
}
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java
View file @
5ffaf4ce
...
...
@@ -316,7 +316,7 @@ public class DepotItemService {
//删除单据的明细
deleteDepotItemHeadId
(
headerId
);
JSONArray
rowArr
=
JSONArray
.
parseArray
(
rows
);
if
(
null
!=
rowArr
)
{
if
(
null
!=
rowArr
&&
rowArr
.
size
()>
0
)
{
for
(
int
i
=
0
;
i
<
rowArr
.
size
();
i
++)
{
DepotItem
depotItem
=
new
DepotItem
();
JSONObject
rowObj
=
JSONObject
.
parseObject
(
rowArr
.
getString
(
i
));
...
...
@@ -411,6 +411,9 @@ public class DepotItemService {
//更新当前库存
updateCurrentStock
(
depotItem
,
tenantId
);
}
}
else
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_ROW_FAILED_CODE
,
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_ROW_FAILED_MSG
));
}
}
...
...
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