凭证相关
This commit is contained in:
parent
0f95191038
commit
33d8f059d5
@ -37,6 +37,7 @@ import com.amarsoft.are.jbo.JBOException;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.log.Log;
|
||||
import com.amarsoft.awe.util.ASResultSet;
|
||||
import com.amarsoft.awe.util.SqlObject;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.dict.als.manage.NameManager;
|
||||
@ -101,7 +102,7 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService {
|
||||
*/
|
||||
private static List<Map<String, String>> getDataList(JBOTransaction tx) throws Exception{
|
||||
// 查询所有待传输的数据
|
||||
String sql = "SELECT F3,F60,ID,MODULE_NAME,DEPT_NAME,F1,F15,V8_STATUS,F5,GENERATE_DATE FROM VI_VOUCHER_V8 WHERE V8_FLAG ='0' AND F3 NOT IN(SELECT F3 FROM VOUCHER_LOG WHERE FLAG = '1')";
|
||||
String sql = "SELECT F3,F60,ID,MODULE_NAME,DEPT_NAME,F1,F15,V8_STATUS,F5,GENERATE_DATE FROM VI_VOUCHER_V8 WHERE F3 NOT IN(SELECT F3 FROM VOUCHER_LOG WHERE FLAG = '1')";
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(tx, sql, null);// 将所有凭证号封装到list集合中
|
||||
return dataList;
|
||||
}
|
||||
@ -124,7 +125,7 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService {
|
||||
String ACC_MONTH = null; // 会计期间/月
|
||||
String tableName="VOUCHER_LOG"; // 表名
|
||||
String insertSql=""; // 定义新增语句对象
|
||||
SqlObject sqlObject; // sqlObject对象
|
||||
SqlObject sqlObject=null; // sqlObject对象
|
||||
Date time = new Date(); // 获取当前时间对象, 并格式化
|
||||
SimpleDateFormat formatter1 = new SimpleDateFormat("yyyyMMddHHmmss");// 年月日时分秒
|
||||
SimpleDateFormat formatter2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 年月日时分秒
|
||||
@ -424,9 +425,10 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService {
|
||||
}
|
||||
// 新增当条凭证信息如voucher_log表
|
||||
insertSql="INSERT INTO VOUCHER_LOG(BILLID,F3,FLAG,CREATE_TIME) VALUES('"+str+"','"+F3+"','1','"+year_month_days+"')";
|
||||
sqlObject = new SqlObject(insertSql);
|
||||
Sqlca.executeSQL(sqlObject);
|
||||
logger.info("将当前数据传入记录表: "+insertSql);
|
||||
//sqlObject = new SqlObject(insertSql);
|
||||
//Sqlca.executeSQL(sqlObject);
|
||||
Sqlca.executeSQL(insertSql);
|
||||
logger.info("凭证记录表插入语句: "+insertSql);
|
||||
}
|
||||
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";
|
||||
@ -455,7 +457,7 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService {
|
||||
// 表名
|
||||
String tableName="CUSTOMER_LOG";
|
||||
String insertSql=""; // 定义新增语句对象
|
||||
SqlObject sqlObject; // sqlObject对象
|
||||
SqlObject sqlObject=null; // sqlObject对象
|
||||
// 获取时间对象, 格式为--年月日时分秒
|
||||
Date time = new Date(); // 获取当前时间对象, 并格式化
|
||||
SimpleDateFormat formatter1 = new SimpleDateFormat("yyyyMMddHHmmss");// 年月日时分秒
|
||||
@ -746,8 +748,9 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService {
|
||||
|
||||
// 将客户xml信息写入状态表中
|
||||
insertSql="INSERT INTO CUSTOMER_LOG(BILLID,CUSTOMER_NUM,FLAG,CREATE_TIME) VALUES('"+str+"','"+customer_num+"','1','"+year_month_days+"')";
|
||||
sqlObject = new SqlObject(insertSql);
|
||||
Sqlca.executeSQL(sqlObject);
|
||||
//sqlObject = new SqlObject(insertSql);
|
||||
//Sqlca.executeSQL(sqlObject);
|
||||
Sqlca.executeSQL(insertSql);
|
||||
logger.info("客户记录语句: "+insertSql);
|
||||
}
|
||||
String URL="//data//files//apzl_leasing//tmp//XZW//APleasing_Customer_"+year_month_day+".xml";
|
||||
@ -791,7 +794,7 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService {
|
||||
String DISTRIBUTORER=""; // 法人
|
||||
String URL=""; // 网址
|
||||
String insertSql=""; // 新增语句
|
||||
SqlObject sqlObject; // 创建sqlObject对象
|
||||
SqlObject sqlObject=null; // 创建sqlObject对象
|
||||
String uuid=""; // uuid
|
||||
String MBAFC_EARLYDISBURSEMENT_TYPE="";// 资金类型/支付类型
|
||||
// 获取时间对象, 格式为--年月日时分秒
|
||||
@ -812,7 +815,7 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService {
|
||||
root.addAttribute("replace", "Y");
|
||||
root.addAttribute("roottag", "");
|
||||
root.addAttribute("sender", "001");
|
||||
String sql="SELECT DISTRIBUTOR_NAME,DISTRIBUTOR_CODING,DISTRIBUTOR_ADDRESS,FACT_ADDR,PROVINCES,POSTCODE,REGISTERED_ADDR,BUSINESS_SCOPE,SUBSIDIARY_COMPANY,TYPE,BUSINESS_LICENSE_NO,DISTRIBUTOR_STATUS,E_MAIL,FAX_NUMBER,REGISTERED_ASSET,DISTRIBUTORER,MBAFC_EARLYDISBURSEMENT_TYPE,URL,FLAG FROM DISTRIBUTOR_INFO WHERE DISTRIBUTOR_CODING NOT IN(SELECT DISTRIBUTOR_CODING FROM DISTRIBUTOR_LOG WHERE FLAG <>'1' ) ";
|
||||
String sql="SELECT DISTRIBUTOR_NAME,DISTRIBUTOR_CODING,DISTRIBUTOR_ADDRESS,FACT_ADDR,PROVINCES,POSTCODE,REGISTERED_ADDR,BUSINESS_SCOPE,SUBSIDIARY_COMPANY,TYPE,BUSINESS_LICENSE_NO,DISTRIBUTOR_STATUS,E_MAIL,FAX_NUMBER,REGISTERED_ASSET,DISTRIBUTORER,MBAFC_EARLYDISBURSEMENT_TYPE,URL FROM DISTRIBUTOR_INFO WHERE DISTRIBUTOR_CODING NOT IN(SELECT DISTRIBUTOR_CODING FROM DISTRIBUTOR_LOG WHERE FLAG ='1' ) ";
|
||||
List<Map<String, String>> rs = DataOperatorUtil.getDataBySql(Sqlca,sql,null);
|
||||
for(int i=0; i<rs.size();i++) {
|
||||
DISTRIBUTOR_NAME = rs.get(i).get("DISTRIBUTOR_NAME");
|
||||
@ -964,8 +967,9 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService {
|
||||
|
||||
// 像记录表添加数据
|
||||
insertSql="INSERT INTO DISTRIBUTOR_LOG(BILLID,DISTRIBUTOR_CODING,FLAG,CREATE_TIME) VALUES('"+uuid+"','"+DISTRIBUTOR_CODING+"','1','"+year_month_days+"')";
|
||||
sqlObject = new SqlObject(insertSql);
|
||||
Sqlca.executeSQL(sqlObject);
|
||||
//sqlObject = new SqlObject(insertSql);
|
||||
//Sqlca.executeSQL(sqlObject);
|
||||
Sqlca.executeSQL(insertSql);
|
||||
logger.info("经销商记录语句: "+ insertSql);
|
||||
}
|
||||
//String f="D:\\voucherXml_NC\\APleasing_Supplier_"+year_month_day+".xml";
|
||||
@ -987,7 +991,7 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService {
|
||||
XMLWriter writer=null;
|
||||
String uuid="";
|
||||
String insertSql="";
|
||||
SqlObject sqlObject;
|
||||
SqlObject sqlObject=null;
|
||||
String contract_number="";
|
||||
String contract_name="";
|
||||
String tableName="SUBSIBIARY_CONTRACT_LOG"; // 表名
|
||||
@ -1010,7 +1014,7 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService {
|
||||
root.addAttribute("replace","Y");
|
||||
root.addAttribute("roottag","");
|
||||
root.addAttribute("sender","001");
|
||||
String sql="SELECT CONTRACT_NUMBER,PRODUCT_NAME FROM LB_CONTRACT_INFO WHERE CONTRACT_NUMBER NOT IN(SELECT CONTRACT_NUMBER FROM subsibiary_contract_log WHERE FLAG <> '1')";
|
||||
String sql="SELECT CONTRACT_NUMBER,PRODUCT_NAME FROM LB_CONTRACT_INFO WHERE CONTRACT_NUMBER NOT IN(SELECT CONTRACT_NUMBER FROM subsibiary_contract_log WHERE FLAG = '1')";
|
||||
List<Map<String, String>> rs = DataOperatorUtil.getDataBySql(Sqlca,sql,null);
|
||||
for (Map<String, String> map : rs) {
|
||||
contract_number=(map.get("CONTRACT_NUMBER")==null)?"":map.get("CONTRACT_NUMBER");
|
||||
@ -1041,8 +1045,8 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService {
|
||||
memo.setText("");
|
||||
// 将记录写入辅助合同日志表
|
||||
insertSql="INSERT INTO SUBSIBIARY_CONTRACT_LOG(BILLID,CONTRACT_NUMBER,FLAG,CREATE_TIME) VALUES('"+uuid+"','"+contract_number+"','1','"+year_month_days+"')";
|
||||
sqlObject= new SqlObject(insertSql);
|
||||
Sqlca.executeSQL(sqlObject);
|
||||
//sqlObject= new SqlObject(insertSql);
|
||||
Sqlca.executeSQL(insertSql);
|
||||
logger.info("辅助合同记录语句: " + insertSql);
|
||||
}
|
||||
String URL="//data//files//apzl_leasing//tmp//XZW//APleasing_Defdoc_"+year_month_day+".xml";
|
||||
@ -1102,8 +1106,9 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService {
|
||||
xmlString += (char) c;
|
||||
}
|
||||
input.close();
|
||||
System.out.println("----" + xmlString);
|
||||
|
||||
System.out.println("--------------------------" + xmlString);
|
||||
String insertSql1="INSERT INTO test_log(id,NAME) VALUES('1','成功')";
|
||||
Sqlca.executeSQL(insertSql1);
|
||||
/**
|
||||
* 将获取到的回执信息生成本地xml
|
||||
*/
|
||||
@ -1121,6 +1126,8 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService {
|
||||
String resFile = "//data//files//apzl_leasing//tmp//WEN"+fmt.format(new Date())+".xml";
|
||||
StreamResult result = new StreamResult(new File(resFile));
|
||||
transformer.transform(source,result);
|
||||
String insertSql="INSERT INTO test_log(id,NAME) VALUES('2','成功')";
|
||||
Sqlca.executeSQL(insertSql);
|
||||
|
||||
/**
|
||||
* 解析xml, 根据回执信息更新状态
|
||||
@ -1149,8 +1156,8 @@ public class VoucherSysJointNCServiceImpl implements VoucherSysJointNCService {
|
||||
resultdescription = el.element("resultdescription").getStringValue();// 错误信息
|
||||
//sql=" UPDATE "+tableName+" SET FLAG='"+resultcode+"',ERR_DESCRIBE='"+resultdescription+"' WHERE BUILLID='"+bdocid+"' ";
|
||||
sql=" UPDATE "+tableName+" SET FLAG='2',ERR_DESCRIBE='"+resultdescription+"' WHERE BUILLID='"+bdocid+"' ";
|
||||
updSql = new SqlObject(sql);
|
||||
Sqlca.executeSQL(updSql);
|
||||
//updSql = new SqlObject(sql);
|
||||
Sqlca.executeSQL(sql);
|
||||
logger.info("根据回执信息, 修改传输失败状态, 记录错误信息"+sql);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user