/*
|
* Copyright (c) 2018-2025, ztt All rights reserved.
|
*
|
* Redistribution and use in source and binary forms, with or without
|
* modification, are permitted provided that the following conditions are met:
|
*
|
* Redistributions of source code must retain the above copyright notice,
|
* this list of conditions and the following disclaimer.
|
* Redistributions in binary form must reproduce the above copyright
|
* notice, this list of conditions and the following disclaimer in the
|
* documentation and/or other materials provided with the distribution.
|
* Neither the name of the pig4cloud.com developer nor the names of its
|
* contributors may be used to endorse or promote products derived from
|
* this software without specific prior written permission.
|
* Author: ztt
|
*/
|
|
package com.chinaztt.mes.warehouse.mapper;
|
|
import com.alibaba.fastjson.JSONObject;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.chinaztt.mes.warehouse.dto.*;
|
import com.chinaztt.mes.warehouse.entity.InventoryDetail;
|
import com.chinaztt.mes.warehouse.entity.Stock;
|
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Param;
|
|
import java.math.BigDecimal;
|
import java.util.List;
|
|
/**
|
* 库存表
|
*
|
* @author cxf
|
* @date 2020-10-22 16:37:46
|
*/
|
@Mapper
|
public interface StockMapper extends BaseMapper<Stock> {
|
|
/**
|
* 分页查询
|
*
|
* @param page
|
* @param gen
|
* @return
|
*/
|
IPage<StockDTO> getStockPage(Page page, @Param("ew") QueryWrapper<StockDTO> gen);
|
|
/**
|
* 统计实时库存数量
|
*
|
* @param gen
|
* @return
|
*/
|
BigDecimal getSumStockQuantity(@Param("ew") QueryWrapper<StockDTO> gen);
|
|
/**
|
* 根据sn号获取库存明细
|
*
|
* @param partBatchNo
|
* @return
|
*/
|
List<StockDTO> getStockBySn(@Param("partBatchNo") String partBatchNo);
|
|
/**
|
* 部分页查询
|
*
|
* @param gen
|
* @return
|
*/
|
List<FeedingStockDTO> getFeedingStock(@Param("workstationId") Long workstationId, @Param("ew") QueryWrapper<FeedingStockDTO> gen);
|
|
/**
|
* 部分页查询
|
*
|
* @param gen
|
* @return
|
*/
|
List<JSONObject> pdaList(@Param("ew") QueryWrapper<FeedingStockDTO> gen);
|
|
/**
|
* 分页查询
|
*
|
* @param page
|
* @param gen
|
* @param partId
|
* @return
|
*/
|
IPage<List<StockDTO>> getStockByPartIdPage(Page page, @Param("ew") QueryWrapper<StockDTO> gen, @Param("partId") Long partId);
|
|
/**
|
* 根据工作站id查询线边仓
|
*
|
* @param gen
|
* @return
|
*/
|
IPage<List<StockDTO>> getStockByWorkstationId(Page page, @Param("ew") QueryWrapper<StockDTO> gen);
|
|
/**
|
* 根据工作站id查询线边仓待处理物料
|
*
|
* @param gen
|
* @return
|
*/
|
IPage<List<StockDTO>> getToDealStockByWorkstationId(Page page, @Param("ew") QueryWrapper<StockDTO> gen);
|
|
/**
|
* 根据库位查询零件
|
*
|
* @param ids
|
* @return
|
*/
|
List<StockDTO> getStockByLocation(@Param("ids") List<Long> ids);
|
|
|
/**
|
* 根据零件、库位和批次号筛选实时库存
|
*
|
* @param id
|
* @param id1
|
* @param partBatchNo
|
* @return
|
*/
|
List<StockDTO> getStock(@Param("id") Long id, @Param("id1") Long id1, @Param("ew") String partBatchNo,@Param("condition") String condition);
|
|
/**
|
* 根据零件、库位和批次号筛选实时库存数量
|
*
|
* @param id
|
* @param id1
|
* @param partBatchNo
|
* @return
|
*/
|
Integer countStock(@Param("id") Long id, @Param("id1") Long id1, @Param("ew") String partBatchNo,@Param("condition") String condition);
|
|
/**
|
* 分页查询
|
*
|
* @param page
|
* @param gen
|
* @param operationTaskId
|
* @return
|
*/
|
IPage<List<StockDTO>> getStockPageByOperation(Page page, @Param("ew") QueryWrapper<StockDTO> gen, @Param("operationTaskId") Long operationTaskId);
|
|
/**
|
* 不分页查询
|
*
|
* @param gen
|
* @param operationTaskId
|
* @return
|
*/
|
List<StockDTO> getStockPageByOperation(@Param("ew") QueryWrapper<StockDTO> gen, @Param("operationTaskId") Long operationTaskId);
|
|
/**
|
* 不分页查询
|
*
|
* @param gen
|
* @param operationTaskId
|
* @return
|
*/
|
List<StockDTO> getStockListByOperation(@Param("ew") QueryWrapper<StockDTO> gen, @Param("operationTaskId") Long operationTaskId);
|
|
|
/**
|
* 根据产出物料系统编号查询序列号
|
* @param systemNo
|
* @return
|
*/
|
String getSerialNoBySystemNo(@Param("systemNo") String systemNo);
|
|
/**
|
* 根据SN号获取可用实时库存对象list
|
* @return
|
*/
|
List<StockDTO> getEnableStockObjList(@Param("sn") String sn);
|
|
/**
|
* 获取可用库位对象list
|
* @return
|
*/
|
List<JSONObject> getEnableLocationObjList();
|
|
/**
|
* 根据库存id获取MoveLibraryBoxDTO集合
|
* @param stockId
|
* @return
|
*/
|
List<MoveLibraryBoxDTO> getMoveLibraryBoxDTOListByStockId(@Param("stockId") Long stockId);
|
|
/**
|
* 根据库存id查找对应的车间订单
|
* @param id
|
* @return
|
*/
|
String getStockMoNo(@Param("id") Long id);
|
|
/**
|
* 根据仓库,库位号,零件查找实时库存
|
* @param locationIds
|
* @param warehouseIds
|
* @param partId
|
* @return
|
*/
|
List<InventoryDetail> getStockByInventory(@Param("locationIds") List<Long> locationIds,@Param("warehouseIds") List<Long> warehouseIds,@Param("partId") Long partId);
|
/*
|
* 根据零件批次号,零件id查询是否工序库存
|
* @param outBatchNo
|
* @param partId
|
* @return
|
*/
|
List<Boolean> getStockOperationStatus(@Param("outBatchNo") String outBatchNo, @Param("partId") Long partId,
|
@Param("systemNo") String systemNo);
|
|
/**
|
* 查找检测合格库位库存
|
* @param sn
|
* @param partNo
|
* @return
|
*/
|
List<StockDTO> getFinishProductStock(@Param("sn") String sn,@Param("partNo") String partNo);
|
/*
|
* 根据locationId,sn查询库存表
|
* @param locationId
|
* @param sn
|
* @return
|
*/
|
List<InventoryDetail> getStockByLocIdAndSn(@Param("locationId") Long locationId, @Param("sn") String sn);
|
|
/**
|
* 分页查询出库位尾号为001的
|
*
|
* @param page
|
* @param gen
|
* @return
|
*/
|
IPage<List<StockDTO>> getStockPageByLocNo(Page page, @Param("ew") QueryWrapper<StockDTO> gen);
|
|
/**
|
* 获取成品库库存
|
* @param partBatchNo
|
* @param partId
|
* @return
|
*/
|
int getFinishLocationProduct(@Param("partBatchNo") String partBatchNo,@Param("partId") Long partId);
|
|
|
/**
|
* 根据sn号获取馈线合格证信息
|
* @param sn
|
* @param locationIdList
|
* @return
|
*/
|
FeederCertificateDTO getFeederCertificate(@Param("sn")String sn,@Param("locationIdList")List<Long> locationIdList);
|
|
|
/**
|
* 根据sn号获取车间订单信息
|
* @param snList
|
* @return
|
*/
|
List<FeederManufacturingOrderDTO> getFeederManufacturingOrder(@Param("snList") List<String> snList);
|
|
|
/**
|
* 根据仓库,库位号,零件查找报工产出
|
* @param locationIds
|
* @param warehouseIds
|
* @param partId
|
* @return
|
*/
|
List<InventoryDetail> getProductionByInventory(@Param("locationIds") List<Long> locationIds,@Param("warehouseIds") List<Long> warehouseIds,@Param("partId") Long partId);
|
|
|
|
|
/**
|
* 根据sn号获取库存信息
|
* @param snList
|
* @return
|
*/
|
List<StockDTO> getStockBySnList(@Param("snList")List<String> snList);
|
|
}
|