支出合同结算单提交校验插件添加
This commit is contained in:
parent
3aafce3628
commit
2abc2d0a9b
|
|
@ -585,6 +585,8 @@ public class OutContractSettleEditPluginExt extends AbstractBillPlugIn implement
|
||||||
boolean issettlebymatin = (boolean) this.getModel().getValue("issettlebymatin");//按入库单结算
|
boolean issettlebymatin = (boolean) this.getModel().getValue("issettlebymatin");//按入库单结算
|
||||||
boolean zcgj_transset = (boolean) changeData.getNewValue();//按入库运费结算新值
|
boolean zcgj_transset = (boolean) changeData.getNewValue();//按入库运费结算新值
|
||||||
if (!issettlebymatin && !zcgj_transset) {
|
if (!issettlebymatin && !zcgj_transset) {
|
||||||
|
int rowCount = this.getModel().getEntryRowCount("itementry");//合同支付项分录总行数
|
||||||
|
if (rowCount > 1) {
|
||||||
DynamicObject transSettleItem1 = this.getModel().getEntryRowEntity("itementry", 1);
|
DynamicObject transSettleItem1 = this.getModel().getEntryRowEntity("itementry", 1);
|
||||||
DynamicObject payItem1 = transSettleItem1.getDynamicObject("payitem");//合同支付项-名称
|
DynamicObject payItem1 = transSettleItem1.getDynamicObject("payitem");//合同支付项-名称
|
||||||
boolean hasSettleTrans1 = "YFJS".equals(payItem1.getString("number"));
|
boolean hasSettleTrans1 = "YFJS".equals(payItem1.getString("number"));
|
||||||
|
|
@ -595,6 +597,7 @@ public class OutContractSettleEditPluginExt extends AbstractBillPlugIn implement
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.autoFetch();
|
this.autoFetch();
|
||||||
this.sumMaterialInAmountToItemEntry();
|
this.sumMaterialInAmountToItemEntry();
|
||||||
SettleUpdateAmtUtils.calAllTypeAmount(this.getModel());
|
SettleUpdateAmtUtils.calAllTypeAmount(this.getModel());
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
package zcgj.zcdev.zcdev.pr.plugin.operate;
|
||||||
|
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||||
|
import kd.bos.entity.ExtendedDataEntity;
|
||||||
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||||
|
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
||||||
|
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
||||||
|
import kd.bos.entity.validate.AbstractValidator;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支出合同结算单提交校验插件
|
||||||
|
*/
|
||||||
|
public class OutContractValidatorSubOp extends AbstractOperationServicePlugIn {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPreparePropertys(PreparePropertysEventArgs e) {
|
||||||
|
super.onPreparePropertys(e);
|
||||||
|
e.getFieldKeys().add("iseqsettle");//按设备费用结算单结算
|
||||||
|
e.getFieldKeys().add("eqsettleentry");//设备费用结算分录
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAddValidators(AddValidatorsEventArgs e) {
|
||||||
|
super.onAddValidators(e);
|
||||||
|
e.getValidators().add(new ValidatorExt());
|
||||||
|
}
|
||||||
|
|
||||||
|
class ValidatorExt extends AbstractValidator {
|
||||||
|
@Override
|
||||||
|
public void validate() {
|
||||||
|
ExtendedDataEntity[] extendedDataEntities = this.getDataEntities();
|
||||||
|
for (ExtendedDataEntity extendedDataEntity : extendedDataEntities) {
|
||||||
|
DynamicObject dataEntity = extendedDataEntity.getDataEntity();
|
||||||
|
boolean isEqSettle = dataEntity.getBoolean("iseqsettle");//按设备费用结算单结算
|
||||||
|
DynamicObjectCollection eqSettleEntryCollection = dataEntity.getDynamicObjectCollection("eqsettleentry");//设备费用结算分录
|
||||||
|
if (isEqSettle && eqSettleEntryCollection.size() == 0) {
|
||||||
|
this.addFatalErrorMessage(extendedDataEntity, "设备维保类合同,按设备费用结算单结算为是,设备费用结算单明细必填!!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue