package com.yem.wm.im.clientdemand.validator;

import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.ExtendedDataEntity;
import kd.bos.entity.validate.AbstractValidator;

public class ClientDeletValidator extends AbstractValidator {

    @Override
    public void validate() {
        ExtendedDataEntity[] dataEntities = this.getDataEntities();
        for(ExtendedDataEntity dataEntitie : dataEntities) {
            DynamicObject dataEntity = dataEntitie.getDataEntity();
            boolean yemSynchronization = dataEntity.getBoolean("yem_synchronization");
            if (yemSynchronization){
                this.addErrorMessage(dataEntitie,"当前单据已同步至下单平台，不允许被删除！！！");
            }
        }
    }
}
