using Khd.Core.Wcs.Global;
//using KingerRobot.WMS.Dao;

namespace Khd.Core.Wcs
{
    public class CommFunction
    {
        /// <summary>
        /// 生成任务号
        /// </summary>
        /// <returns></returns>
        public static string CreateSerialNo()
        {
            int SerialNo = 0;
            var dic = StaticData.BaseDictionary.Where(t => t.dicKey == "WCS_SerialNo").FirstOrDefault();
            if (!dic.updateTime.GetValueOrDefault().ToString("yyyyMMdd").Equals(DateTime.Now.ToString("yyyyMMdd")))
            {
                var ss = DateTime.Now.ToString("MMdd") + "00001";
                SerialNo = Convert.ToInt32(ss);
            }
            else
            {
                SerialNo = Convert.ToInt32(dic.dicValue) + 1;
            }
            dic.updateTime = DateTime.Now;
            dic.dicValue = SerialNo.ToString();
            return SerialNo.ToString();
        }
    }
}
