合同提交校验合同清单金额与合同金额的差
This commit is contained in:
		
							parent
							
								
									8b2d6bbc4c
								
							
						
					
					
						commit
						4e78f4c85b
					
				| 
						 | 
				
			
			@ -49,27 +49,36 @@ public class ContractOPPlugin extends AbstractOperationServicePlugIn {
 | 
			
		|||
                            }
 | 
			
		||||
                            //合同清单(定额)
 | 
			
		||||
                            DynamicObjectCollection invoiceentryinfos;
 | 
			
		||||
                            BigDecimal qeug_amounts = BigDecimal.ZERO;//金额(元)_合计
 | 
			
		||||
                            //合同清单(定额)
 | 
			
		||||
                            DynamicObjectCollection orderformentry;
 | 
			
		||||
                            BigDecimal qeug_taxtotalprices = BigDecimal.ZERO;//金额(元)_合计
 | 
			
		||||
                            boolean isEntry = false;
 | 
			
		||||
                            try {
 | 
			
		||||
                                //合同监控列表点击提交会提示找不到:qeug_invoiceentryinfo属性
 | 
			
		||||
                                invoiceentryinfos = dataEntity.getDynamicObjectCollection("qeug_invoiceentryinfo");
 | 
			
		||||
                                if (!invoiceentryinfos.isEmpty()) {
 | 
			
		||||
                                    for (DynamicObject invoiceentryinfo : invoiceentryinfos) {
 | 
			
		||||
                                        BigDecimal qeug_amount = invoiceentryinfo.getBigDecimal("qeug_amount");
 | 
			
		||||
                                    }
 | 
			
		||||
                                }
 | 
			
		||||
                                //合同监控列表点击提交会提示找不到:qeug_orderformentry属性
 | 
			
		||||
                                orderformentry = dataEntity.getDynamicObjectCollection("qeug_orderformentry");
 | 
			
		||||
                            }catch (Exception e){
 | 
			
		||||
                                dataEntity = BusinessDataServiceHelper.loadSingle(dataEntity.getPkValue(),"recon_contractbill");
 | 
			
		||||
                                invoiceentryinfos = dataEntity.getDynamicObjectCollection("qeug_invoiceentryinfo");
 | 
			
		||||
                                orderformentry = dataEntity.getDynamicObjectCollection("qeug_orderformentry");
 | 
			
		||||
                            }
 | 
			
		||||
                            BigDecimal qeug_amounts = BigDecimal.ZERO;//金额(元)_合计
 | 
			
		||||
                            if (!invoiceentryinfos.isEmpty()) {
 | 
			
		||||
                                isEntry = true;
 | 
			
		||||
                                for (DynamicObject invoiceentryinfo : invoiceentryinfos) {
 | 
			
		||||
                                    qeug_amounts = qeug_amounts.add(invoiceentryinfo.getBigDecimal("qeug_amount"));
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            if (!orderformentry.isEmpty()) {
 | 
			
		||||
                                isEntry = true;
 | 
			
		||||
                                for (DynamicObject orderform : orderformentry) {
 | 
			
		||||
                                    qeug_taxtotalprices = qeug_taxtotalprices.add(orderform.getBigDecimal("qeug_taxtotalprice"));
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            BigDecimal amount = dataEntity.getBigDecimal("amount");//合同金额
 | 
			
		||||
                            // 检查 qeug_amounts 是否大于 amount
 | 
			
		||||
                            if (qeug_amounts.setScale(2, RoundingMode.HALF_UP).compareTo(amount) > 0) {
 | 
			
		||||
                            if (isEntry&&qeug_amounts.add(qeug_taxtotalprices).setScale(2, RoundingMode.HALF_UP).compareTo(amount) < 0) {
 | 
			
		||||
                                this.addErrorMessage(extendedDataEntity, "合同清单(定额)的金额之和不能大于合同金额");
 | 
			
		||||
                            }
 | 
			
		||||
//                            DynamicObjectCollection qeug_orderformentry1 = dataEntity.getDynamicObjectCollection("qeug_orderformentry");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue