| | |
| | | private readonly IMapper _mapper; |
| | | private readonly IBasicService _basicService; |
| | | private readonly IOutboundOrderDetailRepository _outboundOrderDetailRepository; |
| | | private readonly IStockInfoService _stockInfoService; |
| | | |
| | | public IOutboundOrderRepository Repository => BaseDal; |
| | | |
| | | public OutboundOrderService(IOutboundOrderRepository BaseDal, IMapper mapper, IBasicService basicService, IOutboundOrderDetailRepository outboundOrderDetailRepository) : base(BaseDal) |
| | | public OutboundOrderService(IOutboundOrderRepository BaseDal, IMapper mapper, IBasicService basicService, IOutboundOrderDetailRepository outboundOrderDetailRepository, IStockInfoService stockInfoService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _basicService = basicService; |
| | | _outboundOrderDetailRepository = outboundOrderDetailRepository; |
| | | _stockInfoService = stockInfoService; |
| | | } |
| | | |
| | | public WebResponseContent ReceiveOutOrder(ErpOutOrderDTO model) |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥æç»è¡å·ä¿¡æ¯"); |
| | | } |
| | | if(outboundOrderDetail.OrderDetailStatus != OrderDetailStatusEnum.New.ObjToInt()) |
| | | if (outboundOrderDetail.OrderDetailStatus != OrderDetailStatusEnum.New.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æç»ä¸å¯ä¿®æ¹"); |
| | | } |
| | |
| | | |
| | | _outboundOrderDetailRepository.UpdateData(outboundOrderDetail); |
| | | } |
| | | else if (model.Way == 3) |
| | | { |
| | | if (oldOutboundOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥åºåºå"); |
| | | } |
| | | } |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent ReleaseOutOrder(int id) |
| | | { |
| | | try |
| | | { |
| | | Dt_OutboundOrder outboundOrder = Db.Queryable<Dt_OutboundOrder>().Where(x => x.Id == id).Includes(x => x.Details).First(); |
| | | if (outboundOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥åºåºå"); |
| | | } |
| | | if(outboundOrder.Details == null || outboundOrder.Details.Count == 0) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°æç»ä¿¡æ¯"); |
| | | } |
| | | |
| | | foreach (var item in outboundOrder.Details) |
| | | { |
| | | } |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |