作者 朱兆平

优化READER

@@ -52,7 +52,7 @@ public class Main { @@ -52,7 +52,7 @@ public class Main {
52 //数据仓库给九州的发送程序 52 //数据仓库给九州的发送程序
53 Timer timer = new Timer(); 53 Timer timer = new Timer();
54 IMFSender CangKu2Jiuzhou = new IMFSender(client,"data/fid_index.txt"); 54 IMFSender CangKu2Jiuzhou = new IMFSender(client,"data/fid_index.txt");
55 - timer.schedule(CangKu2Jiuzhou, 30000L, 1200000L); 55 + timer.schedule(CangKu2Jiuzhou, 10000L, 1200000L);
56 56
57 } 57 }
58 } 58 }
@@ -9,9 +9,9 @@ import com.airport.bean.MessageBak; @@ -9,9 +9,9 @@ import com.airport.bean.MessageBak;
9 import java.util.List; 9 import java.util.List;
10 10
11 public interface Dao { 11 public interface Dao {
12 - int insertRecord(String var1, String var2); 12 + int insertRecord(String var1, String var2,String var3,String var4);
13 13
14 - void saveRecord(String var1, String var2, String var3) throws Exception; 14 + void saveRecord(String var1, String var2, String var3,String var4,String var5) throws Exception;
15 15
16 void delete(int var1); 16 void delete(int var1);
17 17
@@ -40,15 +40,17 @@ public class DaoImpl implements Dao { @@ -40,15 +40,17 @@ public class DaoImpl implements Dao {
40 this.jdbcTemplate = jdbcTemplate; 40 this.jdbcTemplate = jdbcTemplate;
41 } 41 }
42 42
43 - public int insertRecord(final String oper, final String sndr) { 43 + public int insertRecord(final String oper, final String sndr,String type,String styp) {
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);  
48 - String sql = "insert into T_ETL_MESSAGE(OPER,SNDR,SNTM,content) values(?,?,sysdate,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) values(?,?,sysdate,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);
  52 + ps.setString(3, type);
  53 + ps.setString(4, styp);
52 return ps; 54 return ps;
53 } 55 }
54 }, keyHolder); 56 }, keyHolder);
@@ -56,14 +58,14 @@ public class DaoImpl implements Dao { @@ -56,14 +58,14 @@ public class DaoImpl implements Dao {
56 return generatedId; 58 return generatedId;
57 } 59 }
58 60
59 - public void saveRecord(String messaegType, String sndr, String xmlContent) throws Exception { 61 + public void saveRecord(String messaegType, String sndr, String xmlContent,String type,String styp) throws Exception {
60 Connection conn = null; 62 Connection conn = null;
61 Statement stmt = null; 63 Statement stmt = null;
62 ResultSet rs = null; 64 ResultSet rs = null;
63 int fid = -100; 65 int fid = -100;
64 66
65 try { 67 try {
66 - fid = this.insertRecord(messaegType, sndr); 68 + fid = this.insertRecord(messaegType, sndr,type,styp);
67 conn = this.jdbcTemplate.getDataSource().getConnection(); 69 conn = this.jdbcTemplate.getDataSource().getConnection();
68 conn.setAutoCommit(false); 70 conn.setAutoCommit(false);
69 stmt = conn.createStatement(); 71 stmt = conn.createStatement();