wangxinhui
2025-03-01 d11b1f9c98e8765d3cee15abd4474b0e05a5acbc
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs
@@ -24,10 +24,8 @@
using WIDESEA_ITaskInfoService;
using WIDESEA_Model.Models;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Model.Models.Outbound;
using System.Diagnostics.Metrics;
using System.Reflection.Metadata;
using WIDESEA_Model.Models.Inbound;
using WIDESEA_DTO.Task;
namespace WIDESEA_TaskInfoService
@@ -911,7 +909,6 @@
                    content.BSucc = true;
                    content.StrCode = "0000";
                    content.StrMsg = "执行成功";
                    content.DataTime = DateTime.Now;
                    content.MaterialCode = stock.MaterielCode;
                    content.Quantity = stock.StockQuantity;
                    content.Unit = stock.Unit;
@@ -928,6 +925,46 @@
                return MesResponseContent.Instance.Error(ex.Message);
            }
        }
        /// <summary>
        /// MES成品入库单接收
        /// </summary>
        /// <returns></returns>
        public MesResponseContent BagInfoSync(MesBagInfoModel bagInfoModel)
        {
            MesResponseContent content = new MesResponseContent();
            try
            {
                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x=>x.WarehouseCode==bagInfoModel.WarehouseCode);
                if (warehouse==null)
                {
                    return content.Error("未找到仓库信息");
                }
                List<Dt_MesProInOrderDetail> mesProInOrderDetails = new List<Dt_MesProInOrderDetail>();
                foreach (var item in bagInfoModel.BagDetails)
                {
                    mesProInOrderDetails.Add(_mapper.Map<Dt_MesProInOrderDetail>(item));
                }
                mesProInOrderDetails.ForEach(x =>
                {
                    x.OverInQuantity = 0;
                });
                Dt_MesProInOrder mesProInOrder = new Dt_MesProInOrder()
                {
                    WarehouseId = warehouse.WarehouseId,
                    BatchNo = bagInfoModel.BatchNo,
                    MesProStatus = InOrderStatusEnum.未开始.ObjToInt(),
                    UnPackStock=bagInfoModel.UnPackStock,
                    Details= mesProInOrderDetails
                };
                Db.InsertNav(mesProInOrder).Include(x=>x.Details).ExecuteCommand();
                return content.OK("接收成功");
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// æˆå“è¿”工提库