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
c79d065d
Commit
c79d065d
authored
Aug 04, 2021
by
季圣华
Browse files
解决商品多属性的bug
parent
4d126849
Changes
5
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/docs/jsh_erp.sql
View file @
c79d065d
...
@@ -434,8 +434,8 @@ CREATE TABLE `jsh_material_attribute` (
...
@@ -434,8 +434,8 @@ CREATE TABLE `jsh_material_attribute` (
-- ----------------------------
-- ----------------------------
-- Records of jsh_material_attribute
-- Records of jsh_material_attribute
-- ----------------------------
-- ----------------------------
INSERT
INTO
`jsh_material_attribute`
VALUES
(
'1'
,
'manyColor'
,
'颜色'
,
'红色|橙色|黄色|绿色|蓝色|紫色'
,
'63'
,
'0'
);
INSERT
INTO
`jsh_material_attribute`
VALUES
(
'1'
,
'manyColor'
,
'
多
颜色'
,
'红色|橙色|黄色|绿色|蓝色|紫色'
,
'63'
,
'0'
);
INSERT
INTO
`jsh_material_attribute`
VALUES
(
'2'
,
'manySize'
,
'尺寸'
,
'S|M|L|XL|XXL|XXXL'
,
'63'
,
'0'
);
INSERT
INTO
`jsh_material_attribute`
VALUES
(
'2'
,
'manySize'
,
'
多
尺寸'
,
'S|M|L|XL|XXL|XXXL'
,
'63'
,
'0'
);
INSERT
INTO
`jsh_material_attribute`
VALUES
(
'3'
,
'other1'
,
'自定义1'
,
'小米|华为'
,
'63'
,
'0'
);
INSERT
INTO
`jsh_material_attribute`
VALUES
(
'3'
,
'other1'
,
'自定义1'
,
'小米|华为'
,
'63'
,
'0'
);
INSERT
INTO
`jsh_material_attribute`
VALUES
(
'4'
,
'other2'
,
'自定义2'
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_material_attribute`
VALUES
(
'4'
,
'other2'
,
'自定义2'
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_material_attribute`
VALUES
(
'5'
,
'other3'
,
'自定义3'
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_material_attribute`
VALUES
(
'5'
,
'other3'
,
'自定义3'
,
null
,
'63'
,
'0'
);
...
...
jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt
View file @
c79d065d
...
@@ -1143,8 +1143,8 @@ CREATE TABLE `jsh_material_attribute` (
...
@@ -1143,8 +1143,8 @@ CREATE TABLE `jsh_material_attribute` (
PRIMARY KEY (`id`)
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='产品属性表';
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='产品属性表';
INSERT INTO `jsh_material_attribute` VALUES ('1', 'manyColor', '颜色', '红色|橙色|黄色|绿色|蓝色|紫色', '63', '0');
INSERT INTO `jsh_material_attribute` VALUES ('1', 'manyColor', '
多
颜色', '红色|橙色|黄色|绿色|蓝色|紫色', '63', '0');
INSERT INTO `jsh_material_attribute` VALUES ('2', 'manySize', '尺寸', 'S|M|L|XL|XXL|XXXL', '63', '0');
INSERT INTO `jsh_material_attribute` VALUES ('2', 'manySize', '
多
尺寸', 'S|M|L|XL|XXL|XXXL', '63', '0');
INSERT INTO `jsh_material_attribute` VALUES ('3', 'other1', '自定义1', '小米|华为', '63', '0');
INSERT INTO `jsh_material_attribute` VALUES ('3', 'other1', '自定义1', '小米|华为', '63', '0');
INSERT INTO `jsh_material_attribute` VALUES ('4', 'other2', '自定义2', null, '63', '0');
INSERT INTO `jsh_material_attribute` VALUES ('4', 'other2', '自定义2', null, '63', '0');
INSERT INTO `jsh_material_attribute` VALUES ('5', 'other3', '自定义3', null, '63', '0');
INSERT INTO `jsh_material_attribute` VALUES ('5', 'other3', '自定义3', null, '63', '0');
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/material/MaterialService.java
View file @
c79d065d
...
@@ -791,7 +791,11 @@ public class MaterialService {
...
@@ -791,7 +791,11 @@ public class MaterialService {
public
String
getMaxBarCode
()
{
public
String
getMaxBarCode
()
{
String
maxBarCodeOld
=
materialMapperEx
.
getMaxBarCode
();
String
maxBarCodeOld
=
materialMapperEx
.
getMaxBarCode
();
return
Long
.
parseLong
(
maxBarCodeOld
)+
""
;
if
(
StringUtil
.
isNotEmpty
(
maxBarCodeOld
))
{
return
Long
.
parseLong
(
maxBarCodeOld
)+
""
;
}
else
{
return
"1000"
;
}
}
}
public
List
<
String
>
getMaterialNameList
()
{
public
List
<
String
>
getMaterialNameList
()
{
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/materialAttribute/MaterialAttributeService.java
View file @
c79d065d
...
@@ -193,12 +193,23 @@ public class MaterialAttributeService {
...
@@ -193,12 +193,23 @@ public class MaterialAttributeService {
}
}
public
String
getNameByField
(
String
field
)
{
public
String
getNameByField
(
String
field
)
{
String
res
=
""
;
if
(
"manyColor"
.
equals
(
field
)){
res
=
"多颜色"
;
}
else
if
(
"manySize"
.
equals
(
field
)){
res
=
"多尺寸"
;
}
else
if
(
"other1"
.
equals
(
field
)){
res
=
"自定义1"
;
}
else
if
(
"other2"
.
equals
(
field
)){
res
=
"自定义2"
;
}
else
if
(
"other3"
.
equals
(
field
)){
res
=
"自定义3"
;
}
MaterialAttribute
ma
=
getInfoByField
(
field
);
MaterialAttribute
ma
=
getInfoByField
(
field
);
if
(
ma
!=
null
)
{
if
(
ma
!=
null
&&
StringUtil
.
isNotEmpty
(
ma
.
getAttributeName
()))
{
return
ma
.
getAttributeName
();
res
=
ma
.
getAttributeName
();
}
else
{
return
null
;
}
}
return
res
;
}
}
public
JSONArray
getValueArrByField
(
String
field
)
{
public
JSONArray
getValueArrByField
(
String
field
)
{
...
...
jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml
View file @
c79d065d
...
@@ -276,9 +276,9 @@
...
@@ -276,9 +276,9 @@
</select>
</select>
<select
id=
"getMaxBarCode"
resultType=
"java.lang.String"
>
<select
id=
"getMaxBarCode"
resultType=
"java.lang.String"
>
select max(CAST(
l
.bar_code AS SIGNED)) bar_code from jsh_material_extend
l
select max(CAST(
me
.bar_code AS SIGNED)) bar_code from jsh_material_extend
me
where 1=1
where 1=1
and ifnull(
l
.delete_Flag,'0') !='1'
and ifnull(
me
.delete_Flag,'0') !='1'
</select>
</select>
<select
id=
"getMaterialByMeId"
parameterType=
"com.jsh.erp.datasource.entities.MaterialExample"
resultMap=
"ResultMapList"
>
<select
id=
"getMaterialByMeId"
parameterType=
"com.jsh.erp.datasource.entities.MaterialExample"
resultMap=
"ResultMapList"
>
...
...
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