package com.prolog.cs.biz.outbound.dao;

import com.prolog.cs.biz.outbound.model.PickTaskD;
import com.prolog.cs.biz.outbound.model.dto.*;
import com.prolog.cs.biz.outbound.model.vo.ContainerQtyVo;
import com.prolog.cs.biz.outbound.model.vo.PickTaskDPickVo;
import com.prolog.cs.biz.outbound.model.vo.PickTaskDVo;
import com.prolog.cs.biz.outbound.model.vo.check.InnerCheckTaskDV2VO;
import com.prolog.cs.biz.outbound.model.vo.check.InnerCheckTaskDVO;
import com.prolog.framework.authority.core.dto.UserDTO;
import com.prolog.framework.dao.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

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

@Repository
public interface PickTaskDMapper extends BaseMapper<PickTaskD> {
   Integer addNum(@Param("pickTaskDId") String pickTaskDId,
                  @Param("user1") String user1,
                  @Param("user2") String user2,
                  @Param("incrementQty") BigDecimal incrementQty);
   Integer updateNum(@Param("pickTaskDId") String pickTaskDId,
                  @Param("user1") String user1,
                  @Param("user2") String user2,
                  @Param("newQty") BigDecimal newQty);

   List<InnerCheckTaskDVO> getPickTaskd(@Param("pickTaskId") String pickTaskId,@Param("showLcl") boolean showLcl);

   List<InnerCheckTaskDV2VO> getPickTaskdV2(@Param("pickTaskId") String pickTaskId, @Param("showLcl") boolean showLcl);

   List<InnerCheckTaskDV2VO> getPickTaskdAndWareHouseV2(@Param("pickTaskId") String pickTaskId,  @Param("warehouseId") String warehouseId);

   List<RePrintWholeDto> listWholeLabelRepair(PrintAgainVo printAgainVo);

   List<RePrintBulkDto> listSpellLabelRepair(PrintAgainVo printAgainVo);

    List<RePrintBulkDetailDto> listSpellLabelDetailRepair(@Param("billNos") List<String> billNos);

    List<RePrintWholeBulkDetailDto>  listWholeBulkDetailRepair(@Param("billIds") List<String> billIds);

    List<RePrintWholeBulkDto> listWholeBulkRepair(PrintAgainVo printAgainVo);

   List<RePrintWholeDto> listPrintTask(PrintAgainVo printAgainVo);

   List<Map<String, Object>> listCxPrintData(
           @Param("pickTaskIds") List<String> pickTaskIds,
           @Param("warehouseId") String warehouseId
   );

    List<PickTaskD> getPickTaskdByContainerCode(@Param("containerCode") String containerCode);

    List<PickTaskD> getPickTaskdByPickOrderIdAndContainerCode(@Param("containerCode") String containerCode,@Param("pickOrderId") String pickOrderId);

    List<PickTaskDVo> getBulkPickTaskDList(
            @Param("warehouseId")String warehouseId,
            @Param("enterpriseId")String enterpriseId,
            @Param("bldgId")String bldgId,
            @Param("pickOrderId")String pickOrderId,
            @Param("pks")List<String> pks
    );

    List<ContainerQtyVo> getContainerQty(
            @Param("warehouseId")String warehouseId,
            @Param("enterpriseId")String enterpriseId,
            @Param("bldgId")String bldgId,
            @Param("pickOrderId")String pickOrderId,
            @Param("pks")List<String> pks
    );

    List<PickTaskDPickVo> getByPickOrder(
            @Param("pickOrderId")String pickOrderId,
            @Param("locateId")String locateId,
            @Param("itemId")String itemId,
            @Param("manufacturerLotNum")String manufacturerLotNum
    );

    String getLclNo(
            @Param("stationCode")String stationCode,
            @Param("billId")String billId
    );

    List<PickTaskD> listInnerCheckPickTaskD(
            @Param("pickTaskId") String pickTaskId
    );

    List<InnerCheckTaskDV2VO> listPickTaskDByBarcodeDId(
            @Param("barcodeDIds") List<String> barcodeDIds
    );

    void updatePrintCount(@Param("pickTaskDIds")List<String> pickTaskDIds);

    void updatePrintCountByBarcode(@Param("ids")List<String> ids);

    List<PickTaskD> listPickD4EisConfirm(@Param("ids") String[] dIds);

    int updateVersion(@Param("version") int version, @Param("pickTaskDId") String pickTaskDId);

    List<PickTaskD> getPickTaskDListByPickTaskIds(@Param("pickTaskIds") String[] pickTaskIds);

    long updateZtPickTaskD(@Param("userDTO") UserDTO userDTO, @Param("userNo") String userNo, @Param("date") String date, @Param("flowStatus") String flowStatus, @Param("pickTaskIds") List<String> pickTaskIds);

    List<Map<String, String>> getCheckStatusBySrcCode(@Param("billIds") List<String> billIds);

    void updateByWaveStorageIds(@Param("waveStorageIds") List<String> waveStorageIds);

    List<String> getUnOutCheckBillNos(@Param("times")  Integer times);

}
