| | |
| | | { |
| | | InboundOrderAddDTO orderAddDTO = saveModel.MainData.DicToModel<InboundOrderAddDTO>(); |
| | | orderAddDTO.Details = saveModel.DetailData.DicToIEnumerable<InboundOrderDetailAddDTO>(); |
| | | List<string> LocationCodes = orderAddDTO.Details |
| | | .Where(x => !string.IsNullOrEmpty(x.LocationCode)) |
| | | .Select(x => x.LocationCode).ToList(); |
| | | if (LocationCodes.Any()) |
| | | { |
| | | var content = _basicService.LocationInfoService.UpdateStatus(LocationCodes, LocationStatusEnum.PalletLock.ObjToInt()); |
| | | if (!content.Status) return WebResponseContent.Instance.Error("æå®è´§ä½å¼å¸¸"); |
| | | } |
| | | return AddInboundOrder(orderAddDTO); |
| | | } |
| | | |
| | |
| | | if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2); |
| | | #endregion |
| | | |
| | | List<string> LocationCodes = orderAddDTO.Details |
| | | .Where(x => !string.IsNullOrEmpty(x.LocationCode)) |
| | | .Select(x => x.LocationCode).ToList(); |
| | | |
| | | Dt_InboundOrder inboundOrder = _mapper.Map<Dt_InboundOrder>(orderAddDTO); |
| | | inboundOrder.OrderNo = DateTime.Now.ToString("yyMMddHHmmss"); |
| | | //inboundOrder.OrderNo = DateTime.Now.ToString("yyMMddHHmmss"); |
| | | inboundOrder.OrderStatus = InboundStatusEnum.æªå¼å§.ObjToInt(); |
| | | bool a = BaseDal.Db.InsertNav(inboundOrder).Include(x => x.Details).ExecuteCommand(); |
| | | Db.Ado.BeginTran(); |
| | | if (LocationCodes.Any()) |
| | | { |
| | | content = _basicService.LocationInfoService.UpdateStatus(LocationCodes, LocationStatusEnum.PalletLock.ObjToInt()); |
| | | if (!content.Status) |
| | | throw new Exception(content.Message); |
| | | } |
| | | |
| | | BaseDal.Db.InsertNav(inboundOrder).Include(x => x.Details).ExecuteCommand(); |
| | | Db.Ado.CommitTran(); |
| | | content = WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Db.Ado.RollbackTran(); |
| | | content = WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | finally |