Compare commits

..

No commits in common. "d05e2dfd08d7529ab28be5eec9a04c0c916b16e8" and "341fa9e043b40107743fabb6b194e9a9d083176d" have entirely different histories.

8 changed files with 92 additions and 133 deletions

View File

@ -3,7 +3,6 @@ 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;
@ -24,9 +23,8 @@ import java.util.Calendar;
*/
public class SyncAccountInfoFromSapJob extends BaseCronJob {
//BaseBean logger = new BaseBean();
private final Logger logger = aiyh.utils.Util.getLogger("json_util");
BaseBean logger = new BaseBean();
private final static String JobName = " SyncAccountInfoFromSapJob ";
/** 模块id */
@ -73,11 +71,11 @@ public class SyncAccountInfoFromSapJob extends BaseCronJob {
}
public void execute() {
logger.info("-----" + JobName + " Begin------");
logger.writeLog("-----" + JobName + " Begin------");
RecordSet rs = new RecordSet();
try {
logger.info("-----" + JobName + " getInterfaceName------" + getInterfaceName());
logger.writeLog("-----" + JobName + " getInterfaceName------" + getInterfaceName());
// if (getInterfaceName().indexOf("syncGlaccPeriodBalancesFromSap") >= 0){
@ -101,10 +99,10 @@ public class SyncAccountInfoFromSapJob extends BaseCronJob {
// }
} catch (Exception e) {
logger.info(JobName + " 获取异常: " + e.getMessage());
logger.writeLog(JobName + " 获取异常: " + e.getMessage());
e.printStackTrace();
}
logger.info("--------------------" + JobName + " End---------------------------");
logger.writeLog("--------------------" + JobName + " End---------------------------");
}
public void syncGlaccPeriodBalancesFromSap(String comCode, String period, String year, String glAccount, SAPWebserviceTool tool) throws Exception {
@ -113,7 +111,7 @@ public class SyncAccountInfoFromSapJob extends BaseCronJob {
JSONObject result = tool.callInterface_011(params);
logger.info(JobName + " syncGlaccPeriodBalancesFromSap result : " + result);
logger.writeLog(JobName + " syncGlaccPeriodBalancesFromSap result : " + result);
JSONObject balanceResponse = result.getJSONObject("balanceResponse");
PeriodBalance periodBalance = new PeriodBalance();
@ -147,7 +145,7 @@ public class SyncAccountInfoFromSapJob extends BaseCronJob {
// keyParams.put("IvFiscYear", 2022);
// keyParams.put("IvGlAccount", 12345);
// String str = keyParams.toString();
// logger.info(JobName + " syncSapData Service Call str : " + str);
// logger.writeLog(JobName + " syncSapData Service Call str : " + str);
// Object resultObject = call.invoke(new Object[] { 6000, 8, 2022, 12345 });//调用接口
// result = (String) resultObject;
}

View File

@ -4,7 +4,6 @@ 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;
@ -29,8 +28,8 @@ import java.util.*;
*/
public class SyncAccountStatementJob extends BaseCronJob {
//BaseBean logger = new BaseBean();
private final Logger logger = aiyh.utils.Util.getLogger("json_util");
BaseBean logger = new BaseBean();
private String interfaceName;
/** 模块id */
@ -55,12 +54,12 @@ public class SyncAccountStatementJob extends BaseCronJob {
}
public void execute() {
logger.info("-----" + JobName + " Begin------");
logger.writeLog("-----" + JobName + " Begin------");
RecordSet rs = new RecordSet();
ZennerApiService zennerApiService = new ZennerApiService();
try {
logger.info("-----" + JobName + " getInterfaceName------" + getInterfaceName());
logger.writeLog("-----" + JobName + " getInterfaceName------" + getInterfaceName());
//银行
String bankApiUrl = zennerApiService.getSystemConfigValue("BANK_API_URL");
@ -70,10 +69,10 @@ public class SyncAccountStatementJob extends BaseCronJob {
syncBank_b2e0005(bankApiUrl, Util.null2String(rs.getString("lxh")), Util.null2String(rs.getString("yxzh")));
}
} catch (Exception e) {
logger.info(JobName + " 获取异常: " + e.getMessage());
logger.writeLog(JobName + " 获取异常: " + e.getMessage());
e.printStackTrace();
}
logger.info("--------------------" + JobName + " End---------------------------");
logger.writeLog("--------------------" + JobName + " End---------------------------");
}
/**
@ -88,7 +87,7 @@ public class SyncAccountStatementJob extends BaseCronJob {
if (!dir.exists()) {
dir.mkdirs();
}
logger.info(JobName + "..syncBank_b2e0005......bankApiUrl: " + bankApiUrl);
logger.writeLog(JobName + "..syncBank_b2e0005......bankApiUrl: " + bankApiUrl);
//当日账号余额
Map<String, String> xmlParams = new HashMap<>();
@ -102,7 +101,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.info(JobName + ".syncBank_b2e0005.......xmlFileUrl: " + xmlFileUrl);
logger.writeLog(JobName + ".syncBank_b2e0005.......xmlFileUrl: " + xmlFileUrl);
Bank_b2e0005_Service bankB2e0005Service = new Bank_b2e0005_Service();
bankB2e0005Service.createXml(xmlFileUrl, xmlParams);
@ -113,18 +112,18 @@ public class SyncAccountStatementJob extends BaseCronJob {
int logPageNum = pLen / ps;
int i = 0;
if (pLen <= ps){
logger.info(JobName + ".syncBank_b2e0005.......voucherParams last: " + apiParams);
logger.writeLog(JobName + ".syncBank_b2e0005.......voucherParams last: " + apiParams);
} else {
for (i = 0; i < logPageNum; i++){
logger.info(JobName + ".syncBank_b2e0005.......voucherParams " + i + " : " + apiParams.substring(i * ps, (i + 1) * 500));
logger.writeLog(JobName + ".syncBank_b2e0005.......voucherParams " + i + " : " + apiParams.substring(i * ps, (i + 1) * 500));
}
logger.info(JobName + ".syncBank_b2e0005.......voucherParams last: " + apiParams.substring((i-1) * 500));
logger.writeLog(JobName + ".syncBank_b2e0005.......voucherParams last: " + apiParams.substring((i-1) * 500));
}
logger.info(JobName + " bankApiUrl : " + bankApiUrl);
logger.writeLog(JobName + " bankApiUrl : " + bankApiUrl);
String result = ZennerUtil.httpPostToken(bankApiUrl, new HashMap<>(), apiParams);
logger.info(JobName + " syncBank_b2e0005 result : " + result);
logger.writeLog(JobName + " syncBank_b2e0005 result : " + result);
Document doc = DocumentHelper.parseText(result); // 将xml转为dom对象
Element root = doc.getRootElement(); // 获取根节点
@ -134,7 +133,7 @@ public class SyncAccountStatementJob extends BaseCronJob {
for (Object l2 : elements) { //遍历子元素
Element l2Element = (Element) l2;
logger.info("l2Element name :" + l2Element.getName());
logger.writeLog("l2Element name :" + l2Element.getName());
List<Element> elementsL3 = l2Element.elements();
for (Object l3 : elementsL3) { //遍历子元素
@ -145,7 +144,7 @@ public class SyncAccountStatementJob extends BaseCronJob {
for (Object l4 : elementsL4) { //遍历子元素
Element dataElement = (Element) l4;
logger.info("l4Element name :" + dataElement.getName());
logger.writeLog("l4Element name :" + dataElement.getName());
if ("status".equals(dataElement.getName())){
List<Element> elementsL5 = dataElement.elements();
@ -153,7 +152,7 @@ public class SyncAccountStatementJob extends BaseCronJob {
for (Object l5 : elementsL5) { //遍历子元素
Element l5Element = (Element) l5;
if ("rspcod".equals(l5Element.getName())) {
logger.info("rspcod:" + l5Element.getStringValue());
logger.writeLog("rspcod:" + l5Element.getStringValue());
if (l5Element.getStringValue().equals("B001")){
statusOk = true;
} else {
@ -161,14 +160,14 @@ public class SyncAccountStatementJob extends BaseCronJob {
}
}
if ("rspmsg".equals(l5Element.getName())) {
logger.info("rspmsg:" + l5Element.getStringValue());
logger.writeLog("rspmsg:" + l5Element.getStringValue());
}
}
}
logger.info("statusOk:" + statusOk);
logger.writeLog("statusOk:" + statusOk);
if (statusOk){
logger.info("dataElement.getName():" + dataElement.getName());
logger.writeLog("dataElement.getName():" + dataElement.getName());
if ("b2e0005-rs".equals(dataElement.getName())){
List<Element> elementsData = dataElement.elements();
@ -180,19 +179,19 @@ public class SyncAccountStatementJob extends BaseCronJob {
for (Object l5 : elementsL5) { //遍历子元素
Element l5Element = (Element) l5;
if ("ibknum".equals(l5Element.getName())) {
logger.info("ibknum:" + l5Element.getStringValue());
logger.writeLog("ibknum:" + l5Element.getStringValue());
dayBalance.setIbknum(l5Element.getStringValue());
}
if ("actacn".equals(l5Element.getName())) {
logger.info("actacn:" + l5Element.getStringValue());
logger.writeLog("actacn:" + l5Element.getStringValue());
dayBalance.setActacn(l5Element.getStringValue());
}
if ("curcde".equals(l5Element.getName())) {
logger.info("curcde:" + l5Element.getStringValue());
logger.writeLog("curcde:" + l5Element.getStringValue());
dayBalance.setCurcde(l5Element.getStringValue());
}
if ("actname".equals(l5Element.getName())) {
logger.info("actname:" + l5Element.getStringValue());
logger.writeLog("actname:" + l5Element.getStringValue());
dayBalance.setActname(l5Element.getStringValue());
}
}
@ -204,15 +203,15 @@ public class SyncAccountStatementJob extends BaseCronJob {
for (Object l5 : elementsL5) { //遍历子元素
Element l5Element = (Element) l5;
if ("bokbal".equals(l5Element.getName())) {
logger.info("bokbal:" + l5Element.getStringValue());
logger.writeLog("bokbal:" + l5Element.getStringValue());
dayBalance.setBokbal(l5Element.getStringValue());
}
if ("avabal".equals(l5Element.getName())) {
logger.info("avabal:" + l5Element.getStringValue());
logger.writeLog("avabal:" + l5Element.getStringValue());
dayBalance.setAvabal(l5Element.getStringValue());
}
if ("currentavabal".equals(l5Element.getName())) {
logger.info("currentavabal:" + l5Element.getStringValue());
logger.writeLog("currentavabal:" + l5Element.getStringValue());
if ("".equals(l5Element.getStringValue())){
dayBalance.setCurrentavabal("0");
} else {
@ -221,7 +220,7 @@ public class SyncAccountStatementJob extends BaseCronJob {
}
if ("stpamt".equals(l5Element.getName())) {
logger.info("stpamt:" + l5Element.getStringValue());
logger.writeLog("stpamt:" + l5Element.getStringValue());
if ("".equals(l5Element.getStringValue())){
dayBalance.setStpamt("0");
} else {
@ -229,30 +228,30 @@ public class SyncAccountStatementJob extends BaseCronJob {
}
}
if ("ovramt".equals(l5Element.getName())) {
logger.info("ovramt:" + l5Element.getStringValue());
logger.writeLog("ovramt:" + l5Element.getStringValue());
dayBalance.setOvramt("".equals(l5Element.getStringValue()) ? "0" : l5Element.getStringValue());
}
if ("frzamt".equals(l5Element.getName())) {
logger.info("frzamt:" + l5Element.getStringValue());
logger.writeLog("frzamt:" + l5Element.getStringValue());
dayBalance.setFrzamt("".equals(l5Element.getStringValue()) ? "0" : l5Element.getStringValue());
}
if ("effauthamt".equals(l5Element.getName())) {
logger.info("effauthamt:" + l5Element.getStringValue());
logger.writeLog("effauthamt:" + l5Element.getStringValue());
dayBalance.setEffauthamt("".equals(l5Element.getStringValue()) ? "0" : l5Element.getStringValue());
}
if ("effusdoverbal".equals(l5Element.getName())) {
logger.info("effusdoverbal:" + l5Element.getStringValue());
logger.writeLog("effusdoverbal:" + l5Element.getStringValue());
dayBalance.setEffusdoverbal("".equals(l5Element.getStringValue()) ? "0" : l5Element.getStringValue());
}
if ("effuseablequota".equals(l5Element.getName())) {
logger.info("effuseablequota:" + l5Element.getStringValue());
logger.writeLog("effuseablequota:" + l5Element.getStringValue());
dayBalance.setEffuseablequota("".equals(l5Element.getStringValue()) ? "0" : l5Element.getStringValue());
}
}
}
if ("baldat".equals(l4Element.getName())) {
logger.info("baldat:" + l4Element.getStringValue());
logger.writeLog("baldat:" + l4Element.getStringValue());
if (!"".equals(l4Element.getStringValue())){
Date date = ZennerUtil.parseToDate(l4Element.getStringValue(), ZennerUtil.formatYYYYMMDD_NoSplit);
@ -266,6 +265,6 @@ public class SyncAccountStatementJob extends BaseCronJob {
}
}
dayBalance.save(dayBalance, Util.getIntValue(this.modelId), "uf_bank_day_balance");
logger.info(JobName + " result dayBalance: " + dayBalance.toString());
logger.writeLog(JobName + " result dayBalance: " + dayBalance.toString());
}
}

View File

@ -4,7 +4,6 @@ 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;
@ -30,33 +29,21 @@ import java.util.*;
*/
public class SyncAccountTradeInfoJob extends BaseCronJob {
//BaseBean logger = new BaseBean();
private final Logger logger = aiyh.utils.Util.getLogger("json_util");
BaseBean logger = new BaseBean();
/** 模块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;
}
@ -65,14 +52,6 @@ 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;
}
@ -90,13 +69,13 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
}
public void execute() {
logger.info("-----" + JobName + " Begin------");
logger.writeLog("-----" + JobName + " Begin------");
RecordSet rs = new RecordSet();
ZennerApiService zennerApiService = new ZennerApiService();
try {
logger.info("-----" + JobName + " getInterfaceName------" + getInterfaceName());
logger.info(String.format("params --- fromDate:%s toDate:%s",fromDate,toDate));
logger.writeLog("-----" + JobName + " getInterfaceName------" + getInterfaceName());
logger.writeLog(String.format("params --- fromDate:%s toDate:%s",fromDate,toDate));
//银行
String bankApiUrl = zennerApiService.getSystemConfigValue("BANK_API_URL");
@ -106,21 +85,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.info(JobName + " totalPage:" + totalPage);
logger.writeLog(JobName + " totalPage:" + totalPage);
for (int pageNo = 2; pageNo <= totalPage; pageNo++) {
int startNo = (pageNo - 1) * pageSize;
int endNo = pageNo * pageSize;
logger.info(JobName + " startNo:" + startNo + " endNo:" + endNo);
logger.writeLog(JobName + " startNo:" + startNo + " endNo:" + endNo);
int pageTotal = syncBank_b2e0035(bankApiUrl, Util.null2String(rs.getString("lxh")), Util.null2String(rs.getString("yxzh")), startNo, pageSize);
logger.info(JobName + " total:" + pageTotal);
logger.writeLog(JobName + " total:" + pageTotal);
}
}
} catch (Exception e) {
logger.info(JobName + " 获取异常: " + e.getMessage());
logger.writeLog(JobName + " 获取异常: " + e.getMessage());
e.printStackTrace();
}
logger.info("--------------------" + JobName + " End---------------------------");
logger.writeLog("--------------------" + JobName + " End---------------------------");
}
/**
@ -137,8 +116,6 @@ 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");
@ -147,29 +124,29 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
xmlParams.put("custid", "387679060");
xmlParams.put("trncod", "b2e0035");
xmlParams.put("token", "");
String tempType = "".equals(Util.null2String(this.queryType)) ? "2002" : this.queryType;
xmlParams.put("type", tempType);
xmlParams.put("type", "2002");
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.toDate)) ? this.toDate : ZennerUtil.parseToDateString(cal.getTime(), ZennerUtil.formatYYYYMMDD_NoSplit);
String to = !"".equals(Util.null2String(this.fromDate)) ? this.fromDate : ZennerUtil.parseToDateString(cal.getTime(), ZennerUtil.formatYYYYMMDD_NoSplit);
cal.add(Calendar.DAY_OF_MONTH,-1);
String from = !"".equals(Util.null2String(this.fromDate))
? this.fromDate
String from = !"".equals(Util.null2String(this.toDate))
? this.toDate
: 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", "0.01");
xmlParams.put("amountTo", tempAmountTo);
xmlParams.put("amountFrom", "1");
xmlParams.put("amountTo", "100000");
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.info(JobName + " xmlFileUrl : " + xmlFileUrl);
logger.writeLog(JobName + " xmlFileUrl : " + xmlFileUrl);
Bank_b2e0035_Service bankB2e0035Service = new Bank_b2e0035_Service();
bankB2e0035Service.createXml(xmlFileUrl, xmlParams);
@ -180,19 +157,19 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
int logPageNum = pLen / ps;
int i = 0;
if (pLen <= ps){
logger.info(JobName + "........voucherParams last: " + apiParams);
logger.writeLog(JobName + "........voucherParams last: " + apiParams);
} else {
for (i = 0; i < logPageNum; i++){
logger.info(JobName + "........voucherParams " + i + " : " + apiParams.substring(i * ps, (i + 1) * 500));
logger.writeLog(JobName + "........voucherParams " + i + " : " + apiParams.substring(i * ps, (i + 1) * 500));
}
logger.info(JobName + "........voucherParams last: " + apiParams.substring((i-1) * 500));
logger.writeLog(JobName + "........voucherParams last: " + apiParams.substring((i-1) * 500));
}
logger.info(JobName + " bankApiUrl : " + bankApiUrl);
logger.writeLog(JobName + " bankApiUrl : " + bankApiUrl);
String result = ZennerUtil.httpPostToken(bankApiUrl, new HashMap<>(), apiParams);
logger.info(JobName + " syncBank_b2e0035 result : " + result);
logger.writeLog(JobName + " syncBank_b2e0035 result : " + result);
Document doc = DocumentHelper.parseText(result); // 将xml转为dom对象
Element root = doc.getRootElement(); // 获取根节点
@ -202,7 +179,7 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
for (Object l2 : elements) { //遍历子元素
Element l2Element = (Element) l2;
logger.info(JobName + "l2Element name :" + l2Element.getName());
logger.writeLog(JobName + "l2Element name :" + l2Element.getName());
List<Element> elementsL3 = l2Element.elements();
for (Object l3 : elementsL3) { //遍历子元素
@ -213,7 +190,7 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
for (Object l4 : elementsL4) { //遍历子元素
Element dataElement = (Element) l4;
logger.info(JobName + "l4Element name :" + dataElement.getName());
logger.writeLog(JobName + "l4Element name :" + dataElement.getName());
if ("status".equals(dataElement.getName())){
List<Element> elementsL5 = dataElement.elements();
@ -221,7 +198,7 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
for (Object l5 : elementsL5) { //遍历子元素
Element l5Element = (Element) l5;
if ("rspcod".equals(l5Element.getName())) {
logger.info("rspcod:" + l5Element.getStringValue());
logger.writeLog("rspcod:" + l5Element.getStringValue());
if (l5Element.getStringValue().equals("B001") || l5Element.getStringValue().equals("B002")){
statusOk = true;
} else {
@ -229,16 +206,16 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
}
}
if ("rspmsg".equals(l5Element.getName())) {
logger.info(JobName + "rspmsg:" + l5Element.getStringValue());
logger.writeLog(JobName + "rspmsg:" + l5Element.getStringValue());
}
}
}
if ("totalnum".equals(dataElement.getName())){
logger.info("totalnum:" + dataElement.getStringValue());
logger.writeLog("totalnum:" + dataElement.getStringValue());
}
if ("notenum".equals(dataElement.getName())){
logger.info("notenum:" + dataElement.getStringValue());
logger.writeLog("notenum:" + dataElement.getStringValue());
String notenumStr = Util.null2String(dataElement.getStringValue());
if ("".equals(notenum)){
notenumStr = "0";
@ -246,9 +223,9 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
notenum = Integer.parseInt(notenumStr);
}
logger.info("statusOk:" + statusOk);
logger.writeLog("statusOk:" + statusOk);
if (statusOk){
logger.info(JobName + "dataElement.getName():" + dataElement.getName());
logger.writeLog(JobName + "dataElement.getName():" + dataElement.getName());
if ("b2e0035-rs".equals(dataElement.getName())){
TradeInfo tradeInfo = new TradeInfo();
@ -286,23 +263,23 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
for (Object l5 : elementsL5) { //遍历子元素
Element l5Element = (Element) l5;
if ("toibkn".equals(l5Element.getName())) {
logger.info(JobName + "toibkn:" + l5Element.getStringValue());
logger.writeLog(JobName + "toibkn:" + l5Element.getStringValue());
tradeInfo.setToibkn(l5Element.getStringValue());
}
if ("actacn".equals(l5Element.getName())) {
logger.info(JobName + "actacn:" + l5Element.getStringValue());
logger.writeLog(JobName + "actacn:" + l5Element.getStringValue());
tradeInfo.setActacn_receipt(l5Element.getStringValue());
}
if ("toname".equals(l5Element.getName())) {
logger.info(JobName + "toname:" + l5Element.getStringValue());
logger.writeLog(JobName + "toname:" + l5Element.getStringValue());
tradeInfo.setToname(l5Element.getStringValue());
}
if ("tobank".equals(l5Element.getName())) {
logger.info(JobName + "tobank:" + l5Element.getStringValue());
logger.writeLog(JobName + "tobank:" + l5Element.getStringValue());
tradeInfo.setTobank(l5Element.getStringValue());
}
if ("tobref".equals(l5Element.getName())) {
logger.info(JobName + "tobref:" + l5Element.getStringValue());
logger.writeLog(JobName + "tobref:" + l5Element.getStringValue());
tradeInfo.setTobref(l5Element.getStringValue());
}
}
@ -374,14 +351,6 @@ 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);
@ -391,12 +360,11 @@ public class SyncAccountTradeInfoJob extends BaseCronJob {
}
}
logger.info(JobName + " result tradeInfoList size: " + tradeInfoList.size());
logger.writeLog(JobName + " result tradeInfoList size: " + tradeInfoList.size());
for (TradeInfo tradeInfo : tradeInfoList){
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");
//}
if (!"".equals(tradeInfo.getIbknum())){
tradeInfo.save(tradeInfo, Util.getIntValue(this.modelId), "uf_bank_trade_info");
}
}
return notenum;

View File

@ -1,6 +1,5 @@
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;
@ -14,7 +13,6 @@ 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;
@ -132,15 +130,13 @@ 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 vchnum='" + ufModel.getVchnum() + "'";
logger.info("exist sql ==>"+existSql);
String existSql = "select id from " + tableName + " where ibknum='" + ufModel.getIbknum() + "' and actacn='" + ufModel.getActacn() + "' and outref='" + ufModel.getOutref() + "'";
rs.execute(existSql);
if (rs.next()) {
billId = rs.getInt("id");
String msg = update(modelName, tableName, ufModel);
if (!"".equals(msg)){
logger.info(modelName + " 保存异常: " + msg);
this.writeLog(modelName + " 保存异常: " + msg);
}
return billId;
}
@ -182,16 +178,15 @@ public class TradeInfo extends BaseBean {
return -1;
}
RecordSet rightRs = new RecordSet();
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);
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() + "'");
if (rightRs.next()) {
billId = rightRs.getInt("id");
this.setModeRight(1, formmodeid, billId);
}
}
} catch (Exception e) {
logger.info(modelName + ", 新增报错 ->" + e.getMessage());
writeLog(modelName + ", 新增报错 ->" + e.getMessage());
e.printStackTrace();
return -1;
}
@ -199,7 +194,7 @@ public class TradeInfo extends BaseBean {
}
public String update(String modelName, String tableName, TradeInfo ufModel) throws Exception{
logger.info(modelName + ", update -> formmodeid: " + formmodeid);
writeLog(modelName + ", update -> formmodeid: " + formmodeid);
RecordSet rs = new RecordSet();
String setSql = "";
boolean result = false;
@ -238,16 +233,15 @@ 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() + "'";
String updateSql = "update " + tableName + " set " + setSql + "where vchnum = '" + ufModel.getVchnum() + "'";
logger.info(modelName + ", updateSql ->" + updateSql);
String updateSql = "update " + tableName + " set " + setSql + " where ibknum='" + ufModel.getIbknum() + "' and actacn='" + ufModel.getActacn() + "' and outref='" + ufModel.getOutref() + "'";
writeLog(modelName + ", updateSql ->" + updateSql);
result = rs.execute(updateSql);
if (!result){
return "修改失败";
}
}
} catch (Exception e){
logger.info(modelName + ", 修改报错 ->" + e.getMessage());
writeLog(modelName + ", 修改报错 ->" + e.getMessage());
e.printStackTrace();
return e.getMessage();
}

View File

@ -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-com:document:sap:soap:functions:mc-style\">\n" +
String params = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:sap-getLogFilePath:document:sap:soap:functions:mc-style\">\n" +
" <soapenv:Header/>\n" +
" <soapenv:Body>\n" +
" <urn:ZoaGlGetglaccperiodbalances>\n" +