付款处理反写资金计划申请实付金额功能
This commit is contained in:
		
							parent
							
								
									4d5975d6e2
								
							
						
					
					
						commit
						a2588e7d6a
					
				| 
						 | 
				
			
			@ -0,0 +1,51 @@
 | 
			
		|||
package zcgj.zcdev.zcdev.pr.plugin.operate;
 | 
			
		||||
 | 
			
		||||
import kd.bos.dataentity.entity.DynamicObject;
 | 
			
		||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
 | 
			
		||||
import kd.bos.entity.ExtendedDataEntity;
 | 
			
		||||
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 java.util.HashSet;
 | 
			
		||||
import java.util.Set;
 | 
			
		||||
 | 
			
		||||
public class FundingplanapplyOp extends AbstractOperationServicePlugIn {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onPreparePropertys(PreparePropertysEventArgs e) {
 | 
			
		||||
        e.getFieldKeys().add("zcgj_fin_approved_amount");
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onAddValidators(AddValidatorsEventArgs e) {
 | 
			
		||||
        super.onAddValidators(e);
 | 
			
		||||
        //当前所在的组织是属于矿山下的
 | 
			
		||||
        e.getValidators().add(new ValidatorExt());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    class ValidatorExt extends AbstractValidator {
 | 
			
		||||
        @Override
 | 
			
		||||
        public void validate() {
 | 
			
		||||
            ExtendedDataEntity[] extendedDataEntities = this.getDataEntities();
 | 
			
		||||
            for (ExtendedDataEntity extendedDataEntity : extendedDataEntities) {
 | 
			
		||||
                DynamicObject dataEntity = extendedDataEntity.getDataEntity();
 | 
			
		||||
                DynamicObjectCollection finApprovedAmount = dataEntity.getDynamicObjectCollection("zcgj_fin_approved_amount");
 | 
			
		||||
                if (!finApprovedAmount.isEmpty()) {
 | 
			
		||||
                    Set<String> typeSet = new HashSet<>();
 | 
			
		||||
                    for (DynamicObject dynamicObject : finApprovedAmount) {
 | 
			
		||||
                        String sSetttype = dynamicObject.getString("zcgj_setttype");
 | 
			
		||||
                        if(typeSet.contains(sSetttype)) {
 | 
			
		||||
                            this.addFatalErrorMessage(extendedDataEntity, "财务部核定金额的结算方式不允许重复!");
 | 
			
		||||
                            return;
 | 
			
		||||
                        }else{
 | 
			
		||||
                            typeSet.add(sSetttype);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue