From 85bf4b85455a2e23cae3f2b3623e55fb7500246e Mon Sep 17 00:00:00 2001 From: chenshaoxin <1981897232@qq.com> Date: Mon, 21 Apr 2025 16:07:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A=E9=99=88?= =?UTF-8?q?=E7=BB=8D=E9=91=AB=20=E6=97=A5=E6=9C=9F=EF=BC=9A2025/4/21=2016?= =?UTF-8?q?=EF=BC=9A30=20=E5=86=85=E5=AE=B9:=E4=B8=8A=E5=88=92=E4=B8=8B?= =?UTF-8?q?=E6=8B=A8=EF=BC=88new=EF=BC=89=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transbilldetailreportnewFormPlugin.java | 124 ++++++++++++++++++ .../report/transbillreportnewPlugin.java | 2 +- 2 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/report/transbilldetailreportnewFormPlugin.java diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/report/transbilldetailreportnewFormPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/report/transbilldetailreportnewFormPlugin.java new file mode 100644 index 0000000..c37661c --- /dev/null +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/report/transbilldetailreportnewFormPlugin.java @@ -0,0 +1,124 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package shkd.sys.sys.plugin.report; + +import com.alibaba.fastjson.JSONArray; +import kd.bos.context.RequestContext; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.report.ReportQueryParam; +import kd.bos.form.field.BasedataEdit; +import kd.bos.orm.query.QFilter; +import kd.bos.report.ReportShowParameter; +import kd.bos.report.filter.ReportFilter; +import kd.bos.report.plugin.AbstractReportFormPlugin; +import kd.bos.servicehelper.QueryServiceHelper; +import kd.tmc.fbp.common.helper.TmcOrgDataHelper; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class transbilldetailreportnewFormPlugin extends AbstractReportFormPlugin { + + public void initDefaultQueryParam(ReportQueryParam queryParam) { + List authOrgList = TmcOrgDataHelper.getAuthorizedBankOrgId(RequestContext.get().getCurrUserId(), this.getView().getFormShowParameter().getAppId(), this.getModel().getDataEntityType().getName(), "47150e89000000ac"); + BasedataEdit org = (BasedataEdit)this.getControl("filter_org"); + org.setQFilter(new QFilter("id", "in", this.getAuthParentOrgList(authOrgList))); + BasedataEdit sonOrg = (BasedataEdit)this.getControl("filter_sonorg"); + sonOrg.setQFilter(new QFilter("id", "in", this.getAuthSonOrgList(authOrgList))); + ReportShowParameter formShowParameter = (ReportShowParameter)this.getView().getFormShowParameter(); + BasedataEdit currency = (BasedataEdit)this.getControl("filter_currency"); + currency.setQFilter(new QFilter("id", "in", this.getCurrencyIdList())); + BasedataEdit bank = (BasedataEdit)this.getControl("filter_bank"); + bank.setQFilter(new QFilter("id", "in", this.getBankIdList(authOrgList))); + BasedataEdit accountGroup = (BasedataEdit)this.getControl("filter_accountgroup"); + accountGroup.setQFilter(new QFilter("id", "in", this.getAccountGroupIdList(authOrgList))); + if ("shkd_transbill_reportnew".equals(formShowParameter.getParentFormId())) { + + this.getModel().setValue("filter_org", (Object)null); + Map customParams = formShowParameter.getCustomParams(); + JSONArray accountGroupIds; + if (customParams.get("filter_org") != null) { + accountGroupIds = (JSONArray)customParams.get("filter_org"); + this.getModel().setValue("filter_org", accountGroupIds.toArray()); + } + + if (customParams.get("filter_bank") != null) { + accountGroupIds = (JSONArray)customParams.get("filter_bank"); + this.getModel().setValue("filter_bank", accountGroupIds.toArray()); + } + + if (customParams.get("filter_sonorg") != null) { + accountGroupIds = (JSONArray)customParams.get("filter_sonorg"); + this.getModel().setValue("filter_sonorg", accountGroupIds.toArray()); + } + + if (customParams.get("filter_currency") != null) { + accountGroupIds = (JSONArray)customParams.get("filter_currency"); + this.getModel().setValue("filter_currency", accountGroupIds.toArray()); + } + + if (customParams.get("filter_accountgroup") != null) { + accountGroupIds = (JSONArray)customParams.get("filter_accountgroup"); + this.getModel().setValue("filter_accountgroup", accountGroupIds.toArray()); + } + + if (customParams.get("filter_biztype") != null) { + this.getModel().setValue("filter_biztype", customParams.get("filter_biztype")); + } + + this.getModel().setValue("filter_period", customParams.get("filter_period")); + this.getModel().setValue("filter_startdate", customParams.get("filter_startdate")); + this.getModel().setValue("filter_enddate", customParams.get("filter_enddate")); + this.getModel().setValue("filter_statcurrency", customParams.get("filter_statcurrency")); + this.getModel().setValue("filter_currencyunit", customParams.get("filter_currencyunit")); + ReportFilter rptFilter = (ReportFilter)this.getControl("reportfilterap"); + rptFilter.search(); + } + } + + + private List getAuthParentOrgList(List authOrgList) { + QFilter companyIdFilter = new QFilter("company", "in", authOrgList); + DynamicObjectCollection groupAccount = QueryServiceHelper.query("fca_acctgroup", "company", new QFilter[]{companyIdFilter}); + return (List)groupAccount.stream().map((g) -> { + return g.getLong("company"); + }).collect(Collectors.toList()); + } + + private List getAuthSonOrgList(List authOrgList) { + QFilter companyIdFilter = new QFilter("entrys.bankacct.company", "in", authOrgList); + DynamicObjectCollection groupAccount = QueryServiceHelper.query("fca_acctgroup", "entrys.bankacct.company", new QFilter[]{companyIdFilter}); + return (List)groupAccount.stream().map((g) -> { + return g.getLong("entrys.bankacct.company"); + }).collect(Collectors.toList()); + } + + private List getCurrencyIdList() { + QFilter filter = new QFilter("1", "=", 1); + DynamicObjectCollection groupAccount = QueryServiceHelper.query("fca_acctgroup", "currency", new QFilter[]{filter}); + return (List)groupAccount.stream().map((g) -> { + return g.getLong("currency"); + }).collect(Collectors.toList()); + } + + private List getBankIdList(List authOrgList) { + QFilter companyIdFilter = new QFilter("company", "in", authOrgList); + DynamicObjectCollection groupAccount = QueryServiceHelper.query("fca_acctgroup", "accountbank.bank.id", new QFilter[]{companyIdFilter}); + return (List)groupAccount.stream().map((g) -> { + return g.getLong("accountbank.bank.id"); + }).collect(Collectors.toList()); + } + + private List getAccountGroupIdList(List authOrgList) { + QFilter companyIdFilter = new QFilter("company", "in", authOrgList); + DynamicObjectCollection groupAccount = QueryServiceHelper.query("fca_acctgroup", "id", new QFilter[]{companyIdFilter}); + return (List)groupAccount.stream().map((g) -> { + return g.getLong("id"); + }).collect(Collectors.toList()); + } + +} diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/report/transbillreportnewPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/report/transbillreportnewPlugin.java index 3d012f4..ff84bfe 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/report/transbillreportnewPlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/report/transbillreportnewPlugin.java @@ -324,7 +324,7 @@ public class transbillreportnewPlugin extends AbstractTmcTreeReportDataPlugin { ")"); DataSet res = DB.queryDataSet(this.getClass().getSimpleName(), DBRoute.of("fi"), sqlBuilder.toString());//财务云 res = addExchangeRateAndCurrencyUnit1(res, paramMap); - DataSet select = res.select(new String[]{"shkd_subacct","downamount as shkd_qcye","upamount as shkd_qckyye"}); + DataSet select = res.select(new String[]{"shkd_subacct","downamount_report as shkd_qcye","upamount_report as shkd_qckyye"}); return select; }