Parcourir la source

[task-5951] 设施环境推送数据兼容编制时间为"yyyy-MM-dd"的格式

huangws il y a 2 semaines
Parent
commit
7c369b284b

+ 6 - 1
ibps-provider-root/modules/provider-platform/src/main/java/com/lc/ibps/platform/plan/job/AbstractJob.java

@@ -71,7 +71,12 @@ public abstract class AbstractJob  extends BaseJob2 {
                 map.put("id_", id);
                 map.put("create_time_", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
                 if (map.containsKey("bian_zhi_shi_jian") && !tableName.equals("t_zlzbpjzb")){
-                    map.put("bian_zhi_shi_jian", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(map.get("bian_zhi_shi_jian")));
+                    try {
+                        map.put("bian_zhi_shi_jian", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(map.get("bian_zhi_shi_jian")));
+                    } catch (Exception e) {
+                        // 处理解析失败的情况,比如记录日志或设置默认值
+                        logger.error(tableName+" 编制时间转换失败,还原成原值,异常信息 {}", e.getMessage());
+                    }
                 }
                 commonDao.execute(this.buildInsertSql(map, tableName));
                 ids.add(id);