非空判断

This commit is contained in:
CD
2022-12-15 14:04:13 +08:00
parent 268e8cff15
commit 26f87c21ac
@@ -20,6 +20,7 @@ import com.adc.da.utils.util.InitStandAttrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.xwpf.usermodel.*; import org.apache.poi.xwpf.usermodel.*;
import org.apache.xmlbeans.XmlCursor; import org.apache.xmlbeans.XmlCursor;
import org.apache.xmlbeans.XmlObject; import org.apache.xmlbeans.XmlObject;
@@ -522,16 +523,18 @@ public class SarFileSplitInfoEOServiceImpl implements SarFileSplitInfoEOService
for (XWPFRun xwrun : p.getRuns()) { for (XWPFRun xwrun : p.getRuns()) {
VerticalAlign subscript = xwrun.getSubscript(); VerticalAlign subscript = xwrun.getSubscript();
String smalltext = xwrun.getText(0); String smalltext = xwrun.getText(0);
switch (subscript) { if (ObjectUtils.isNotEmpty(smalltext)) {
case BASELINE: switch (subscript) {
buffer.append(smalltext); case BASELINE:
break; buffer.append(smalltext);
case SUBSCRIPT: break;
buffer.append("<span class=sub>" + smalltext + "</span>"); case SUBSCRIPT:
break; buffer.append("<span class=sub>" + smalltext + "</span>");
case SUPERSCRIPT: break;
buffer.append("<span class=sup>" + smalltext + "</span>"); case SUPERSCRIPT:
break; buffer.append("<span class=sup>" + smalltext + "</span>");
break;
}
} }
} }
String text = buffer.toString(); String text = buffer.toString();