Commit 93a4b99d authored by Quxl's avatar Quxl

x

parent d8bd91f5
...@@ -5,3 +5,4 @@ ...@@ -5,3 +5,4 @@
/application.properties /application.properties
/bin/ /bin/
/logs/ /logs/
/xmlHistory/
...@@ -9,8 +9,6 @@ import java.util.Map.Entry; ...@@ -9,8 +9,6 @@ import java.util.Map.Entry;
import javax.jws.WebService; import javax.jws.WebService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
...@@ -32,8 +30,6 @@ import com.google.gson.Gson; ...@@ -32,8 +30,6 @@ import com.google.gson.Gson;
@WebService(serviceName = "MaterialMasterService", targetNamespace = "http://material_master.sso.egolm.com", endpointInterface = "com.egolm.sso.services.material_master.MaterialMasterService") @WebService(serviceName = "MaterialMasterService", targetNamespace = "http://material_master.sso.egolm.com", endpointInterface = "com.egolm.sso.services.material_master.MaterialMasterService")
public class MaterialMasterServiceImpl implements MaterialMasterService { public class MaterialMasterServiceImpl implements MaterialMasterService {
private static Log logger = LogFactory.getLog(MaterialMasterService.class);
@Autowired @Autowired
JdbcTemplate jdbcTemplate; JdbcTemplate jdbcTemplate;
...@@ -125,10 +121,11 @@ public class MaterialMasterServiceImpl implements MaterialMasterService { ...@@ -125,10 +121,11 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
isSuccess = false; isSuccess = false;
throw new XRException("数据保存失败", e); throw new XRException("数据保存失败", e);
} finally { } finally {
String xmlName = Z_MT_SD_001_MATERIAL_MASTER.getClass().getSimpleName() + ".xml"; String xmlName = Z_MT_SD_001_MATERIAL_MASTER.getClass().getSimpleName();
try { try {
String xml = XMLUtil.toXml(Z_MT_SD_001_MATERIAL_MASTER); String xml = XMLUtil.toXml(Z_MT_SD_001_MATERIAL_MASTER);
FileUtil.writeText(xmlRoot + "/sap/" + xmlName + "/" + DateUtil.formatDate(new Date(), DateUtil.FMT_DATE) + "/" + (isSuccess?"success":"error") + "/" + xmlName + "-" + common.getNextval(dateString + "T_VEN_GOODS_BATCH_" + dateString) + ".XML" , xml); String xmlFullName = xmlRoot + "/sap/" + xmlName + "/" + DateUtil.formatDate(new Date(), DateUtil.FMT_DATE) + "/" + (isSuccess?"success":"error") + "/" + xmlName + "-" + common.getNextval(dateString + "MATERIAL_MASTER_FILE_NAME" + dateString) + ".XML";
FileUtil.writeText(xmlFullName, xml);
} catch (Exception e) { } catch (Exception e) {
throw new XRException("报文保存失败", e); throw new XRException("报文保存失败", e);
} }
......
...@@ -2,6 +2,7 @@ package com.egolm.sso.util; ...@@ -2,6 +2,7 @@ package com.egolm.sso.util;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.BufferedWriter; import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
...@@ -26,7 +27,12 @@ public class FileUtil { ...@@ -26,7 +27,12 @@ public class FileUtil {
} }
public static void writeText(String path, String text) throws IOException { public static void writeText(String path, String text) throws IOException {
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path))); File file = new File(path);
File parentFile = file.getParentFile();
if(!parentFile.exists()) {
parentFile.mkdirs();
}
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file)));
writer.write(text); writer.write(text);
writer.close(); writer.close();
} }
......
wsUsername: test wsUsername: test
wsPassword: 78258c537d6e4d5fb210a57d05619fb6 wsPassword: 78258c537d6e4d5fb210a57d05619fb6
xmlRoot: xmlHistory xmlRoot: XML_HISTORY
SAP: SAP:
NO009: NO009:
CRON: 0 0 0 * * ? CRON: 0 0 0 * * ?
......
wsUsername: schneider wsUsername: schneider
wsPassword: f14d4a80f823438a875b1924384c944c wsPassword: f14d4a80f823438a875b1924384c944c
xmlRoot: xmlHistory xmlRoot: XML_HISTORY
SAP: SAP:
NO009: NO009:
CRON: 0 0 0 * * ? CRON: 0 0 0 * * ?
......
wsUsername: test wsUsername: test
wsPassword: 78258c537d6e4d5fb210a57d05619fb6 wsPassword: 78258c537d6e4d5fb210a57d05619fb6
xmlRoot: xmlHistory xmlRoot: XML_HISTORY
SAP: SAP:
NO009: NO009:
CRON: 0 0 0 * * ? CRON: 0 0 0 * * ?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment