项目库-认证清单-导入导出
This commit is contained in:
+10
@@ -36,4 +36,14 @@ public interface ISysDictItemService extends IService<SysDictItem> {
|
||||
void setEditOrderNum(SysDictItem sysDictItem);
|
||||
|
||||
String disposeShowDictItemValue(List<SysDictItem> sysDictItems,String fieldValues,String cut,String dicCode);
|
||||
|
||||
/**
|
||||
* 导入时将item_text处置为item_value存入
|
||||
* @param sysDictItems
|
||||
* @param fieldTexts
|
||||
* @param cut
|
||||
* @param dicCode
|
||||
* @return
|
||||
*/
|
||||
String disposeShowDictItemText(List<SysDictItem> sysDictItems,String fieldTexts,String cut,String dicCode);
|
||||
}
|
||||
|
||||
+48
@@ -183,4 +183,52 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入时将item_text处置为item_value存入
|
||||
* @param sysDictItems
|
||||
* @param fieldTexts
|
||||
* @param cut
|
||||
* @param dicCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String disposeShowDictItemText(List<SysDictItem> sysDictItems, String fieldTexts, String cut, String dicCode) {
|
||||
String result = "";
|
||||
List<SysDictItem> sysDictItemList = sysDictItems.stream().filter(e -> {
|
||||
boolean flag = false;
|
||||
if(StringUtils.equals(e.getDictCode(),dicCode)){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).distinct().collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(sysDictItemList)){
|
||||
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
result = sysDictItemList.stream().filter(e -> {
|
||||
boolean flag = false;
|
||||
List<String> fieldTextStrList = Arrays.asList(fieldTexts.split(","));
|
||||
for (String fieldTextStr : fieldTextStrList) {
|
||||
if(StringUtils.equals(fieldTextStr,e.getItemText())){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).map(SysDictItem::getItemValue).collect(Collectors.joining(","));
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
result = sysDictItemList.stream().filter(e -> {
|
||||
boolean flag = false;
|
||||
List<String> fieldTextStrList = Arrays.asList(fieldTexts.split(","));
|
||||
for (String fieldTextStr : fieldTextStrList) {
|
||||
if(StringUtils.equals(fieldTextStr,e.getItemText())){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).map(SysDictItem::getItemValue).collect(Collectors.joining(","));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user