package com.tofly.qualitycontrol.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tofly.qualitycontrol.dto.*;
import com.tofly.qualitycontrol.entity.CertificationOrder;
import com.tofly.qualitycontrol.vo.*;
import org.springframework.web.multipart.MultipartFile;

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

/**
 * 认证服务
 *
 * @author B
 */
public interface ICertificationOrderService extends IService<CertificationOrder> {

    /**
     * 新增认证工单
     *
     * @param certificationOrder
     * @return java.lang.Boolean
     **/
    Boolean saveCertificationOrder(CertificationOrderDto certificationOrder);

    /**
     * 工单上报的分页和模糊查询
     *
     * @param orderDto
     * @param page
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.tofly.qualitycontrol.vo.BusinessMonitorVO_L>
     **/
    IPage<BusinessMonitorVO_L> getOrderList(ReportOrderDto orderDto, Page<CertificationOrder> page);

    /**
     * 认证,新增整改工单,上传文件,推送消息
     *
     * @param certificationOrder
     * @param fileList
     * @return java.lang.Boolean
     **/
    Boolean certifyOrder(CertificationOrder certificationOrder, List<MultipartFile> fileList);

    /**
     * 分页和模糊查询
     *
     * @param orderDto
     * @param page
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.tofly.qualitycontrol.vo.CertificationOrderVO_L>
     **/
    IPage<BusinessMonitorVO_L> getCertificationList(ReportOrderDto orderDto, Page<CertificationOrder> page);

    /**
     * 查询工单详情
     *
     * @param id
     * @return com.tofly.qualitycontrol.vo.CertificationOrderVO_D
     **/
    CertificationOrderVO_D getDetail(Long id);

    /**
     * 获取文件下载地址
     *
     * @param fileIds
     * @return java.util.List<java.lang.String>
     **/
    List<Map<String, String>> getFilePath(List<Long> fileIds);

    /**
     * 删除认证工单
     *
     * @param id
     * @return java.lang.Boolean
     **/
    Boolean deleteOrder(Long id);

    /**
     * 获取当前用户每个环节的计数
     *
     * @param
     * @return <java.util.Map < java.lang.String,java.lang.Object>
     **/
    Map<String, Object> getProcessCount();

    /**
     * 批量添加检验记录
     *
     * @param dto      数据
     * @param fileList 文件
     * @return
     */
    Object certifyOrderBatch(CertifyOrderDto dto, List<MultipartFile> fileList);

    /**
     * 订单统计集合
     *
     * @param dto 查询条件
     * @return
     */
    List<OrderSummaryVo> orderSummaryList(OrderDto dto);

    /**
     * 订单上报统计集合
     *
     * @param dto 查询条件
     * @return
     */
    List<ReportSummaryVo> orderReportSummary(OrderDto dto);

    List<ReportSummaryVo> orderInspectSummary(OrderDto dto);

    /**
     * 工单详细信息
     *
     * @param id   工单id
     * @param type 工单类型，
     * @return
     */
    List<ReportOrderInfoVo> getOrder(Long id, Long type);

    List<OrderListInfoVo> getWorkOrderList(OrderListDto dto);

    Page<OrderListInfoVo> getWorkOrderList(OrderListDto dto, Page page);

    List<OrderFinishVo> getOrderFinish(OrderReportDto dto);

    List<OrderFinishInfoVo> getDefectType(OrderReportDto dto);

    List<Map<String, Object>> getDefectTrend(OrderReportDto dto);


    List<ClientAttestationVo> getClientAttestation(ClientAttestationDto dto);

    Object getManageBenefit(OrderReportDto dto);

    Integer updateReadmeterhis(String clientNumber, String yearMonth);
}
