作者 朱兆平

增加入库出错提示,修复针对SNTM字段入库出错的BUG

@@ -33,7 +33,7 @@ public class IMFReader extends Thread { @@ -33,7 +33,7 @@ public class IMFReader extends Thread {
33 } 33 }
34 } 34 }
35 } else { 35 } else {
36 - logger.info("***"); 36 + //logger.info("***");
37 } 37 }
38 38
39 try { 39 try {
@@ -66,11 +66,13 @@ public class IMFReader extends Thread { @@ -66,11 +66,13 @@ public class IMFReader extends Thread {
66 //出错的报文存储到报文目录 66 //出错的报文存储到报文目录
67 fileName = path + Utils.dateToStr(dt, "yyyyMMddhhmmssSSS") + ".txt"; 67 fileName = path + Utils.dateToStr(dt, "yyyyMMddhhmmssSSS") + ".txt";
68 Utils.saveFile(fileName, message); 68 Utils.saveFile(fileName, message);
69 - logger.warn("created " + fileName + " ok"); 69 + logger.warn("报文入库失败已存储成备份文件:created " + fileName + " ok");
  70 + logger.error(var7);
  71 + logger.warn(var7);
70 } 72 }
71 } else { 73 } else {
72 - logger.info("创建目录失败.");  
73 - logger.info(message); 74 + logger.warn("创建目录失败.");
  75 + logger.warn(message);
74 } 76 }
75 77
76 } 78 }
@@ -44,8 +44,8 @@ public class DaoImpl implements Dao { @@ -44,8 +44,8 @@ public class DaoImpl implements Dao {
44 KeyHolder keyHolder = new GeneratedKeyHolder(); 44 KeyHolder keyHolder = new GeneratedKeyHolder();
45 this.jdbcTemplate.update(new PreparedStatementCreator() { 45 this.jdbcTemplate.update(new PreparedStatementCreator() {
46 public PreparedStatement createPreparedStatement(Connection connection) throws SQLException { 46 public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
47 - DaoImpl.logger.info("oper=" + oper + " sndr=" + sndr+"type="+type+"styp="+styp);  
48 - String sql = "insert into T_ETL_MESSAGE(OPER,SNDR,SNTM,content,TYPE,STYP,SEQN) values(?,?,to_date(?,'yyyyMMddhh24miss'),empty_clob(),?,?,?)"; 47 + DaoImpl.logger.info("oper=" + oper + " sndr=" + sndr+" type="+type+" styp="+styp);
  48 + String sql = "insert into T_ETL_MESSAGE(OPER,SNDR,SNTM,content,TYPE,STYP,SEQN) values(?,?,to_timestamp(?,'yyyyMMddHH24MIssff'),empty_clob(),?,?,?)";
49 PreparedStatement ps = connection.prepareStatement(sql, new String[]{"FID"}); 49 PreparedStatement ps = connection.prepareStatement(sql, new String[]{"FID"});
50 ps.setString(1, oper); 50 ps.setString(1, oper);
51 ps.setString(2, sndr); 51 ps.setString(2, sndr);