标准导出字典转换

This commit is contained in:
zhaokaiyao@91isoft.com
2021-12-27 16:07:29 +08:00
parent 057ce691d6
commit cdffdad6ad
@@ -714,7 +714,14 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
}
public void attrInfoShowExport(List<SarStandardsInfo> sarlist) throws Exception {
public void attrInfoShowExport(List<SarStandardsInfo> sarlist) throws Exception {
List<DicTypeEO> dicInfo = dicTypeEODao.getDicInfo("dic_type_code", "dic_type_name");
Map<String, String> dicMap =
dicInfo.stream()
.collect(Collectors.toMap(DicTypeEO::getDicTypeCode,DicTypeEO::getDicTypeName,(value1, value2 )->value2));
for (SarStandardsInfo row : sarlist) {
attrInfoDetailsExport(row);
Map<String, Object> getAttrMap = row.getAttrInfoMap();
@@ -724,6 +731,28 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey();
String value = "";
/**
*============================ 对getAttrMap的value赋值中文名称===============================
*/
if(entry.getValue()!=null) {
StringBuilder builder = new StringBuilder("");
for (String s : entry.getValue().toString().split(",")) {
if (dicMap.containsKey(s)) {
builder.append(dicMap.get(s)+" ");
} else {
builder.append(entry.getValue().toString());
}
getAttrMap.put(name, builder.toString());
}
}
/**
*============================ 对getAttrMap的value赋值中文名称===============================
*/
if ("SVPPS".equals(name)) {
Object svpps = entry.getValue();
if (svpps != null && StringUtils.isNotBlank(svpps.toString())) {
@@ -760,6 +789,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
getAttrMap.put("SVPPSTips", svppsTip);
}
//对attrMap赋值
row.setAttrInfoMap(getAttrMap);
}
}