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

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

/**
 * @author ljw
 * @date 2024/11/13 20:11
 * @description StorageApplyValidator
 */
public class StorageApplyValidator   extends AbstractValidator {
    @Override
    public void validate() {
        ExtendedDataEntity[] dataEntities = this.getDataEntities();
        for(ExtendedDataEntity dataEntitie : dataEntities) {
            DynamicObject dataEntity = dataEntitie.getDataEntity();
            String yem_cloudhousetitle = "整机储运申请";
            DynamicObject yemBususer = dataEntity.getDynamicObject("yem_operator");
            if (yemBususer != null) {
                String string = ( yemBususer).getString("name");
                yem_cloudhousetitle = yem_cloudhousetitle + "," + string;
            }
            DynamicObject yemBuyercountry = dataEntity.getDynamicObject("yem_clientcountry");
            if (yemBuyercountry != null) {
                String string = ( yemBuyercountry).getString("name");
                yem_cloudhousetitle = yem_cloudhousetitle + "," + string;
            }
            String yemStcontractno = dataEntity.getString("yem_applytype");
            if (yemStcontractno != null) {
                yem_cloudhousetitle = yem_cloudhousetitle + "," + yemStcontractno;
            }
            dataEntitie.setValue("yem_cloudhousetitle",yem_cloudhousetitle);
        }
    }
}
