package com.hzs.sale.order.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.domain.sale.ext.SaOrderItemsExt;
import com.hzs.common.domain.sale.order.SaOrder;
import com.hzs.common.domain.sale.order.SaOrderItems;
import com.hzs.sale.deliver.param.DeliverExcludeProductParam;
import com.hzs.sale.deliver.param.DeliverMergeParam;
import com.hzs.sale.deliver.param.DeliverUnhandledParam;
import com.hzs.sale.deliver.vo.DeliverUnhandledVO;
import com.hzs.sale.deliver.vo.DeliverExcludeProductVO;
import com.hzs.sale.order.mapper.SaOrderItemsMapper;
import com.hzs.sale.order.param.OrderItemsParam;
import com.hzs.sale.order.param.WaresOrderParam;
import com.hzs.sale.order.service.ISaOrderItemsService;
import com.hzs.sale.order.vo.WaresOrderVo;
import org.springframework.stereotype.Service;

import java.util.*;

/**
 * 销售订单-明细表 服务实现类
 */
@Service
public class SaOrderItemsServiceImpl extends ServiceImpl<SaOrderItemsMapper, SaOrderItems> implements ISaOrderItemsService {

    @Override
    public List<DeliverUnhandledVO> queryDeliverUnhandledList(DeliverUnhandledParam param, Integer pkCountry) {
        return baseMapper.queryDeliverUnhandledList(param, pkCountry);
    }

    @Override
    public List<DeliverExcludeProductVO> queryExcludeProductByIdList(List<Long> idList, Integer pkCountry) {
        return baseMapper.queryExcludeProductByIdList(idList, pkCountry);
    }

    @Override
    public List<DeliverExcludeProductVO> queryExcludeProductByQueryParam(DeliverExcludeProductParam param, Integer pkCountry) {
        return baseMapper.queryExcludeProductByQueryParam(param, pkCountry);
    }

    @Override
    public List<SaOrderItemsExt> queryMergeByQueryParam(DeliverMergeParam param, Integer pkCountry) {
        return baseMapper.queryMergeByQueryParam(param, pkCountry);
    }

    @Override
    public List<SaOrderItemsExt> queryMergeByIdList(List<Long> idList, DeliverMergeParam param, Integer pkCountry) {
        return baseMapper.queryMergeByIdList(idList, param, pkCountry);
    }

    @Override
    public Boolean updateOrderItems(SaOrder saOrder) {
        return baseMapper.updateOrderItems(saOrder) > 0;
    }

    @Override
    public void updateOrderItemsByMemberList(List<Long> memberList, Long pkApprove, Date currentDateTime) {
        baseMapper.updateOrderItemsByMemberList(memberList, pkApprove, currentDateTime);
    }

    @Override
    public Boolean updateOrderItemsById(List<Long> pkOrderItemsId, Long pkApprove, Date currentDate) {
        return baseMapper.updateOrderItemsById(pkOrderItemsId, pkApprove, currentDate) > 0;
    }

    @Override
    public List<SaOrderItemsExt> queryListByOrderId(List<Long> orderIdList) {
        return baseMapper.queryListByOrderId(orderIdList);
    }

    @Override
    public List<WaresOrderVo> waresListByOrderId(List<Long> orderIdList) {
        return baseMapper.waresListByOrderId(orderIdList);
    }

    @Override
    public List<SaOrderItemsExt> queryListByItemId(List<Long> itemIdList, List<Integer> statusList, Integer pkCountry) {
        return baseMapper.queryListByItemId(itemIdList, statusList, pkCountry);
    }

    @Override
    public List<WaresOrderVo> selectByInvestmentList(WaresOrderParam waresOrderParam) {
        return baseMapper.selectByInvestmentList(waresOrderParam);
    }

    @Override
    public void closeOrder(Integer pkCountry, String data, Integer orderType) {
        baseMapper.closeOrder(pkCountry, data, orderType);
    }

    @Override
    public List<SaOrderItemsExt> selectByList(Long pkOrder) {
        return baseMapper.selectByList(pkOrder);
    }

    @Override
    public List<OrderItemsParam> getOrderItemsParams(List<Long> orderIdList) {
        return baseMapper.getOrderItemsParams(orderIdList);
    }

    @Override
    public List<SaOrderItems> queryDeliverByOrder(Long pkOrder) {
        return baseMapper.queryDeliverByOrder(pkOrder);
    }

    @Override
    public int insertBach(List<SaOrderItems> orderItemsList) {
        return baseMapper.insertBach(orderItemsList);
    }

    @Override
    public int checkOrderItemsPutOn(String orderCode) {
        return baseMapper.checkOrderItemsPutOn(orderCode);
    }

    @Override
    public int updateToPayByPkOrder(List<Long> pkOrderList, Integer pkCountry, Long userId) {
        return baseMapper.updateToPayByPkOrder(pkOrderList, pkCountry, userId);
    }

    @Override
    public int copyDeductionItems(Long pkOrderOld, Long pkOrderNew, Long userId, Date nowDate) {
        return baseMapper.copyDeductionItems(pkOrderOld, pkOrderNew, userId, nowDate);
    }

    @Override
    public List<OrderItemsParam> selectByWaresCodeList(String orderCode) {
        return baseMapper.selectByWaresCodeList(orderCode);
    }

    @Override
    public int countOrderDeliver(List<String> orderCodeList, Integer pkCountry) {
        return baseMapper.countOrderDeliver(orderCodeList, pkCountry);
    }

}
