优化代码 提交校验
This commit is contained in:
parent
e04585a124
commit
5af47982cd
|
@ -26,13 +26,9 @@ public class InContractSettlementValidator extends InContractSettleValidator {
|
|||
if (contractTemp == null) {
|
||||
return;
|
||||
}
|
||||
long id = dataEntity.getDataEntity().getLong("id");
|
||||
QFilter f1 = new QFilter("id", "=", id);
|
||||
DynamicObject incontractsettle = BusinessDataServiceHelper.loadSingle("ec_in_contract_settle", new QFilter[]{f1});
|
||||
if(incontractsettle!=null){
|
||||
DynamicObjectCollection itementry = incontractsettle.getDynamicObjectCollection("itementry");
|
||||
if(itementry == null) {
|
||||
if(itementry.isEmpty()) {
|
||||
DynamicObjectCollection itementry = dataEntity.getDataEntity().getDynamicObjectCollection("itementry");
|
||||
if (itementry != null) {
|
||||
if (itementry.size() == 0) {
|
||||
this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项不能为空", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0]));
|
||||
}
|
||||
DynamicObject contract = BusinessDataServiceHelper.loadSingle(dataEntity.getDataEntity().getDynamicObject("contract").getPkValue(), "ec_in_contract");
|
||||
|
@ -46,7 +42,6 @@ public class InContractSettlementValidator extends InContractSettleValidator {
|
|||
validateAmount = !StringUtils.equals("09", contractAttr.getString("basictype"));
|
||||
}
|
||||
}
|
||||
}
|
||||
// DynamicObjectCollection payitemdetailap = incontractsettle.getDynamicObjectCollection("payitemdetailap");
|
||||
// if (validateAmount && settleOfTaxAmount.compareTo(totalOfTaxAmount.subtract(totalSettleOfTaxAmount)) > 0) {
|
||||
// this.addErrorMessage(dataEntity, ResManager.loadKDString("本期结算价税合计不能大于合同剩余金额价税合计", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0]));
|
||||
|
|
|
@ -17,12 +17,8 @@ public class OutContractSettlementValidator extends OutContractSettleValidator {
|
|||
{
|
||||
BigDecimal settleOfTaxAmount = dataEntity.getDataEntity().getBigDecimal("settleoftaxamount");
|
||||
DynamicObject contractTemp = dataEntity.getDataEntity().getDynamicObject("contract");
|
||||
long id = dataEntity.getDataEntity().getLong("id");
|
||||
QFilter f1 = new QFilter("id", "=", id);
|
||||
DynamicObject incontractsettle = BusinessDataServiceHelper.loadSingle("ec_in_contract_settle", new QFilter[]{f1});
|
||||
if(incontractsettle!=null){
|
||||
DynamicObjectCollection itementry = incontractsettle.getDynamicObjectCollection("itementry");
|
||||
// DynamicObjectCollection payitemdetailap = incontractsettle.getDynamicObjectCollection("payitemdetailap");
|
||||
|
||||
DynamicObjectCollection itementry = dataEntity.getDataEntity().getDynamicObjectCollection("itementry");
|
||||
if(itementry.isEmpty()) {
|
||||
this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项不能为空", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0]));
|
||||
}
|
||||
|
@ -49,8 +45,5 @@ public class OutContractSettlementValidator extends OutContractSettleValidator {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue