diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/CbsDynamicCostFormPluginExt.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/CbsDynamicCostFormPluginExt.java index ce3659b..cbcbd42 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/CbsDynamicCostFormPluginExt.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/CbsDynamicCostFormPluginExt.java @@ -645,18 +645,13 @@ public class CbsDynamicCostFormPluginExt extends AbstractFormPlugin implements B protected void queryCostData(DynamicObject project, Map confirmCostMap, Map notSplitCostMap, Map notConfirmCostMap) { Object zcgj_periodyear = this.getModel().getValue("zcgj_periodyear"); int periodYear = 0; - if (zcgj_periodyear.equals("1")) { - periodYear = 2025; - } else if (zcgj_periodyear.equals("2")) { - periodYear = 2026; - } else if (zcgj_periodyear.equals("3")) { - periodYear = 2027; - } else if (zcgj_periodyear.equals("4")) { - periodYear = 2028; - } else if (zcgj_periodyear.equals("5")) { - periodYear = 2029; - } else if (zcgj_periodyear.equals("6")) { - periodYear = 2030; + + if (zcgj_periodyear instanceof String) { + try { + periodYear = Integer.parseInt((String) zcgj_periodyear); + } catch (NumberFormatException ignored) { + throw new RuntimeException(ignored); + } } QFilter costFilter = new QFilter("project", "=", project.getPkValue()); costFilter.and("billstatus", "in", new String[]{BillStatusEnum.AUDIT.getValue(), BillStatusEnum.SUBMIT.getValue()}); @@ -825,7 +820,10 @@ public class CbsDynamicCostFormPluginExt extends AbstractFormPlugin implements B } } - DynamicObjectCollection equipmentCostBills = QueryServiceHelper.query("eceq_costsplit", "billstatus,settlesplitentity.settleid,settlesplitentity.costsplitentity.unitproject,settlesplitentity.costsplitentity.procbs,settlesplitentity.costsplitentity.splitamount", new QFilter[]{costFilter1}); + QFilter costFilter2 = new QFilter("project", "=", project.getPkValue()); + costFilter2.and("billstatus", "in", new String[]{BillStatusEnum.AUDIT.getValue(), BillStatusEnum.SUBMIT.getValue()}); + costFilter2.and("splitperiod.periodyear", QCP.equals, periodYear);//会计期间-年度--二开添加 + DynamicObjectCollection equipmentCostBills = QueryServiceHelper.query("eceq_costsplit", "billstatus,settlesplitentity.settleid,settlesplitentity.costsplitentity.unitproject,settlesplitentity.costsplitentity.procbs,settlesplitentity.costsplitentity.splitamount", new QFilter[]{costFilter2}); Set splitReferenceEqSettleSet = new HashSet(16); Iterator var79 = equipmentCostBills.iterator(); @@ -1053,6 +1051,20 @@ public class CbsDynamicCostFormPluginExt extends AbstractFormPlugin implements B aimCostFilter.and("unitproject", "in", unitProjectIds); }*///二开注释掉的 + if (zcgj_periodyear.equals("2025")) { + zcgj_periodyear = "1"; + } else if (zcgj_periodyear.equals("2026")) { + zcgj_periodyear = "2"; + } else if (zcgj_periodyear.equals("2027")) { + zcgj_periodyear = "3"; + } else if (zcgj_periodyear.equals("2028")) { + zcgj_periodyear = "4"; + } else if (zcgj_periodyear.equals("2029")) { + zcgj_periodyear = "5"; + } else if (zcgj_periodyear.equals("2030")) { + zcgj_periodyear = "6"; + } + aimCostFilter.and("isenable", "=", "1"); aimCostFilter.and("zcgj_periodyear", "=", zcgj_periodyear);//二开添加 DynamicObject[] aimCostBills = BusinessDataServiceHelper.load("ecco_aimcostbillcbs", "unitproject,treeentryentity,treeentryentity.cbs,treeentryentity.pdamount", new QFilter[]{aimCostFilter}); @@ -1343,6 +1355,19 @@ public class CbsDynamicCostFormPluginExt extends AbstractFormPlugin implements B DynamicObject unitProject = (DynamicObject) this.getModel().getValue("unitproject", rowIndex); DynamicObject project = (DynamicObject) this.getModel().getValue("project"); Object zcgj_periodyear = this.getModel().getValue("zcgj_periodyear");//年度-二开添加 + if (zcgj_periodyear.equals("2025")) { + zcgj_periodyear = "1"; + } else if (zcgj_periodyear.equals("2026")) { + zcgj_periodyear = "2"; + } else if (zcgj_periodyear.equals("2027")) { + zcgj_periodyear = "3"; + } else if (zcgj_periodyear.equals("2028")) { + zcgj_periodyear = "4"; + } else if (zcgj_periodyear.equals("2029")) { + zcgj_periodyear = "5"; + } else if (zcgj_periodyear.equals("2030")) { + zcgj_periodyear = "6"; + } QFilter aimCostFilter = new QFilter("project", "=", project.getPkValue()); aimCostFilter.and("unitproject", "=", unitProject == null ? 0L : unitProject.getPkValue()); aimCostFilter.and("isenable", "=", "1"); @@ -1357,7 +1382,7 @@ public class CbsDynamicCostFormPluginExt extends AbstractFormPlugin implements B protected void showPeriodDetailCost(int rowIndex, String splitType) { Map paramMap = new HashMap(); - Object zcgj_periodyear = this.getModel().getValue("zcgj_periodyear");//年度--二开添加 +// Object zcgj_periodyear = this.getModel().getValue("zcgj_periodyear");//年度--二开添加 DynamicObject cbs = (DynamicObject) this.getModel().getValue("cbs", rowIndex); if (cbs != null && cbs.getBoolean("isleaf")) { paramMap.put("projectId", this.getPageCache().get("queryProject"));