diff --git a/src_cmb/com/tenwa/invoice/IAutokpDo.java b/src_cmb/com/tenwa/invoice/IAutokpDo.java index 3ea68f4f8..936df5d46 100644 --- a/src_cmb/com/tenwa/invoice/IAutokpDo.java +++ b/src_cmb/com/tenwa/invoice/IAutokpDo.java @@ -56,6 +56,7 @@ public class IAutokpDo { String responseParam=""; doc = ivoiceXML.createInvoiceXML(lsm,fpzl,fpzf); requestParam = doc.asXML(); + try { if(!requestParam.startsWith("error")&&requestParam!=null&&!"".equals(requestParam)){ IAutokpUtils.saveFile(requestParam, contract_no); diff --git a/src_cmb/com/tenwa/invoice/IAutokpUtils.java b/src_cmb/com/tenwa/invoice/IAutokpUtils.java index 4dd9f2996..8797f826b 100644 --- a/src_cmb/com/tenwa/invoice/IAutokpUtils.java +++ b/src_cmb/com/tenwa/invoice/IAutokpUtils.java @@ -6,6 +6,7 @@ import java.io.FileWriter; import java.io.IOException; import java.util.HashMap; import java.util.Map; +import java.util.ResourceBundle; import org.dom4j.Document; import org.dom4j.DocumentException; @@ -14,7 +15,9 @@ import org.dom4j.Element; public class IAutokpUtils { public static void saveFile(String str,String contractNo){ - File file = new File("D:\\tmp\\invoicelog\\"+"invoice_"+contractNo+".txt"); + ResourceBundle resource = ResourceBundle.getBundle("com/tenwa/invoice/InvoiceConfig"); + String saveFilePath = resource.getString("saveFilePath"); + File file = new File(saveFilePath+"/invoice_"+contractNo+".txt"); FileWriter fw = null; try { fw = new FileWriter(file); @@ -56,9 +59,12 @@ public class IAutokpUtils { } static void addUserInfo(Element rootEle) { + ResourceBundle resource = ResourceBundle.getBundle("com/tenwa/invoice/InvoiceConfig"); Element Ele_wsname = rootEle.addElement("wsname"); - Ele_wsname.setText("admin"); + Ele_wsname.setText(resource.getString("wsname")); Element Ele_wspwd = rootEle.addElement("wspwd"); - Ele_wspwd.setText("admin"); + Ele_wspwd.setText(resource.getString("wspwd")); + + } } diff --git a/src_cmb/com/tenwa/invoice/IAutokpserviceLocator.java b/src_cmb/com/tenwa/invoice/IAutokpserviceLocator.java index 16a6b41c7..cf1e090d3 100644 --- a/src_cmb/com/tenwa/invoice/IAutokpserviceLocator.java +++ b/src_cmb/com/tenwa/invoice/IAutokpserviceLocator.java @@ -7,6 +7,8 @@ package com.tenwa.invoice; +import java.util.ResourceBundle; + public class IAutokpserviceLocator extends org.apache.axis.client.Service implements com.tenwa.invoice.IAutokpservice { public IAutokpserviceLocator() { @@ -22,7 +24,7 @@ public class IAutokpserviceLocator extends org.apache.axis.client.Service implem } // Use to get a proxy class for IAutokpPort - private java.lang.String IAutokpPort_address = "http://tjaisino.top:8356/soap/IAutokp"; + private java.lang.String IAutokpPort_address = ResourceBundle.getBundle("com/tenwa/invoice/InvoiceConfig").getString("url"); public java.lang.String getIAutokpPortAddress() { return IAutokpPort_address; diff --git a/src_cmb/com/tenwa/invoice/InvoiceConfig.properties b/src_cmb/com/tenwa/invoice/InvoiceConfig.properties new file mode 100644 index 000000000..af288aa44 --- /dev/null +++ b/src_cmb/com/tenwa/invoice/InvoiceConfig.properties @@ -0,0 +1,4 @@ +wsname=admin +wspwd=admin +saveFilePath=/tmp +url=http://tjaisino.top:8356/soap/IAutokp