1
wangxinhui
15 小时以前 0023d3db5bd701864b73e57c0240c219c40c3a4e
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesProductService.cs
@@ -541,6 +541,7 @@
                {
                    return content.Error($"提库任务单{model.TaskNo}已存在");
                }
                //生成提库单
                Dt_MesRworkOutboundOrder mesRworkOutboundOrder = new Dt_MesRworkOutboundOrder()
                {
                    WarehouseId = warehouse.WarehouseId,
@@ -560,6 +561,7 @@
                List<Dt_ProStockInfo>? proStockInfos = null;
                List<Dt_OutProStockInfo>? outProStockInfos = null;
                List<Dt_LocationInfo>? locationInfos = null;
                List<Dt_ProStockInfoDetail> proStockInfoDetails = new List<Dt_ProStockInfoDetail>();
                //分配库存生成提库任务
                (List<Dt_ProStockInfo>?, Dt_MesRworkOutboundOrder?, List<Dt_OutProStockInfo>?, List<Dt_LocationInfo>) result = _outboundService.RworkOutboundOrderService.AssignMesStocks(mesRworkOutboundOrder);
                if (result.Item1 != null && result.Item1.Count > 0)
@@ -585,6 +587,10 @@
                    x.TargetAddress = "5236";
                    x.OrderNo = mesRworkOutboundOrder.TaskNo;
                });
                proStockInfos.ForEach(x =>
                {
                    proStockInfoDetails.AddRange(x.proStockInfoDetails);
                });
                _unitOfWorkManage.BeginTran();
                int id = BaseDal.AddData(tasks);
@@ -604,6 +610,12 @@
                    }
                }
                _outboundService.RworkOutboundOrderService.Repository.AddData(mesRworkOutboundOrder);
                //MES成品库存板出库同步
                WebResponseContent responseContent = _outboundService.RworkOutboundOrderService.ProductOutBoundSync(_outboundService.RworkOutboundOrderService.MesProOutBound(mesRworkOutboundOrder, proStockInfoDetails));
                if (!responseContent.Status)
                {
                    throw new Exception("同步MES库存板出库失败,错误:" + responseContent.Message);
                }
                _unitOfWorkManage.CommitTran();
                return content.OK("提供返库单接收成功");
            }