ee4806a4b2ec94ec63b4cb9b58447d9863baebe5..3e7b82e73d972972bab8c67dac7a5a6078f30a8b
2025-07-18 wxw
修改问题
3e7b82 对比 | 目录
2025-07-18 wxw
修改问题
1bb1d5 对比 | 目录
2个文件已修改
68 ■■■■ 已修改文件
Wms/WMS.BLL/BllTransServer/RcsServer.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.DAL/Common.cs 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllTransServer/RcsServer.cs
@@ -27,7 +27,8 @@
{
    public class RcsServer:IRcsServer
    {
        private readonly object RcsLock = new object();
        private readonly object GetPalleLock = new object();
        private readonly object ApplyLocatLock = new object();
        private static readonly SqlSugarScope Db = DataContext.Db;
        /// <summary>
@@ -39,7 +40,7 @@
        /// <exception cref="Exception"></exception>
        public void GetPalletNo(Pallnetmsg model, string url, out string taskNo)
        {
            lock (RcsLock)
            lock (GetPalleLock)
            {
                try
                {
@@ -448,7 +449,7 @@
        /// <exception cref="Exception"></exception>
        public void ApplyLocatNo(Pallnetmsg model, string url, out string taskNo)
        {
            lock (RcsLock)
            lock (ApplyLocatLock)
            {
                try
                {
@@ -1345,7 +1346,7 @@
                var taskIng= Db.Queryable<LogTask>().First(w => w.IsDel == "0" && (w.Status == "0" || w.Status == "1") && w.PalletNo == palletNo);
                if (taskIng != null)
                {
                    throw new Exception("分配的桶有正在执行的任务,请稍后再试");
                    throw new Exception($"分配的桶{palletNo}有正在执行的任务,请稍后再试");
                }
                //分配桶的储位信息
                var locatInfo = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == palletInfo.LocatNo);
Wms/WMS.DAL/Common.cs
@@ -20,7 +20,7 @@
    {
        //public static readonly DataContext Db = new DataContext();
        private readonly object GetMaxNoLock = new object();
        /// <summary>
        /// 获取深度为1的储位号(根据深度为2的储位号)
        /// </summary>
@@ -163,40 +163,43 @@
        /// <returns></returns>
        public string GetMaxNo(string codeFlag)
        {
            try
            {
                var maxNo = "";
                //获取异常号
                maxNo = SelectMaxNo(codeFlag);
                if (!string.IsNullOrEmpty(maxNo))
            lock (GetMaxNoLock)
            {
                try
                {
                    maxNo = maxNo.Substring(codeFlag.Length);
                }
                //获取数据库时间八位
                string date = DateTime.Now.ToString("yyyyMMdd").Trim();
                string no = "";
                if (string.IsNullOrEmpty(maxNo))
                {
                    no = codeFlag + date + "00001";
                }
                else
                {
                    if (maxNo.Substring(0, 8) == date)
                    var maxNo = "";
                    //获取异常号
                    maxNo = SelectMaxNo(codeFlag);
                    if (!string.IsNullOrEmpty(maxNo))
                    {
                        int lastNo = Convert.ToInt32(maxNo.Substring(8, 5)) + 1;
                        no = codeFlag + date + (lastNo.ToString().PadLeft(5, '0'));
                        maxNo = maxNo.Substring(codeFlag.Length);
                    }
                    else
                    //获取数据库时间八位
                    string date = DateTime.Now.ToString("yyyyMMdd").Trim();
                    string no = "";
                    if (string.IsNullOrEmpty(maxNo))
                    {
                        no = codeFlag + date + "00001";
                    }
                    else
                    {
                        if (maxNo.Substring(0, 8) == date)
                        {
                            int lastNo = Convert.ToInt32(maxNo.Substring(8, 5)) + 1;
                            no = codeFlag + date + (lastNo.ToString().PadLeft(5, '0'));
                        }
                        else
                        {
                            no = codeFlag + date + "00001";
                        }
                    }
                    return no;
                }
                return no;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    throw;
                }
            }
        }
        /// <summary>