From 61dbe850d2798440976bbd4d8d517ef92b3f5e98 Mon Sep 17 00:00:00 2001 From: zengweihai Date: Thu, 8 Aug 2024 10:57:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E9=87=91=E6=97=A5=E8=A1=A8=E5=8F=96?= =?UTF-8?q?=E6=95=B0=E9=80=BB=E8=BE=91=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/data/CapitalDayListDataPlugin.java | 80 +++++-------------- 1 file changed, 18 insertions(+), 62 deletions(-) diff --git a/shkd-cosmic-debug/src/main/java/shkd/fi/cas/report/data/CapitalDayListDataPlugin.java b/shkd-cosmic-debug/src/main/java/shkd/fi/cas/report/data/CapitalDayListDataPlugin.java index 0440040..6c26354 100644 --- a/shkd-cosmic-debug/src/main/java/shkd/fi/cas/report/data/CapitalDayListDataPlugin.java +++ b/shkd-cosmic-debug/src/main/java/shkd/fi/cas/report/data/CapitalDayListDataPlugin.java @@ -87,6 +87,8 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple BigDecimal recTotal = BigDecimal.ZERO; //总计 期间收入合计 BigDecimal payLB = BigDecimal.ZERO; //内部往来,支出合计 BigDecimal recLB = BigDecimal.ZERO; //内部往来 期间收入合计 + BigDecimal payNet = BigDecimal.ZERO;//支出净额 + BigDecimal recNet = BigDecimal.ZERO;//收入净额 for (int i = 0; i < cas_cashmgtinits.length; i++) { //若是集团,需要在第一行拼接第一行的数据 if("group".equals(shkd_queryorgtype)&&i == 0){ @@ -119,7 +121,7 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple //逻辑1:查询该公司到查询时间的所有付款单 QFilter bef_payQF = new QFilter("billstatus", QCP.equals, "D"); bef_payQF.and("org.id",QCP.equals,orgPkValue); - bef_payQF.and("paydate",QCP.large_equals,begindate); + bef_payQF.and("bizdate",QCP.large_equals,begindate);//付款日期paydate if (firstDate == null){//没有设置时间,则查询今日记账,即查询期间开始到今日之前的所有付款单据 firstDate = new Date(); } @@ -130,7 +132,7 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple bef_payQF.and("currency.id",QCP.equals,orgcurrencyId); } Date startDate = this.getStartDate(firstDate);//过滤条件-开始日期 - bef_payQF.and("paydate","<",startDate); + bef_payQF.and("bizdate","<",startDate); DynamicObject[] bef_cas_paybills = BusinessDataServiceHelper.load("cas_paybill", "id,org,org.id,org.number,payeenumber,actpayamt,currency", bef_payQF.toArray()); for (DynamicObject bef_cas_paybill : bef_cas_paybills) { String payNumber = bef_cas_paybill.getDynamicObject("org").getString("number"); @@ -151,8 +153,8 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple bef_recQF.and("currency.id",QCP.equals,orgcurrencyId); } bef_recQF.and("org.id",QCP.equals,orgPkValue); - bef_recQF.and("payeedate",QCP.large_equals,begindate); - bef_recQF.and("payeedate","<",startDate); + bef_recQF.and("bizdate",QCP.large_equals,begindate);//收款日期payeedate + bef_recQF.and("bizdate","<",startDate); DynamicObject[] cas_recbills = BusinessDataServiceHelper.load("cas_recbill", "id,org,org.id,org.number,actrecamt,currency", bef_recQF.toArray()); for (DynamicObject cas_recbill : cas_recbills) { BigDecimal actrecamt = cas_recbill.getBigDecimal("actrecamt"); @@ -178,8 +180,8 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple if (orgcurrency != null){ per_recQF.and("currency.id",QCP.equals,orgcurrencyId); } - per_recQF.and("payeedate",QCP.large_equals,startDate); - per_recQF.and("payeedate",QCP.less_equals,overDate); + per_recQF.and("bizdate",QCP.large_equals,startDate);//收款日期payeedate + per_recQF.and("bizdate",QCP.less_equals,overDate); DynamicObject[] per_cas_recbills = BusinessDataServiceHelper.load("cas_recbill", "id,org,org.id,org.number,actrecamt,currency,payertype,customerf7,customerf7", per_recQF.toArray()); BigDecimal transactions = this.getTransactions(per_cas_recbills); recLB =recLB.add(transactions); //内部往来收入合计 @@ -199,8 +201,8 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple per_payQF.and("currency.id",QCP.equals,orgcurrencyId); } per_payQF.and("org.id",QCP.equals,orgPkValue); - per_payQF.and("paydate",QCP.large_equals,startDate); - per_payQF.and("paydate",QCP.less_equals,overDate); + per_payQF.and("bizdate",QCP.large_equals,startDate);//付款日期paydate + per_payQF.and("bizdate",QCP.less_equals,overDate); DynamicObject[] per_cas_paybills = BusinessDataServiceHelper.load("cas_paybill", "id,org,org.id,org.number,payeenumber,actpayamt,currency,payeetype,payee", per_payQF.toArray()); BigDecimal transactionsByfk = this.getTransactionsByfk(per_cas_paybills); payLB =payLB.add(transactionsByfk); //内部往来收入合计 @@ -234,64 +236,18 @@ public class CapitalDayListDataPlugin extends AbstractReportListDataPlugin imple firmParam[4] = payTotal; //今日收入合计 firmParams.add(firmParam); - Object[] firmParam2 = new Object[7];//存放公司数据 + Object[] firmParam2 = new Object[7];//存放内部往来数据 firmParam2[1] = "内部往来"; - firmParam2[3] = recLB; //今日收入合计 - firmParam2[4] = payLB; //今日收入合计 + firmParam2[3] = recLB; //收入(内部往来)合计 + firmParam2[4] = payLB; //支出(内部往来)合计 firmParams.add(firmParam2); //内部收支净额的组装 - + Object[] firmParam3 = new Object[7];//存放内部往来数据 + firmParam3[1] = "收支净额"; + firmParam3[3] = recTotal.subtract(recLB); //收入(内部往来)合计 + firmParam3[4] = payTotal.subtract(payLB); //支出(内部往来)合计 + firmParams.add(firmParam3); } - - - -// Map>> firm_accMap = new HashMap>>(cas_cashmgtinits.length);//总体公司银行账户集合数据 -// for (DynamicObject cas_cashmgtinit : cas_cashmgtinits) { -// DynamicObject org = cas_cashmgtinit.getDynamicObject("org"); -// String name = org.getString("name"); -// List> firm_banks = new ArrayList>();//银行账户集合 -// DynamicObjectCollection entrybank = cas_cashmgtinit.getDynamicObjectCollection("entrybank"); -// for (DynamicObject dynamicObject : entrybank) { -// Map bankInfo = new HashMap();//单个银行数据信息 -// bankInfo.put("bank_accountbank_id",dynamicObject.getDynamicObject("bank_accountbank").getLong("id")); -// bankInfo.put("bank_journalbalance",dynamicObject.getBigDecimal("bank_journalbalance")); -// bankInfo.put("bank_journalsumbalanceadj",dynamicObject.getBigDecimal("bank_journalsumbalanceadj")); -// firm_banks.add(bankInfo); -// } -// firm_accMap.put(name,firm_banks); -// } - - - //2、查询所有收款处理单据数据cas_recbill org收款人(公司) accountbank银行账号 actrecamt收款金额 - - - //3、查询所有付款处理单据数据 org付款人(公司) payeracctbank银行账号 payeename收款人名称 payeebanknum收款账号 actpayamt付款金额 -// QFilter payQF = new QFilter(); -// BusinessDataServiceHelper.load("cas_paybill",) - - -// Collection coll= new ArrayList(); -// for (int i = 0;i < 3 ;i++ ){ -// Object[] values = new Object[fileNames.length]; -// values[0] = i+1; -// values[1] = "公司"+i; -// values[2] = 10+(int)Math.floor(Math.random()*100); -// values[3] = 10+(int)Math.floor(Math.random()*100); -// values[4] = 10+(int)Math.floor(Math.random()*100); -// values[5] = 10+(int)Math.floor(Math.random()*100); -// coll.add(values); -// } -// BigDecimal sum1 = BigDecimal.ZERO; -// BigDecimal sum2 = BigDecimal.ZERO; -// for (Object[] objects : coll) { -// sum1 = sum1.add(new BigDecimal(objects[3].toString())); -// sum2 = sum2.add(new BigDecimal(objects[4].toString())); -// } -// Object[] obj = new Object[fileNames.length]; -// obj[1] = "期间汇总"; -// obj[3] = sum1; -// obj[4] = sum2; -// coll.add(obj); if (firmParams != null){ RowMeta row = RowMetaFactory.createRowMeta(fileNames, dataTypes); CollectionInput inputs = new CollectionInput(row, firmParams);