Explorar o código

截取内容区域字符串

Wayne hai 4 meses
pai
achega
9e8665f168

+ 5 - 0
projects-service/src/main/java/com/rtrh/projects/modules/projects/service/impl/SubInfoQueryServiceImpl.java

@@ -417,6 +417,11 @@ public class SubInfoQueryServiceImpl implements SubInfoQueryService {
 
             //遍历subInfoTotalExcel将万元转换为亿元
             e.setAmtTotal(e.getAmtTotal().divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP));
+
+            //由于content字段过长,所以截取长度100字符,避免空指针异常
+            // 检查内容是否为空,避免空指针异常,并截取前100个字符
+            String content = e.getContent();
+            e.setContent(content == null ? "" : StringUtils.substring(content, 0, 100));
         });
 
         PageInfo<SubFixListVo> pageInfo = new PageInfo<SubFixListVo>(list);