package com.yem.wm.bd.signals.validator;

import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.ExtendedDataEntity;
import kd.bos.entity.validate.AbstractValidator;
import kd.bos.servicehelper.AttachmentServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;

import java.util.List;
import java.util.Map;

public class RequireddtValidator extends AbstractValidator {
    @Override
    public void validate() {
        ExtendedDataEntity[] dataEntities = this.getDataEntities();
        for (ExtendedDataEntity dataEntitie : dataEntities) {
            DynamicObject mechanical = dataEntitie.getDataEntity();
            long id = mechanical.getLong("id");
            String attachments = mechanical.getString("yem_attsum");
            if ("0".equals(attachments)){
                this.addErrorMessage(dataEntitie, "附件未上传或未保存！！！");
            }
        }
    }
}
