提交人:陈绍鑫

日期:2025/4/21 16:30
内容:上划下拨(new)插件
This commit is contained in:
陈绍鑫 2025-04-21 16:07:59 +08:00
parent 98a8462017
commit 85bf4b8545
2 changed files with 125 additions and 1 deletions

View File

@ -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<Long> 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<String, Object> 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<Long> getAuthParentOrgList(List<Long> 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<Long> getAuthSonOrgList(List<Long> 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<Long> 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<Long> getBankIdList(List<Long> 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<Long> getAccountGroupIdList(List<Long> 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());
}
}

View File

@ -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;
}