Pre Merge pull request !491 from SupperDogITCode/N/A

This commit is contained in:
SupperDogITCode 2024-05-29 04:21:04 +00:00 committed by Gitee
commit d48a3e43af
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 21 deletions

View File

@ -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;
} }
/** /**