| | |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly IBasicRepository _basicRepository; |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IOutboundOrderDetailRepository _outboundOrderDetailRepository; |
| | | private readonly SqlSugarClient _dbBase; |
| | | |
| | | public IOutboundOrderRepository Repository => BaseDal; |
| | | |
| | | public OutboundOrderService(IOutboundOrderRepository BaseDal, IBasicRepository basicRepository, IMapper mapper, IMaterielInfoService materielInfoService, IStockInfoDetailService stockDetailService, IStockInfoService stockInfoService, IUnitOfWorkManage unitOfWorkManage,ITaskRepository taskRepository) : base(BaseDal) |
| | | public OutboundOrderService(IOutboundOrderRepository BaseDal, IBasicRepository basicRepository, IMapper mapper, IMaterielInfoService materielInfoService, IStockInfoDetailService stockDetailService, IStockInfoService stockInfoService, IUnitOfWorkManage unitOfWorkManage, ITaskRepository taskRepository, IOutboundOrderDetailRepository outboundOrderDetailRepository) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _materielInfoService = materielInfoService; |
| | |
| | | _stockService = stockInfoService; |
| | | _dbBase = unitOfWorkManage.GetDbClient(); |
| | | _taskRepository = taskRepository; |
| | | _outboundOrderDetailRepository = outboundOrderDetailRepository; |
| | | } |
| | | |
| | | public override WebResponseContent AddData(SaveModel saveModel) |
| | |
| | | } |
| | | saveModel.DetailData = dics; |
| | | return base.UpdateData(saveModel); |
| | | } |
| | | |
| | | public override WebResponseContent DeleteData(object[] keys) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<Dt_OutboundOrder> _OutboundOrders = BaseDal.Db.Queryable<Dt_OutboundOrder>().Includes(x => x.Details).Where(x => keys.Contains(x.Id)).ToList(); |
| | | if (_OutboundOrders.Count < 1) throw new Exception("æªæ¾å°åºåºå"); |
| | | List<Dt_OutboundOrderDetail> orderDetails = new List<Dt_OutboundOrderDetail>(); |
| | | foreach (var item in _OutboundOrders) |
| | | { |
| | | if (item.Details.Where(x => x.LockQuantity != x.OverOutQuantity).Any()) |
| | | throw new Exception("å卿ªåºåºå®ææç"); |
| | | orderDetails.AddRange(item.Details); |
| | | item.Details = null; |
| | | } |
| | | BaseDal.DeleteAndMoveIntoHty(_OutboundOrders, OperateType.人工å é¤); |
| | | content.Status = _outboundOrderDetailRepository.DeleteAndMoveIntoHty(orderDetails, OperateType.人工å é¤); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | public WebResponseContent AddOutboundOrder(OutboundOrderAddDTO orderAddDTO) |
| | |
| | | return (false, "忮已åå¨", outboundOrderAddDTO); |
| | | } |
| | | return (true, "æå", outboundOrderAddDTO); |
| | | } |
| | | |
| | | public WebResponseContent ReleaseOutOrder(int orderId) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |