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
62ef2b39
Commit
62ef2b39
authored
Sep 09, 2022
by
季圣华
Browse files
给组装拆卸、调拨单增加校验
parent
aa72b0bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java
View file @
62ef2b39
...
...
@@ -93,6 +93,8 @@ public class BusinessConstants {
public
static
final
String
SUB_TYPE_SALES_RETURN
=
"销售退货"
;
public
static
final
String
SUB_TYPE_TRANSFER
=
"调拨"
;
public
static
final
String
SUB_TYPE_REPLAY
=
"盘点复盘"
;
public
static
final
String
SUB_TYPE_ASSEMBLE
=
"组装单"
;
public
static
final
String
SUB_TYPE_DISASSEMBLE
=
"拆卸单"
;
/**
* 批量插入sql时最大的数据条数
* */
...
...
jshERP-boot/src/main/java/com/jsh/erp/constants/ExceptionConstants.java
View file @
62ef2b39
...
...
@@ -326,6 +326,12 @@ public class ExceptionConstants {
//比例格式错误
public
static
final
int
MATERIAL_RATIO_NOT_INTEGER_CODE
=
8000016
;
public
static
final
String
MATERIAL_RATIO_NOT_INTEGER_MSG
=
"第%s行比例格式错误"
;
//组装拆卸单不能选择批号或序列号商品
public
static
final
int
MATERIAL_ASSEMBLE_SELECT_ERROR_CODE
=
80000017
;
public
static
final
String
MATERIAL_ASSEMBLE_SELECT_ERROR_MSG
=
"抱歉,组装拆卸单不能选择批号或序列号商品:%s"
;
//调拨单不能选择批号或序列号商品
public
static
final
int
MATERIAL_TRANSFER_SELECT_ERROR_CODE
=
80000018
;
public
static
final
String
MATERIAL_TRANSFER_SELECT_ERROR_MSG
=
"抱歉,调拨单不能选择批号或序列号商品:%s"
;
/**
* 单据信息
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java
View file @
62ef2b39
...
...
@@ -406,6 +406,20 @@ public class DepotItemService {
depotItem
.
setMaterialExtendId
(
materialExtend
.
getId
());
depotItem
.
setMaterialUnit
(
rowObj
.
getString
(
"unit"
));
Material
material
=
materialService
.
getMaterial
(
depotItem
.
getMaterialId
());
if
(
BusinessConstants
.
ENABLE_SERIAL_NUMBER_ENABLED
.
equals
(
material
.
getEnableSerialNumber
())
||
BusinessConstants
.
ENABLE_BATCH_NUMBER_ENABLED
.
equals
(
material
.
getEnableBatchNumber
()))
{
//组装拆卸单不能选择批号或序列号商品
if
(
BusinessConstants
.
SUB_TYPE_ASSEMBLE
.
equals
(
depotHead
.
getSubType
())
||
BusinessConstants
.
SUB_TYPE_DISASSEMBLE
.
equals
(
depotHead
.
getSubType
()))
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
MATERIAL_ASSEMBLE_SELECT_ERROR_CODE
,
String
.
format
(
ExceptionConstants
.
MATERIAL_ASSEMBLE_SELECT_ERROR_MSG
,
barCode
));
}
//调拨单不能选择批号或序列号商品(该场景走出库和入库单)
if
(
BusinessConstants
.
SUB_TYPE_TRANSFER
.
equals
(
depotHead
.
getSubType
()))
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
MATERIAL_TRANSFER_SELECT_ERROR_CODE
,
String
.
format
(
ExceptionConstants
.
MATERIAL_TRANSFER_SELECT_ERROR_MSG
,
barCode
));
}
}
if
(
StringUtil
.
isExist
(
rowObj
.
get
(
"snList"
)))
{
depotItem
.
setSnList
(
rowObj
.
getString
(
"snList"
));
if
(
StringUtil
.
isExist
(
rowObj
.
get
(
"depotId"
)))
{
...
...
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