package com.yem.wm.es.salesorder.validator;

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

/**
 * @author ljw
 * @date 2024/9/9 16:57
 * @description NewSalesOrderSubmitAnnexValidator
 */
public class NewSalesOrderSubmitAnnexValidator extends AbstractValidator {
    @Override
    public void validate() {
        ExtendedDataEntity[] dataEntities = this.getDataEntities();
        for (ExtendedDataEntity dataEntitie : dataEntities) {
            DynamicObject mechanical = dataEntitie.getDataEntity();
            String attachments = mechanical.getString("yem_attsum");
            if ("0".equals(attachments)){
                this.addErrorMessage(dataEntitie, "附件未上传或未保存！！！");
            }
        }
    }
}
