项目工序动态成本分析表二开优化

This commit is contained in:
xuhaihui 2025-12-09 16:13:01 +08:00
parent 6333878a1e
commit 8f9a510b07
1 changed files with 39 additions and 14 deletions

View File

@ -645,18 +645,13 @@ public class CbsDynamicCostFormPluginExt extends AbstractFormPlugin implements B
protected void queryCostData(DynamicObject project, Map<String, BigDecimal> confirmCostMap, Map<String, BigDecimal> notSplitCostMap, Map<String, BigDecimal> 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<Long> 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<String, Object> 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"));