提交 9718656c authored 作者: lvwei's avatar lvwei

--no commit message

上级 8c8427ae
package com.zrqx.bg.resource.manage.diytype;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
......@@ -28,15 +30,13 @@ public class DiyTypeManage {
* @author lw
* @date: 2019年4月1日 下午2:44:46
*/
public List<String> getDiyTypesName(String goodsid){
public Map<Integer, String> getDiyTypesName(String goodsid){
GoodsDiyTypeRelation record = new GoodsDiyTypeRelation();
record.setGoodsid(String.valueOf(goodsid));
List<GoodsDiyTypeRelation> goodsDiyTypeRelations = goodsDiyTypeRelationMapper.select(record);
List<String> diyTypeNames = goodsDiyTypeRelations.stream()
.map(GoodsDiyTypeRelation :: getDiytypeid)
.map(id -> {
return getName(id, new StringBuffer());
}).collect(Collectors.toList());
Map<Integer, String> diyTypeNames = new HashMap<Integer, String>();
goodsDiyTypeRelations.stream().map(GoodsDiyTypeRelation :: getDiytypeid)
.forEach(id -> diyTypeNames.put(id, getName(id, new StringBuffer())));
return diyTypeNames;
}
......
package com.zrqx.bg.resource.manage.label;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -9,6 +11,9 @@ import java.util.stream.Collectors;
import net.bytebuddy.asm.Advice.This;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -19,6 +24,9 @@ import org.springframework.stereotype.Component;
import com.zrqx.bg.resource.mapper.label.LabelGoodsRelationMapper;
import com.zrqx.bg.resource.mapper.label.LabelMapper;
import com.zrqx.core.model.resource.diytype.DiyType;
......@@ -44,16 +52,13 @@ public class LabelManage {
* @author lw
* @date: 2019年4月1日 下午2:54:52
*/
public List<String> getLabelName(String goodsid) {
public Map<Integer, String> getLabelName(String goodsid) {
LabelGoodsRelation record = new LabelGoodsRelation();
record.setGoodsid(String.valueOf(goodsid));
List<LabelGoodsRelation> labelGoodsRelation = labelGoodsRelationMapper.select(record);
List<String> labelNames = labelGoodsRelation.stream()
.map(LabelGoodsRelation :: getLabelId)
.map(id -> {
return getName(id, new StringBuffer());
})
.collect(Collectors.toList());
Map<Integer, String> labelNames = new HashMap<Integer, String>();
labelGoodsRelation.stream().map(LabelGoodsRelation :: getLabelId)
.map(id -> labelNames.put(id, getName(id, new StringBuffer())));
return labelNames;
}
......
......@@ -4,9 +4,11 @@ package com.zrqx.bg.resource.service.goods.eleresource;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.collections4.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论