package com.sqx.modules.artificer.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.common.utils.Result;
import com.sqx.modules.artificer.entity.Period;
import com.sqx.modules.artificer.entity.Orders;
import com.sqx.modules.utils.excel.ExcelData;

import java.math.BigDecimal;
import java.util.Map;

public interface OrdersService extends IService<Orders> {

    Map<String,Object> selectTaxiMoney(Long artificerId, String latitude, String longitude, String city);

    Result insertOrders(Orders orders);

    Result updateOrders(Orders orders);

    Result cancelOrdersMoney(Long userId,Long ordersId);

    Result cancelOrders(Long userId,Long ordersId);

    Result cancelSupplementOrders(Long userId, Long ordersId, Integer isAuto, Integer type);

    Result removeOrders(Long ordersId);

    Result refundOrdersMoney(Long ordersId,BigDecimal refundMoney);

    Result selectOrdersDetails(Long ordersId);

    Result selectOrdersList(Long userId,Integer page,Integer limit,Integer status,String city,
                            String name,String phone,Long artificerId,Long parentId,String startTime,
                            String endTime,Integer isAdd,String ordersNo,String artificerName,
                            String oneUserName,String oneArtificerUserName,
                            String startServeTime,String endServeTime,Integer overTimeOrders,Long shopId,
                            String shopName,Integer warning,String title,String classifyId, Long userPackageId);

    Result selectAppOrdersList(Long userId,Integer page,Integer limit,Integer status,Long userPackageId);

    ExcelData excelOrdersList(Long userId,Integer status,String city,
                              String name,String phone,Long artificerId,Long parentId,String startTime,
                              String endTime,Integer isAdd,String ordersNo,String artificerName,
                              String oneUserName,String oneArtificerUserName,
                              String startServeTime,String endServeTime,Integer overTimeOrders,Long shopId,
                              String shopName,Integer warning,String title,String classifyId);

    Orders selectOrdersByOrderNo(String ordersNo);

    Result payOrders(Long ordersId,Integer type);

    void sendMsg(Orders orders);

    Result payUserVip(Long userId,Long vipDetailsId);

    Result accomplishOrders(Long ordersId,Integer type,String accomplishLongitude,String accomplishLatitude,String jsFwcn,String  jsPjtag,String jsTsbz,String earlyFinishReason);

    Result startOrders(Long ordersId,String startLongitude,String startLatitude,String startImg,String startRemark);

    Result artificerStartOrEndTime(Long ordersId);

    Result selectArtificerIndex(Long artificerId,String startTime,String endTime);

    Result selectTodayOrder(Long artificerId, Integer page, Integer limit,Integer type,String startTime,String endTime);

    Result selectArtificerOrder(Long userId, Integer status, Integer page, Integer limit);

    Result refundOrders(Long ordersId);

    Result updateArtificerCreditScore(Integer type,BigDecimal creditScore,Long artificerId);

    void endOrders();

    Result selectTeamOrdersList(Integer page, Integer limit, Long userId, Integer type, Integer status);

    Result selectTeamUserList(Integer page, Integer limit, String invitationCode, Integer type, Long userId);

    Double selectOrdersMoneyCountByUserId(Long userId, Integer type, String time);

    Integer selectUserCountByInvitationCode(String invitationCode, Integer type);

    Integer selectOrdersCountStatisticsByYear(Integer flag,String time,Integer status);

    Result selectArtificerOrdersList(Integer page,Integer limit,String artificerName,String artificerPhone,
                                     String userName,String phone,Integer warning,Integer overTimeOrders);

    Result selectShopMoney(Integer page,Integer limit,String userName,String phone,String flag,String time);

    Result selectOneUserMoney(Integer page,Integer limit,String userName,String phone,String flag,String time);

    Result selectOneArtificerMoney(Integer page,Integer limit,String userName,String phone,String flag,String time);

    Result selectArtificerMoney(Integer page,Integer limit,String userName,String phone,String flag,String time);

    Result selectNewUserOrdersCount(Integer page,Integer limit,String userName,String phone);

    Result selectNewUserOrdersRate();


    Result selectDividedIntoDetail(Period period);

    Result selectDividedIntoDetails(Integer page, Integer limit, Period period);

    Result splitDetails(Period period);

    /**
     * 技师确认接单
     * @param ordersId 订单id
     * @return
     */
    Result jishiQueren(Long ordersId);

    Result jszd(Long orderId, Long artificerId);
}