//初始化该日期已经导出(导入)过数据
String hsjbjgbh=getHsJbjgbh(jbjgbh);
initDcDr2(ywrq, "ts", hsjbjgbh);
if (isDcIngOfWt(ywrq, hsjbjgbh)) {
return "-123_,其它的线程正在执行导出。";
}
//标志正在进行导出
setDcingOfWt(ywrq, hsjbjgbh);
log.info("托收导出方法执行:(ywrq, dcywrq, czy, jbjgbh, fsfs)="+"("+ywrq+","+ dcywrq+","+ czy+","+ jbjgbh+","+ fsfs+")");
Connection con = null;
CallableStatement CStmt = null;
String succ = "";
String[] pchs =null;
try {
con = com.bjzfy.zfzj.gg.util.EjbGetter.getConnection();
String sql = "{call p_gjj_khjs_wtsk_dc(?,?,?,?,?,?,?,?,?)}";
CStmt = con.prepareCall(sql);
CStmt.setString(1, ywrq);
//业务日期
CStmt.setString(2, dcywrq);
//导出业务日期
CStmt.setString(3, czy);
//操作员
CStmt.setString(4, jbjgbh);
//经办
CStmt.setString(5, gjjtskhh);
//
CStmt.setString(6, fsfs);
//发送方式 0 自动,1手动
CStmt.registerOutParameter(7, java.sql.Types.INTEGER);
CStmt.registerOutParameter(8, java.sql.Types.VARCHAR);
CStmt.registerOutParameter(9, java.sql.Types.VARCHAR);
CStmt.execute();
int fhz = CStmt.getInt(7);
String fhxx = CStmt.getString(8);
log.info("委托收款导出结果:fhxx is:"+fhz+";" + fhxx);
succ = fhz + "_" + fhxx;
String pch = CStmt.getString(9);
//导出完成
//setDcFinishOfWt(ywrq, hsjbjgbh);
//更新日志
pchs=pch.split(",");
for (int i=0;i<pchs.length;i++){
dcAfterLog(ywrq, fhz,pchs[i]);
//log.info("批次号:pchs[i]=" + pchs[i]);
}
} catch (SQLException se) {
se.printStackTrace();
succ=-100+"_"+"保存出错!";
} finally {
//导出完成
setDcFinishOfWt(ywrq, hsjbjgbh);
try {
EjbGetter.safeClose(CStmt);
EjbGetter.safeClose(con);
} catch (Exception se) {
se.printStackTrace();
}
}
return succ;