提交人:刘森澳

日期:2025/5/09 10:58
内容:1、资金用途分录调整
This commit is contained in:
16358 2025-05-09 10:58:43 +08:00
parent ae665f29dc
commit 51342a465f
1 changed files with 76 additions and 23 deletions

View File

@ -3,6 +3,9 @@ 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;
@ -16,7 +19,7 @@ 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)) {
if ("shkd_entrybillno".equals(name)) {
//FIXME修改值改变方案当前方案不支持多选展示
// DynamicObject shkdEntrybillno = (DynamicObject) this.getView().getModel().getValue("shkd_entrybillno");
// DynamicObject cfm_loanbill_bond = BusinessDataServiceHelper.loadSingle(shkdEntrybillno.get("id"), "cfm_loanbill_bond");
@ -30,29 +33,29 @@ public class inputBondEntryDataPlugin extends AbstractBillPlugIn implements Plug
// this.getModel().setValue("shkd_entrystartdate", cfm_loanbill_bond.get("bizdate"),rowIndex);
// //到期日期
// this.getModel().setValue("shkd_entryexpiredate", cfm_loanbill_bond.get("expiredate"),rowIndex);
DynamicObjectCollection bondissueEntry = (DynamicObjectCollection)this.getView().getModel().getValue("shkd_bondissue_entry");
DynamicObjectCollection bondissueEntry = (DynamicObjectCollection) this.getView().getModel().getValue("shkd_bondissue_entry");
for (int i = 0; i < bondissueEntry.size(); i++) {
//获取每一行的数据反写到每一行
DynamicObject temp = bondissueEntry.get(i);
DynamicObject entrybillno = temp.getDynamicObject("shkd_entrybillno");
DynamicObject cfm_loanbill_bond = BusinessDataServiceHelper.loadSingle(entrybillno.get("id"), "cfm_loanbill_bond");
//债券简码
this.getModel().setValue("shkd_shortname", cfm_loanbill_bond.get("shortname"),i);
this.getModel().setValue("shkd_shortname", cfm_loanbill_bond.get("shortname"), i);
//债券发行人
this.getModel().setValue("shkd_entryorg", cfm_loanbill_bond.get("org"),i);
this.getModel().setValue("shkd_entryorg", cfm_loanbill_bond.get("org"), i);
//起息日期
this.getModel().setValue("shkd_startintdate", cfm_loanbill_bond.get("startintdate"),i);
this.getModel().setValue("shkd_startintdate", cfm_loanbill_bond.get("startintdate"), i);
//到期日期
this.getModel().setValue("shkd_entryexpiredate", cfm_loanbill_bond.get("expiredate"),i);
this.getModel().setValue("shkd_entryexpiredate", cfm_loanbill_bond.get("expiredate"), i);
//发行金额
this.getModel().setValue("shkd_entryamount", cfm_loanbill_bond.get("drawamount"),i);
this.getModel().setValue("shkd_entryamount", cfm_loanbill_bond.get("drawamount"), i);
//发行利率
this.getModel().setValue("shkd_startloanrate", cfm_loanbill_bond.get("startloanrate"),i);
this.getModel().setValue("shkd_startloanrate", cfm_loanbill_bond.get("startloanrate"), i);
//融资余额
this.getModel().setValue("shkd_notrepayamount", cfm_loanbill_bond.get("notrepayamount"),i);
this.getModel().setValue("shkd_notrepayamount", cfm_loanbill_bond.get("notrepayamount"), i);
}
}
if("shkd_entrycontractnum".equals(name)) {
if ("shkd_loanbill".equals(name)) {
//FIXME修改值改变方案当前方案不支持多选展示
// DynamicObject shkd_entrycontractnum = (DynamicObject) this.getView().getModel().getValue("shkd_entrycontractnum");
// DynamicObject cfm_loancontractbill = BusinessDataServiceHelper.loadSingle(shkd_entrycontractnum.get("id"), "cfm_loancontractbill");
@ -63,26 +66,76 @@ public class inputBondEntryDataPlugin extends AbstractBillPlugIn implements Plug
// //合同结束日期
// this.getModel().setValue("shkd_contractenddate", cfm_loancontractbill.get("enddate"),rowIndex);
DynamicObjectCollection shkdBankcontractEntry = (DynamicObjectCollection) this.getView().getModel().getValue("shkd_bankcontract_entry");
for (int i = 0; i < shkdBankcontractEntry.size(); i++) {
//获取每一行的数据反写到每一行
DynamicObject temp = shkdBankcontractEntry.get(i);
DynamicObject shkdLoanbill = temp.getDynamicObject("shkd_loanbill");
DynamicObjectCollection shkdBankcontractEntry = this.getModel().getEntryEntity("shkd_bankcontract_entry");
// for (int i = 0; i < shkdBankcontractEntry.size(); i++) {
//
// }
//获取每一行的数据反写到每一行
DynamicObject temp = shkdBankcontractEntry.get(rowIndex);
DynamicObject shkdLoanbill = temp.getDynamicObject("shkd_loanbill");
if (shkdLoanbill == null) {
//借款人
this.getModel().setValue("shkd_enryborrower", null, rowIndex);
//贷款人
this.getModel().setValue("shkd_textcreditor", null, rowIndex);
//起息日期
this.getModel().setValue("shkd_startintdate1", null, rowIndex);
//到期日期
this.getModel().setValue("shkd_entryexpiredate1", null, rowIndex);
//提款金额
this.getModel().setValue("shkd_drawamount", null, rowIndex);
//融资利率
this.getModel().setValue("shkd_startloanrate1", null, rowIndex);
//融资余额
this.getModel().setValue("shkd_notrepayamount1", null, rowIndex);
} else {
DynamicObject cfm_loancontractbill = BusinessDataServiceHelper.loadSingle(shkdLoanbill.get("id"), "cfm_loanbill");
//借款人
this.getModel().setValue("shkd_enryborrower", cfm_loancontractbill.get("org"), i);
//债权人
this.getModel().setValue("shkd_entryorg", cfm_loancontractbill.get("textcreditor"), i);
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"), i);
this.getModel().setValue("shkd_startintdate1", cfm_loancontractbill.get("startintdate"), rowIndex);
//到期日期
this.getModel().setValue("shkd_entryexpiredate1", cfm_loancontractbill.get("expiredate"), i);
this.getModel().setValue("shkd_entryexpiredate1", cfm_loancontractbill.get("expiredate"), rowIndex);
//提款金额
this.getModel().setValue("shkd_entryamount", cfm_loancontractbill.get("drawamount"), i);
this.getModel().setValue("shkd_drawamount", cfm_loancontractbill.get("drawamount"), rowIndex);
//融资利率
this.getModel().setValue("shkd_startloanrate", cfm_loancontractbill.get("startloanrate"), i);
this.getModel().setValue("shkd_startloanrate1", cfm_loancontractbill.get("startloanrate"), rowIndex);
//融资余额
this.getModel().setValue("shkd_notrepayamount", cfm_loancontractbill.get("notrepayamount"), i);
this.getModel().setValue("shkd_notrepayamount1", cfm_loancontractbill.get("notrepayamount"), rowIndex);
}
}
}
@Override
public void afterAddRow(AfterAddRowEventArgs e) {
String name = e.getEntryProp().getName();
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);
}
}
}
}