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
e68666a8
Commit
e68666a8
authored
Nov 23, 2021
by
季圣华
Browse files
给商品导入增加保质期字段,给商品导入增加条码重复校验
parent
68e06657
Changes
1
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/service/material/MaterialService.java
View file @
e68666a8
...
...
@@ -471,7 +471,7 @@ public class MaterialService {
String
model
=
ExcelUtils
.
getContent
(
src
,
i
,
2
);
//型号
String
color
=
ExcelUtils
.
getContent
(
src
,
i
,
3
);
//颜色
String
categoryName
=
ExcelUtils
.
getContent
(
src
,
i
,
4
);
//类别
String
safetyStock
=
ExcelUtils
.
getContent
(
src
,
i
,
5
);
//
安全存量
String
expiryNum
=
ExcelUtils
.
getContent
(
src
,
i
,
5
);
//
保质期
String
unit
=
ExcelUtils
.
getContent
(
src
,
i
,
6
);
//基础单位
//校验名称、单位是否为空
if
(
StringUtil
.
isNotEmpty
(
name
)
&&
StringUtil
.
isNotEmpty
(
unit
))
{
...
...
@@ -484,6 +484,9 @@ public class MaterialService {
if
(
null
!=
categoryId
){
m
.
setCategoryId
(
categoryId
);
}
if
(
StringUtil
.
isNotEmpty
(
expiryNum
))
{
m
.
setExpiryNum
(
Integer
.
parseInt
(
expiryNum
));
}
String
manyUnit
=
ExcelUtils
.
getContent
(
src
,
i
,
7
);
//副单位
String
barCode
=
ExcelUtils
.
getContent
(
src
,
i
,
8
);
//基础条码
String
manyBarCode
=
ExcelUtils
.
getContent
(
src
,
i
,
9
);
//副条码
...
...
@@ -492,6 +495,18 @@ public class MaterialService {
String
commodityDecimal
=
ExcelUtils
.
getContent
(
src
,
i
,
12
);
//零售价
String
wholesaleDecimal
=
ExcelUtils
.
getContent
(
src
,
i
,
13
);
//销售价
String
lowDecimal
=
ExcelUtils
.
getContent
(
src
,
i
,
14
);
//最低售价
String
enabled
=
ExcelUtils
.
getContent
(
src
,
i
,
15
);
//状态
//校验条码是否存在
List
<
MaterialVo4Unit
>
basicMaterialList
=
getMaterialByBarCode
(
barCode
);
if
(
basicMaterialList
!=
null
&&
basicMaterialList
.
size
()>
0
)
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
MATERIAL_BARCODE_EXISTS_CODE
,
String
.
format
(
ExceptionConstants
.
MATERIAL_BARCODE_EXISTS_MSG
,
barCode
));
}
List
<
MaterialVo4Unit
>
otherMaterialList
=
getMaterialByBarCode
(
manyBarCode
);
if
(
otherMaterialList
!=
null
&&
otherMaterialList
.
size
()>
0
)
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
MATERIAL_BARCODE_EXISTS_CODE
,
String
.
format
(
ExceptionConstants
.
MATERIAL_BARCODE_EXISTS_MSG
,
manyBarCode
));
}
JSONObject
materialExObj
=
new
JSONObject
();
JSONObject
basicObj
=
new
JSONObject
();
basicObj
.
put
(
"barCode"
,
barCode
);
...
...
@@ -522,7 +537,6 @@ public class MaterialService {
m
.
setUnit
(
unit
);
}
m
.
setMaterialExObj
(
materialExObj
);
String
enabled
=
ExcelUtils
.
getContent
(
src
,
i
,
15
);
//状态
m
.
setEnabled
(
enabled
.
equals
(
"1"
)?
true
:
false
);
//缓存各个仓库的库存信息
Map
<
Long
,
BigDecimal
>
stockMap
=
new
HashMap
<
Long
,
BigDecimal
>();
...
...
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