分支自 SuZhouGuanHong/TaiYuanTaiZhong

huanghongfeng
2024-05-20 cb62fe00ff0c80bce983b0aa7a2b320fdc26f85f
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/ToMes/AddToFloat3.cs
@@ -3,10 +3,13 @@
using WIDESEA_Comm;
using WIDESEA_Comm.LogInfo;
using WIDESEA_Common;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Core.ManageUser;
using WIDESEA_Core.Utilities;
using WIDESEA_Entity.DomainModels;
using WIDESEA_Entity.DomainModels.Mes;
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.Repositories;
namespace WIDESEA_WMS
{
@@ -49,7 +52,7 @@
                {
                    station2.quantity = station1.quantity;
                    station2.bindSN = station1.bindSN;
                    station2.location_state = station1.location_state;
                    station2.location_state = LocationStateEnum.Stroge.ToString();
                    station2.tray_status = station1.tray_status;
                    freeDB.Update(station2);
@@ -64,14 +67,45 @@
                    throw new Exception("起始或目的地址,已存在任务!");
                }
                content.OK();
                WriteDBLog.Success($"手动移库", new { æ•°æ® = requestTemp }, "WMS", UserContext.Current.UserTrueName);
                WriteDBLog.Success($"手动移库", new { æ•°æ® = requestTemp }, "WMS", UserContext.Current.UserName + UserContext.Current.UserTrueName);
            }
            catch (Exception ex)
            {
                WriteDBLog.Error($"手动移库", new { æ•°æ® = requestTemp, å¼‚常信息 = ex.Message }, "WMS", UserContext.Current.UserTrueName);
                WriteDBLog.Error($"手动移库", new { æ•°æ® = requestTemp, å¼‚常信息 = ex.Message }, "WMS", UserContext.Current.UserName + UserContext.Current.UserTrueName);
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// å¤–协货位扫码确认物料已被取走
        /// </summary>
        /// <param name="saveModel"></param>
        /// <returns></returns>
        public WebResponseContent Confirmedcut(SaveModel saveModel)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                VOLContext context = new VOLContext();
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context);
                string sn = saveModel.MainData["from_address"].ToString();
                var station = stationinfoRepository.Find(x => x.bindSN.Contains(sn) && (x.stationCode.Contains("W01001001") || x.stationCode.Contains("W01001002") || x.stationCode.Contains("W01001003"))).FirstOrDefault();
                if (station == null) throw new Exception($"未找到车轮SN号:{sn}的外协货位信息!");
                station.Number = string.Empty;
                station.billetID = string.Empty;
                station.heatNumber = string.Empty;
                station.stationType = string.Empty;
                station.tray_status = "EmptyTray";
                station.lastUpdateTime = DateTime.Now;
                stationinfoRepository.Update(station, true);
                content.OK();
            }
            catch (Exception ex)
            {
                content.Message = ex.Message;
            }
            return content;
        }
    }
}