From ce265d3613859bb17e608aba7c6ff60b65dcc2b9 Mon Sep 17 00:00:00 2001 From: xuhaihui <2098865055@qq.com> Date: Tue, 25 Nov 2025 13:34:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=97=A0=E5=90=88=E5=90=8C=E4=BB=98?= =?UTF-8?q?=E6=AC=BE=E7=94=B3=E8=AF=B7=E6=B7=BB=E5=8A=A0=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=BB=B4=E4=BF=AE=E7=94=B3=E8=AF=B7=E8=B6=85=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PublicreimbursebillNoContractPlugin.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractPlugin.java index 3afe4e7..559ac38 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractPlugin.java @@ -406,9 +406,13 @@ public class PublicreimbursebillNoContractPlugin extends AbstractBillPlugIn impl this.addItemClickListeners("receiveentrytoolbar");//收款信息 增行 - EntryGrid entryGrid = this.getView().getControl("zcgj_materialinbillentry");//入库单分录 - if (entryGrid != null) { - entryGrid.addHyperClickListener(this); + EntryGrid zcgj_materialinbillentry = this.getView().getControl("zcgj_materialinbillentry");//入库单分录 + if (zcgj_materialinbillentry != null) { + zcgj_materialinbillentry.addHyperClickListener(this); + } + EntryGrid zcgj_maintenanceackentry = this.getView().getControl("zcgj_maintenanceackentry");//维修确认单分录 + if (zcgj_maintenanceackentry != null) { + zcgj_maintenanceackentry.addHyperClickListener(this); } } } @@ -417,12 +421,21 @@ public class PublicreimbursebillNoContractPlugin extends AbstractBillPlugIn impl public void hyperLinkClick(HyperLinkClickEvent hyperLinkClickEvent) { String fieldName = hyperLinkClickEvent.getFieldName(); if (StringUtils.equals(fieldName, "zcgj_materialinbill") || StringUtils.equals(fieldName, "zcgj_materialinbillname")) { + //打开入库单 int rowIndex = hyperLinkClickEvent.getRowIndex(); DynamicObjectCollection materialInBillEntryCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_materialinbillentry");//入库单分录 DynamicObject materialInBillEntry = materialInBillEntryCollection.get(rowIndex); Object zcgj_purchaseapply_f7 = materialInBillEntry.getDynamicObject("zcgj_materialinbill").getPkValue(); BillShowParameter billShowParameter = OpenPageUtils.buildBillShowParam(zcgj_purchaseapply_f7, "ecma_materialinbill");//入库单 this.getView().showForm(billShowParameter);//打开入库单 + }else if (StringUtils.equals(fieldName, "zcgj_maintenanceack") || StringUtils.equals(fieldName, "zcgj_maintenanceackname")) { + //打开设备维修确认单 + int rowIndex = hyperLinkClickEvent.getRowIndex(); + DynamicObjectCollection maintenanceAckEntryCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_maintenanceackentry");//设备维修确认单分录 + DynamicObject maintenanceAckEntry = maintenanceAckEntryCollection.get(rowIndex); + Object zcgj_maintenanceack_f7 = maintenanceAckEntry.getDynamicObject("zcgj_maintenanceack").getPkValue(); + BillShowParameter billShowParameter = OpenPageUtils.buildBillShowParam(zcgj_maintenanceack_f7, "zcgj_maintenanceackbill");//设备维修确认单 + this.getView().showForm(billShowParameter); } } From 71c04327cfb98e52af44752c93784cf20a1f3582 Mon Sep 17 00:00:00 2001 From: xuhaihui <2098865055@qq.com> Date: Tue, 25 Nov 2025 13:35:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=8F=92=E4=BB=B6=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E6=A0=A1=E9=AA=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/form/EntCostSplitBillPlugin.java | 35 ++++++++++++----- .../MaterialInBillDateSubValidatorOp.java | 38 ++++++++++++++----- 2 files changed, 54 insertions(+), 19 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EntCostSplitBillPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EntCostSplitBillPlugin.java index d64416e..26e13e5 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EntCostSplitBillPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EntCostSplitBillPlugin.java @@ -259,19 +259,21 @@ public class EntCostSplitBillPlugin extends AbstractBillPlugIn { Object costType1 = entry1.get("costtype"); Object costType2 = entry2.get("costtype"); - // 处理null值情况 - 将null值放在前面 if (costType1 == null && costType2 == null) return 0; - if (costType1 == null) return -1; // null值排在前面 - if (costType2 == null) return 1; // null值排在前面 + if (costType1 == null) return -1; + if (costType2 == null) return 1; - // 提取数值部分进行比较 - String value1 = costType1.toString().replaceAll("[^0-9]", ""); - String value2 = costType2.toString().replaceAll("[^0-9]", ""); + String str1 = costType1.toString().trim(); + String str2 = costType2.toString().trim(); - int num1 = value1.isEmpty() ? 0 : Integer.parseInt(value1); - int num2 = value2.isEmpty() ? 0 : Integer.parseInt(value2); + Integer sortValue1 = COST_TYPE_SORT_MAP.get(str1); + Integer sortValue2 = COST_TYPE_SORT_MAP.get(str2); - return Integer.compare(num1, num2); + if (sortValue1 == null && sortValue2 == null) return 0; + if (sortValue1 == null) return 1; + if (sortValue2 == null) return -1; + + return sortValue1.compareTo(sortValue2); }); // 按排序后的顺序添加数据 @@ -301,4 +303,19 @@ public class EntCostSplitBillPlugin extends AbstractBillPlugIn { } } } + + private static final Map COST_TYPE_SORT_MAP = new HashMap<>(); + + static { + COST_TYPE_SORT_MAP.put("10.", 10); + COST_TYPE_SORT_MAP.put("20.", 20); + COST_TYPE_SORT_MAP.put("30.", 30); + COST_TYPE_SORT_MAP.put("40.", 40); + COST_TYPE_SORT_MAP.put("50.", 50); + COST_TYPE_SORT_MAP.put("60.", 60); + COST_TYPE_SORT_MAP.put("70.", 70); + COST_TYPE_SORT_MAP.put("80.", 80); + COST_TYPE_SORT_MAP.put("90.", 90); + COST_TYPE_SORT_MAP.put("100.", 100); + } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/MaterialInBillDateSubValidatorOp.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/MaterialInBillDateSubValidatorOp.java index b12a472..15c00e8 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/MaterialInBillDateSubValidatorOp.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/MaterialInBillDateSubValidatorOp.java @@ -12,6 +12,8 @@ import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.QueryServiceHelper; +import java.time.LocalDate; +import java.time.ZoneId; import java.util.Date; /** @@ -67,9 +69,13 @@ public class MaterialInBillDateSubValidatorOp extends AbstractOperationServicePl DynamicObject ecma_purchaseapply = BusinessDataServiceHelper.loadSingle("ecma_purchaseapply", "auditdate", qFilters);//采购申请 Date auditdate = ecma_purchaseapply.getDate("auditdate");//采购申请-审核时间 Date bizdate = ecma_MaterialInBill.getDate("bizdate");//业务日期 - if (auditdate != null && bizdate != null && auditdate.after(bizdate)) { - this.addFatalErrorMessage(extendedDataEntity, "采购申请单:" + zcgj_number + "的审批日期不能晚于业务日期!"); - continue; + if (auditdate != null && bizdate != null) { + LocalDate auditLocalDate = auditdate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + LocalDate bizLocalDate = bizdate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + if (auditLocalDate.isAfter(bizLocalDate)) { + this.addFatalErrorMessage(extendedDataEntity, "采购申请单" + zcgj_number + "的审批日期不能晚于业务日期!"); + continue; + } } DynamicObjectCollection zcgj_entryentityCollection = ecma_MaterialInBill.getDynamicObjectCollection("zcgj_entryentity");//合同进项发票信息 if (zcgj_entryentityCollection.size() > 0) { @@ -78,8 +84,12 @@ public class MaterialInBillDateSubValidatorOp extends AbstractOperationServicePl if (zcgj_invoice != null) { Date invoicedate = zcgj_invoice.getDate("invoicedate");//发票号码-开票日期 String billno = zcgj_invoice.getString("billno"); - if (invoicedate != null && auditdate != null && auditdate.after(invoicedate)) { - this.addFatalErrorMessage(extendedDataEntity, "采购申请单:" + zcgj_number + "的审批日期不能晚于发票:" + billno + "的开票日期!"); + if (auditdate != null && invoicedate != null) { + LocalDate auditLocalDate = auditdate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + LocalDate bizLocalDate = invoicedate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + if (auditLocalDate.isAfter(bizLocalDate)) { + this.addFatalErrorMessage(extendedDataEntity, "采购申请单" + zcgj_number + "的审批日期不能晚于发票" + billno + "的开票日期!"); + } } } } @@ -95,9 +105,13 @@ public class MaterialInBillDateSubValidatorOp extends AbstractOperationServicePl DynamicObject ecma_purchaseapply = BusinessDataServiceHelper.loadSingle("ecma_purchaseapply", "auditdate", qFilters);//采购申请 Date auditdate = ecma_purchaseapply.getDate("auditdate");//采购申请-审核时间 Date bizdate = ecma_MaterialInBill.getDate("bizdate");//业务日期 - if (auditdate != null && bizdate != null && auditdate.after(bizdate)) { - this.addFatalErrorMessage(extendedDataEntity, "采购申请的审批日期不能晚于业务日期!"); - continue; + if (auditdate != null && bizdate != null) { + LocalDate auditLocalDate = auditdate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + LocalDate bizLocalDate = bizdate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + if (auditLocalDate.isAfter(bizLocalDate)) { + this.addFatalErrorMessage(extendedDataEntity, "采购申请的审批日期不能晚于业务日期!"); + continue; + } } DynamicObjectCollection zcgj_entryentityCollection = ecma_MaterialInBill.getDynamicObjectCollection("zcgj_entryentity");//合同进项发票信息 if (zcgj_entryentityCollection.size() > 0) { @@ -106,8 +120,12 @@ public class MaterialInBillDateSubValidatorOp extends AbstractOperationServicePl if (zcgj_invoice != null) { Date invoicedate = zcgj_invoice.getDate("invoicedate");//发票号码-开票日期 String billno = zcgj_invoice.getString("billno"); - if (invoicedate != null && auditdate != null && auditdate.after(invoicedate)) { - this.addFatalErrorMessage(extendedDataEntity, "采购申请的审批日期不能晚于发票:" + billno + "的开票日期!"); + if (auditdate != null && invoicedate != null) { + LocalDate auditLocalDate = auditdate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + LocalDate bizLocalDate = invoicedate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + if (auditLocalDate.isAfter(bizLocalDate)) { + this.addFatalErrorMessage(extendedDataEntity, "采购申请的审批日期不能晚于发票" + billno + "的开票日期!"); + } } } }