package cn.iocoder.yudao.module.inspection.service;

import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
import cn.iocoder.yudao.module.inspection.entity.InspectionWorkNode;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 检测流程表 服务类
 * </p>
 *
 * @author dianliang
 * @since 2024-10-31
 */
public interface IInspectionWorkNodeService extends IService<InspectionWorkNode> {
    /**
     * 员工接单
     *
     * @param inspectionId
     * @param workNodeId
     */
    void updateInspectionWorkNode(Integer inspectionId, String workNodeId);

    /**
     * 员工取消接单
     *
     * @param inspectionId
     * @param workNodeId
     */
    void cancelAnOrder(Integer inspectionId, String workNodeId);

    /**
     * 更新流程图片 步骤信息
     *
     * @param inspectionWorkNode
     */
    void updateImageAndStep(InspectionWorkNode inspectionWorkNode);

    /**
     * 根据检测id获取流程信息
     *
     * @param inspectionId
     * @return
     */
    List<InspectionWorkNode> getWeorkNodesById(Integer inspectionId);

    boolean orImages(Integer inspectionId, String workNodeId);

    /**
     * 分页查询提成
     *
     * @param page
     * @param inspectionWorkNode
     * @return
     */
    IPage<Map> getRoyaltyList(IPage page, InspectionWorkNode inspectionWorkNode);

    Map getRoyaltySum(InspectionWorkNode inspectionWorkNode);

    /**
     * 重新检测
     *
     * @param workNodes
     */
    void recheck(InspectionWorkNode workNodes);

    /**
     * 获取员工统计排序
     *
     * @param dlInspectionProject
     * @return
     */
    List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject);

    /**
     * 根据检测id获取异常节点
     *
     * @param idList
     * @return
     */
    List<Map<String, Object>> selectExceptionNodesByInspectionIds(List<Long> idList);

    /**
     * 完成异常节点
     * @param idList
     */
    void updateException(Long inspectionInfoId,List<String> idList);
}
