update ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java.
public static String convertByExp(String propertyValue, String converterExp, String separator) 大佬这个方法是不是设计的太复杂了点 Signed-off-by: SupperDogITCode <13203991+superdogitcode@user.noreply.gitee.com>
This commit is contained in:
parent
61c2e96aaa
commit
bb81106bfc
|
|
@ -1219,31 +1219,14 @@ public class ExcelUtil<T>
|
||||||
*/
|
*/
|
||||||
public static String convertByExp(String propertyValue, String converterExp, String separator)
|
public static String convertByExp(String propertyValue, String converterExp, String separator)
|
||||||
{
|
{
|
||||||
StringBuilder propertyString = new StringBuilder();
|
|
||||||
String[] convertSource = converterExp.split(",");
|
String[] convertSource = converterExp.split(",");
|
||||||
for (String item : convertSource)
|
for (String item : convertSource) {
|
||||||
{
|
|
||||||
String[] itemArray = item.split("=");
|
String[] itemArray = item.split("=");
|
||||||
if (StringUtils.containsAny(propertyValue, separator))
|
if (itemArray[0].equals(propertyValue)) {
|
||||||
{
|
return itemArray[1];
|
||||||
for (String value : propertyValue.split(separator))
|
|
||||||
{
|
|
||||||
if (itemArray[0].equals(value))
|
|
||||||
{
|
|
||||||
propertyString.append(itemArray[1] + separator);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (itemArray[0].equals(propertyValue))
|
|
||||||
{
|
|
||||||
return itemArray[1];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return StringUtils.stripEnd(propertyString.toString(), separator);
|
return propertyValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue