Commit 234d607f authored by shiyu's avatar shiyu

标准件

parent 0498e10c
...@@ -69,14 +69,14 @@ public class CategoryVo implements Serializable { ...@@ -69,14 +69,14 @@ public class CategoryVo implements Serializable {
private String material; private String material;
@ApiModelProperty(value = "直径 (mm * 100)") @ApiModelProperty(value = "直径范围")
private Integer diameter; private String diameter;
@ApiModelProperty(value = " 厚度 (mm * 100)") @ApiModelProperty(value = " 厚度范围")
private Integer thickness; private String thickness;
@ApiModelProperty(value = "重量 (g * 100)") @ApiModelProperty(value = "重量范围")
private Integer weight; private String weight;
@ApiModelProperty(value = "合金成分分析表图片路径") @ApiModelProperty(value = "合金成分分析表图片路径")
...@@ -162,9 +162,9 @@ public class CategoryVo implements Serializable { ...@@ -162,9 +162,9 @@ public class CategoryVo implements Serializable {
this.publisher = extractExtra(extraData, "publisher"); this.publisher = extractExtra(extraData, "publisher");
this.exiQuantity = extractExtraInt(extraData, "exiQuantity"); this.exiQuantity = extractExtraInt(extraData, "exiQuantity");
this.dynasty = extractExtra(extraData, "dynasty"); this.dynasty = extractExtra(extraData, "dynasty");
this.diameter = extractExtraInt(extraData, "diameter"); this.diameter = extractExtraString(extraData, "diameter");
this.thickness = extractExtraInt(extraData, "thickness"); this.thickness = extractExtraString(extraData, "thickness");
this.weight = extractExtraInt(extraData, "weight"); this.weight = extractExtraString(extraData, "weight");
this.extendName = extractExtra(extraData, "extendName"); this.extendName = extractExtra(extraData, "extendName");
this.serialNo = extractExtra(extraData, "serialNo"); this.serialNo = extractExtra(extraData, "serialNo");
this.caTableImage = extractExtra(extraData, "caTableImage"); this.caTableImage = extractExtra(extraData, "caTableImage");
...@@ -288,27 +288,27 @@ public class CategoryVo implements Serializable { ...@@ -288,27 +288,27 @@ public class CategoryVo implements Serializable {
this.extendName = extendName; this.extendName = extendName;
} }
public Integer getDiameter() { public String getDiameter() {
return diameter; return diameter;
} }
public void setDiameter(Integer diameter) { public void setDiameter(String diameter) {
this.diameter = diameter; this.diameter = diameter;
} }
public Integer getThickness() { public String getThickness() {
return thickness; return thickness;
} }
public void setThickness(Integer thickness) { public void setThickness(String thickness) {
this.thickness = thickness; this.thickness = thickness;
} }
public Integer getWeight() { public String getWeight() {
return weight; return weight;
} }
public void setWeight(Integer weight) { public void setWeight(String weight) {
this.weight = weight; this.weight = weight;
} }
...@@ -326,6 +326,14 @@ public class CategoryVo implements Serializable { ...@@ -326,6 +326,14 @@ public class CategoryVo implements Serializable {
return null; return null;
} }
private String extractExtraString(Map<String, Object> extraData, String key) {
if (!StringUtils.isEmpty(extraData.get(key))) {
return extraData.get(key).toString();
}
return null;
}
public Category toDo() { public Category toDo() {
Category category = new Category(); Category category = new Category();
category.setId(this.id); category.setId(this.id);
......
...@@ -62,17 +62,17 @@ public class CategoryServiceImpl implements CategoryService { ...@@ -62,17 +62,17 @@ public class CategoryServiceImpl implements CategoryService {
categoryVo.setCategoryPath(StringUtils.join(categoryManager.getCategoryPath(c.getId()), ">")); categoryVo.setCategoryPath(StringUtils.join(categoryManager.getCategoryPath(c.getId()), ">"));
//如果是叶子结点,就从商品表中查询标准件信息作为该分类的信息 //如果是叶子结点,就从商品表中查询标准件信息作为该分类的信息
if (c.getIsLeaf()) { /* if (c.getIsLeaf()) {
Item item = itemManager.findStandard(categoryVo.getId()); Item item = itemManager.findStandard(categoryVo.getId());
if (item != null) { if (item != null) {
String extra = item.getExtra(); String extra = item.getExtra();
Map<String, Object> map = JsonUtils.toMap(extra); Map<String, Object> map = JsonUtils.toMap(extra);
categoryVo.setDiameter(map.get("diameter") == null? null: Integer.valueOf(map.get("diameter").toString())); categoryVo.setDiameter(map.get("diameter") == null? null: map.get("diameter").toString());
categoryVo.setThickness(map.get("thickness")== null? null: Integer.valueOf(map.get("thickness").toString())); categoryVo.setThickness(map.get("thickness")== null? null: map.get("thickness").toString());
categoryVo.setWeight(map.get("weight")== null? null: Integer.valueOf(map.get("weight").toString())); categoryVo.setWeight(map.get("weight")== null? null: map.get("weight").toString());
categoryVo.setIcon(item.getTopImage()); categoryVo.setIcon(item.getTopImage());
} }
} }*/
// categoryVoList.add(new CategoryVo(c)); // categoryVoList.add(new CategoryVo(c));
categoryVoList.add(categoryVo); categoryVoList.add(categoryVo);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment