Compare commits

...

3 Commits

Author SHA1 Message Date
zhangzhiguo fb58b6ea97 Merge remote-tracking branch 'origin/dev' into dev 2025-09-22 11:08:57 +08:00
zhangzhiguo 3fdbb23b45 银行存款余额调节表插件 2025-09-22 11:08:44 +08:00
zhangzhiguo 372571abb0 入库单计算支出合同结算单支付项目分录金额插件提交权限校验 2025-09-22 11:08:37 +08:00
2 changed files with 73 additions and 3 deletions

View File

@ -0,0 +1,68 @@
package zcgj.zcdev.zcdev.fs.plugin.form;
import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.bill.BillShowParameter;
import kd.bos.bill.OperationStatus;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.entity.datamodel.events.ChangeData;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.sdk.plugin.Plugin;
import java.math.BigDecimal;
import java.util.EventObject;
/**
* 银行存款余额调节表插件
*/
public class BankadjustPlugin extends AbstractBillPlugIn implements Plugin {
@Override
public void afterBindData(EventObject e) {
super.afterBindData(e);
BillShowParameter bsp=(BillShowParameter)this.getView().getFormShowParameter();
if(bsp.getStatus()== OperationStatus.ADDNEW ){
DynamicObjectCollection entryentity = this.getModel().getDataEntity().getDynamicObjectCollection("zcgj_entryentity");
String[] item1Array = new String[]{"银行存款日记账余额","加:银行已收企业未收款","减:银行已付企业未付款","调节后存款余额"};
String[] item2Array = new String[]{"银行对账单余额","加:企业已收银行未收款","减:企业已付银行未付款","调节后存款余额"};
for (int i = 0; i < item1Array.length; i++) {
DynamicObject item = entryentity.addNew();
item.set("zcgj_item1",item1Array[i]);
item.set("zcgj_item2",item2Array[i]);
}
getView().updateView("zcgj_entryentity");
}
this.getView().setEnable(false, 3, "zcgj_amount1","zcgj_amount2");
}
@Override
public void propertyChanged(PropertyChangedArgs e) {
super.propertyChanged(e);
String name = e.getProperty().getName();
ChangeData changeData = e.getChangeSet()[0];
if(name.equals("zcgj_amount1")){
int rowIndex = changeData.getRowIndex();
DynamicObjectCollection entryentity = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_entryentity");
//0+1-2
BigDecimal amount0 = entryentity.get(0).getBigDecimal("zcgj_amount1") == null?BigDecimal.ZERO:entryentity.get(0).getBigDecimal("zcgj_amount1");
BigDecimal amount1 = entryentity.get(1).getBigDecimal("zcgj_amount1") == null?BigDecimal.ZERO:entryentity.get(1).getBigDecimal("zcgj_amount1");
BigDecimal amount2 = entryentity.get(2).getBigDecimal("zcgj_amount1") == null?BigDecimal.ZERO:entryentity.get(2).getBigDecimal("zcgj_amount1");
BigDecimal result = amount0.add(amount1).subtract(amount2);
entryentity.get(3).set("zcgj_amount1",result);
this.getView().updateView("zcgj_entryentity");
}else if(name.equals("zcgj_amount2")){
DynamicObjectCollection entryentity = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_entryentity");
//0+1-2
BigDecimal amount0 = entryentity.get(0).getBigDecimal("zcgj_amount2") == null?BigDecimal.ZERO:entryentity.get(0).getBigDecimal("zcgj_amount2");
BigDecimal amount1 = entryentity.get(1).getBigDecimal("zcgj_amount2") == null?BigDecimal.ZERO:entryentity.get(1).getBigDecimal("zcgj_amount2");
BigDecimal amount2 = entryentity.get(2).getBigDecimal("zcgj_amount2") == null?BigDecimal.ZERO:entryentity.get(2).getBigDecimal("zcgj_amount2");
BigDecimal result = amount0.add(amount1).subtract(amount2);
entryentity.get(3).set("zcgj_amount2",result);
this.getView().updateView("zcgj_entryentity");
}
}
}

View File

@ -53,9 +53,11 @@ public class MaterialInAmountToItemEntryWorkFlowPlugin implements IWorkflowPlugi
calAllTypeAmount(outContractSettle);
SaveServiceHelper.save(new DynamicObject[]{outContractSettle});
OperateOption option= OperateOption.create();
option.setVariableValue(OperateOptionConst.STRICTVALIDATION, String.valueOf(false));
option.setVariableValue(OperateOptionConst.IGNOREINTERACTION, String.valueOf(true));
option.setVariableValue(OperateOptionConst.IGNOREWARN, String.valueOf(true));
// option.setVariableValue("ishasright", "true");//此处是跳过校验权限
// option.setVariableValue(OperateOptionConst.STRICTVALIDATION, String.valueOf(false));
// option.setVariableValue(OperateOptionConst.IGNOREINTERACTION, String.valueOf(true));
// option.setVariableValue(OperateOptionConst.IGNOREWARN, String.valueOf(true));
option.setVariableValue(OperateOptionConst.ISHASRIGHT, String.valueOf(true));//跳过权限校验
//option.add(OperateOptionConst.SKIP_PERMISSION_CHECK);
OperationResult result = OperationServiceHelper.executeOperate("submit", "ec_out_contract_settle", new DynamicObject[]{outContractSettle}, option);
log.info("MaterialInAmountToItemEntryWorkFlowPlugin-result:"+result.toString());