parent
23ffc1857c
commit
80b83942c4
|
@ -8,9 +8,12 @@ import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
||||||
import kd.bos.entity.validate.AbstractValidator;
|
import kd.bos.entity.validate.AbstractValidator;
|
||||||
import kd.bos.logging.Log;
|
import kd.bos.logging.Log;
|
||||||
import kd.bos.logging.LogFactory;
|
import kd.bos.logging.LogFactory;
|
||||||
|
import kd.bos.orm.query.QCP;
|
||||||
|
import kd.bos.orm.query.QFilter;
|
||||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
|
||||||
public class ContractOPPlugin extends AbstractOperationServicePlugIn {
|
public class ContractOPPlugin extends AbstractOperationServicePlugIn {
|
||||||
private static final Log logger = LogFactory.getLog(ContractOPPlugin.class);
|
private static final Log logger = LogFactory.getLog(ContractOPPlugin.class);
|
||||||
|
@ -61,9 +64,28 @@ public class ContractOPPlugin extends AbstractOperationServicePlugIn {
|
||||||
}
|
}
|
||||||
BigDecimal amount = dataEntity.getBigDecimal("amount");//合同金额
|
BigDecimal amount = dataEntity.getBigDecimal("amount");//合同金额
|
||||||
// 检查 qeug_amounts 是否大于 amount
|
// 检查 qeug_amounts 是否大于 amount
|
||||||
if (qeug_amounts.compareTo(amount) > 0) {
|
if (qeug_amounts.setScale(2, RoundingMode.HALF_UP).compareTo(amount) > 0) {
|
||||||
this.addErrorMessage(extendedDataEntity, "合同清单(定额)的金额之和不能大于合同金额");
|
this.addErrorMessage(extendedDataEntity, "合同清单(定额)的金额之和不能大于合同金额");
|
||||||
}
|
}
|
||||||
|
DynamicObjectCollection qeug_orderformentry1 = dataEntity.getDynamicObjectCollection("qeug_orderformentry");
|
||||||
|
int qeug_orderformentry = qeug_orderformentry1==null?0:qeug_orderformentry1.size();
|
||||||
|
DynamicObjectCollection qeug_invoiceentryinfo1 = dataEntity.getDynamicObjectCollection("qeug_invoiceentryinfo");
|
||||||
|
int qeug_invoiceentryinfo = qeug_invoiceentryinfo1==null?0:qeug_invoiceentryinfo1.size();
|
||||||
|
if(qeug_orderformentry+qeug_invoiceentryinfo<1){
|
||||||
|
this.addErrorMessage(extendedDataEntity, "合同清单不允许为空!");
|
||||||
|
}
|
||||||
|
QFilter qFilter = new QFilter("billno", QCP.equals, dataEntity.getString("billno"));
|
||||||
|
DynamicObject[] load = BusinessDataServiceHelper.load("recon_conpayplan", "contractbill", qFilter.toArray());
|
||||||
|
if (load.length!=0) {
|
||||||
|
Object pkValue = load[0].getPkValue();
|
||||||
|
DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(pkValue, "recon_conpayplan");
|
||||||
|
DynamicObjectCollection conpayplanschedule = dynamicObject.getDynamicObjectCollection("conpayplanschedule");
|
||||||
|
if(conpayplanschedule==null||conpayplanschedule.size()<1){
|
||||||
|
this.addErrorMessage(extendedDataEntity, "付款计划不能为空,若已存在付款计划,请先保存");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.addErrorMessage(extendedDataEntity, "付款计划不能为空,若已存在付款计划,请先保存");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "qeug_attatchment":
|
case "qeug_attatchment":
|
||||||
|
|
Loading…
Reference in New Issue