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

import cn.iocoder.yudao.module.inspection.query.FileByTypeQuery;
import cn.iocoder.yudao.module.inspection.query.OrderTableQuery;
import cn.iocoder.yudao.module.label.vo.LabelPageReqVO;
import cn.iocoder.yudao.module.label.vo.LabelRespVO;
import cn.iocoder.yudao.module.partner.entity.PartnerBalance;
import cn.iocoder.yudao.module.partner.entity.PartnerBalanceDetail;
import cn.iocoder.yudao.module.partner.entity.PartnerWorker;
import cn.iocoder.yudao.module.payment.entity.OrderInfo;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.iocoder.yudao.module.inspection.entity.*;
import cn.iocoder.yudao.module.inspection.query.PartnerListQuery;
import cn.iocoder.yudao.module.inspection.vo.*;
import cn.iocoder.yudao.module.shop.entity.ShopCouponTemplate;
import cn.iocoder.yudao.module.shop.entity.ShopMallPartners;

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


public interface AppInspectionPartnerService extends IService<ShopMallPartners> {
    IPage<PartnerListVo> partnerList(Page<PartnerListVo> page, PartnerListQuery partnerListQuery);

    List<ShopInspectionCategory> categoryList(Long partnerId);

    PartnerListVo shopDetail(PartnerListQuery partnerListQuery);

    void addSalesNum(Long partnerId);

    ShopMallPartners shopInfo() throws Exception;

    /**
     * 重写shopInfo()方法
     */
    ShopMallPartners shopInfoByUserId() throws Exception;

    JSONObject getAppointAndPickNum() throws Exception;

    void startOrEnd(Long partnerId);

    StatisticsInfo statisticsInfo(Long partnerId);

    JSONObject chartInfoAmount(Long partnerId, String unit);
    JSONObject chartInfoAmount(String startTime, String endTime);

    JSONObject newChartInfoAmount(String unit);

    JSONObject chartLineInspectionNum(Long partnerId, String unit);
    JSONObject chartLineInspectionNum(String startTime, String endTime);

    JSONObject newChartLineInspectionNum(String unit);

    JSONObject chartLineInspectionAmount(Long partnerId, String unit);
    JSONObject chartLineInspectionAmount(String startTime, String endTime);

    JSONObject chartInfoNum(Long partnerId, String unit);

    JSONObject newChartInfoNum(String unit);

    JSONObject chartInfoRatio(Long partnerId, String unit);

    JSONObject newChartInfoRatio(String unit);

    List<OrderInfo> orderInfo(Long partnerId);

    List<HotGoodsVo> hotGoodsList(Long partnerId);

    List<HotGoodsVo> newHotGoodsList();

    void addGoods(ShopInspectionGoods goods) throws Exception;

    IPage<GoodsVo> goodsList(Page<GoodsVo> page, Long partnerId, String isListing, String goodsTitle);

    List<JSONObject> canUseGoods(Long partnerId);

    ShopInspectionGoods goodsDetail(Long goodsId);

    void editGoods(ShopInspectionGoods goods) throws Exception;

    void editSkuPrice(ShopInspectionGoods goods) throws Exception;

    void changeListing(Long goodsId) throws Exception;

    void delGoods(Long goodsId) throws Exception;

    void editPartnerInfo(ShopMallPartners partners);

    PartnerVo getPartnerInfo(Long partnerId);

    PartnerBalance accountInfo(Long partnerId);

    IPage<PartnerBalanceDetail> accountDetail(Page<PartnerBalanceDetail> page, Long partnerId, Integer pageNum, Integer pageSize);

    IPage<OrderAppDetail> orderList(Page<OrderAppDetail> page, Long partnerId, String phoneNum, String title);

    OrderAppDetail orderDetail(Long partnerId, Long orderId);

    Long orderDetailByCode(Long partnerId, String code) throws Exception;

    void takeOut(InspectionInfo inspectionInfo) throws Exception;

    void addWorker(Long partnerId, String realName, String phoneNum, Long postId) throws Exception;

    List<PartnerWorker> getWorkList(Long partnerId, Long postId, String workName, String phoneNum);

    IPage<PartnerWorker> pageWorkList(Long partnerId, Long postId, String workName, String phoneNum, Page<LabelRespVO> page);

    void delWorker(Long partnerId, Long workId);

    IPage<InspectionInfo> inspectionList(Page<InspectionInfo> page, Long partnerId, String status, String carNum);

    InspectionInfoVo inspectionDetail(Long inspectionInfoId);

    List<InspectionInfo> workerInspectionList(Long partnerId, String status, String searchValue);

    void addStepInfo(InspectionStepInfo stepInfo);

    void stopInspection(InspectionInfo info) throws Exception;

    void makeCertOk(Long inspectionId);

    IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page, Long partnerId, String phoneNum, String carNo, String startTime, String endTime);
    IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page, AppointmentQuery query);

    IPage<OrderInfo> validationList(Page<OrderInfo> page, Long partnerId, String searchValue);

    void sendCoupon(ShopCouponTemplate template) throws Exception;

    IPage<ShopCouponTemplate> listCoupon(Page<ShopCouponTemplate> page, Long partnerId, String searchValue);

    void delCoupon(Long partnerId, Long id);

    void designatePickCarWorker(Long pickCarId, Long workerId);

    IPage<InspectionPickCar> getPickCarList(Page page, Long partnerId, String phoneNum, String pickStatus);

    InspectionPickCar getPickCarDetail(Long dataId);

    IPage<InspectionPickCar> getPickCarListOfWorker(Page<InspectionPickCar> page, Long workerId, String phoneNum);

    JSONObject vehicleLicenseOCR(String imagePath) throws Exception;

    void offlineCharging(InspectionInfoVo infoVo);

    String workOrderView(Long inspectionId);

    List<PostDO> inspectionPostInfo();

    Map<String, Double> staticsTable1(Long partnerId, String startTime, String endTime);

    Map<String, Double> newStaticsTable1(String startTime, String endTime);

    Map<String, Integer> staticsTable2(Long partnerId, String startTime, String endTime);

    Map<String, Integer> newStaticsTable2(String startTime, String endTime);

    List<Map<String, Object>> staticsTable3(Long partnerId, String startTime, String endTime);

    List<Map<String, Object>> newStaticsTable3(String startTime, String endTime);

    List<Map<String, Object>> staticsTable3Detail(Long partnerId, String startTime, String endTime, String remark);

    List<Map<String, Object>> staticsTable4(Long partnerId, String startTime, String endTime);

    List<Map<String, Object>> staticsTable5(Long partnerId, String startTime, String endTime);


    //新检测金额折线图
    JSONObject newChartLineInspectionAmount(String unit);

    /**
     * 根据inspection_info的id查有的项目名称
     *
     * @param ids inspection_info的id
     * @author 小李
     * @date 14:52 2024/12/10
     **/
    Map<Long, String> getProjectByIds(Long[] ids);

    /**
     * 根据inspection_info的id查有的项目名称
     *
     * @param ids inspection_info的id
     * @author 小李
     * @date 14:52 2024/12/10
     **/
    Map<Long, List<Map<String, String>>> getProjectBelowStandardByIds(Long[] ids, String status, String type);

    /**
     * 根据inspection_info的id查有的项目名称
     *
     * @param ids inspection_info的id
     * @author 小李
     * @date 14:52 2024/12/10
     **/
    Map<Long, List<Map<String, String>>> getProjectExceptionByIds(Long[] ids, String status, String type);

    /**
     * 根据时间查订单
     *
     * @param startTime 开始时间 非必传
     * @param endTime   结束时间 非必传
     * @author 小李
     * @date 14:39 2024/12/12
     **/
    IPage<OrderTable> getOrderByDate(OrderTableQuery query, Page<OrderTable> page);

    /**
     * 根据时间查订单
     *
     * @param startTime 开始时间 非必传
     * @param endTime   结束时间 非必传
     * @author 小李
     * @date 14:39 2024/12/12
     **/
    IPage<OrderTable> getOrderApp(String startTime, String endTime, String chooseStatus, Page<OrderTable> page);

    /**
     * 分类计数
     *
     * @param startTime    开始时间
     * @param endTime      结束时间
     * @param chooseStatus 状态
     * @author 小李
     * @date 17:14 2024/12/16
     **/
    Map<String, Long> getTypeCount(String startTime, String endTime, String chooseStatus);

    /**
     * 查询检测类型统计
     *
     * @param startTime 开始时间
     * @param endTime   结束时间
     * @return 结果
     */
    List<Map<String, Object>> queryInspectionSkuList(String startTime, String endTime);

    /**
     * 查询员工统计
     *
     * @param dlInspectionProject 项目信息
     * @return 结果
     */
    List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject);

    /**
     * 查询员工统计
     *
     * @param dlInspectionProject 项目信息
     * @return 结果
     */
    Map<String, Object> getStaffCountByUserId(DlInspectionProject dlInspectionProject);

    /**
     * 文件统计
     *
     * @param startTime 开始时间
     * @param endTime   结束时间
     * @return 结果
     */
    Map<String, Object> fileStatistics(String servicePackageId, String startTime, String endTime);

    /**
     * 客户来源统计
     *
     * @param startTime 开始时间
     * @param endTime   结束时间
     * @param businessId 业务渠道id
     * @return
     */
    List<Map<String, Object>> customerSourceCount(String startTime, String endTime, Long businessId);

    /**
     * 文件统计列表
     *
     * @param startTime 开始时间
     * @param endTime   结束时间
     * @return 结果
     */
    Map<String, Object> fileStatisticsList(String servicePackageId, String startTime, String endTime);

    /**
     * 批量结算
     * @param query
     */
    void batchSettlement(OrderTableQuery query);

    /**
     * @description: 结算订单
     * @param infoVo
     * @return: void
     * @author 許
     * @date: 2025/8/12 11:28
     */
    void settlement(InspectionInfoVo infoVo);
}
