1.付款申请单实付金额根据付款申请单行号过滤反写功能开发
This commit is contained in:
		
							parent
							
								
									ed193c4279
								
							
						
					
					
						commit
						e8108297cf
					
				| 
						 | 
				
			
			@ -7,6 +7,7 @@ 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 kd.bos.servicehelper.BusinessDataServiceHelper;
 | 
			
		||||
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -19,7 +20,10 @@ public class OutContractSettleProcessCheckOp  extends AbstractOperationServicePl
 | 
			
		|||
    public void onPreparePropertys(PreparePropertysEventArgs e) {
 | 
			
		||||
        super.onPreparePropertys(e);
 | 
			
		||||
        e.getFieldKeys().add("itementry");
 | 
			
		||||
        e.getFieldKeys().add("itementry.oftaxamount");
 | 
			
		||||
        e.getFieldKeys().add("zcgj_processallocatentity");
 | 
			
		||||
        e.getFieldKeys().add("contract");
 | 
			
		||||
        //e.getFieldKeys().add("contract.zcgj_pricetype");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
| 
						 | 
				
			
			@ -35,19 +39,27 @@ public class OutContractSettleProcessCheckOp  extends AbstractOperationServicePl
 | 
			
		|||
            ExtendedDataEntity[] extendedDataEntities = this.getDataEntities();
 | 
			
		||||
            for (ExtendedDataEntity extendedDataEntity : extendedDataEntities) {
 | 
			
		||||
                DynamicObject dataEntity = extendedDataEntity.getDataEntity();
 | 
			
		||||
                DynamicObjectCollection itementryCollection = dataEntity.getDynamicObjectCollection("itementry");
 | 
			
		||||
                int i=1;
 | 
			
		||||
                for (DynamicObject itementry : itementryCollection) {
 | 
			
		||||
                    BigDecimal oftaxamount = itementry.getBigDecimal("oftaxamount");
 | 
			
		||||
                    DynamicObjectCollection processallocatentityCollection = itementry.getDynamicObjectCollection("zcgj_processallocatentity");
 | 
			
		||||
                    BigDecimal totalPaAmount = BigDecimal.ZERO;
 | 
			
		||||
                    for (DynamicObject dynamicObject : processallocatentityCollection) {
 | 
			
		||||
                        totalPaAmount = totalPaAmount.add(dynamicObject.getBigDecimal("zcgj_pa_amount"));
 | 
			
		||||
                DynamicObject contract = dataEntity.getDynamicObject("contract");
 | 
			
		||||
                if (contract != null) {
 | 
			
		||||
                    DynamicObject contractObj = BusinessDataServiceHelper.loadSingle(contract.getLong("id"), "ec_out_contract", "zcgj_pricetype");
 | 
			
		||||
                    //不定量不定价合同和总价包干合同,zjbg,bdlbdj
 | 
			
		||||
                    if (contractObj.getString("zcgj_pricetype").equals("zjbg")
 | 
			
		||||
                            || contractObj.getString("zcgj_pricetype").equals("bdlbdj")) {
 | 
			
		||||
                        DynamicObjectCollection itementryCollection = dataEntity.getDynamicObjectCollection("itementry");
 | 
			
		||||
                        int i=1;
 | 
			
		||||
                        for (DynamicObject itementry : itementryCollection) {
 | 
			
		||||
                            BigDecimal oftaxamount = itementry.getBigDecimal("oftaxamount");
 | 
			
		||||
                            DynamicObjectCollection processallocatentityCollection = itementry.getDynamicObjectCollection("zcgj_processallocatentity");
 | 
			
		||||
                            BigDecimal totalPaAmount = BigDecimal.ZERO;
 | 
			
		||||
                            for (DynamicObject dynamicObject : processallocatentityCollection) {
 | 
			
		||||
                                totalPaAmount = totalPaAmount.add(dynamicObject.getBigDecimal("zcgj_pa_amount"));
 | 
			
		||||
                            }
 | 
			
		||||
                            if(totalPaAmount.compareTo(oftaxamount)!=0){
 | 
			
		||||
                                this.addFatalErrorMessage(extendedDataEntity, "合同支付项第"+i+"条,价税合计金额与工序分摊金额不一致,请重新核对并调整分摊金额,以确保两者相等。");
 | 
			
		||||
                            }
 | 
			
		||||
                            i++;
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    if(totalPaAmount.compareTo(oftaxamount)!=0){
 | 
			
		||||
                        this.addFatalErrorMessage(extendedDataEntity, "合同支付项第"+i+"条,价税合计金额与工序分摊金额不一致,请重新核对并调整分摊金额,以确保两者相等。");
 | 
			
		||||
                    }
 | 
			
		||||
                    i++;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue