解决异常
parent
5a8ef40e18
commit
2ff4e22bbd
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -3,6 +3,7 @@ package com.api.nonstandardext.zenner.job;
|
|||
import com.api.nonstandardext.zenner.model.sap.PeriodBalance;
|
||||
import com.api.nonstandardext.zenner.utils.SAPWebserviceTool;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.log4j.Logger;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.setup.ModeRightInfo;
|
||||
import weaver.general.BaseBean;
|
||||
|
@ -23,7 +24,8 @@ import java.util.Calendar;
|
|||
*/
|
||||
public class SyncAccountInfoFromSapJob extends BaseCronJob {
|
||||
|
||||
BaseBean logger = new BaseBean();
|
||||
//BaseBean logger = new BaseBean();
|
||||
private final Logger logger = aiyh.utils.Util.getLogger("json_util");
|
||||
|
||||
private final static String JobName = " SyncAccountInfoFromSapJob ";
|
||||
|
||||
|
@ -71,11 +73,11 @@ public class SyncAccountInfoFromSapJob extends BaseCronJob {
|
|||
}
|
||||
|
||||
public void execute() {
|
||||
logger.writeLog("-----" + JobName + " Begin------");
|
||||
logger.info("-----" + JobName + " Begin------");
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
try {
|
||||
logger.writeLog("-----" + JobName + " getInterfaceName------" + getInterfaceName());
|
||||
logger.info("-----" + JobName + " getInterfaceName------" + getInterfaceName());
|
||||
|
||||
// if (getInterfaceName().indexOf("syncGlaccPeriodBalancesFromSap") >= 0){
|
||||
|
||||
|
@ -99,10 +101,10 @@ public class SyncAccountInfoFromSapJob extends BaseCronJob {
|
|||
// }
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.writeLog(JobName + " 获取异常: " + e.getMessage());
|
||||
logger.info(JobName + " 获取异常: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
logger.writeLog("--------------------" + JobName + " End---------------------------");
|
||||
logger.info("--------------------" + JobName + " End---------------------------");
|
||||
}
|
||||
|
||||
public void syncGlaccPeriodBalancesFromSap(String comCode, String period, String year, String glAccount, SAPWebserviceTool tool) throws Exception {
|
||||
|
@ -111,7 +113,7 @@ public class SyncAccountInfoFromSapJob extends BaseCronJob {
|
|||
|
||||
JSONObject result = tool.callInterface_011(params);
|
||||
|
||||
logger.writeLog(JobName + " syncGlaccPeriodBalancesFromSap result : " + result);
|
||||
logger.info(JobName + " syncGlaccPeriodBalancesFromSap result : " + result);
|
||||
|
||||
JSONObject balanceResponse = result.getJSONObject("balanceResponse");
|
||||
PeriodBalance periodBalance = new PeriodBalance();
|
||||
|
@ -145,7 +147,7 @@ public class SyncAccountInfoFromSapJob extends BaseCronJob {
|
|||
// keyParams.put("IvFiscYear", 2022);
|
||||
// keyParams.put("IvGlAccount", 12345);
|
||||
// String str = keyParams.toString();
|
||||
// logger.writeLog(JobName + " syncSapData Service Call str : " + str);
|
||||
// logger.info(JobName + " syncSapData Service Call str : " + str);
|
||||
// Object resultObject = call.invoke(new Object[] { 6000, 8, 2022, 12345 });//调用接口
|
||||
// result = (String) resultObject;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.api.nonstandardext.zenner.model.bank.DayBalance;
|
|||
import com.api.nonstandardext.zenner.service.bank.Bank_b2e0005_Service;
|
||||
import com.api.nonstandardext.zenner.utils.ZennerApiService;
|
||||
import com.api.nonstandardext.zenner.utils.ZennerUtil;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
|
@ -28,8 +29,8 @@ import java.util.*;
|
|||
*/
|
||||
public class SyncAccountStatementJob extends BaseCronJob {
|
||||
|
||||
BaseBean logger = new BaseBean();
|
||||
|
||||
//BaseBean logger = new BaseBean();
|
||||
private final Logger logger = aiyh.utils.Util.getLogger("json_util");
|
||||
private String interfaceName;
|
||||
|
||||
/** 模块id */
|
||||
|
@ -54,12 +55,12 @@ public class SyncAccountStatementJob extends BaseCronJob {
|
|||
}
|
||||
|
||||
public void execute() {
|
||||
logger.writeLog("-----" + JobName + " Begin------");
|
||||
logger.info("-----" + JobName + " Begin------");
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
ZennerApiService zennerApiService = new ZennerApiService();
|
||||
try {
|
||||
logger.writeLog("-----" + JobName + " getInterfaceName------" + getInterfaceName());
|
||||
logger.info("-----" + JobName + " getInterfaceName------" + getInterfaceName());
|
||||
//银行
|
||||
String bankApiUrl = zennerApiService.getSystemConfigValue("BANK_API_URL");
|
||||
|
||||
|
@ -69,10 +70,10 @@ public class SyncAccountStatementJob extends BaseCronJob {
|
|||
syncBank_b2e0005(bankApiUrl, Util.null2String(rs.getString("lxh")), Util.null2String(rs.getString("yxzh")));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.writeLog(JobName + " 获取异常: " + e.getMessage());
|
||||
logger.info(JobName + " 获取异常: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
logger.writeLog("--------------------" + JobName + " End---------------------------");
|
||||
logger.info("--------------------" + JobName + " End---------------------------");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -87,7 +88,7 @@ public class SyncAccountStatementJob extends BaseCronJob {
|
|||
if (!dir.exists()) {
|
||||
dir.mkdirs();
|
||||
}
|
||||
logger.writeLog(JobName + "..syncBank_b2e0005......,,,bankApiUrl: " + bankApiUrl);
|
||||
logger.info(JobName + "..syncBank_b2e0005......,,,bankApiUrl: " + bankApiUrl);
|
||||
//当日账号余额
|
||||
Map<String, String> xmlParams = new HashMap<>();
|
||||
|
||||
|
@ -101,7 +102,7 @@ public class SyncAccountStatementJob extends BaseCronJob {
|
|||
xmlParams.put("ibknum", ibknum);
|
||||
xmlParams.put("actacn", actacn);
|
||||
String xmlFileUrl = dirPath + "b2e0005_" + ZennerUtil.parseToDateString(Calendar.getInstance().getTime(), ZennerUtil.formatYYYYMMDD)+ ".xml";
|
||||
logger.writeLog(JobName + ".syncBank_b2e0005.......,,,xmlFileUrl: " + xmlFileUrl);
|
||||
logger.info(JobName + ".syncBank_b2e0005.......,,,xmlFileUrl: " + xmlFileUrl);
|
||||
Bank_b2e0005_Service bankB2e0005Service = new Bank_b2e0005_Service();
|
||||
bankB2e0005Service.createXml(xmlFileUrl, xmlParams);
|
||||
|
||||
|
@ -112,18 +113,18 @@ public class SyncAccountStatementJob extends BaseCronJob {
|
|||
int logPageNum = pLen / ps;
|
||||
int i = 0;
|
||||
if (pLen <= ps){
|
||||
logger.writeLog(JobName + ".syncBank_b2e0005.......,,,voucherParams last: " + apiParams);
|
||||
logger.info(JobName + ".syncBank_b2e0005.......,,,voucherParams last: " + apiParams);
|
||||
} else {
|
||||
for (i = 0; i < logPageNum; i++){
|
||||
logger.writeLog(JobName + ".syncBank_b2e0005.......,,,,,,voucherParams " + i + " : " + apiParams.substring(i * ps, (i + 1) * 500));
|
||||
logger.info(JobName + ".syncBank_b2e0005.......,,,,,,voucherParams " + i + " : " + apiParams.substring(i * ps, (i + 1) * 500));
|
||||
}
|
||||
logger.writeLog(JobName + ".syncBank_b2e0005.......,,,voucherParams last: " + apiParams.substring((i-1) * 500));
|
||||
logger.info(JobName + ".syncBank_b2e0005.......,,,voucherParams last: " + apiParams.substring((i-1) * 500));
|
||||
}
|
||||
|
||||
logger.writeLog(JobName + " bankApiUrl : " + bankApiUrl);
|
||||
logger.info(JobName + " bankApiUrl : " + bankApiUrl);
|
||||
|
||||
String result = ZennerUtil.httpPostToken(bankApiUrl, new HashMap<>(), apiParams);
|
||||
logger.writeLog(JobName + " syncBank_b2e0005 result : " + result);
|
||||
logger.info(JobName + " syncBank_b2e0005 result : " + result);
|
||||
|
||||
Document doc = DocumentHelper.parseText(result); // 将xml转为dom对象
|
||||
Element root = doc.getRootElement(); // 获取根节点
|
||||
|
@ -133,7 +134,7 @@ public class SyncAccountStatementJob extends BaseCronJob {
|
|||
for (Object l2 : elements) { //遍历子元素
|
||||
|
||||
Element l2Element = (Element) l2;
|
||||
logger.writeLog("l2Element name :" + l2Element.getName());
|
||||
logger.info("l2Element name :" + l2Element.getName());
|
||||
List<Element> elementsL3 = l2Element.elements();
|
||||
|
||||
for (Object l3 : elementsL3) { //遍历子元素
|
||||
|
@ -144,7 +145,7 @@ public class SyncAccountStatementJob extends BaseCronJob {
|
|||
for (Object l4 : elementsL4) { //遍历子元素
|
||||
|
||||
Element dataElement = (Element) l4;
|
||||
logger.writeLog("l4Element name :" + dataElement.getName());
|
||||
logger.info("l4Element name :" + dataElement.getName());
|
||||
|
||||
if ("status".equals(dataElement.getName())){
|
||||
List<Element> elementsL5 = dataElement.elements();
|
||||
|
@ -152,7 +153,7 @@ public class SyncAccountStatementJob extends BaseCronJob {
|
|||
for (Object l5 : elementsL5) { //遍历子元素
|
||||
Element l5Element = (Element) l5;
|
||||
if ("rspcod".equals(l5Element.getName())) {
|
||||
logger.writeLog("rspcod:" + l5Element.getStringValue());
|
||||
logger.info("rspcod:" + l5Element.getStringValue());
|
||||
if (l5Element.getStringValue().equals("B001")){
|
||||
statusOk = true;
|
||||
} else {
|
||||
|
@ -160,14 +161,14 @@ public class SyncAccountStatementJob extends BaseCronJob {
|
|||
}
|
||||
}
|
||||
if ("rspmsg".equals(l5Element.getName())) {
|
||||
logger.writeLog("rspmsg:" + l5Element.getStringValue());
|
||||
logger.info("rspmsg:" + l5Element.getStringValue());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
logger.writeLog("statusOk:" + statusOk);
|
||||
logger.info("statusOk:" + statusOk);
|
||||
if (statusOk){
|
||||
logger.writeLog("dataElement.getName():" + dataElement.getName());
|
||||
logger.info("dataElement.getName():" + dataElement.getName());
|
||||
if ("b2e0005-rs".equals(dataElement.getName())){
|
||||
List<Element> elementsData = dataElement.elements();
|
||||
|
||||
|
@ -179,19 +180,19 @@ public class SyncAccountStatementJob extends BaseCronJob {
|
|||
for (Object l5 : elementsL5) { //遍历子元素
|
||||
Element l5Element = (Element) l5;
|
||||
if ("ibknum".equals(l5Element.getName())) {
|
||||
logger.writeLog("ibknum:" + l5Element.getStringValue());
|
||||
logger.info("ibknum:" + l5Element.getStringValue());
|
||||
dayBalance.setIbknum(l5Element.getStringValue());
|
||||
}
|
||||
if ("actacn".equals(l5Element.getName())) {
|
||||
logger.writeLog("actacn:" + l5Element.getStringValue());
|
||||
logger.info("actacn:" + l5Element.getStringValue());
|
||||
dayBalance.setActacn(l5Element.getStringValue());
|
||||
}
|
||||
if ("curcde".equals(l5Element.getName())) {
|
||||
logger.writeLog("curcde:" + l5Element.getStringValue());
|
||||
logger.info("curcde:" + l5Element.getStringValue());
|
||||
dayBalance.setCurcde(l5Element.getStringValue());
|
||||
}
|
||||
if ("actname".equals(l5Element.getName())) {
|
||||
logger.writeLog("actname:" + l5Element.getStringValue());
|
||||
logger.info("actname:" + l5Element.getStringValue());
|
||||
dayBalance.setActname(l5Element.getStringValue());
|
||||
}
|
||||
}
|
||||
|
@ -203,15 +204,15 @@ public class SyncAccountStatementJob extends BaseCronJob {
|
|||
for (Object l5 : elementsL5) { //遍历子元素
|
||||
Element l5Element = (Element) l5;
|
||||
if ("bokbal".equals(l5Element.getName())) {
|
||||
logger.writeLog("bokbal:" + l5Element.getStringValue());
|
||||
logger.info("bokbal:" + l5Element.getStringValue());
|
||||
dayBalance.setBokbal(l5Element.getStringValue());
|
||||
}
|
||||
if ("avabal".equals(l5Element.getName())) {
|
||||
logger.writeLog("avabal:" + l5Element.getStringValue());
|
||||
logger.info("avabal:" + l5Element.getStringValue());
|
||||
dayBalance.setAvabal(l5Element.getStringValue());
|
||||
}
|
||||
if ("currentavabal".equals(l5Element.getName())) {
|
||||
logger.writeLog("currentavabal:" + l5Element.getStringValue());
|
||||
logger.info("currentavabal:" + l5Element.getStringValue());
|
||||
if ("".equals(l5Element.getStringValue())){
|
||||
dayBalance.setCurrentavabal("0");
|
||||
} else {
|
||||
|
@ -220,7 +221,7 @@ public class SyncAccountStatementJob extends BaseCronJob {
|
|||
|
||||
}
|
||||
if ("stpamt".equals(l5Element.getName())) {
|
||||
logger.writeLog("stpamt:" + l5Element.getStringValue());
|
||||
logger.info("stpamt:" + l5Element.getStringValue());
|
||||
if ("".equals(l5Element.getStringValue())){
|
||||
dayBalance.setStpamt("0");
|
||||
} else {
|
||||
|
@ -228,30 +229,30 @@ public class SyncAccountStatementJob extends BaseCronJob {
|
|||
}
|
||||
}
|
||||
if ("ovramt".equals(l5Element.getName())) {
|
||||
logger.writeLog("ovramt:" + l5Element.getStringValue());
|
||||
logger.info("ovramt:" + l5Element.getStringValue());
|
||||
dayBalance.setOvramt("".equals(l5Element.getStringValue()) ? "0" : l5Element.getStringValue());
|
||||
}
|
||||
if ("frzamt".equals(l5Element.getName())) {
|
||||
logger.writeLog("frzamt:" + l5Element.getStringValue());
|
||||
logger.info("frzamt:" + l5Element.getStringValue());
|
||||
dayBalance.setFrzamt("".equals(l5Element.getStringValue()) ? "0" : l5Element.getStringValue());
|
||||
}
|
||||
if ("effauthamt".equals(l5Element.getName())) {
|
||||
logger.writeLog("effauthamt:" + l5Element.getStringValue());
|
||||
logger.info("effauthamt:" + l5Element.getStringValue());
|
||||
dayBalance.setEffauthamt("".equals(l5Element.getStringValue()) ? "0" : l5Element.getStringValue());
|
||||
}
|
||||
if ("effusdoverbal".equals(l5Element.getName())) {
|
||||
logger.writeLog("effusdoverbal:" + l5Element.getStringValue());
|
||||
logger.info("effusdoverbal:" + l5Element.getStringValue());
|
||||
dayBalance.setEffusdoverbal("".equals(l5Element.getStringValue()) ? "0" : l5Element.getStringValue());
|
||||
}
|
||||
if ("effuseablequota".equals(l5Element.getName())) {
|
||||
logger.writeLog("effuseablequota:" + l5Element.getStringValue());
|
||||
logger.info("effuseablequota:" + l5Element.getStringValue());
|
||||
dayBalance.setEffuseablequota("".equals(l5Element.getStringValue()) ? "0" : l5Element.getStringValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ("baldat".equals(l4Element.getName())) {
|
||||
logger.writeLog("baldat:" + l4Element.getStringValue());
|
||||
logger.info("baldat:" + l4Element.getStringValue());
|
||||
|
||||
if (!"".equals(l4Element.getStringValue())){
|
||||
Date date = ZennerUtil.parseToDate(l4Element.getStringValue(), ZennerUtil.formatYYYYMMDD_NoSplit);
|
||||
|
@ -265,6 +266,6 @@ public class SyncAccountStatementJob extends BaseCronJob {
|
|||
}
|
||||
}
|
||||
dayBalance.save(dayBalance, Util.getIntValue(this.modelId), "uf_bank_day_balance");
|
||||
logger.writeLog(JobName + " result dayBalance: " + dayBalance.toString());
|
||||
logger.info(JobName + " result dayBalance: " + dayBalance.toString());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.api.nonstandardext.zenner.model.bank.TradeInfo;
|
|||
import com.api.nonstandardext.zenner.service.bank.Bank_b2e0035_Service;
|
||||
import com.api.nonstandardext.zenner.utils.ZennerApiService;
|
||||
import com.api.nonstandardext.zenner.utils.ZennerUtil;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
|
@ -29,21 +30,33 @@ import java.util.*;
|
|||
*/
|
||||
public class SyncAccountTradeInfoJob extends BaseCronJob {
|
||||
|
||||
BaseBean logger = new BaseBean();
|
||||
|
||||
//BaseBean logger = new BaseBean();
|
||||
private final Logger logger = aiyh.utils.Util.getLogger("json_util");
|
||||
/** 模块id */
|
||||
private String modelId;
|
||||
|
||||
private String interfaceName;
|
||||
|
||||
private String amountTo;
|
||||
|
||||
/** 同步开始日期 */
|
||||
private String fromDate;
|
||||
|
||||
/** 同步结束日期 */
|
||||
private String toDate;
|
||||
|
||||
private String queryType;
|
||||
|
||||
private final static String JobName = " SyncAccountTradeInfoJob ";
|
||||
|
||||
public String getAmountTo() {
|
||||
return amountTo;
|
||||
}
|
||||
|
||||
public void setAmountTo(String amountTo) {
|
||||
this.amountTo = amountTo;
|
||||
}
|
||||
|
||||
public String getFromDate() {
|
||||
return fromDate;
|
||||
}
|
||||
|
@ -52,6 +65,14 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
|
|||
this.fromDate = fromDate;
|
||||
}
|
||||
|
||||
public String getQueryType() {
|
||||
return queryType;
|
||||
}
|
||||
|
||||
public void setQueryType(String queryType) {
|
||||
this.queryType = queryType;
|
||||
}
|
||||
|
||||
public String getToDate() {
|
||||
return toDate;
|
||||
}
|
||||
|
@ -69,13 +90,13 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
|
|||
}
|
||||
|
||||
public void execute() {
|
||||
logger.writeLog("-----" + JobName + " Begin------");
|
||||
logger.info("-----" + JobName + " Begin------");
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
ZennerApiService zennerApiService = new ZennerApiService();
|
||||
try {
|
||||
logger.writeLog("-----" + JobName + " getInterfaceName------" + getInterfaceName());
|
||||
logger.writeLog(String.format("params --- fromDate:%s toDate:%s",fromDate,toDate));
|
||||
logger.info("-----" + JobName + " getInterfaceName------" + getInterfaceName());
|
||||
logger.info(String.format("params --- fromDate:%s toDate:%s",fromDate,toDate));
|
||||
//银行
|
||||
String bankApiUrl = zennerApiService.getSystemConfigValue("BANK_API_URL");
|
||||
|
||||
|
@ -85,21 +106,21 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
|
|||
while (rs.next()){
|
||||
int total = syncBank_b2e0035(bankApiUrl, Util.null2String(rs.getString("lxh")), Util.null2String(rs.getString("yxzh")), 1, pageSize);
|
||||
Integer totalPage = (total + pageSize - 1) / pageSize;
|
||||
logger.writeLog(JobName + " totalPage:" + totalPage);
|
||||
logger.info(JobName + " totalPage:" + totalPage);
|
||||
for (int pageNo = 2; pageNo <= totalPage; pageNo++) {
|
||||
int startNo = (pageNo - 1) * pageSize;
|
||||
int endNo = pageNo * pageSize;
|
||||
|
||||
logger.writeLog(JobName + " startNo:" + startNo + " endNo:" + endNo);
|
||||
logger.info(JobName + " startNo:" + startNo + " endNo:" + endNo);
|
||||
int pageTotal = syncBank_b2e0035(bankApiUrl, Util.null2String(rs.getString("lxh")), Util.null2String(rs.getString("yxzh")), startNo, pageSize);
|
||||
logger.writeLog(JobName + " total:" + pageTotal);
|
||||
logger.info(JobName + " total:" + pageTotal);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.writeLog(JobName + " 获取异常: " + e.getMessage());
|
||||
logger.info(JobName + " 获取异常: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
logger.writeLog("--------------------" + JobName + " End---------------------------");
|
||||
logger.info("--------------------" + JobName + " End---------------------------");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -116,6 +137,8 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
|
|||
dir.mkdirs();
|
||||
}
|
||||
|
||||
String tempAmountTo = "".equals(Util.null2String(this.amountTo)) ? "100000000" : Util.null2String(this.amountTo);
|
||||
|
||||
//当日账号余额
|
||||
Map<String, String> xmlParams = new HashMap<>();
|
||||
xmlParams.put("termid", "E192168000104");
|
||||
|
@ -124,29 +147,29 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
|
|||
xmlParams.put("custid", "387679060");
|
||||
xmlParams.put("trncod", "b2e0035");
|
||||
xmlParams.put("token", "");
|
||||
|
||||
xmlParams.put("type", "2002");
|
||||
String tempType = "".equals(Util.null2String(this.queryType)) ? "2002" : this.queryType;
|
||||
xmlParams.put("type", tempType);
|
||||
xmlParams.put("ibknum", ibknum);
|
||||
xmlParams.put("actacn", actacn);
|
||||
//xmlParams.put("from", "20220919");
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.add(Calendar.DAY_OF_MONTH, -1);
|
||||
String to = !"".equals(Util.null2String(this.fromDate)) ? this.fromDate : ZennerUtil.parseToDateString(cal.getTime(), ZennerUtil.formatYYYYMMDD_NoSplit);
|
||||
String to = !"".equals(Util.null2String(this.toDate)) ? this.toDate : ZennerUtil.parseToDateString(cal.getTime(), ZennerUtil.formatYYYYMMDD_NoSplit);
|
||||
cal.add(Calendar.DAY_OF_MONTH,-1);
|
||||
String from = !"".equals(Util.null2String(this.toDate))
|
||||
? this.toDate
|
||||
String from = !"".equals(Util.null2String(this.fromDate))
|
||||
? this.fromDate
|
||||
: ZennerUtil.parseToDateString(cal.getTime(), ZennerUtil.formatYYYYMMDD_NoSplit);
|
||||
//String to = !"".equals(Util.null2String(this.toDate)) ? this.toDate : ZennerUtil.parseToDateString(new Date(), ZennerUtil.formatYYYYMMDD_NoSplit);
|
||||
xmlParams.put("from", from);
|
||||
xmlParams.put("to", to);
|
||||
xmlParams.put("amountFrom", "1");
|
||||
xmlParams.put("amountTo", "100000");
|
||||
xmlParams.put("amountFrom", "0.01");
|
||||
xmlParams.put("amountTo", tempAmountTo);
|
||||
xmlParams.put("begnum", start + "");
|
||||
xmlParams.put("recnum", end + "");
|
||||
xmlParams.put("direction", "0");
|
||||
|
||||
String xmlFileUrl = dirPath + "b2e0035_" + ZennerUtil.parseToDateString(Calendar.getInstance().getTime(), ZennerUtil.formatYYYYMMDD)+ ".xml";
|
||||
logger.writeLog(JobName + " xmlFileUrl : " + xmlFileUrl);
|
||||
logger.info(JobName + " xmlFileUrl : " + xmlFileUrl);
|
||||
Bank_b2e0035_Service bankB2e0035Service = new Bank_b2e0035_Service();
|
||||
bankB2e0035Service.createXml(xmlFileUrl, xmlParams);
|
||||
|
||||
|
@ -157,19 +180,19 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
|
|||
int logPageNum = pLen / ps;
|
||||
int i = 0;
|
||||
if (pLen <= ps){
|
||||
logger.writeLog(JobName + "........,,,voucherParams last: " + apiParams);
|
||||
logger.info(JobName + "........,,,voucherParams last: " + apiParams);
|
||||
} else {
|
||||
for (i = 0; i < logPageNum; i++){
|
||||
logger.writeLog(JobName + "........,,,,,,voucherParams " + i + " : " + apiParams.substring(i * ps, (i + 1) * 500));
|
||||
logger.info(JobName + "........,,,,,,voucherParams " + i + " : " + apiParams.substring(i * ps, (i + 1) * 500));
|
||||
}
|
||||
logger.writeLog(JobName + "........,,,voucherParams last: " + apiParams.substring((i-1) * 500));
|
||||
logger.info(JobName + "........,,,voucherParams last: " + apiParams.substring((i-1) * 500));
|
||||
}
|
||||
|
||||
logger.writeLog(JobName + " bankApiUrl : " + bankApiUrl);
|
||||
logger.info(JobName + " bankApiUrl : " + bankApiUrl);
|
||||
|
||||
String result = ZennerUtil.httpPostToken(bankApiUrl, new HashMap<>(), apiParams);
|
||||
|
||||
logger.writeLog(JobName + " syncBank_b2e0035 result : " + result);
|
||||
logger.info(JobName + " syncBank_b2e0035 result : " + result);
|
||||
|
||||
Document doc = DocumentHelper.parseText(result); // 将xml转为dom对象
|
||||
Element root = doc.getRootElement(); // 获取根节点
|
||||
|
@ -179,7 +202,7 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
|
|||
for (Object l2 : elements) { //遍历子元素
|
||||
|
||||
Element l2Element = (Element) l2;
|
||||
logger.writeLog(JobName + "l2Element name :" + l2Element.getName());
|
||||
logger.info(JobName + "l2Element name :" + l2Element.getName());
|
||||
List<Element> elementsL3 = l2Element.elements();
|
||||
|
||||
for (Object l3 : elementsL3) { //遍历子元素
|
||||
|
@ -190,7 +213,7 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
|
|||
for (Object l4 : elementsL4) { //遍历子元素
|
||||
|
||||
Element dataElement = (Element) l4;
|
||||
logger.writeLog(JobName + "l4Element name :" + dataElement.getName());
|
||||
logger.info(JobName + "l4Element name :" + dataElement.getName());
|
||||
|
||||
if ("status".equals(dataElement.getName())){
|
||||
List<Element> elementsL5 = dataElement.elements();
|
||||
|
@ -198,7 +221,7 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
|
|||
for (Object l5 : elementsL5) { //遍历子元素
|
||||
Element l5Element = (Element) l5;
|
||||
if ("rspcod".equals(l5Element.getName())) {
|
||||
logger.writeLog("rspcod:" + l5Element.getStringValue());
|
||||
logger.info("rspcod:" + l5Element.getStringValue());
|
||||
if (l5Element.getStringValue().equals("B001") || l5Element.getStringValue().equals("B002")){
|
||||
statusOk = true;
|
||||
} else {
|
||||
|
@ -206,16 +229,16 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
|
|||
}
|
||||
}
|
||||
if ("rspmsg".equals(l5Element.getName())) {
|
||||
logger.writeLog(JobName + "rspmsg:" + l5Element.getStringValue());
|
||||
logger.info(JobName + "rspmsg:" + l5Element.getStringValue());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("totalnum".equals(dataElement.getName())){
|
||||
logger.writeLog("totalnum:" + dataElement.getStringValue());
|
||||
logger.info("totalnum:" + dataElement.getStringValue());
|
||||
}
|
||||
if ("notenum".equals(dataElement.getName())){
|
||||
logger.writeLog("notenum:" + dataElement.getStringValue());
|
||||
logger.info("notenum:" + dataElement.getStringValue());
|
||||
String notenumStr = Util.null2String(dataElement.getStringValue());
|
||||
if ("".equals(notenum)){
|
||||
notenumStr = "0";
|
||||
|
@ -223,9 +246,9 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
|
|||
notenum = Integer.parseInt(notenumStr);
|
||||
}
|
||||
|
||||
logger.writeLog("statusOk:" + statusOk);
|
||||
logger.info("statusOk:" + statusOk);
|
||||
if (statusOk){
|
||||
logger.writeLog(JobName + "dataElement.getName():" + dataElement.getName());
|
||||
logger.info(JobName + "dataElement.getName():" + dataElement.getName());
|
||||
if ("b2e0035-rs".equals(dataElement.getName())){
|
||||
|
||||
TradeInfo tradeInfo = new TradeInfo();
|
||||
|
@ -263,23 +286,23 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
|
|||
for (Object l5 : elementsL5) { //遍历子元素
|
||||
Element l5Element = (Element) l5;
|
||||
if ("toibkn".equals(l5Element.getName())) {
|
||||
logger.writeLog(JobName + "toibkn:" + l5Element.getStringValue());
|
||||
logger.info(JobName + "toibkn:" + l5Element.getStringValue());
|
||||
tradeInfo.setToibkn(l5Element.getStringValue());
|
||||
}
|
||||
if ("actacn".equals(l5Element.getName())) {
|
||||
logger.writeLog(JobName + "actacn:" + l5Element.getStringValue());
|
||||
logger.info(JobName + "actacn:" + l5Element.getStringValue());
|
||||
tradeInfo.setActacn_receipt(l5Element.getStringValue());
|
||||
}
|
||||
if ("toname".equals(l5Element.getName())) {
|
||||
logger.writeLog(JobName + "toname:" + l5Element.getStringValue());
|
||||
logger.info(JobName + "toname:" + l5Element.getStringValue());
|
||||
tradeInfo.setToname(l5Element.getStringValue());
|
||||
}
|
||||
if ("tobank".equals(l5Element.getName())) {
|
||||
logger.writeLog(JobName + "tobank:" + l5Element.getStringValue());
|
||||
logger.info(JobName + "tobank:" + l5Element.getStringValue());
|
||||
tradeInfo.setTobank(l5Element.getStringValue());
|
||||
}
|
||||
if ("tobref".equals(l5Element.getName())) {
|
||||
logger.writeLog(JobName + "tobref:" + l5Element.getStringValue());
|
||||
logger.info(JobName + "tobref:" + l5Element.getStringValue());
|
||||
tradeInfo.setTobref(l5Element.getStringValue());
|
||||
}
|
||||
}
|
||||
|
@ -351,6 +374,14 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
|
|||
tradeInfo.setInsid(l4Element.getStringValue());
|
||||
}
|
||||
}
|
||||
if ("vchnum".equals(l4Element.getName())) {
|
||||
if (!"".equals(l4Element.getStringValue())){
|
||||
tradeInfo.setVchnum(l4Element.getStringValue());
|
||||
}
|
||||
}
|
||||
if ("transid".equals(l4Element.getName()) && !"".equals(l4Element.getStringValue())) {
|
||||
tradeInfo.setTransid(l4Element.getStringValue());
|
||||
}
|
||||
}
|
||||
|
||||
tradeInfoList.add(tradeInfo);
|
||||
|
@ -360,11 +391,12 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
|
|||
}
|
||||
}
|
||||
|
||||
logger.writeLog(JobName + " result tradeInfoList size: " + tradeInfoList.size());
|
||||
logger.info(JobName + " result tradeInfoList size: " + tradeInfoList.size());
|
||||
for (TradeInfo tradeInfo : tradeInfoList){
|
||||
if (!"".equals(tradeInfo.getIbknum())){
|
||||
tradeInfo.save(tradeInfo, Util.getIntValue(this.modelId), "uf_bank_trade_info");
|
||||
}
|
||||
//if (!"".equals(tradeInfo.getIbknum())){
|
||||
// tradeInfo.save(tradeInfo, Util.getIntValue(this.modelId), "uf_bank_trade_info");
|
||||
//}
|
||||
}
|
||||
|
||||
return notenum;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.api.nonstandardext.zenner.model.bank;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.setup.ModeRightInfo;
|
||||
import weaver.general.BaseBean;
|
||||
|
@ -13,6 +14,7 @@ import java.util.Date;
|
|||
*/
|
||||
public class TradeInfo extends BaseBean {
|
||||
|
||||
private final Logger logger = aiyh.utils.Util.getLogger("json_util");
|
||||
private Integer formmodeid;
|
||||
private String modedatacreater;
|
||||
private String modedatacreatertype;
|
||||
|
@ -130,13 +132,15 @@ public class TradeInfo extends BaseBean {
|
|||
ufModel.setModedatacreatedate(currentDateTime.substring(0, 10));
|
||||
ufModel.setModedatacreatetime(currentDateTime.substring(11));
|
||||
|
||||
String existSql = "select id from " + tableName + " where ibknum='" + ufModel.getIbknum() + "' and actacn='" + ufModel.getActacn() + "' and outref='" + ufModel.getOutref() + "'";
|
||||
//String existSql = "select id from " + tableName + " where ibknum='" + ufModel.getIbknum() + "' and actacn='" + ufModel.getActacn() + "' and outref='" + ufModel.getOutref() + "'";
|
||||
String existSql = "select id from " + tableName + " where vchnum='" + ufModel.getVchnum() + "'";
|
||||
logger.info("exist sql ==>"+existSql);
|
||||
rs.execute(existSql);
|
||||
if (rs.next()) {
|
||||
billId = rs.getInt("id");
|
||||
String msg = update(modelName, tableName, ufModel);
|
||||
if (!"".equals(msg)){
|
||||
this.writeLog(modelName + ", 保存异常: " + msg);
|
||||
logger.info(modelName + ", 保存异常: " + msg);
|
||||
}
|
||||
return billId;
|
||||
}
|
||||
|
@ -178,15 +182,16 @@ public class TradeInfo extends BaseBean {
|
|||
return -1;
|
||||
}
|
||||
RecordSet rightRs = new RecordSet();
|
||||
writeLog(modelName + ", insertSql ->" + insertSql + ", result:" + result + ", formmodeid: " + formmodeid);
|
||||
rightRs.execute("SELECT id FROM " + tableName + " where ibknum='" + ufModel.getIbknum() + "' and actacn='" + ufModel.getActacn() + "' and outref='" + ufModel.getOutref() + "'");
|
||||
logger.info(modelName + ", insertSql ->" + insertSql + ", result:" + result + ", formmodeid: " + formmodeid);
|
||||
//rightRs.execute("SELECT id FROM " + tableName + " where ibknum='" + ufModel.getIbknum() + "' and actacn='" + ufModel.getActacn() + "' and outref='" + ufModel.getOutref() + "'");
|
||||
rightRs.execute(existSql);
|
||||
if (rightRs.next()) {
|
||||
billId = rightRs.getInt("id");
|
||||
this.setModeRight(1, formmodeid, billId);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
writeLog(modelName + ", 新增报错 ->" + e.getMessage());
|
||||
logger.info(modelName + ", 新增报错 ->" + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
|
@ -194,7 +199,7 @@ public class TradeInfo extends BaseBean {
|
|||
}
|
||||
|
||||
public String update(String modelName, String tableName, TradeInfo ufModel) throws Exception{
|
||||
writeLog(modelName + ", update -> formmodeid: " + formmodeid);
|
||||
logger.info(modelName + ", update -> formmodeid: " + formmodeid);
|
||||
RecordSet rs = new RecordSet();
|
||||
String setSql = "";
|
||||
boolean result = false;
|
||||
|
@ -233,15 +238,16 @@ public class TradeInfo extends BaseBean {
|
|||
}
|
||||
if(!"".equals(setSql)) {
|
||||
setSql = setSql.substring(1);
|
||||
String updateSql = "update " + tableName + " set " + setSql + " where ibknum='" + ufModel.getIbknum() + "' and actacn='" + ufModel.getActacn() + "' and outref='" + ufModel.getOutref() + "'";
|
||||
writeLog(modelName + ", updateSql ->" + updateSql);
|
||||
//String updateSql = "update " + tableName + " set " + setSql + " where ibknum='" + ufModel.getIbknum() + "' and actacn='" + ufModel.getActacn() + "' and outref='" + ufModel.getOutref() + "'";
|
||||
String updateSql = "update " + tableName + " set " + setSql + "where vchnum = '" + ufModel.getVchnum() + "'";
|
||||
logger.info(modelName + ", updateSql ->" + updateSql);
|
||||
result = rs.execute(updateSql);
|
||||
if (!result){
|
||||
return "修改失败";
|
||||
}
|
||||
}
|
||||
} catch (Exception e){
|
||||
writeLog(modelName + ", 修改报错 ->" + e.getMessage());
|
||||
logger.info(modelName + ", 修改报错 ->" + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return e.getMessage();
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class SAPWebserviceTool extends BaseBean {
|
|||
|
||||
public String callParams_011(String comCode, String period, String year, String glAccount){
|
||||
|
||||
String params = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:sap-getLogFilePath:document:sap:soap:functions:mc-style\">\n" +
|
||||
String params = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:sap-com:document:sap:soap:functions:mc-style\">\n" +
|
||||
" <soapenv:Header/>\n" +
|
||||
" <soapenv:Body>\n" +
|
||||
" <urn:ZoaGlGetglaccperiodbalances>\n" +
|
||||
|
|
Loading…
Reference in New Issue