From 098c568713a52620feb21c5f498663591feef104 Mon Sep 17 00:00:00 2001 From: ic_excellent <2570192571@qq.com> Date: Thu, 20 Jul 2023 15:52:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E6=B5=B7=E5=A4=A7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xiao/sh_bigdata/service/ReportService.java | 2 +- .../zenner/job/SyncAccountInfoFromSapJob.java | 5 ++++- .../zenner/job/SyncAccountStatementJob.java | 13 ++++++++++++- .../zenner/job/SyncAccountTradeInfoJob.java | 17 +++++++++++++---- src/test/java/bokang/xiao/NormalTest.java | 17 +++++++++++++++++ 5 files changed, 47 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/api/bokang/xiao/sh_bigdata/service/ReportService.java b/src/main/java/com/api/bokang/xiao/sh_bigdata/service/ReportService.java index ceffa97..0c1940a 100644 --- a/src/main/java/com/api/bokang/xiao/sh_bigdata/service/ReportService.java +++ b/src/main/java/com/api/bokang/xiao/sh_bigdata/service/ReportService.java @@ -44,7 +44,7 @@ public class ReportService { String endDate = Util.null2String(param.get("endDate")); //航班车次 String flightAndTrain = Util.null2String(param.get("flightAndTrain")); - String whereSql = ""; + String whereSql = " and (frhsz = 0 or frhsz is null) "; if(!"".equals(beginDate) && !"".equals(endDate)){ whereSql += " and (dlsk1 between #{param.beginDate} and #{param.endDate} )"; }else { diff --git a/src/main/java/com/api/nonstandardext/zenner/job/SyncAccountInfoFromSapJob.java b/src/main/java/com/api/nonstandardext/zenner/job/SyncAccountInfoFromSapJob.java index 8cdd361..e805869 100644 --- a/src/main/java/com/api/nonstandardext/zenner/job/SyncAccountInfoFromSapJob.java +++ b/src/main/java/com/api/nonstandardext/zenner/job/SyncAccountInfoFromSapJob.java @@ -27,6 +27,9 @@ public class SyncAccountInfoFromSapJob extends BaseCronJob { private final static String JobName = " SyncAccountInfoFromSapJob "; + /** 模块id */ + private String modelId; + private String interfaceName; private String theNearPeriod; @@ -122,7 +125,7 @@ public class SyncAccountInfoFromSapJob extends BaseCronJob { periodBalance.setEvCurrency(Util.null2String(balanceResponse.getString("EvCurrency"))); periodBalance.setGlAccount(glAccount); - periodBalance.save(periodBalance, 52, "uf_period_balance"); + periodBalance.save(periodBalance, Util.getIntValue(this.modelId), "uf_period_balance"); // String result = ""; //// String url = "http://127.0.0.1/uapws/service/nc65to63projectsysplugin";//这是接口地址,注意去掉.wsdl,否则会报错 diff --git a/src/main/java/com/api/nonstandardext/zenner/job/SyncAccountStatementJob.java b/src/main/java/com/api/nonstandardext/zenner/job/SyncAccountStatementJob.java index 903db8d..7726121 100644 --- a/src/main/java/com/api/nonstandardext/zenner/job/SyncAccountStatementJob.java +++ b/src/main/java/com/api/nonstandardext/zenner/job/SyncAccountStatementJob.java @@ -32,8 +32,19 @@ public class SyncAccountStatementJob extends BaseCronJob { private String interfaceName; + /** 模块id */ + private String modelId; + private final static String JobName = " SyncAccountStatementJob "; + public String getModelId() { + return modelId; + } + + public void setModelId(String modelId) { + this.modelId = modelId; + } + public String getInterfaceName() { return interfaceName; } @@ -253,7 +264,7 @@ public class SyncAccountStatementJob extends BaseCronJob { } } } - dayBalance.save(dayBalance, 50, "uf_bank_day_balance"); + dayBalance.save(dayBalance, Util.getIntValue(this.modelId), "uf_bank_day_balance"); logger.writeLog(JobName + " result dayBalance: " + dayBalance.toString()); } } diff --git a/src/main/java/com/api/nonstandardext/zenner/job/SyncAccountTradeInfoJob.java b/src/main/java/com/api/nonstandardext/zenner/job/SyncAccountTradeInfoJob.java index 1a72ca3..ed9079b 100644 --- a/src/main/java/com/api/nonstandardext/zenner/job/SyncAccountTradeInfoJob.java +++ b/src/main/java/com/api/nonstandardext/zenner/job/SyncAccountTradeInfoJob.java @@ -9,6 +9,8 @@ import org.dom4j.DocumentHelper; import org.dom4j.Element; import weaver.conn.RecordSet; import weaver.general.BaseBean; +import weaver.general.Time; +import weaver.general.TimeUtil; import weaver.general.Util; import weaver.interfaces.schedule.BaseCronJob; import java.io.File; @@ -29,6 +31,9 @@ public class SyncAccountTradeInfoJob extends BaseCronJob { BaseBean logger = new BaseBean(); + /** 模块id */ + private String modelId; + private String interfaceName; /** 同步开始日期 */ @@ -125,9 +130,13 @@ public class SyncAccountTradeInfoJob extends BaseCronJob { xmlParams.put("actacn", actacn); //xmlParams.put("from", "20220919"); Calendar cal = Calendar.getInstance(); - cal.set(Calendar.DAY_OF_MONTH, -1); - 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); + cal.add(Calendar.DAY_OF_MONTH, -1); + 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.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", "1"); @@ -354,7 +363,7 @@ public class SyncAccountTradeInfoJob extends BaseCronJob { logger.writeLog(JobName + " result tradeInfoList size: " + tradeInfoList.size()); for (TradeInfo tradeInfo : tradeInfoList){ if (!"".equals(tradeInfo.getIbknum())){ - tradeInfo.save(tradeInfo, 51, "uf_bank_trade_info"); + tradeInfo.save(tradeInfo, Util.getIntValue(this.modelId), "uf_bank_trade_info"); } } diff --git a/src/test/java/bokang/xiao/NormalTest.java b/src/test/java/bokang/xiao/NormalTest.java index bd19a33..9364a92 100644 --- a/src/test/java/bokang/xiao/NormalTest.java +++ b/src/test/java/bokang/xiao/NormalTest.java @@ -122,11 +122,28 @@ public class NormalTest extends BaseTest { examineSchedule.runCode(); } + @Test + public void testDatea(){ + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.DAY_OF_MONTH,-1); + // 获取修改后的日期并赋值给 from + String to = new SimpleDateFormat("yyyyMMdd").format(cal.getTime()); + // 将日期减一天 + cal.add(Calendar.DAY_OF_MONTH, -1); + + // 获取修改后的日期并赋值给 to + String from = new SimpleDateFormat("yyyyMMdd").format(cal.getTime()); + + System.out.println("From: " + from); + System.out.println("To: " + to); + } + @Test public void testResponseSync(){ ParseTest parseTest = new ParseTest(); Map resultData = parseTest.getResultData(); System.out.println(JSON.toJSONString(resultData)); + //ResponseMappingDeal responseMappingDeal = new ResponseMappingDeal(); //responseMappingDeal.doResponseSync("test1",resultData); }