From eebd9c6b40bcfe568fd06a1acae306e24b5c309f Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Thu, 9 Jan 2025 09:59:47 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=A7=BB=E5=8A=A8=E5=85=B3=E9=97=AD=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=B0=83=E8=AF=95=202.=E5=AE=9A=E6=A0=87=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=90=88=E5=90=8C=E6=90=BA=E5=B8=A6=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit S --- .../formplugin/ContractProjectFormPlugin.java | 82 ++++++++----------- .../shkd/todotask/closeTaskPagePlugin.java | 22 ++--- 2 files changed, 48 insertions(+), 56 deletions(-) diff --git a/main/java/shkd/repc/recon/formplugin/ContractProjectFormPlugin.java b/main/java/shkd/repc/recon/formplugin/ContractProjectFormPlugin.java index 6943bb1..529b79e 100644 --- a/main/java/shkd/repc/recon/formplugin/ContractProjectFormPlugin.java +++ b/main/java/shkd/repc/recon/formplugin/ContractProjectFormPlugin.java @@ -15,9 +15,12 @@ import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper; import shkd.repc.rebm.formplugin.ImportPurchaseApplyBillPlugin; +import java.math.BigDecimal; import java.util.EventObject; import java.util.List; +import static org.apache.fop.fonts.type1.AdobeStandardEncoding.n; + public class ContractProjectFormPlugin extends AbstractBillPlugIn { private static final Log logger = LogFactory.getLog(ContractProjectFormPlugin.class); @@ -27,57 +30,44 @@ public class ContractProjectFormPlugin extends AbstractBillPlugIn { super.afterBindData(e); //根据组织携带项目 updateRenovationProject(); - //转换规则 - IFormView parentView = this.getView().getParentView(); - if (null != parentView) { - parentView = parentView.getParentView(); - if (null != parentView) { - IDataModel model = parentView.getModel(); - DynamicObject dataEntity = model.getDataEntity(); - IDataEntityType dataEntityType = dataEntity.getDataEntityType(); - String name = dataEntityType.getName(); - if ("rebm_decision".equals(name)) { - DynamicObject org = (DynamicObject)this.getView().getModel().getValue("org"); - DynamicObject contractbill = this.getView().getModel().getDataEntity(); - contractbill = BusinessDataServiceHelper.loadSingle(contractbill.getPkValue(), "recon_contractbill"); - if (null != org) { - String qeugCombofield = org.getString("qeug_combofield");//业务体系 - contractbill.set("qeug_combofield",qeugCombofield); - contractbill.set("partyatype","qeug_recon_developer");//甲方类别:财务组织 - org = BusinessDataServiceHelper.loadSingle(org.getPkValue(),"bos_org"); - DynamicObject qeug_recon_orgrelation = BusinessDataServiceHelper.loadSingle("qeug_recon_orgrelation", - new QFilter[]{new QFilter("number", QCP.equals, org.getString("number"))}); - if (null != qeug_recon_orgrelation) { - //行政与财务组织对应关系 - qeug_recon_orgrelation = BusinessDataServiceHelper.loadSingle(qeug_recon_orgrelation.getPkValue(),"qeug_recon_orgrelation"); - //甲方 - DynamicObject qeug_recon_developer = BusinessDataServiceHelper.loadSingle("qeug_recon_developer", - new QFilter[]{new QFilter("number", QCP.equals, qeug_recon_orgrelation.getString("qeug_companynumber"))}); - if (null != qeug_recon_developer) { - contractbill.set("multitypepartya",qeug_recon_developer);//甲方 - } - } - } - DynamicObject bidproject = contractbill.getDynamicObject("bidproject");//定标名称 - if (null != bidproject) { - DynamicObject bidmode = bidproject.getDynamicObject("bidmode");//采购方式 - if (null != bidmode) { - logger.info("88"); - contractbill.set("qeug_bidmode",bidmode); - } - } - contractbill.set("bd_taxrate",null);//税率 - SaveServiceHelper.save(new DynamicObject[]{contractbill}); + DynamicObject org = (DynamicObject)this.getView().getModel().getValue("org"); + DynamicObject contractbill = this.getView().getModel().getDataEntity(); - DynamicObject qeugBidmode = (DynamicObject)this.getView().getModel().getValue("qeug_bidmode"); - if (null == qeugBidmode) { - logger.info("99"); - this.getView().invokeOperation("refresh"); - } + if (null != org) { + String qeugCombofield = org.getString("qeug_combofield");//业务体系 + this.getView().getModel().setValue("qeug_combofield",qeugCombofield); + + this.getView().getModel().setValue("partyatype","qeug_recon_developer");//甲方类别:财务组织 + org = BusinessDataServiceHelper.loadSingle(org.getPkValue(),"bos_org"); + DynamicObject qeug_recon_orgrelation = BusinessDataServiceHelper.loadSingle("qeug_recon_orgrelation", + new QFilter[]{new QFilter("number", QCP.equals, org.getString("number"))}); + if (null != qeug_recon_orgrelation) { + //行政与财务组织对应关系 + qeug_recon_orgrelation = BusinessDataServiceHelper.loadSingle(qeug_recon_orgrelation.getPkValue(),"qeug_recon_orgrelation"); + //甲方 + DynamicObject qeug_recon_developer = BusinessDataServiceHelper.loadSingle("qeug_recon_developer", + new QFilter[]{new QFilter("number", QCP.equals, qeug_recon_orgrelation.getString("qeug_companynumber"))}); + if (null != qeug_recon_developer) { + this.getView().getModel().setValue("multitypepartya",qeug_recon_developer);//甲方 } } } + DynamicObject bidproject = (DynamicObject)this.getView().getModel().getValue("bidproject");//定标名称 + if (null != bidproject) { + DynamicObject bidmode = bidproject.getDynamicObject("bidmode");//采购方式 + if (null != bidmode) { + logger.info("88"); + this.getView().getModel().setValue("qeug_bidmode",bidmode); + } + } +// DynamicObject bdTaxrate =(DynamicObject) this.getView().getModel().getValue("bd_taxrate");//税率 +// if (null == bdTaxrate) { +// this.getView().getModel().setValue("bd_taxrate",null);//税率 +// this.getView().getModel().setValue("taxrate", BigDecimal.ZERO);//税率(%) +// this.getView().getModel().setValue("tax",BigDecimal.ZERO);//税额 +//// this.getView().getModel().setValue("notaxamt",null);//不含税金额 +// } } diff --git a/main/java/shkd/todotask/closeTaskPagePlugin.java b/main/java/shkd/todotask/closeTaskPagePlugin.java index 5435766..258ac56 100644 --- a/main/java/shkd/todotask/closeTaskPagePlugin.java +++ b/main/java/shkd/todotask/closeTaskPagePlugin.java @@ -16,6 +16,7 @@ import java.util.Map; */ public class closeTaskPagePlugin implements IApprovalSubPlugin { private static final Log logger = LogFactory.getLog(closeTaskPagePlugin.class); + @Override public boolean executeClosePageAfterSubmitTask(boolean isPCShow, Map customParams) { logger.info("进入页面关闭方法"); @@ -26,20 +27,21 @@ public class closeTaskPagePlugin implements IApprovalSubPlugin { if (parameter.getCustomParams().containsKey("apptype")) { String apptype = parameter.getCustomParam("apptype"); if ("zhiyuan".equals(apptype)) { - if (isPCShow){ - try { - view.close(); - }catch (Exception e) { - logger.info("发送指令时异常" + e.getMessage()); - throw new RuntimeException(e); - } - flag = true; - }else { - HashMap map = new HashMap<>(); + if (isPCShow) { + try { + view.close(); + } catch (Exception e) { + logger.info("发送指令时异常" + e.getMessage()); + throw new RuntimeException(e); + } + flag = true; + } else { + HashMap map = new HashMap<>(); map.put("method", "closeWebView"); String mapString = JSON.toJSONString(map); logger.info("准备发送指令" + mapString); view.executeClientCommand("callAPPApi", map); + flag = true; } } }