dengjunjie
2025-03-12 f43b7df8400f4fcffc9f19dca0888d61e2b33d5f
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/InboundOrderService.cs
@@ -55,14 +55,6 @@
        {
            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);
        }
@@ -81,14 +73,28 @@
                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