|
|
@@ -645,94 +645,6 @@ public class HanaOrderComponent {
|
|
|
return j;
|
|
|
}
|
|
|
|
|
|
- private int createDeliverOrderTxt(ResultSet result) throws Exception {
|
|
|
-=========
|
|
|
->>>>>>>>> Temporary merge branch 2
|
|
|
- File file = null;
|
|
|
- FileWriter fw = null;
|
|
|
- Connection conn = null;
|
|
|
- PreparedStatement pstm =null;
|
|
|
- int j =0;
|
|
|
- try {
|
|
|
- long i =0;
|
|
|
-
|
|
|
- //创建IO需求的条件,并声明输出路径
|
|
|
- file = new File((Global.getTemdataPath()+"selfDeliverOrder/"));
|
|
|
- log.info("selfDeliverOrder数据缓存路径:" + Global.getTemdataPath()+"selfDeliverOrder/");
|
|
|
- if(!file.exists()){
|
|
|
- file.mkdir();
|
|
|
- }
|
|
|
-
|
|
|
- file = new File(Global.getTemdataPath()+"selfDeliverOrder/"+j+".txt");
|
|
|
- if(!file.exists()){
|
|
|
- file.createNewFile();
|
|
|
- }else {
|
|
|
- //取得这个目录下的所有子文件对象
|
|
|
- File[] files = new File(Global.getTemdataPath()+"selfDeliverOrder/").listFiles();
|
|
|
- //遍历该目录下的文件对象
|
|
|
- for (File f: files){
|
|
|
- f.delete();
|
|
|
- }
|
|
|
- file.delete();
|
|
|
- file.createNewFile();
|
|
|
- }
|
|
|
- fw = new FileWriter(file);
|
|
|
- Long startTime = System.currentTimeMillis();
|
|
|
- while (result.next()){
|
|
|
-
|
|
|
- fw.write(
|
|
|
- result.getString("MANDT")
|
|
|
- +"$$"+result.getString("VBELN")
|
|
|
- +"$$"+result.getString("DATUM")
|
|
|
- + "\r\n");
|
|
|
-
|
|
|
- fw.flush();
|
|
|
- i++;
|
|
|
- if (i%50000==0){
|
|
|
- j++;
|
|
|
- //创建IO需求的条件,并声明输出路径
|
|
|
- file = new File(Global.getTemdataPath()+"selfDeliverOrder/"+j+".txt");
|
|
|
- if(!file.exists()){
|
|
|
- file.createNewFile();
|
|
|
- }else {
|
|
|
- file.delete();
|
|
|
- file.createNewFile();
|
|
|
- }
|
|
|
- fw = new FileWriter(file);
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- Long endTime = System.currentTimeMillis();
|
|
|
- log.info("生成selfDeliverOrder-TXT用时:" + (endTime - startTime) + "毫秒");
|
|
|
- /* conn = getMysqlConnection();
|
|
|
- //生产表
|
|
|
- String sql = "TRUNCATE TABLE meta_hana_self_deliver_order";
|
|
|
- pstm = conn.prepareStatement(sql);
|
|
|
- pstm.execute();*/
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- }finally {
|
|
|
- fw.close();
|
|
|
- if(pstm!=null){
|
|
|
- try {
|
|
|
- pstm.close();
|
|
|
- } catch (SQLException e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- }
|
|
|
- if(conn!=null){
|
|
|
- try {
|
|
|
- conn.close();
|
|
|
- } catch (SQLException e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return j;
|
|
|
- }
|
|
|
-
|
|
|
private int createDeliverOrderTxt(ResultSet result) throws Exception {
|
|
|
File file = null;
|
|
|
FileWriter fw = null;
|