|
@@ -40,17 +40,19 @@ public class DaoImpl implements Dao { |
|
@@ -40,17 +40,19 @@ 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,String type,String styp) {
|
43
|
+ public int insertRecord(final String oper, final String sndr,String sntm,String type,String styp,String seqn) {
|
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);
|
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(),?,?)";
|
48
|
+ String sql = "insert into T_ETL_MESSAGE(OPER,SNDR,SNTM,content,TYPE,STYP,SEQN) values(?,?,to_date(?,'yyyyMMddhh24miss'),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
|
+ ps.setString(3, sntm);
|
|
|
53
|
+ ps.setString(4, type);
|
|
|
54
|
+ ps.setString(5, styp);
|
|
|
55
|
+ ps.setString(6,seqn);
|
54
|
return ps;
|
56
|
return ps;
|
55
|
}
|
57
|
}
|
56
|
}, keyHolder);
|
58
|
}, keyHolder);
|
|
@@ -58,14 +60,14 @@ public class DaoImpl implements Dao { |
|
@@ -58,14 +60,14 @@ public class DaoImpl implements Dao { |
58
|
return generatedId;
|
60
|
return generatedId;
|
59
|
}
|
61
|
}
|
60
|
|
62
|
|
61
|
- public void saveRecord(String messaegType, String sndr, String xmlContent,String type,String styp) throws Exception {
|
63
|
+ public void saveRecord(String messaegType, String sndr,String sntm, String xmlContent,String type,String styp,String seqn) throws Exception {
|
62
|
Connection conn = null;
|
64
|
Connection conn = null;
|
63
|
Statement stmt = null;
|
65
|
Statement stmt = null;
|
64
|
ResultSet rs = null;
|
66
|
ResultSet rs = null;
|
65
|
int fid = -100;
|
67
|
int fid = -100;
|
66
|
|
68
|
|
67
|
try {
|
69
|
try {
|
68
|
- fid = this.insertRecord(messaegType, sndr,type,styp);
|
70
|
+ fid = this.insertRecord(messaegType, sndr,sntm,type,styp,seqn);
|
69
|
conn = this.jdbcTemplate.getDataSource().getConnection();
|
71
|
conn = this.jdbcTemplate.getDataSource().getConnection();
|
70
|
conn.setAutoCommit(false);
|
72
|
conn.setAutoCommit(false);
|
71
|
stmt = conn.createStatement();
|
73
|
stmt = conn.createStatement();
|
|
@@ -115,6 +117,7 @@ public class DaoImpl implements Dao { |
|
@@ -115,6 +117,7 @@ public class DaoImpl implements Dao { |
115
|
|
117
|
|
116
|
public int getMaxFID(String sqlmax) {
|
118
|
public int getMaxFID(String sqlmax) {
|
117
|
// String sqlmax = "select max(fid) from MESSAGE_BAK WHERE (FID>%s and FID<%s+%s) AND (TYPE='CLR' OR TYPE='ES1' OR TYPE='IS1' OR STYP = 'BSTA' OR STYP = 'FZE_RCF' OR STYP = 'FSU_FOH' OR STYP = 'FSU_DEP' OR STYP = 'COST' OR STYP = 'ABME' OR STYP = 'FZE_DEP' OR STYP = 'FSU_RCF') ORDER BY FID\n";
|
119
|
// String sqlmax = "select max(fid) from MESSAGE_BAK WHERE (FID>%s and FID<%s+%s) AND (TYPE='CLR' OR TYPE='ES1' OR TYPE='IS1' OR STYP = 'BSTA' OR STYP = 'FZE_RCF' OR STYP = 'FSU_FOH' OR STYP = 'FSU_DEP' OR STYP = 'COST' OR STYP = 'ABME' OR STYP = 'FZE_DEP' OR STYP = 'FSU_RCF') ORDER BY FID\n";
|
|
|
120
|
+ sqlmax = ConfigUtils.SQlMax;
|
118
|
return this.jdbcTemplate.queryForInt(sqlmax);
|
121
|
return this.jdbcTemplate.queryForInt(sqlmax);
|
119
|
}
|
122
|
}
|
120
|
|
123
|
|