Commit 234d607f authored by shiyu's avatar shiyu

标准件

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