| | |
| | | |
| | | // åºå®æ¥è¯¢ç«åºåºå |
| | | getData() { |
| | | const url = "api/StockInfo/GetStockSelectViews?materielCode="; |
| | | const url = "api/StockInfo/GetSelectViewDTOs?materielCode="; |
| | | this.http |
| | | .post( |
| | | url + this.row.materielCode + "&orderId=" + this.row.id, |
| | | url + this.row.materielCode + "&orderNo=" + this.row.orderNo, |
| | | null, |
| | | "æ¥è¯¢ä¸" |
| | | ) |
| | |
| | | public List<StockSelectViewDTO> GetSelectViewDTOs(string orderNo,string materielCode) |
| | | { |
| | | var outboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == orderNo).First(); |
| | | if(outboundOrder == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°åæ®ç¼å·ä¸º{orderNo}çåºåºåä¿¡æ¯"); |
| | | } |
| | | return GetStockSelectViews(outboundOrder.Id, materielCode); |
| | | } |
| | | |
| | |
| | | .Includes(x => x.Details); |
| | | |
| | | // æ§è¡æ¥è¯¢å¹¶æå
è¿å
åºæåº |
| | | var stocks = stockQuery.ToList() |
| | | .Where(x => x.Details.Any(d => |
| | | d.MaterielCode == materielCode && |
| | | string.IsNullOrEmpty(orderDetail.BatchNo)?true: d.BatchNo == orderDetail.BatchNo&& |
| | | string.IsNullOrEmpty(orderDetail.BatchNo)?true:d.SupplyCode == orderDetail.SupplyCode && |
| | | d.StockQuantity > d.OutboundQuantity |
| | | )) |
| | | .OrderBy(x => x.CreateDate) |
| | | .ToList(); |
| | | var Qstocks = stockQuery.Where(x => x.Details.Any(d => d.MaterielCode == materielCode &&d.StockQuantity > d.OutboundQuantity)); |
| | | |
| | | if (!string.IsNullOrEmpty(orderDetail.BatchNo)) |
| | | { |
| | | |
| | | Qstocks = stockQuery.Where(x => x.Details.Any(d => d.BatchNo == orderDetail.BatchNo)); |
| | | |
| | | } |
| | | if (!string.IsNullOrEmpty(orderDetail.SupplyCode)) |
| | | { |
| | | |
| | | Qstocks = stockQuery.Where(x => x.Details.Any(d => d.SupplyCode == orderDetail.SupplyCode)); |
| | | |
| | | } |
| | | |
| | | var stocks= Qstocks.OrderBy(x => x.CreateDate) .ToList(); |
| | | |
| | | foreach (var stock in stocks) |
| | | { |
| | | var relevantDetails = stock.Details |
| | | .Where(d => d.MaterielCode == materielCode && |
| | | string.IsNullOrEmpty(orderDetail.BatchNo) ? true : d.BatchNo == orderDetail.BatchNo && |
| | | string.IsNullOrEmpty(orderDetail.BatchNo) ? true : d.SupplyCode == orderDetail.SupplyCode && |
| | | string.IsNullOrEmpty(orderDetail.SupplyCode) ? true : d.SupplyCode == orderDetail.SupplyCode && |
| | | d.StockQuantity > d.OutboundQuantity) |
| | | .ToList(); |
| | | |
| | |
| | | result.Add(new StockSelectViewDTO |
| | | { |
| | | LocationCode = stock.LocationCode, |
| | | MaterielCode = materielCode, |
| | | MaterielCode = firstDetail. MaterielCode, |
| | | MaterielName = firstDetail.MaterielName, |
| | | BatchNo = orderDetail.BatchNo, |
| | | SupplyCode = orderDetail.SupplyCode, |
| | |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Model.Models.Check; |
| | | using WIDESEA_Model.Models.Outbound; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | |
| | | private readonly IInboundOrderService _inboundOrderService; |
| | | private readonly IInboundOrderDetailService _inboundOrderDetailService; |
| | | |
| | | private readonly IRepository<Dt_ReCheckOrder> _reCheckOrderRepository; |
| | | private readonly IRepository<Dt_OutboundBatch> _OutboundBatchRepository; |
| | | private readonly IOutboundOrderService _outboundOrderService; |
| | | private readonly IOutboundOrderDetailService _outboundOrderDetailService; |
| | |
| | | |
| | | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList(); |
| | | |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository) : base(BaseDal) |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository,IRepository<Dt_ReCheckOrder> reCheckOrderRepository) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _outStockLockInfoService = outStockLockInfoService; |
| | | _allocateService = allocateService; |
| | | _OutboundBatchRepository = outboundBatchRepository; |
| | | _reCheckOrderRepository = reCheckOrderRepository; |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | ReqCode = Guid.NewGuid().ToString(), |
| | | ReqTime = DateTime.Now.ToString(), |
| | | BusinessType = "3", |
| | | BusinessType = "2", |
| | | FactoryArea = outboundOrder.FactoryArea, |
| | | OperationType = 1, |
| | | Operator = outboundOrder.Operator, |
| | |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Model.Models.Basic; |
| | | using WIDESEA_Model.Models.Check; |
| | | using WIDESEA_Model.Models.Outbound; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | |
| | | { |
| | | try |
| | | { |
| | | (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(orderDetailId, stockSelectViews); |
| | | var orderNo = _reCheckOrderRepository.Db.Queryable<Dt_ReCheckOrder>().First(x => x.Id == orderDetailId)?.OrderNo; |
| | | var outboundOrder = _outboundOrderService.Db.Queryable<Dt_OutboundOrder>().Includes(x => x.Details).First(x => x.UpperOrderNo == orderNo); |
| | | if(outboundOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æ¾ä¸å°åæ®"); |
| | | } |
| | | (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) result = OutboundTaskDataHandle(outboundOrder.Details.First().Id, stockSelectViews); |
| | | |
| | | WebResponseContent content = GenerateOutboundTaskDataUpdate(result.Item1, result.Item2, result.Item3, result.Item4, result.Item5); |
| | | |
| | |
| | | [HttpPost, HttpGet, Route("GetSelectViewDTOs"), AllowAnonymous] |
| | | public List<StockSelectViewDTO> GetSelectViewDTOs(string orderNo, string materielCode) |
| | | { |
| | | try |
| | | { |
| | | return Service.GetSelectViewDTOs(orderNo, materielCode); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | return new List<StockSelectViewDTO>(); |
| | | } |
| | | } |
| | | } |
| | | } |