| | |
| | | using Microsoft.Extensions.Logging; |
| | | using MailKit.Search; |
| | | using Microsoft.Extensions.Logging; |
| | | using SqlSugar; |
| | | using WIDESEA_BasicService; |
| | | using WIDESEA_Common.CommonEnum; |
| | |
| | | /// </summary> |
| | | public class OutboundPickingService : ServiceBase<Dt_PickingRecord, IRepository<Dt_PickingRecord>>, IOutboundPickingService |
| | | { |
| | | #region æé 彿° |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | public IRepository<Dt_PickingRecord> Repository => BaseDal; |
| | | |
| | |
| | | _interfaceLog = interfaceLog; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region æ¥è¯¢æ¹æ³ |
| | | // è·åæªæ£éå表 |
| | |
| | | |
| | | return ValidationResult<(Dt_PickingRecord, Dt_OutStockLockInfo, Dt_OutboundOrderDetail)>.Success((pickingRecord, lockInfo, orderDetail)); |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ£æ¥éå®ä¿¡æ¯å¯¹åºçæ¡ç æ¯å¦å·²ç»ååº |
| | |
| | | #endregion |
| | | |
| | | #region ååºæä½ç§ææ¹æ³ |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ£æ¥æ´ä¸ªæçæ¯å¦å·²ç»ååº |
| | | /// </summary> |
| | |
| | | } |
| | | |
| | | private async Task<WebResponseContent> HandleNoReturnItems(string orderNo, string palletCode, Dt_Task originalTask, int stockInfoId) |
| | | { |
| | | { |
| | | try |
| | | { |
| | | var locationtype = 0; |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | private async Task HandlePalletStockGoodsReturn(List<Dt_StockInfoDetail> palletStockGoods) |
| | | { |
| | |
| | | _logger.LogError($"UpdateOrderStatusForReturn失败 - OrderNo: {orderNo}, Error: {ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 空æç |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region è¾
婿¹æ³ |
| | | /// <summary> |
| | | /// ç»ä¸åææçç¶æ - è¿åæçç宿´ç¶æä¿¡æ¯ |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | private async Task<string> GenerateNewBarcode() |
| | | { |
| | |
| | | } |
| | | return WebResponseContent.Instance.OK("æ£é确认æå", new { SplitResults = new List<SplitResult>() }); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region èæåºå
¥åº |
| | |
| | | if (result1 != null && result1.code == 200) |
| | | { |
| | | var orderIds = inboundOrderDetails.Select(x => x.Id).Distinct().ToList(); |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | | if (inboundOrder.OrderStatus == InOrderStatusEnum.å
¥åºå®æ.ObjToInt()) |
| | | { |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1, Remark = "" }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | | } |
| | | _inboundOrderDetailService.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 }) |
| | | .Where(it => orderIds.Contains(it.Id)).ExecuteCommand(); |
| | | } |
| | | else |
| | | { |
| | | _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 2, Remark = result1.message }) |
| | | .Where(it => it.Id == inboundOrder.Id).ExecuteCommand(); |
| | | _inboundOrderDetailService.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 2 }) |
| | | .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand(); |
| | | } |
| | | //åºåºåä¼ MES |
| | | |
| | |
| | | |
| | | |
| | | await _outboundOrderService.Db.Updateable<Dt_OutboundOrder>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 1) |
| | | .SetColumns(it => new Dt_OutboundOrder { ReturnToMESStatus = 1, Remark = "" }) |
| | | .Where(x => x.Id == outboundOrder.Id) |
| | | .ExecuteCommandAsync(); |
| | | |
| | | await _interfaceLog.Db.Updateable<Dt_InterfaceLog>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 1) |
| | | .Where(x => x.DocumentNo == documentNo) |
| | | .ExecuteCommandAsync(); |
| | | } |
| | | else |
| | | { |
| | | var uporderIds = outboundOrderDetails.Select(x => x.Id).Distinct().ToList(); |
| | | await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 2) |
| | | .Where(x => uporderIds.Contains(x.Id)) |
| | | .ExecuteCommandAsync(); |
| | | |
| | | await _outboundOrderService.Db.Updateable<Dt_OutboundOrder>() |
| | | .SetColumns(it => new Dt_OutboundOrder { ReturnToMESStatus = 2, Remark = result.message }) |
| | | .Where(x => x.Id == outboundOrder.Id) |
| | | .ExecuteCommandAsync(); |
| | | |
| | | await _interfaceLog.Db.Updateable<Dt_InterfaceLog>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 2) |
| | | .Where(x => x.DocumentNo == documentNo) |
| | | .ExecuteCommandAsync(); |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | Dt_InboundOrderDetail inboundOrderDetail = _stockInfoDetailService.Db.Queryable<Dt_InboundOrderDetail>().Where(x=>x.Barcode == barcode&& x.OrderDetailStatus !=OrderDetailStatusEnum.Over.ObjToInt()).First(); |
| | | if(inboundOrderDetail == null) |
| | | Dt_InboundOrderDetail inboundOrderDetail = _stockInfoDetailService.Db.Queryable<Dt_InboundOrderDetail>().Where(x => x.Barcode == barcode && x.OrderDetailStatus != OrderDetailStatusEnum.Over.ObjToInt()).First(); |
| | | if (inboundOrderDetail == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥æ¡ç {barcode}çå
¥åºæç»æè
æç»ç¶æå·²å
¥æºä»å®æ"); |
| | | } |
| | |
| | | |
| | | return WebResponseContent.Instance.OK("æ¥è¯¢éè´åæå", data: resultData); |
| | | } |
| | | catch(Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | #region æ¯æç±»å®ä¹ |