提交 7995eefd authored 作者: 吴德鹏's avatar 吴德鹏

属性管理

上级 65258e78
...@@ -150,49 +150,52 @@ public class AttributesController { ...@@ -150,49 +150,52 @@ public class AttributesController {
AttributesVo attrNames = new AttributesVo(); AttributesVo attrNames = new AttributesVo();
attrNames.setId(attr.getId()); attrNames.setId(attr.getId());
attrNames.setAttrName(attr.getAttrName()); attrNames.setAttrName(attr.getAttrName());
List<AttributesDescEntity> descs = attributesDescService.queryByAttrId(attr.getId()); // List<AttributesDescEntity> descs = attributesDescService.queryByAttrId(attr.getId());
//
List<AttributesDescVo> attributesVos = new ArrayList<>(); // List<AttributesDescVo> attributesVos = new ArrayList<>();
descs.forEach(desc -> { // descs.forEach(desc -> {
AttributesDescVo descVo = new AttributesDescVo(); // AttributesDescVo descVo = new AttributesDescVo();
String attrValue = desc.getAttrValue(); // String attrValue = desc.getAttrValue();
String attrDesc = desc.getAttrDesc(); // String attrDesc = desc.getAttrDesc();
descVo.setAttrDescId(desc.getAttrDescId()); // descVo.setAttrDescId(desc.getAttrDescId());
descVo.setAttrValue(attrValue + "(" + attrDesc + ")"); // descVo.setAttrValue(attrValue + "(" + attrDesc + ")");
attributesVos.add(descVo); // attributesVos.add(descVo);
}); // });
//
attrNames.setDescList(attributesVos); // attrNames.setDescList(attributesVos);
attrNameList.add(attrNames); attrNameList.add(attrNames);
}); });
return R.ok().put("list", attrNameList); return R.ok().put("list", attrNameList);
} }
// /** /**
// * 属性值 * 属性值
// * *
// * @param id 属性Id * @param id 属性Id
// * @return url(../attributes/queryAttrDescs?id=2) * @return url(../attributes/queryAttrDescs?id=2)
// */ */
// @RequestMapping("/queryAttrDescs") @RequestMapping("/queryAttrDescs")
// @ResponseBody @ResponseBody
// @IgnoreAuth @IgnoreAuth
// public R queryAttrDescs(@RequestParam("id") String id) { public R queryAttrDescs(@RequestParam("id") String id) {
// if (StringUtils.isBlank(id)) { if (StringUtils.isBlank(id)) {
// return R.error("id不能为空!"); return R.error("id不能为空!");
// } }
// List<String> attrDescList = new ArrayList<>();
// List<AttributesDescEntity> descs = attributesDescService.queryByAttrId(id); List<AttributesDescEntity> descs = attributesDescService.queryByAttrId(id);
// List<AttributesDescVo> attributesVos = new ArrayList<>();
// descs.forEach(desc -> { descs.forEach(desc -> {
// String attrValue = desc.getAttrValue(); AttributesDescVo descVo = new AttributesDescVo();
// String attrDesc = desc.getAttrDesc(); String attrValue = desc.getAttrValue();
// attrDescList.add(attrValue + "(" + attrDesc + ")"); String attrDesc = desc.getAttrDesc();
// }); descVo.setAttrDescId(desc.getAttrDescId());
// descVo.setAttrValue(attrValue + "(" + attrDesc + ")");
// return R.ok().put("list", attrDescList); attributesVos.add(descVo);
// } });
return R.ok().put("list", attributesVos);
}
/** /**
* 新版商品属性(整合旧版数据) * 新版商品属性(整合旧版数据)
......
...@@ -14,5 +14,5 @@ import java.util.List; ...@@ -14,5 +14,5 @@ import java.util.List;
public class AttributesVo { public class AttributesVo {
private String id; private String id;
private String attrName; private String attrName;
private List<AttributesDescVo> descList; // private List<AttributesDescVo> descList;
} }
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
`create_time`, `create_time`,
`update_time` `update_time`
from attributes_desc from attributes_desc
where attr_id = #{id} where attr_desc_id = #{id}
</select> </select>
<select id="queryList" resultType="com.platform.entity.AttributesDescEntity"> <select id="queryList" resultType="com.platform.entity.AttributesDescEntity">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论