فهرست منبع

[bug-4888]处理同时有温湿度的值时,有的带不带换行符导致解析报错的情况

huangws 9 ماه پیش
والد
کامیت
77136f5069

+ 10 - 4
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/business/thirtyparty/service/impl/NanShaWsdServiceImpl.java

@@ -138,9 +138,13 @@ public class NanShaWsdServiceImpl extends WsdBaseServiceImpl implements NanShaWs
     }
 
     private void addBoth(Map<String, Object> excel, String clcrm, Map<String, Object> data ,String time) throws Exception {
-        String[] result = StrUtil.str(excel.get(clcrm)).split("/\n");
-        String[] max = StrUtil.str(excel.get("报警最大值")).split("/\n");
-        String[] min = StrUtil.str(excel.get("报警最小值")).split("/\n");
+//        String[] result = StrUtil.str(excel.get(clcrm)).split("/\n");
+//        String[] max = StrUtil.str(excel.get("报警最大值")).split("/\n");
+//        String[] min = StrUtil.str(excel.get("报警最小值")).split("/\n");
+        //处理同时有温湿度的值时,有的带不带换行符导致解析报错的情况
+        String[] result = StrUtil.str(excel.get(clcrm)).replace("/\n", "/").split("/");
+        String[] max = StrUtil.str(excel.get("报警最大值")).replace("/\n", "/").split("/");
+        String[] min = StrUtil.str(excel.get("报警最小值")).replace("/\n", "/").split("/");
         for (int j = 0; j < result.length; j++) {
             if (result[j].equals("—"))continue;
             String subId = StrUtil.str(excel.get("监控点名称"));
@@ -318,7 +322,7 @@ public class NanShaWsdServiceImpl extends WsdBaseServiceImpl implements NanShaWs
             String updSql = "update t_snwsdjkjlb SET bian_zhi_ren_='"+userId+"',update_by_='"+userId+"',update_time_=now()," +
                     " shi_fou_guo_shen_='已完成', wen_shi_du_kong_z='"+wdfw+" "+sdfw+"',shi_kong_zhuang_t='"+zhuangtai+"'," +
                     "shi_ji_cao_zuo_sh='"+shi_ji_shi_jian_+"',lie_biao_shu_ju_='"+params+"' where id_='"+id+"'";
-            log.warn("name{},id_{}","t_bxwdjkjlb",id);
+            log.warn("name{},id_{}","t_snwsdjkjlb",id);
             commonDao.execute(updSql);
         }
     }
@@ -374,6 +378,7 @@ public class NanShaWsdServiceImpl extends WsdBaseServiceImpl implements NanShaWs
                     "shi_fou_guo_shen_='已完成', wen_kong_zhi_fan_='"+wdfw+" "+sdfw+"',shi_kong_zhuang_t='"+zhuangtai+"'," +
                     "shi_ji_shi_jian_='"+shi_ji_shi_jian_+"',lie_biao_shu_ju_='"+params+"',kai_ji_shi_jian_='24H开机'," +
                     "guan_ji_shi_jian_='/',jian_cha_shui_wei='正常',qing_jie_biao_mia='正常',xiang_nei_xiao_du='清水清洁' where id_='"+id+"'";
+            log.warn("name{},id_{}","t_wyxwdjkywhjlb",id);
             commonDao.execute(updSql);
         }
     }
@@ -427,6 +432,7 @@ public class NanShaWsdServiceImpl extends WsdBaseServiceImpl implements NanShaWs
             String updSql = "update t_ylgwdjkjlb SET bian_zhi_ren_='"+userId+"',update_by_='"+userId+"',update_time_=now(), " +
                     "shi_fou_guo_shen_='已完成', wen_du_jian_kong_='"+wdfw+" "+sdfw+"',shi_kong_zhuang_t='"+zhuangtai+"'," +
                     "shi_ji_shi_jian_='"+shi_ji_shi_jian_+"',lie_biao_shu_ju_='"+params+"' where id_='"+id+"'";
+            log.warn("name{},id_{}","t_ylgwdjkjlb",id);
             commonDao.execute(updSql);
         }
     }