| | |
| | | using Org.BouncyCastle.Crypto; |
| | | using SqlSugar; |
| | | using SqlSugar.Extensions; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IStockRepository; |
| | |
| | | { |
| | | public class StockInfoRepository : RepositoryBase<Dt_StockInfo>, IStockInfoRepository |
| | | { |
| | | private readonly ILocationInfoRepository _locationInfoRepository; |
| | | public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage, ILocationInfoRepository locationInfoRepository) : base(unitOfWorkManage) |
| | | public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | _locationInfoRepository = locationInfoRepository; |
| | | } |
| | | |
| | | public List<StockViewDTO> GetAllStockViews() |
| | |
| | | AreaId = a.AreaId, |
| | | LocationCode = b.LocationCode, |
| | | Column = a.Column, |
| | | CreateDate = a.CreateDate, |
| | | Creater = a.Creater, |
| | | CreateDate = b.CreateDate, |
| | | Creater = b.Creater, |
| | | Depth = a.Depth, |
| | | EnalbeStatus = a.EnalbeStatus, |
| | | Id = a.Id, |
| | | EnalbeStatus = a.EnableStatus, |
| | | IsFull = b.IsFull, |
| | | Layer = a.Layer, |
| | | LocationName = a.LocationName, |
| | | LocationStatus = a.LocationStatus, |
| | | LocationType = a.LocationType, |
| | | Modifier = a.Modifier, |
| | | ModifyDate = a.ModifyDate, |
| | | Modifier = b.Modifier, |
| | | ModifyDate = b.ModifyDate, |
| | | PalletCode = b.PalletCode, |
| | | Remark = a.Remark, |
| | | StockRemark = b.Remark, |
| | | RoadwayNo = a.RoadwayNo, |
| | | Row = a.Row, |
| | | StockId = b.Id, |
| | | StockRemark = b.Remark, |
| | | StockStatus = b.StockStatus, |
| | | Details = b.Details, |
| | | }).Includes(x => x.Details).ToList(); |
| | |
| | | { |
| | | return Db.UpdateNav(stockInfo).Include(x => x.Details).ExecuteCommand(); |
| | | } |
| | | |
| | | public Dt_StockInfo GetPalletStockInfo(string roadwayNo) |
| | | { |
| | | //ISugarQueryable<string> locationCodes = Db.Queryable<Dt_LocationInfo>().Where(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || LocationEnalbeStatusEnum.Normal.ObjToInt() == x.EnalbeStatus)).Select(x => x.LocationCode); |
| | | |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => x.StockStatus == StockStatusEmun.å·²å
¥åº.ObjToInt() && SqlFunc.Subqueryable<Dt_LocationInfo>().Where(v => v.LocationCode == x.LocationCode && v.RoadwayNo == roadwayNo && v.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (v.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || EnableStatusEnum.Normal.ObjToInt() == v.EnableStatus)).Any()).OrderBy(x => x.ModifyDate).First(); |
| | | } |
| | | } |
| | | } |