package nckd.jxccl.wtc.wtp.mservice;

import kd.bos.dataentity.entity.DynamicObject;
import kd.hr.hbp.business.servicehelper.HRMServiceHelper;
import kd.hr.hbp.common.util.HRObjectUtils;
import kd.sdk.wtc.wtp.business.attfile.AttFileVersion;
import kd.sdk.wtc.wtp.business.helper.WTPServiceHelper;
import nckd.jxccl.wtc.wtp.mservice.api.IWTPCustomerService;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

/**
 *  工事假勤规则自定义微服务
 * @author: jtd
 * @date: 2026/1/11 18:41
 */
public class WTPCustomerService implements IWTPCustomerService {

    @Override
    public Long getAttFileBoId(LocalDate localDate, long employeeId) {
        AttFileVersion attFile = WTPServiceHelper.getAttFile(localDate, employeeId);
        return HRObjectUtils.isEmpty(attFile) ? 0L : attFile.getBoId();
    }

    @Override
    public List<DynamicObject> queryQuota(long attFileBoId, List<Long> qtTypeIdList, int rangQueryType, Date startDate, Date endDate) {
        return HRMServiceHelper.invokeBizService("wtc", "wtp", "IQTService", "queryQuota", new Object[]{attFileBoId, qtTypeIdList, rangQueryType, startDate, endDate});
    }

}
