10133
2025-06-05 de050bac4823c99ff275b85cb0c80f292d1bbfb1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using HH.WCS.NongFuChaYuan.WmsService;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace HH.WCS.NongFuChaYuan.OtherService
{
    [AttributeUsage(AttributeTargets.Class, Inherited = true)]
    class STAttribute : SugarTable
    {
        public static Dictionary<string, string> TableModelName = new Dictionary<string, string>();
 
        public STAttribute(string tableName) : base(tableName)
        {
            string value = "";
            if (TableModelName.TryGetValue(TableName, out value))
            {
                TableName = value;
            }
        }
 
        public static void InitTableName()
        {
            //Console.WriteLine($"StartUp Init TableName...");
            var tableName = Settings.GetTableNameList().Where(a => a.TableProType == Settings.TableProType).ToList();
            if (tableName.Count > 0)
            {
                tableName.ForEach(a =>
                {
                    if (!TableModelName.Keys.Contains(a.TableName)) TableModelName.Add(a.TableName, a.TableSqlName);
                });
            }
            //Console.WriteLine($"StartUp Init TableName Complete!");
        }
        /// <summary>
        /// 创建数据中间表表
        /// </summary>
        /// <returns></returns>
        public static void CreateMiddleTable()
        {
            var order = new SqlHelper<HangChaAGV>().CreateTable();//富勒传输托盘信息表
            var order1 = new SqlHelper<MarginAGV>().CreateTable();//设备信号时间中间表
            //var order2 = new SqlHelper<DaMingShanDeviceState>().CreateTable();
        }
    }
}