diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/backlogTack/ToDoResendTack.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/backlogTack/ToDoResendTack.java index b16896b..0656324 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/backlogTack/ToDoResendTack.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/backlogTack/ToDoResendTack.java @@ -189,7 +189,7 @@ public class ToDoResendTack extends AbstractTask { switch (t_status) { case "0": //标题 - String title = "请处理" + next.getString("fstartname") + "提交的" + next.getString("fentityname"); + String title = next.getString("fsubject"); //PC地址 String pcUrl = GetUrlUtils.getInstance().getPcUrl(next.getString("fprocessingpage"), next.getString("fprocessingmobilepage"), diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/servicehandler/BacklogServiceHandle.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/servicehandler/BacklogServiceHandle.java index 5dc1392..04dca3f 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/servicehandler/BacklogServiceHandle.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/servicehandler/BacklogServiceHandle.java @@ -163,7 +163,7 @@ public class BacklogServiceHandle extends AbstractServiceHandler { List userIds = todoInfo.getUserIds(); DynamicObjectCollection query = QueryServiceHelper.query("bos_user", "id,name,number" + ",phone,username", new QFilter[]{new QFilter("id", "in", userIds)}); - DynamicObject dynamicObject = QueryServiceHelper.queryOne("wf_hitaskinst", "billno,startname,id,name", + DynamicObject dynamicObject = QueryServiceHelper.queryOne("wf_hitaskinst", "billno,startname,subject,id,name", new QFilter[]{new QFilter("id", "=", todoInfo.getTaskId())}); logger.info("####待办taskid:" + todoInfo.getTaskId()); for (DynamicObject query_one : query) { @@ -180,7 +180,7 @@ public class BacklogServiceHandle extends AbstractServiceHandler { // BacklogMessage backlogMessage = new BacklogMessage(); form.append("{"); form.append("\"title\":"); - form.append("\"").append(todoInfo.getTitle()).append("\","); + form.append("\"").append(dynamicObject.getString("subject")).append("\","); form.append("\"bName\":"); form.append("\"").append("司库").append("\","); form.append("\"bussinessCode\":"); @@ -257,7 +257,7 @@ public class BacklogServiceHandle extends AbstractServiceHandler { List userIds = todoInfo.getUserIds(); DynamicObjectCollection query = QueryServiceHelper.query("bos_user", "id,name,number" + ",phone,username", new QFilter[]{new QFilter("id", "in", userIds)}); - DynamicObject dynamicObject = QueryServiceHelper.queryOne("wf_hitaskinst", "billno,startname,id,name", + DynamicObject dynamicObject = QueryServiceHelper.queryOne("wf_hitaskinst", "billno,subject,startname,id,name", new QFilter[]{new QFilter("id", "=", todoInfo.getTaskId())}); logger.info("####待办taskid:" + todoInfo.getTaskId()); for (DynamicObject query_one : query) { @@ -274,7 +274,7 @@ public class BacklogServiceHandle extends AbstractServiceHandler { // BacklogMessage backlogMessage = new BacklogMessage(); form.append("{"); form.append("\"title\":"); - form.append("\"").append(todoInfo.getTitle()).append("\","); + form.append("\"").append(dynamicObject.getString("subject")).append("\","); form.append("\"bName\":"); form.append("\"").append("司库").append("\","); form.append("\"bussinessCode\":"); diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/BdimbondBuildEntryPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/BdimbondBuildEntryPlugin.java index c6f904e..6354d35 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/BdimbondBuildEntryPlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/BdimbondBuildEntryPlugin.java @@ -31,6 +31,20 @@ public class BdimbondBuildEntryPlugin extends AbstractFormPlugin implements Plug @Override public void afterBindData(EventObject e) { this.getView().setVisible(false, "shkd_bondissue","shkd_bankcontract"); + DynamicObjectCollection loanuse = (DynamicObjectCollection )this.getModel().getValue("shkd_loanuse"); + if (loanuse != null){ + for (DynamicObject dObj : loanuse) { + DynamicObject shkdLoanuse = (DynamicObject)dObj.getDynamicObject("fbasedataid"); + + if("0001".equals(shkdLoanuse.get("number"))) { + this.getView().setVisible(true, "shkd_bondissue"); + } + + if("0002".equals(shkdLoanuse.get("number"))) { + this.getView().setVisible(true, "shkd_bankcontract"); + } + } + } //前端去掉星号,前端不一定会校验 DecimalEdit attch= (DecimalEdit)this.getControl("e_underwriteratio"); AmountEdit attch2= (AmountEdit)this.getControl("e_underwriteamount"); diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/BondSelectEntryOrgPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/BondSelectEntryOrgPlugin.java index 00af45d..46beab9 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/BondSelectEntryOrgPlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/BondSelectEntryOrgPlugin.java @@ -15,10 +15,7 @@ import kd.bos.servicehelper.org.OrgUnitServiceHelper; import kd.bos.servicehelper.org.OrgViewType; import kd.sdk.plugin.Plugin; -import java.util.ArrayList; -import java.util.Collections; -import java.util.EventObject; -import java.util.List; +import java.util.*; /** * 债券发行/发行计划单据 债券发行,银行借款合同分录 选择F7时过滤 @@ -30,8 +27,8 @@ public class BondSelectEntryOrgPlugin extends AbstractBillPlugIn implements Plug //债券发行编码 RefBillEdit edit = this.getView().getControl("shkd_entrybillno"); edit.addBeforeF7SelectListener(this); - //借款合同单据编码 - RefBillEdit edit2 = this.getView().getControl("shkd_entrycontractnum"); + //提款单编号 + RefBillEdit edit2 = this.getView().getControl("shkd_loanbill"); edit2.addBeforeF7SelectListener(this); //借款人 OrgEdit edit3 = this.getView().getControl("shkd_enryborrower"); @@ -53,15 +50,24 @@ public class BondSelectEntryOrgPlugin extends AbstractBillPlugIn implements Plug IDataEntityProperty property = evt.getProperty(); String name = property.getName(); List dataFilter = new ArrayList<>(); - if("shkd_entrycontractnum".equals(name)){ + if("shkd_loanbill".equals(name)){ DynamicObject shkdEnryborrower = (DynamicObject)this.getView().getModel().getValue("shkd_enryborrower"); if(shkdEnryborrower == null){ this.getView().showTipNotification("请先选择借款人。"); evt.setCancel(true); return; } + Date startdate = (Date)this.getView().getModel().getValue("startdate"); + if(startdate == null){ + startdate = (Date)this.getView().getModel().getValue("bizdate"); + } QFilter accountQFilter = new QFilter("org.id", QCP.equals, shkdEnryborrower.getPkValue()); - dataFilter.add(accountQFilter); + //发行日期 >= 提款单放款日期 + QFilter accountQFilter2 = new QFilter("bizdate", QCP.less_equals, startdate); + //只能选择 已提款 和 已部分还款 的单据 + List temps = Arrays.asList("drawed","partpayment"); + QFilter accountQFilter3 = new QFilter("drawtype", QCP.in, temps); + dataFilter.add(accountQFilter.and(accountQFilter2).and(accountQFilter3)); } if("shkd_entrybillno".equals(name)){ QFilter accountQFilter = new QFilter("org.id", QCP.equals, orgId); diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/LoancontractF7Plugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/LoancontractF7Plugin.java index 4fde0c3..a4d2c01 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/LoancontractF7Plugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/LoancontractF7Plugin.java @@ -100,12 +100,12 @@ public class LoancontractF7Plugin extends AbstractBillPlugIn implements Plugin, return; } //结束日期 - Date enddate = (Date)this.getModel().getValue("enddate"); - if(enddate == null){ - this.getView().showTipNotification("请先选择结束日期。"); - evt.setCancel(true); - return; - } +// Date enddate = (Date)this.getModel().getValue("enddate"); +// if(enddate == null){ +// this.getView().showTipNotification("请先选择结束日期。"); +// evt.setCancel(true); +// return; +// } //发行人 DynamicObject org = (DynamicObject)this.getModel().getValue("org"); if(org == null){ @@ -124,7 +124,8 @@ public class LoancontractF7Plugin extends AbstractBillPlugIn implements Plugin, dataFilter.add(accountQFilter2); //发行日期与结束日期要在注册额度的生效日期和失效日期之间 - QFilter accountQFilter3 = new QFilter("expirydate", QCP.large_equals,enddate).and(new QFilter("effectdate", QCP.less_equals,startdate)); + //FIXME:逻辑修改,只需要发行日期在注册额度的生效日期和失效日期之间 + QFilter accountQFilter3 = new QFilter("expirydate", QCP.large_equals,startdate).and(new QFilter("effectdate", QCP.less_equals,startdate)); dataFilter.add(accountQFilter3); diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/inputBondEntryDataPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/inputBondEntryDataPlugin.java index 97debb2..98b56af 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/inputBondEntryDataPlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/tmc/inputBondEntryDataPlugin.java @@ -2,6 +2,10 @@ package shkd.sys.sys.plugin.tmc; import kd.bos.bill.AbstractBillPlugIn; import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.datamodel.IDataModel; +import kd.bos.entity.datamodel.RowDataEntity; +import kd.bos.entity.datamodel.events.AfterAddRowEventArgs; import kd.bos.entity.datamodel.events.PropertyChangedArgs; import kd.bos.form.plugin.AbstractFormPlugin; import kd.bos.servicehelper.BusinessDataServiceHelper; @@ -15,31 +19,138 @@ public class inputBondEntryDataPlugin extends AbstractBillPlugIn implements Plug public void propertyChanged(PropertyChangedArgs e) { String name = e.getProperty().getName(); int rowIndex = e.getChangeSet()[0].getRowIndex(); - if("shkd_entrybillno".equals(name)) { - DynamicObject shkdEntrybillno = (DynamicObject) this.getView().getModel().getValue("shkd_entrybillno"); - DynamicObject cfm_loanbill_bond = BusinessDataServiceHelper.loadSingle(shkdEntrybillno.get("id"), "cfm_loanbill_bond"); - //债券发行人 - this.getModel().setValue("shkd_entryorg", cfm_loanbill_bond.get("org"),rowIndex); - //发行总额 - this.getModel().setValue("shkd_entrytotalmount", cfm_loanbill_bond.get("amount"),rowIndex); - //发行金额 - this.getModel().setValue("shkd_entryamount", cfm_loanbill_bond.get("drawamount"),rowIndex); - //发行日期 - this.getModel().setValue("shkd_entrystartdate", cfm_loanbill_bond.get("bizdate"),rowIndex); - //到期日期 - this.getModel().setValue("shkd_entryexpiredate", cfm_loanbill_bond.get("expiredate"),rowIndex); - + if ("shkd_entrybillno".equals(name)) { + DynamicObjectCollection shkdBankcontractEntry = this.getModel().getEntryEntity("shkd_bondissue_entry"); + DynamicObject temp = shkdBankcontractEntry.get(rowIndex); + DynamicObject cfm_loanbill_bond = temp.getDynamicObject("shkd_entrybillno"); + if (cfm_loanbill_bond == null) { + //债券简码 + this.getModel().setValue("shkd_shortname", null, rowIndex); + //债券发行人 + this.getModel().setValue("shkd_entryorg", null, rowIndex); + //起息日期 + this.getModel().setValue("shkd_startintdate", null, rowIndex); + //到期日期 + this.getModel().setValue("shkd_entryexpiredate",null, rowIndex); + //发行金额 + this.getModel().setValue("shkd_entryamount", null, rowIndex); + //发行利率 + this.getModel().setValue("shkd_startloanrate", null, rowIndex); + //融资余额 + this.getModel().setValue("shkd_notrepayamount", null, rowIndex); + } else { + DynamicObject cfm_loancontractbill = BusinessDataServiceHelper.loadSingle(cfm_loanbill_bond.get("id"), "cfm_loanbill_bond"); + //借款人 + this.getModel().setValue("shkd_enryborrower", cfm_loancontractbill.get("org"), rowIndex); + //贷款人 + this.getModel().setValue("shkd_textcreditor", cfm_loancontractbill.get("textcreditor"), rowIndex); + //起息日期 + this.getModel().setValue("shkd_startintdate1", cfm_loancontractbill.get("startintdate"), rowIndex); + //到期日期 + this.getModel().setValue("shkd_entryexpiredate1", cfm_loancontractbill.get("expiredate"), rowIndex); + //提款金额 + this.getModel().setValue("shkd_drawamount", cfm_loancontractbill.get("drawamount"), rowIndex); + //融资利率 + this.getModel().setValue("shkd_startloanrate1", cfm_loancontractbill.get("startloanrate"), rowIndex); + //融资余额 + this.getModel().setValue("shkd_notrepayamount1", cfm_loancontractbill.get("notrepayamount"), rowIndex); + } } - if("shkd_entrycontractnum".equals(name)) { - DynamicObject shkd_entrycontractnum = (DynamicObject) this.getView().getModel().getValue("shkd_entrycontractnum"); - DynamicObject cfm_loancontractbill = BusinessDataServiceHelper.loadSingle(shkd_entrycontractnum.get("id"), "cfm_loancontractbill"); - //借款金额 - this.getModel().setValue("shkd_borrowamount", cfm_loancontractbill.get("amount"),rowIndex); - //合同开始日期 - this.getModel().setValue("shkd_contractstartdate", cfm_loancontractbill.get("startdate"),rowIndex); - //合同结束日期 - this.getModel().setValue("shkd_contractenddate", cfm_loancontractbill.get("enddate"),rowIndex); + if ("shkd_loanbill".equals(name)) { + DynamicObjectCollection shkdBankcontractEntry = this.getModel().getEntryEntity("shkd_bankcontract_entry"); + DynamicObject temp = shkdBankcontractEntry.get(rowIndex); + DynamicObject shkdLoanbill = temp.getDynamicObject("shkd_loanbill"); + if (shkdLoanbill == null) { + //债券简码 + this.getModel().setValue("shkd_shortname", null, rowIndex); + //债券发行人 + this.getModel().setValue("shkd_entryorg", null, rowIndex); + //起息日期 + this.getModel().setValue("shkd_startintdate", null, rowIndex); + //到期日期 + this.getModel().setValue("shkd_entryexpiredate", null, rowIndex); + //发行金额 + this.getModel().setValue("shkd_entryamount", null, rowIndex); + //发行利率 + this.getModel().setValue("shkd_startloanrate", null, rowIndex); + //融资余额 + this.getModel().setValue("shkd_notrepayamount", null, rowIndex); + } else { + DynamicObject cfm_loanbill_bond = BusinessDataServiceHelper.loadSingle(shkdLoanbill.get("id"), "cfm_loanbill_bond"); + //债券简码 + this.getModel().setValue("shkd_shortname", cfm_loanbill_bond.get("shortname"), rowIndex); + //债券发行人 + this.getModel().setValue("shkd_entryorg", cfm_loanbill_bond.get("org"), rowIndex); + //起息日期 + this.getModel().setValue("shkd_startintdate", cfm_loanbill_bond.get("startintdate"), rowIndex); + //到期日期 + this.getModel().setValue("shkd_entryexpiredate", cfm_loanbill_bond.get("expiredate"), rowIndex); + //发行金额 + this.getModel().setValue("shkd_entryamount", cfm_loanbill_bond.get("drawamount"), rowIndex); + //发行利率 + this.getModel().setValue("shkd_startloanrate", cfm_loanbill_bond.get("startloanrate"), rowIndex); + //融资余额 + this.getModel().setValue("shkd_notrepayamount", cfm_loanbill_bond.get("notrepayamount"), rowIndex); + } } + } + @Override + public void afterAddRow(AfterAddRowEventArgs e) { + String name = e.getEntryProp().getName(); + if ("shkd_bondissue_entry".equals(name)) { + RowDataEntity[] rowDataEntities = e.getRowDataEntities(); + for (RowDataEntity rowDataEntity : rowDataEntities) { + int rowIndex = rowDataEntity.getRowIndex(); + DynamicObject entry = rowDataEntity.getDataEntity(); + + DynamicObject entrybillno = entry.getDynamicObject("shkd_entrybillno"); + if (entrybillno != null) { + this.getModel(); + DynamicObject cfm_loanbill_bond = BusinessDataServiceHelper.loadSingle(entrybillno.getPkValue(), "cfm_loanbill_bond"); + //债券简码 + this.getModel().setValue("shkd_shortname", cfm_loanbill_bond.get("shortname"), rowIndex); + //债券发行人 + this.getModel().setValue("shkd_entryorg", cfm_loanbill_bond.get("org"), rowIndex); + //起息日期 + this.getModel().setValue("shkd_startintdate", cfm_loanbill_bond.get("startintdate"), rowIndex); + //到期日期 + this.getModel().setValue("shkd_entryexpiredate", cfm_loanbill_bond.get("expiredate"), rowIndex); + //发行金额 + this.getModel().setValue("shkd_entryamount", cfm_loanbill_bond.get("drawamount"), rowIndex); + //发行利率 + this.getModel().setValue("shkd_startloanrate", cfm_loanbill_bond.get("startloanrate"), rowIndex); + //融资余额 + this.getModel().setValue("shkd_notrepayamount", cfm_loanbill_bond.get("notrepayamount"), rowIndex); + } + } + } + if ("shkd_bankcontract_entry".equals(name)) { + RowDataEntity[] rowDataEntities = e.getRowDataEntities(); + for (RowDataEntity rowDataEntity : rowDataEntities) { + int rowIndex = rowDataEntity.getRowIndex(); + DynamicObject entry = rowDataEntity.getDataEntity(); + + DynamicObject loanBill = entry.getDynamicObject("shkd_loanbill"); + if (loanBill != null) { + IDataModel model = this.getModel(); + DynamicObject cfm_loancontractbill = BusinessDataServiceHelper.loadSingle(loanBill.getPkValue(), "cfm_loanbill"); + //借款人 + model.setValue("shkd_enryborrower", cfm_loancontractbill.get("org"), rowIndex); + //贷款人 + model.setValue("shkd_textcreditor", cfm_loancontractbill.get("textcreditor"), rowIndex); + //起息日期 + model.setValue("shkd_startintdate1", cfm_loancontractbill.get("startintdate"), rowIndex); + //到期日期 + model.setValue("shkd_entryexpiredate1", cfm_loancontractbill.get("expiredate"), rowIndex); + //提款金额 + model.setValue("shkd_drawamount", cfm_loancontractbill.get("drawamount"), rowIndex); + //融资利率 + model.setValue("shkd_startloanrate1", cfm_loancontractbill.get("startloanrate"), rowIndex); + //融资余额 + model.setValue("shkd_notrepayamount1", cfm_loancontractbill.get("notrepayamount"), rowIndex); + } + } + } } } \ No newline at end of file