凭证接口ip及制定字段变更
This commit is contained in:
parent
dfbfd95a06
commit
af172fa7e4
@ -175,6 +175,23 @@
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
|
||||
<class name="NCXML_DETAIL_RECORDS" label="NC传输记录及回执信息" keyAttributes="BILLID">
|
||||
<attributes>
|
||||
<attribute name="BILLID" label="xml传输/回执ID" type="STRING" length="32"/>
|
||||
<attribute name="XML_TYPE" label="用于区分xml类别" type="STRING" length="32"/>
|
||||
<attribute name="BATCH" label="批次号" type="STRING" length="32"/>
|
||||
<attribute name="TABLE_NUM" label="表数据编号" type="STRING" length="32"/>
|
||||
<attribute name="FLAG" label="状态" type="STRING" length="2"/>
|
||||
<attribute name="ERR_DESCRIBE" label="错误描述" type="STRING" length="65535"/>
|
||||
<attribute name="CREATE_TIME" label="新增时间" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="ncxml_detail_records" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
</package>
|
||||
|
||||
</jbo>
|
||||
|
||||
@ -74,7 +74,7 @@ public class VoucherToNCforAssistContract implements Job{
|
||||
// 生成xml头
|
||||
Document document = DocumentHelper.createDocument(); // 生成每个xml的头
|
||||
Element root = document.addElement("ufinterface");
|
||||
root.addAttribute("account","8");
|
||||
root.addAttribute("account","BQ1217");
|
||||
root.addAttribute("billtype","defdoc(自定义档案)");
|
||||
root.addAttribute("businessunitcode","");
|
||||
root.addAttribute("filename","");
|
||||
@ -168,7 +168,7 @@ public class VoucherToNCforAssistContract implements Job{
|
||||
* 获取对方post连接
|
||||
*/
|
||||
//String url = "http://47.93.227.86:8858/service/XChangeServlet?account=q0225&groupcode=001";
|
||||
String url = "http://47.93.227.86:8858/service/XChangeServlet?account=8&groupcode=06";
|
||||
String url = "http://172.16.0.88:9990/service/XChangeServlet?account=BQ1217&groupcode=06";
|
||||
URL realURL = new URL(url);
|
||||
HttpURLConnection connection = (HttpURLConnection)realURL.openConnection();
|
||||
connection.setDoOutput(true);
|
||||
|
||||
@ -78,7 +78,7 @@ public class VoucherToNCforCustomer implements Job{
|
||||
// 生成xml头
|
||||
Document document= DocumentHelper.createDocument();
|
||||
Element root = document.addElement("ufinterface");
|
||||
root.addAttribute("account", "8");
|
||||
root.addAttribute("account", "BQ1217");
|
||||
root.addAttribute("billtype", "customer(客户)");
|
||||
root.addAttribute("businessunitcode", "develop");
|
||||
root.addAttribute("filename", "");
|
||||
@ -88,7 +88,7 @@ public class VoucherToNCforCustomer implements Job{
|
||||
root.addAttribute("receiver", "接收方业务单元编码");
|
||||
root.addAttribute("replace", "Y");
|
||||
root.addAttribute("roottag", "");
|
||||
root.addAttribute("sender", "001");
|
||||
root.addAttribute("sender", "kh01");
|
||||
|
||||
String batch = SerialNumberUtil.getVoucherPCNumber(Sqlca);// 生成批次号
|
||||
|
||||
@ -115,7 +115,8 @@ public class VoucherToNCforCustomer implements Job{
|
||||
Element mnecode = billhead.addElement("mnecode"); // 助记码,最大长度为50,类型为:String
|
||||
mnecode.setText("");
|
||||
Element pk_custclass = billhead.addElement("pk_custclass"); // 客户基本分类,最大长度为20,类型为:String
|
||||
pk_custclass.setText((customertype==null)?"":customertype);
|
||||
//pk_custclass.setText((customertype==null)?"":customertype);
|
||||
pk_custclass.setText("0201");
|
||||
Element pk_areacl = billhead.addElement("pk_areacl"); // 地区分类,最大长度为20,类型为:String
|
||||
pk_areacl.setText("");
|
||||
Element issupplier = billhead.addElement("issupplier"); // 供应商,最大长度为1,类型为:UFBoolean
|
||||
@ -222,7 +223,7 @@ public class VoucherToNCforCustomer implements Job{
|
||||
* 获取对方post连接
|
||||
*/
|
||||
//String url = "http://47.93.227.86:8858/service/XChangeServlet?account=q0225&groupcode=001";
|
||||
String url = "http://47.93.227.86:8858/service/XChangeServlet?account=8&groupcode=06";
|
||||
String url = "http://172.16.0.88:9990/service/XChangeServlet?account=BQ1217&groupcode=06";
|
||||
URL realURL = new URL(url);
|
||||
HttpURLConnection connection = (HttpURLConnection)realURL.openConnection();
|
||||
connection.setDoOutput(true);
|
||||
|
||||
@ -94,7 +94,7 @@ public class VoucherToNCforDistributor implements Job{
|
||||
// 设置xml标签头
|
||||
Document document = DocumentHelper.createDocument();
|
||||
Element root = document.addElement("ufinterface");
|
||||
root.addAttribute("account", "8");
|
||||
root.addAttribute("account", "BQ1217");
|
||||
root.addAttribute("billtype", "supplier(供应商)");
|
||||
root.addAttribute("filename", "");
|
||||
root.addAttribute("groupcode", "06");
|
||||
@ -102,7 +102,7 @@ public class VoucherToNCforDistributor implements Job{
|
||||
root.addAttribute("receiver", "接收方业务单元编码");
|
||||
root.addAttribute("replace", "Y");
|
||||
root.addAttribute("roottag", "");
|
||||
root.addAttribute("sender", "001");
|
||||
root.addAttribute("sender", "gys01");
|
||||
// 获取批次号
|
||||
String batch = SerialNumberUtil.getVoucherPCNumber(Sqlca);
|
||||
|
||||
@ -156,7 +156,8 @@ public class VoucherToNCforDistributor implements Job{
|
||||
Element pk_areacl = billhead.addElement("pk_areacl"); // 地区分类,最大长度为20,类型为:String
|
||||
pk_areacl.setText((region==null)?"":region);
|
||||
Element pk_supplierclass = billhead.addElement("pk_supplierclass"); // 供应商基本分类,最大长度为20,类型为:String
|
||||
pk_supplierclass.setText((TYPE==null)?"":TYPE);
|
||||
//pk_supplierclass.setText((TYPE==null)?"":TYPE);
|
||||
pk_supplierclass.setText("0201");
|
||||
Element iscustomer = billhead.addElement("iscustomer"); // 客户,最大长度为1,类型为:UFBoolean
|
||||
iscustomer.setText("");
|
||||
Element corcustomer = billhead.addElement("corcustomer"); // 对应客户,最大长度为20,类型为:String
|
||||
@ -311,7 +312,7 @@ public class VoucherToNCforDistributor implements Job{
|
||||
* 获取对方post连接
|
||||
*/
|
||||
//String url = "http://47.93.227.86:8858/service/XChangeServlet?account=q0225&groupcode=001";
|
||||
String url = "http://47.93.227.86:8858/service/XChangeServlet?account=8&groupcode=06";
|
||||
String url = "http://172.16.0.88:9990/service/XChangeServlet?account=BQ1217&groupcode=06";
|
||||
URL realURL = new URL(url);
|
||||
HttpURLConnection connection = (HttpURLConnection)realURL.openConnection();
|
||||
connection.setDoOutput(true);
|
||||
|
||||
@ -75,8 +75,8 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
*/
|
||||
private static String DOM4JcreateToVoucher(){
|
||||
// 本地xml存放文件夹, 没有就创建
|
||||
File file2 = new File("D:\\voucherXml_NC");
|
||||
if (!file2.exists()) {file2.mkdirs();}// 判断是否存在, 如果不存在就创建该文件夹
|
||||
// File file2 = new File("D:\\voucherXml_NC");
|
||||
// if (!file2.exists()) {file2.mkdirs();}// 判断是否存在, 如果不存在就创建该文件夹
|
||||
JBOTransaction tx=null;
|
||||
Transaction Sqlca = null;
|
||||
String returns="true";
|
||||
@ -112,7 +112,7 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
Sqlca = Transaction.createTransaction(tx);
|
||||
document = DocumentHelper.createDocument(); // 创建Document对象
|
||||
Element root = document.addElement("ufinterface"); // 设置xml头
|
||||
root.addAttribute("account", "8"); // 设置xml头属性
|
||||
root.addAttribute("account", "BQ1217"); // 设置xml头属性
|
||||
root.addAttribute("billtype", "vouchergl(凭证)");
|
||||
root.addAttribute("businessunitcode", "develop");
|
||||
root.addAttribute("filename", "");
|
||||
@ -122,7 +122,7 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
root.addAttribute("receiver", "接收方业务单元编码");
|
||||
root.addAttribute("replace", "Y");
|
||||
root.addAttribute("roottag", "");
|
||||
root.addAttribute("sender", "001");
|
||||
root.addAttribute("sender", "GL");
|
||||
String batch = SerialNumberUtil.getVoucherPCNumber(Sqlca);
|
||||
for (int x = i * b; x < (i + 1) * b && x < a; x++) { // 决定当前xml生成的数据量
|
||||
// 获取凭证编号
|
||||
@ -155,7 +155,7 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
uuid=UUID.randomUUID().toString().replace("-", "");
|
||||
pkVoucher.setText(uuid);
|
||||
Element pk_vouchertype = voucherHead.addElement("pk_vouchertype");// 凭证类别, 默认01/非空
|
||||
pk_vouchertype.setText("1");//----------------------------------------------------------------------
|
||||
pk_vouchertype.setText("记账凭证");//----------------------------------------------------------------------
|
||||
Element year = voucherHead.addElement("year");// 会计年度/非空
|
||||
year.setText((ACC_YEAR==null)?"":ACC_YEAR);
|
||||
Element pk_system = voucherHead.addElement("pk_system");// 来源系统/非空
|
||||
@ -176,7 +176,7 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
Element prepareddate = voucherHead.addElement("prepareddate");// 制单日期/非空
|
||||
prepareddate.setText(timeAll);//---------------------------------------------------
|
||||
Element pk_prepared = voucherHead.addElement("pk_prepared");// 制单人/非空
|
||||
pk_prepared.setText("制单人/非空");//-------------------------------------------
|
||||
pk_prepared.setText("807caoyuli");//-------------------------------------------
|
||||
Element pk_casher = voucherHead.addElement("pk_casher");// 出纳
|
||||
pk_casher.setText("");//------------------------------------------
|
||||
Element signflag = voucherHead.addElement("signflag");// 签字标志
|
||||
@ -398,14 +398,14 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
logger.info("凭证记录表插入语句: "+insertSql);
|
||||
count++;
|
||||
}
|
||||
// String URL="//data//files//apzl_leasing//tmp//XZW//APleasing_VOUCHER_"+year_month_day+".xml";
|
||||
String URL="D:\\voucherXml_NC\\APleasing_VOUCHER_"+year_month_day+".xml";
|
||||
String URL="//data//files//apzl_leasing//tmp//XZW//APleasing_VOUCHER_"+year_month_day+".xml";
|
||||
// String URL="D:\\voucherXml_NC\\APleasing_VOUCHER_"+year_month_day+".xml";
|
||||
file=new File(URL);
|
||||
writer = new XMLWriter(new FileOutputStream(file), OutputFormat.createPrettyPrint());
|
||||
writer.setEscapeText(false);// 字符是否转义,默认true
|
||||
writer.write(document);
|
||||
writer.close();
|
||||
// InterActionToNC(Sqlca,URL,type,batch,count);
|
||||
InterActionToNC(Sqlca,URL,type,batch,count);
|
||||
Sqlca.commit();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@ -445,7 +445,7 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
* 获取对方post连接
|
||||
*/
|
||||
//String url = "http://47.93.227.86:8858/service/XChangeServlet?account=q0225&groupcode=001";
|
||||
String url = "http://47.93.227.86:8858/service/XChangeServlet?account=8&groupcode=06";
|
||||
String url = "http://172.16.0.88:9990/service/XChangeServlet?account=BQ1217&groupcode=06";
|
||||
URL realURL = new URL(url);
|
||||
HttpURLConnection connection = (HttpURLConnection)realURL.openConnection();
|
||||
connection.setDoOutput(true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user