package com.ktg.iscs.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ktg.iscs.domain.IsJobTicket;
import com.ktg.iscs.domain.dto.ticket.AddJobTicketDTO;
import com.ktg.iscs.domain.dto.ticket.AddMarsJobDTO;
import com.ktg.iscs.domain.dto.ticket.PageTicketDTO;
import com.ktg.iscs.domain.vo.ticket.*;

import java.util.List;

/**
 * 作业票Service接口
 *
 * @author cgj
 * @date 2024-10-18
 */
public interface IIsJobTicketService extends IService<IsJobTicket>
{
    /**
     * 查询作业票
     *
     * @param ticketId 作业票主键
     * @return 作业票
     */
    JobTicketDetailVO selectIsJobTicketByTicketId(Long ticketId);

    /**
     * 查询作业票列表
     *
     * @param isJobTicket 作业票
     * @return 作业票集合
     */
    List<IsJobTicket> selectIsJobTicketList(IsJobTicket isJobTicket);

    /**
     * 新增作业票-sop
     *
     * @param dto 作业票
     * @return 结果
     */
    Long insertJobTicketBySop(AddMarsJobDTO dto);

    Boolean insertJobByMachinery(AddMarsJobDTO dto);

    /**
     * 修改作业票
     *
     * @param dto 作业票
     * @return 结果
     */
    Boolean updateIsJobTicket(AddJobTicketDTO dto);

    /**
     * 批量删除作业票
     *
     * @param ticketIds 需要删除的作业票主键集合
     * @return 结果
     */
    Boolean deleteIsJobTicketByTicketIds(String ticketIds);

    /**
     * 删除作业票信息
     *
     * @param ticketId 作业票主键
     * @return 结果
     */
    int deleteIsJobTicketByTicketId(Long ticketId);

    /**
     * 作业票分页查询
     * @param page
     * @param dto
     * @return
     */
    Page<PageTicketVO> getIsJobTicketPage(Page<IsJobTicket> page, PageTicketDTO dto);

    List<IsJobTicket> getWorkstationTicketList();

    List<IsJobTicket> getMapWorkstationTicketList();

    Boolean updateTicketProgress(JobTicketUpdateProgressReqVO reqVO);

    Page<MonitorTicketPageVO> getMonitorJobTicketPage(Page<IsJobTicket> page, PageTicketDTO dto);

    MonitorJobTicketDetailVO selectMonitorJobTicketDetail(Long ticketId);

    Boolean updateJobToFinish(IsJobTicket isJobTicket);

    Boolean updateJobToCancel(IsJobTicket isJobTicket);

    List<JobTicketDetailVO> selectConflictTicket1(List<Long> points, Long ticketId);

    List<JobTicketDetailVO> selectConflictTicket2(List<Long> points, Long ticketId);
}
