付款会计科目过滤
This commit is contained in:
		
							parent
							
								
									785132b439
								
							
						
					
					
						commit
						6e329bb970
					
				| 
						 | 
				
			
			@ -0,0 +1,44 @@
 | 
			
		|||
package zcgj.zcdev.zcdev.pr.plugin.form;
 | 
			
		||||
 | 
			
		||||
import kd.bos.bill.AbstractBillPlugIn;
 | 
			
		||||
import kd.bos.dataentity.entity.DynamicObject;
 | 
			
		||||
import kd.bos.entity.datamodel.events.ChangeData;
 | 
			
		||||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
 | 
			
		||||
import kd.bos.form.field.events.BeforeF7SelectListener;
 | 
			
		||||
import kd.sdk.plugin.Plugin;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 收入/支出合同计量提交时,系统校验计量清单变动的单价,
 | 
			
		||||
 * 当清单项单价变动过大(超过原单价的2倍或低于0.5倍)时,
 | 
			
		||||
 * 弹出提醒“请注意,清单项:【xx资源名称】、【xx资源名称】的单价变动较大,
 | 
			
		||||
 * 请检查是否存在错误”,且对应清单项的“说明”必填。
 | 
			
		||||
 */
 | 
			
		||||
public class ContractPriceChangedWarnPlugin extends AbstractBillPlugIn implements Plugin {
 | 
			
		||||
    @Override
 | 
			
		||||
    public void propertyChanged(PropertyChangedArgs e) {
 | 
			
		||||
        super.propertyChanged(e);
 | 
			
		||||
        String price = e.getProperty().getName();
 | 
			
		||||
        if(price.equals("currentprice")){
 | 
			
		||||
            StringBuilder sb = new StringBuilder();
 | 
			
		||||
            ChangeData[] changeSet = e.getChangeSet();
 | 
			
		||||
            for(ChangeData changeData : changeSet){
 | 
			
		||||
                int rowIndex = changeData.getRowIndex();
 | 
			
		||||
                DynamicObject oldValue = (DynamicObject) changeData.getOldValue();
 | 
			
		||||
                DynamicObject newValue = (DynamicObject) changeData.getNewValue();
 | 
			
		||||
                int oldPrice = oldValue.getInt("currentprice");
 | 
			
		||||
                int newPrice = newValue.getInt("currentprice");
 | 
			
		||||
                if((newPrice >= oldPrice * 2)||(newPrice <= oldPrice * 0.5)){
 | 
			
		||||
                    String resname = (String)this.getModel().getValue("resname", rowIndex);
 | 
			
		||||
                    sb.append(resname).append(",");
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            if(sb.length()>0){
 | 
			
		||||
                sb.deleteCharAt(sb.length()-1);
 | 
			
		||||
                this.getView().showTipNotification(
 | 
			
		||||
                        "请注意,清单项:"+sb.toString()+"的单价变动较大,\n" +
 | 
			
		||||
                                " 请检查是否存在错误");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue