package com.yiqi.order.service;

import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yiqi.core.domain.SettlementManageBill;
import com.yiqi.core.domain.dto.SettlementBillAddDTO;
import com.yiqi.order.domain.dto.*;
import com.yiqi.order.domain.OrderClothItem;
import com.yiqi.order.domain.vo.*;

/**
 * 洗衣订单衣服明细Service接口
 *
 * @author ruoyi
 * @date 2023-10-06
 */
public interface IOrderClothItemService extends IService<OrderClothItem> {

    /**
     * 获取门店未完成衣物数量
     * @return
     */
    public OrderClothItemCountStatisticVO getUnFinishedOrderClothCountGroupByStatus(Long factoryId, Long storeId);

    public OrderClothItemTimeoutCountStatisticVO getTimeoutOrderClothCountGroupByStatus(Long factoryId, Long storeId);

    public List<OrderClothItemVO> buildWeAppOrderClothItemDetail(List<OrderClothItem> orderClothItems);

    public List<OrderClothItemVO> buildOrderClothItemDetail(List<OrderClothItem> orderClothItems);

    /**
     * 衣服出厂
     *
     * @param orderClothItemOutFactoryDTO
     * @return
     * @throws Exception
     */
    public List<OrderClothItem> outFactory(OrderClothItemOutFactoryDTO orderClothItemOutFactoryDTO) throws Exception;


    /**
     * 查询洗衣订单衣服明细
     *
     * @param id 洗衣订单衣服明细主键
     * @return 洗衣订单衣服明细
     */
    public OrderClothItem selectOrderClothItemById(Long id);

    /**
     * 查询洗衣订单衣服明细列表
     *
     * @param orderClothItem 洗衣订单衣服明细
     * @return 洗衣订单衣服明细集合
     */
    public List<OrderClothItem> selectOrderClothItemList(OrderClothItem orderClothItem);

    /**
     * 新增洗衣订单衣服明细
     *
     * @param orderClothItem 洗衣订单衣服明细
     * @return 结果
     */
    public int insertOrderClothItem(OrderClothItem orderClothItem);

    /**
     * 修改洗衣订单衣服明细
     *
     * @param orderClothItem 洗衣订单衣服明细
     * @return 结果
     */
    public int updateOrderClothItem(OrderClothItem orderClothItem);

    /**
     * 批量删除洗衣订单衣服明细
     *
     * @param ids 需要删除的洗衣订单衣服明细主键集合
     * @return 结果
     */
    public int deleteOrderClothItemByIds(Long[] ids);

    /**
     * 删除洗衣订单衣服明细信息
     *
     * @param id 洗衣订单衣服明细主键
     * @return 结果
     */
    public int deleteOrderClothItemById(Long id);


    /**
     * 查询洗衣订单-待上挂衣服列表
     *
     * @param orderClothHangerDTO 洗衣订单衣服明细
     * @return 洗衣订单衣服明细集合
     */
    public Page<OrderClothItemVO> getOrderClothItemListByUpHanger(OrderClothHangerDTO orderClothHangerDTO);
    /**
     * 重洗衣服
     *
     * @param orderClothItemId 洗衣订单衣服id
     * @return 洗衣订单衣服明细集合
     */
    public void reFlowCloth(Long orderClothItemId);

    List<FactoryFinancialClothDayVO> listFinancialStatisticsByFactoryWithToday(FactoryOrderFinancialDayQueryDTO factoryOrderFinancialDayQueryDTO);

    List<FactoryStatisticsListQueryVO> listFinancialStatisticsByFactoryOperate(FactoryStatisticsQueryDTO factoryStatisticsQueryDTO);

    List<FactoryStatisticsDetailQueryVO> listFinancialStatisticsByFactoryOperateDetail(FactoryStatisticsDetailQueryDTO factoryStatisticsDetailQueryDTO);

    int countFinancialStatisticsByFactoryOperateDetail(FactoryStatisticsDetailQueryDTO factoryStatisticsDetailQueryDTO);

    /**
     * 查询洗衣订单 clothesItem
     *
     * @param orderClothItemQueryDTO
     * @return
     */
    List<OrderClothItemVO> queryClothItem(OrderClothItemQueryDTO orderClothItemQueryDTO);

    /**
     * 根据订单id查询 clothesItem
     *
     * @param orderId
     * @return
     */
    List<OrderClothItemVO> queryClothItemByOrderId(String orderSn);

    /**
     * 修改所有 clothesItem 状态
     *
     * @param clothOrderId
     * @param flawStatus
     */
    void updateAllClothItemStatusByOrderId(Long clothOrderId, String flawStatus);

    /**
     * 判断所有的衣服是否已经符合订单状态
     * @param clothOrderId
     * @return
     */
    Boolean checkClothItemStatus(Long clothOrderId, String flawStatus);

    /**
     * 查询工厂衣服记录(衣服和附件一起查询)
     *
     * @param orderClothItemFactoryQueryDTO
     * @return
     */
    List<OrderClothItemVO> findAllFactoryClothPage(OrderClothItemFactoryQueryDTO orderClothItemFactoryQueryDTO);

    /**
     * 门店返洗衣服
     *
     * @return
     */
    void reFlowClothByStore(Long orderClothItemId);
}
