From c36b2dab010e7b2f2144bf780d97a40501d28e28 Mon Sep 17 00:00:00 2001 From: ggxl <194689125@qq.com> Date: Fri, 29 Nov 2024 10:18:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=87=E8=B4=AD=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E6=80=BB=E9=87=91=E9=A2=9D=E6=95=B0=E5=80=BC=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=8F=98=E5=8C=96=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DecisionJumpToConPlanPlugin.java | 68 ++++++++++--------- .../WriteBackAdjustAmountOpPlugin.java | 3 +- 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/main/java/shkd/repc/rebm/formplugin/DecisionJumpToConPlanPlugin.java b/main/java/shkd/repc/rebm/formplugin/DecisionJumpToConPlanPlugin.java index 1b6895d..efd66f3 100644 --- a/main/java/shkd/repc/rebm/formplugin/DecisionJumpToConPlanPlugin.java +++ b/main/java/shkd/repc/rebm/formplugin/DecisionJumpToConPlanPlugin.java @@ -18,6 +18,7 @@ import kd.bos.entity.datamodel.IDataModel; import kd.bos.exception.KDException; import kd.bos.form.*; import kd.bos.form.container.Tab; +import kd.bos.form.container.TabPage; import kd.bos.form.control.Control; import kd.bos.form.control.EntryGrid; import kd.bos.form.control.Toolbar; @@ -84,39 +85,6 @@ public class DecisionJumpToConPlanPlugin extends AbstractBillPlugIn implements C String operateKey = eventArgs.getOperateKey(); if ("changeplan".equals(operateKey)) { IFormView mainView = this.getView().getMainView(); - IPageCache pageCache = mainView.getPageCache(); - String tabPageKeys = pageCache.get("_Tab_Items_TabPageKeys"); - boolean result = false; - String key = ""; - if (!tabPageKeys.isEmpty()) { - String[] splits = tabPageKeys.replaceAll("\\[", "").replaceAll("]", "").split(","); - for (String split : splits) { - if (split.contains("recos")) { - key = split.replaceAll("\"", ""); - result = true; - break; - } - } - } - - if (!result) { - FormShowParameter formShowParameter = new FormShowParameter(); - formShowParameter.setAppId("recos"); - formShowParameter.getOpenStyle().setShowType(ShowType.NewTabPage); - formShowParameter.getOpenStyle().setTargetKey("tabap"); - formShowParameter.setCustomParam("formId", "recos_conplan"); - formShowParameter.setCustomParam("appImageUrl", "icons/pc/application/fdc_cbgl_48_48.png"); - formShowParameter.setCustomParam("appid", "recos"); - formShowParameter.setFormId("recos_apphome"); - formShowParameter.setCaption("成本管理"); - formShowParameter.setPageId("recos" + mainView.getPageId()); - mainView.showForm(formShowParameter); - getView().sendFormAction(mainView); - } else { - Tab tab = mainView.getControl("tabap"); - tab.activeTab(key); - } - IDataModel model = this.getModel(); DynamicObjectCollection bidSections = model.getEntryEntity("bidsection");// 标段 DynamicObjectCollection bottomSections = model.getEntryEntity("bottomsection");// 标底标段 @@ -155,6 +123,7 @@ public class DecisionJumpToConPlanPlugin extends AbstractBillPlugIn implements C } if (finalPriceSum.compareTo(controlAmountSum) >= 1) { + jumpRECOS(); if (project != null) { generateAimAdjustBill(mainView, model.getDataEntity().getLong("id"), project.getString("number"), seq); } @@ -164,6 +133,39 @@ public class DecisionJumpToConPlanPlugin extends AbstractBillPlugIn implements C } } + private void jumpRECOS() { + IFormView mainView = this.getView().getMainView(); + Tab tab = mainView.getControl("tabap"); + + boolean result = false; + String key = ""; + List items = tab.getItems(); + for (Control item : items) { + TabPage tabPage = (TabPage) item; + if (tabPage.getKey().contains("recos")) { + result = true; + key= tabPage.getKey(); + } + } + + if (!result) { + FormShowParameter formShowParameter = new FormShowParameter(); + formShowParameter.setAppId("recos"); + formShowParameter.getOpenStyle().setShowType(ShowType.NewTabPage); + formShowParameter.getOpenStyle().setTargetKey("tabap"); + formShowParameter.setCustomParam("formId", "recos_conplan"); + formShowParameter.setCustomParam("appImageUrl", "icons/pc/application/fdc_cbgl_48_48.png"); + formShowParameter.setCustomParam("appid", "recos"); + formShowParameter.setFormId("recos_apphome"); + formShowParameter.setCaption("成本管理"); + formShowParameter.setPageId("recos" + mainView.getPageId()); + mainView.showForm(formShowParameter); + getView().sendFormAction(mainView); + } else { + tab.activeTab(key); + } + } + private void generateAimAdjustBill(IFormView mainView,Long id, String purProjectNum, int seqNum) { String appPageID = "recos" + mainView.getPageId(); IFormView appPageView = mainView.getViewNoPlugin(appPageID); diff --git a/main/java/shkd/repc/rebm/opplugin/WriteBackAdjustAmountOpPlugin.java b/main/java/shkd/repc/rebm/opplugin/WriteBackAdjustAmountOpPlugin.java index 7dad41e..15f72c5 100644 --- a/main/java/shkd/repc/rebm/opplugin/WriteBackAdjustAmountOpPlugin.java +++ b/main/java/shkd/repc/rebm/opplugin/WriteBackAdjustAmountOpPlugin.java @@ -70,12 +70,13 @@ public class WriteBackAdjustAmountOpPlugin extends AbstractOperationServicePlugI bottomEntry.set("qeug_planamount", bottomEntry.getBigDecimal("planamount")); bottomEntry.set("qeug_botcontrolamount", bottomEntry.getBigDecimal("botcontrolamount")); + BigDecimal controlamount = dynamicObject.getBigDecimal("controlamount").add(adjustSumAmt.subtract(bottomEntry.getBigDecimal("botcontrolamount"))); + bottomEntry.set("planamount", adjustSumAmt); bottomEntry.set("botcontrolamount", adjustSumAmt); bottomEntry.set("botctrlamtexceptvat", adjustSumAmt); bottomEntry.set("nottaxplanamount", adjustSumAmt); - BigDecimal controlamount = dynamicObject.getBigDecimal("controlamount").add(adjustSumAmt.subtract(bottomEntry.getBigDecimal("botcontrolamount"))); dynamicObject.set("controlamount", controlamount); dynamicObject.set("exctaxcontrolamount", controlamount); }