Compare commits

..

No commits in common. "fb58b6ea972c049b059c20c94e06f0e616f9d628" and "0d2428c35eb63b8a178a1def4554255df5d255ea" have entirely different histories.

2 changed files with 3 additions and 73 deletions

View File

@ -1,68 +0,0 @@
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,11 +53,9 @@ public class MaterialInAmountToItemEntryWorkFlowPlugin implements IWorkflowPlugi
calAllTypeAmount(outContractSettle);
SaveServiceHelper.save(new DynamicObject[]{outContractSettle});
OperateOption option= OperateOption.create();
// 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.setVariableValue(OperateOptionConst.STRICTVALIDATION, String.valueOf(false));
option.setVariableValue(OperateOptionConst.IGNOREINTERACTION, String.valueOf(true));
option.setVariableValue(OperateOptionConst.IGNOREWARN, 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());