作者 朱兆平

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

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