| | |
| | | 锘縰sing Autofac.Core; |
| | | using AutoMapper; |
| | | using MailKit.Search; |
| | | using SqlSugar; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IAllocateService; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_IRecordService; |
| | |
| | | private readonly IRepository<Dt_StockInfoDetail> _stockInfoDetailRepository; |
| | | private readonly IOutboundOrderService _outboundOrderService; |
| | | //private readonly IOutboundOrderDetailService _outboundOrderDetailService; |
| | | |
| | | private readonly IRepository<Dt_AllocateOrder> _allocateRepository; |
| | | private readonly ILocationInfoService _locationInfoService; |
| | | public StockInfoService(IRepository<Dt_StockInfo> BaseDal, IMapper mapper, IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRecordService recordService, ILocationInfoService locationInfoService, IOutboundOrderService outboundOrderService) : base(BaseDal) |
| | | public StockInfoService(IRepository<Dt_StockInfo> BaseDal, IMapper mapper, IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRecordService recordService, ILocationInfoService locationInfoService, IOutboundOrderService outboundOrderService, IRepository<Dt_AllocateOrder> allocateRepository) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _stockInfoDetailRepository = stockInfoDetailRepository; |
| | | _recordService = recordService; |
| | | _locationInfoService = locationInfoService; |
| | | _outboundOrderService = outboundOrderService; |
| | | _allocateRepository = allocateRepository; |
| | | //_outboundOrderDetailService = outboundOrderDetailService; |
| | | } |
| | | |
| | |
| | | // } |
| | | |
| | | //} |
| | | |
| | | public List<StockSelectViewDTO> GetAllocateSelectViewDTOs(int orderId, string materielCode) |
| | | { |
| | | var dballocate = _allocateRepository.Db.Queryable<Dt_AllocateOrder>().First(x => x.Id == orderId); |
| | | if (dballocate == null) |
| | | { |
| | | throw new Exception($"鏈壘鍒板崟鎹紪鍙蜂负{dballocate.OrderNo}鐨勫崟淇℃伅"); |
| | | |
| | | } |
| | | |
| | | var outboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrder>().Where(x => x.OrderNo == dballocate.OrderNo).First(); |
| | | if (outboundOrder == null) |
| | | { |
| | | throw new Exception($"鏈壘鍒板崟鎹紪鍙蜂负{dballocate.OrderNo}鐨勫嚭搴撳崟淇℃伅"); |
| | | } |
| | | return GetStockSelectViews(outboundOrder.Id, materielCode); |
| | | } |
| | | |
| | | public List<StockSelectViewDTO> GetSelectViewDTOs(string orderNo,string materielCode) |
| | | { |
| | | var outboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == orderNo).First(); |