package com.rongwei.bscommon.sys.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.rongwei.bsentity.domain.EquMaintenanceScheduleDo;
import com.rongwei.bsentity.dto.BatchCreateDTO;
import com.rongwei.bsentity.dto.TaskCreatorDTO;
import com.rongwei.bsentity.enums.PlannedStatusEnum;

import java.util.List;

/**
 * @author shangmi
 * @title EquMaintenanceScheduleService
 * @date 2023/11/27 15:53
 * @description 保养/维护计划业务类
 */
public interface EquMaintenanceScheduleService extends IService<EquMaintenanceScheduleDo>{
    /**
     * 通过年、设备ID、保养分类获得保养计划
     *
     * @param taskCreator
     * @return {@link EquMaintenanceScheduleDo}
     * @date 2023/12/13 10:09
     * @author shangmi
     *
     */

    EquMaintenanceScheduleDo getMaintenanceSiteByList(TaskCreatorDTO taskCreator);

    /**
     * 批量保存
     *
     * @param maintenanceScheduleList
     * @return {@link int}
     * @date 2023/12/13 10:08
     * @author shangmi
     *
     */

    int saveBatchList(List<EquMaintenanceScheduleDo> maintenanceScheduleList);

    /**
     * 通过年和设备查询
     *
     * @param split
     * @param batchCreate
     * @return {@link List< EquMaintenanceScheduleDo>}
     * @date 2023/12/13 10:08
     * @author shangmi
     *
     */

    List<EquMaintenanceScheduleDo> getYearAndEquipmentByList(List<String> split,BatchCreateDTO batchCreate);

    /**
     * 查询该年下当前工厂的计划
     *
     * @param oldYear
     * @param tenantId
     * @return {@link List<EquMaintenanceScheduleDo>}
     * @date 2023/12/13 10:06
     * @author shangmi
     *
     */

    List<EquMaintenanceScheduleDo> getYearAndTenantIdByList(int oldYear, String tenantId);

    /**
     * 通过ID查询记录表
     *
     * @param masterIds
     * @return {@link List< EquMaintenanceScheduleDo>}
     * @date 2023/12/13 10:06
     * @author shangmi
     *
     */

    List<EquMaintenanceScheduleDo> getListByIds(List<String> masterIds);

    /**
     * 根据用户ID修改计划状态
     *
     * @param strings
     * @param plannedStatusEnum
     * @return
     * @date 2023/12/13 10:07
     * @author shangmi
     *
     */

    void updatePlannedstatusByIds(List<String> strings, PlannedStatusEnum plannedStatusEnum);

    /**
     * 查询该年所有
     *
     * @param year
     * @return {@link List<EquMaintenanceScheduleDo>}
     * @date 2023/12/13 10:11
     * @author shangmi
     */

    List<EquMaintenanceScheduleDo> getYearByList(int year);

    /**
     * 修改指定设备的保养检修任务
     *
     * @param equipmentId
     * @return
     * @date 2024/1/16 17:40
     * @author shangmi
     *
     */

    void updateStateByEquId(String equipmentId);
}
