package nckd.jxccl.sit.hcsi.validate.web;

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

/**
 * Tyx 2025-10-29
 * 社保核定单校验器，弱校验
 * 当存在单据体未维护子单据体的情况弹窗提示
 */
public class SinsurEmpCoordBillValidator extends AbstractValidator {

    @Override
    public void validate() {
        String key = this.getOperateKey();
        for (ExtendedDataEntity dataEntity : dataEntities) {
            // TODO 个别类型的核定单不校验
            DynamicObject bill = dataEntity.getDataEntity();
            DynamicObjectCollection entryCols = bill.getDynamicObjectCollection("nckd_entryentity");
            if(entryCols.size() == 0) {
                this.addWarningMessage(dataEntity, "未维护险种基数信息");
            }
        }
    }
}
