| | |
| | | /// <returns></returns> |
| | | public List<MateDataStockDto> GetDataStockList(string skuNo, string skuName, string ownerNo, string ownerName) |
| | | { |
| | | string str = "select stock.SkuNo,stock.SkuName,stock.LotNo,stock.LotText,stock.Standard,stock.Qty,stock.LockQty,stock.FrozenQty,stock.OwnerNo,stock.OwnerName,(mate.Weight * stock.Qty) WeightSum from DataStock stock left join SysMaterials mate on stock.SkuNo = mate.SkuNo Where stock.IsDel = @isdel"; |
| | | string str = "select stock.SkuNo,stock.SkuName,stock.LotNo,stock.LotText,stock.Standard,stock.Qty," + |
| | | "stock.LockQty,stock.FrozenQty,stock.OwnerNo,stock.OwnerName,(mate.Weight * stock.Qty) WeightSum " + |
| | | "from DataStock stock " + |
| | | "left join SysMaterials mate on stock.SkuNo = mate.SkuNo " + |
| | | "Where stock.IsDel = @isdel"; |
| | | //判断物料编码是否为空 |
| | | if (!string.IsNullOrEmpty(skuNo)) |
| | | { |
| | |
| | | /// <param name="status">库存状态</param> |
| | | /// <param name="inspectStatus">质检状态</param> |
| | | /// <returns></returns> |
| | | public List<StockDetailDto> GetInventoryList1(string skuNo, string skuName, string lotNo, string locatNo, string palletNo, string status, string inspectStatus, string ownerNo, string ownerName) |
| | | public List<StockDetailDto> GetInventoryList1(string skuNo, string skuName, string lotNo, string locatNo, string palletNo, |
| | | string status, string inspectStatus, string ownerNo, string ownerName) |
| | | { |
| | | string str = "select detail.*,house.WareHouseNo + '-' + house.WareHouseName as WareHouseName,roadway.RoadwayNo + '-' + roadway.RoadwayName as RoadwayName,area.AreaNo + '-' + area.AreaName as AreaName from DataStockDetail detail left join SysStorageRoadway roadway on detail.RoadwayNo = roadway.RoadwayNo left join SysWareHouse house on detail.WareHouseNo = house.WareHouseNo left join SysStorageArea area on detail.AreaNo = area.AreaNo Where detail.IsDel = @isdel"; |
| | | string str = "select detail.*,house.WareHouseNo + '-' + house.WareHouseName as WareHouseName," + |
| | | "roadway.RoadwayNo + '-' + roadway.RoadwayName as RoadwayName,area.AreaNo + '-' + area.AreaName as AreaName " + |
| | | "from DataStockDetail detail " + |
| | | "left join SysStorageRoadway roadway on detail.RoadwayNo = roadway.RoadwayNo " + |
| | | "left join SysWareHouse house on detail.WareHouseNo = house.WareHouseNo " + |
| | | "left join SysStorageArea area on detail.AreaNo = area.AreaNo " + |
| | | "Where detail.IsDel = @isdel"; |
| | | //判断物料编码是否为空 |
| | | if (!string.IsNullOrEmpty(skuNo)) |
| | | { |
| | | str += " and detail.SkuNo = @skuno"; |
| | | str += " and detail.SkuNo like @skuno"; |
| | | } |
| | | //判断物料名称是否为空 |
| | | if (!string.IsNullOrEmpty(skuName)) |
| | | { |
| | | str += " and detail.SkuName = @skuname"; |
| | | str += " and detail.SkuName like @skuname"; |
| | | } |
| | | //判断批次是否为空 |
| | | if (!string.IsNullOrEmpty(lotNo)) |
| | | { |
| | | str += " and detail.LotNo = @lotno"; |
| | | str += " and detail.LotNo like @lotno"; |
| | | } |
| | | //判断储位地址是否为空 |
| | | if (!string.IsNullOrEmpty(locatNo)) |
| | | { |
| | | str += " and detail.LocatNo = @locatno"; |
| | | str += " and detail.LocatNo like @locatno"; |
| | | } |
| | | //判断托盘条码是否为空 |
| | | if (!string.IsNullOrEmpty(palletNo)) |
| | | { |
| | | str += " and detail.PalletNo = @palletno"; |
| | | str += " and detail.PalletNo like @palletno"; |
| | | } |
| | | //判断库存状态是否为空 |
| | | if (!string.IsNullOrEmpty(status)) |
| | |
| | | List<StockDetailDto> stockDetailsList = Db.Ado.SqlQuery<StockDetailDto>(str, new |
| | | { |
| | | isdel = "0", //是否删除 |
| | | skuno = skuNo, //物料编码 |
| | | skuname = skuName, //物料名称 |
| | | lotno = lotNo, //批次 |
| | | locatno = locatNo, //储位地址 |
| | | palletno = palletNo, //托盘条码 |
| | | skuno = "%" + skuNo + "%", //物料编码 |
| | | skuname = "%" + skuName + "%", //物料名称 |
| | | lotno = "%" + lotNo + "%", //批次 |
| | | locatno = "%" + locatNo + "%", //储位地址 |
| | | palletno = "%" + palletNo + "%", //托盘条码 |
| | | status = status, //库存状态 |
| | | inspectstatus = inspectStatus, //质检状态 |
| | | ownerNo = "%" + ownerNo + "%", //货主编码 |