xxyy
2025-03-10 457b75b642a1fdaa7158e5b047cabc5d7ae16333
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/ModifyAccessStatus.cs
@@ -1,4 +1,5 @@
using MailKit;
using Masuit.Tools;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -25,15 +26,18 @@
                if (locationinfo != null)
                {
                    //检测柜提供的货位状态,只有wms未锁定且提供的状态为允许才允许放货
                    if (locationinfo.Remark != LocationStatusByCode(result.StateCode))
                    if (locationinfo.Remark != result.StateCode.ToString())
                    {
                        locationinfo.Remark = LocationStatusByCode(result.StateCode);
                        locationinfo.Remark = result.StateCode.ToString();
                        _locationRepository.UpdateData(locationinfo);
                    }
                }
                else
                    throw new Exception("货位不存在");
                LogFactory.GetLog("分容库位同步").Info(true, $"\r\r--------------------------------------");
                LogFactory.GetLog("分容库位同步").Info(true, result.ToJsonString());
                return content.OK();
            }
            catch (Exception ex)
@@ -41,18 +45,20 @@
                return content.Error(ex.Message);
            }
        }
        private static string LocationStatusByCode(int code)
        {
            string str = null;
            switch (code)
            {
                case 1: str = "LocationState_Allows"; break;
                case 2: str = "LocationState_NotAllows"; break;
                //case 2: str = LocationState.LocationLock.ToString(); break;
                default:
                    str = "LocationState_NotAllows"; break;
            }
            return str;
        }
        //private static string LocationStatusByCode(int code)
        //{
        //    string str = null;
        //    switch (code)
        //    {
        //        case 1: str = "LocationState_Allows"; break;
        //        case 2: str = "LocationState_NotAllows"; break;
        //        //case 2: str = LocationState.LocationLock.ToString(); break;
        //        default:
        //            str = "LocationState_NotAllows"; break;
        //    }
        //    return str;
        //}
    }
}