Przeglądaj źródła

pms 瑞恒看板 其它项目部的生产动态概述 以队伍为维度展示 过滤掉 生产动态中的 回车 换行符

zhangcl 1 dzień temu
rodzic
commit
0394844e71

+ 5 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrhdailyreport/IotRhDailyReportServiceImpl.java

@@ -1591,7 +1591,11 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
 
                                     // 4. 施工动态(仅当施工时间为 0 且动态非空时显示;为空则不显示前面的“,”)
                                     if (isZero && StrUtil.isNotBlank(production)) {
-                                        sb.append(",").append(production);
+                                        // 过滤掉回车、换行符(\r \n),防止拼接后的格式错乱
+                                        String cleanProduction = production.replaceAll("[\\r\\n]", "");
+                                        if (StrUtil.isNotBlank(cleanProduction)) {
+                                            sb.append(",").append(cleanProduction);
+                                        }
                                     }
 
                                     sb.append("。");