Prechádzať zdrojové kódy

1.更新api
2.更新界面
3.增加运行时长同步任务

zhangliwen 1 rok pred
rodič
commit
6515795172
22 zmenil súbory, kde vykonal 534 pridanie a 958 odobranie
  1. 218 460
      SCADA_DAQ.DAL/DBSchema.cs
  2. 1 1
      SCADA_DAQ.Plugin.Tailg/SCADA_DAQ.Plugin.Tailg.csproj
  3. 82 17
      SCADA_DAQ.Plugin.Tailg/Service/WebApiService.cs
  4. 34 34
      SCADA_DAQ/Customer/Jobs/SyncRunTime.cs
  5. 32 14
      SCADA_DAQ/Customer/Machines/ScannerMachine.cs
  6. 0 302
      SCADA_DAQ/Customer/Models/AlarmTable/AddAlarmTable.cs
  7. 0 14
      SCADA_DAQ/Customer/Models/AlarmTable/AlarmTableModel.cs
  8. 0 21
      SCADA_DAQ/Customer/Models/AlarmTable/QueryAlarmTableModel.cs
  9. 3 1
      SCADA_DAQ/Customer/Models/DeviceMap/DeviceMapModel.cs
  10. 28 23
      SCADA_DAQ/Customer/Models/ProductionLineManagement/AddProductionLineManagementModel.cs
  11. 1 1
      SCADA_DAQ/Customer/Models/ProductionLineManagement/ProductionLineManagementModel.cs
  12. 1 1
      SCADA_DAQ/Customer/Models/ProductionLineManagement/ProductionLineStateModel.cs
  13. 1 1
      SCADA_DAQ/Customer/Models/ProductionLineManagement/ProductionManagementStation.cs
  14. 9 5
      SCADA_DAQ/Customer/Models/ProductionLineManagement/QueryProductionLineManagementModel.cs
  15. 39 27
      SCADA_DAQ/Customer/Models/TaskManagement/QueryTaskModel.cs
  16. 16 14
      SCADA_DAQ/Customer/Models/TaskManagement/TaskManagementModel.cs
  17. 7 9
      SCADA_DAQ/Customer/Service/CustomerServiceConfig.cs
  18. 6 8
      SCADA_DAQ/Customer/UctFrmCodeScanningGun.xaml.cs
  19. 0 4
      SCADA_DAQ/Customer/UctFrmMotorcycleTypeManagement.xaml.cs
  20. 11 0
      SCADA_DAQ/Customer/UctFrmProductionLineManagement.xaml.cs
  21. 0 1
      SCADA_DAQ/SCADA_DAQ.csproj
  22. 45 0
      SCADA_DAQ/SystemControl.cs

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 218 - 460
SCADA_DAQ.DAL/DBSchema.cs


+ 1 - 1
SCADA_DAQ.Plugin.Tailg/SCADA_DAQ.Plugin.Tailg.csproj

@@ -94,7 +94,7 @@
   <ItemGroup>
     <Compile Include="Env.cs" />
     <Compile Include="LocalResource.Designer.cs" />
-    <Compile Include="Service\CustomerService.cs" />
+    <Compile Include="Service\WebApiService.cs" />
     <Compile Include="Service\CustomerServiceConfig.cs" />
   </ItemGroup>
   <ItemGroup>

+ 82 - 17
SCADA_DAQ.Plugin.Tailg/Service/CustomerService.cs → SCADA_DAQ.Plugin.Tailg/Service/WebApiService.cs

@@ -5,6 +5,10 @@ using SCADA_DAQ.Plugin.Tailg;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
+using System.Windows.Forms;
+using System.Text.RegularExpressions;
+using System.Data;
+using SCADA.CommonLib.Data.DIL;
 
 namespace SCADA_DAQ.Plugin.Tailg.Service
 {
@@ -12,24 +16,23 @@ namespace SCADA_DAQ.Plugin.Tailg.Service
     /// 看板API服务
     /// </summary>
     [DisplayName("看板API服务")]
-    public class CustomerService : BaseService
+    public class WebApiService : BaseService
     {
-        // 数据库对象
-        private static SqlSchema.DIL.DILDB DAL = Env.SgIDAL;
 
         // 静态缓存时长/s
-        private static int staticCacheDuration = 2;
+        private static int staticCacheDuration = 5;
         // 静态缓存
         private Dictionary<string, Dictionary<string, object>> StaticCache =
             new Dictionary<string, Dictionary<string, object>>()
         {
-            { "GetTaskInfo", new Dictionary<string, object>(){ {"Time",DateTime.Now}, { "Cache", null} } },
-            { "GetOutputAndOrder", new Dictionary<string, object>(){ { "Time", DateTime.Now }, { "Cache", null} } },
-            { "GetNoticeInfo", new Dictionary<string, object>(){ { "Time", DateTime.Now }, { "Cache", null} } }
+            { "GetExceptionData", new Dictionary<string, object>(){ {"Time",DateTime.Now}, { "Cache", null} } },
+            { "GetTodayOutput", new Dictionary<string, object>(){ { "Time", DateTime.Now }, { "Cache", null} } },
+            { "GetMonthOutput", new Dictionary<string, object>(){ { "Time", DateTime.Now }, { "Cache", null} } },
+            { "GetPerCapitaOutputPerHour", new Dictionary<string, object>(){ { "Time", DateTime.Now }, { "Cache", null} } }
         };
 
 
-        private static CustomerService _instance;
+        private static WebApiService _instance;
         private CustomerServiceConfig _customerServiceConfig;
         /// <summary>
         /// 
@@ -44,7 +47,7 @@ namespace SCADA_DAQ.Plugin.Tailg.Service
         /// <summary>
         /// 
         /// </summary>
-        public static CustomerService Instance { get => _instance ?? (_instance = new CustomerService()); }
+        public static WebApiService Instance { get => _instance ?? (_instance = new WebApiService()); }
 
 
         /// <summary>
@@ -53,7 +56,7 @@ namespace SCADA_DAQ.Plugin.Tailg.Service
         public override Type ConfigType => typeof(CustomerServiceConfig);
 
 
-        private CustomerService()
+        private WebApiService()
         {
             if (_instance == null)
             {
@@ -125,6 +128,44 @@ namespace SCADA_DAQ.Plugin.Tailg.Service
         }
 
 
+        /// <summary>
+        /// 获取当日异常数据
+        /// </summary>
+        /// <returns></returns>
+        public RpcResponse<object> GetExceptionData()
+        {
+            // 返回静态缓存
+            var timespan = (DateTime.Now - (DateTime)StaticCache["GetExceptionData"]["Time"]).TotalSeconds;
+            if (timespan < staticCacheDuration)
+                return new RpcResponse<object>() { Data = StaticCache["GetExceptionData"]["Cache"], Message = null };
+
+            Dictionary<string, string> workShopMap = new Dictionary<string, string>()
+            {
+                { "一车间","W01"}, {"二车间","W02"}, {"三车间","W03"}, {"四车间","W04"},
+                { "五车间","W05"}, {"六车间","W06"}, {"七车间","W07"}, {"八车间","W08"},
+            };
+            Dictionary<string, string> productionLineMap = new Dictionary<string, string>()
+            {
+                { "产线1号","P01"}, {"产线2号","P02"}, {"产线3号","P03"}, {"产线4号","P04"},
+                { "产线5号","P05"}, {"产线6号","P06"}, {"产线7号","P07"}, {"产线8号","P08"},
+            };
+
+            var sql = $"SELECT LEFT(Device_Str, 3) 车间号, SUBSTRING(Device_Str,4,4) 产线号, " +
+                $"AlarmType_Str AS 异常类型, COUNT(*) AS 次数, SUM(Duration_Int) 时长 " +
+                $"FROM V_Base_AlarmLog WHERE DATEDIFF(dd, CreateTime_Dt, GETDATE())= 0 " +
+                $"AND LEN(AlarmType_Str)>0 GROUP BY Device_Str, AlarmType_Str";
+            var dt = Env.SgIDAL.ReadDataTable(sql);
+            foreach (DataRow dr in dt.Rows)
+            {
+                dr["车间号"] = workShopMap[dr["车间号"].ToString()];
+                dr["产线号"] = productionLineMap[dr["产线号"].ToString()];
+            }
+
+            // 设置静态缓存
+            StaticCache["GetExceptionData"] = new Dictionary<string, object>()
+                { { "Time", DateTime.Now}, { "Cache", dt} };
+            return new RpcResponse<object>() { Data = dt, Message = null };
+        }
 
 
         /// <summary>
@@ -133,11 +174,20 @@ namespace SCADA_DAQ.Plugin.Tailg.Service
         /// <returns></returns>
         public RpcResponse<object> GetTodayOutput()
         {
+            // 返回静态缓存
+            var timespan = (DateTime.Now - (DateTime)StaticCache["GetTodayOutput"]["Time"]).TotalSeconds;
+            if (timespan < staticCacheDuration)
+                return new RpcResponse<object>() { Data = StaticCache["GetTodayOutput"]["Cache"], Message = null };
+
             var sql = $"SELECT WorkShopId_Str AS 车间号, ProductionLineId_Str AS 产线号, COUNT(*) AS 产量 " +
                 $"FROM APP_TaiLing_ProductionRecord WHERE DATEDIFF(dd, EndTime_Dt, GETDATE())= 0 " +
                 $"GROUP BY WorkShopId_Str, ProductionLineId_Str";
-            var res = DAL.ReadDataTable(sql);
-            return new RpcResponse<object>() { Data = res, Message = null };
+            var dt = Env.SgIDAL.ReadDataTable(sql);
+
+            // 设置静态缓存
+            StaticCache["GetTodayOutput"] = new Dictionary<string, object>()
+                { { "Time", DateTime.Now}, { "Cache", dt} };
+            return new RpcResponse<object>() { Data = dt, Message = null };
         }
 
 
@@ -147,12 +197,21 @@ namespace SCADA_DAQ.Plugin.Tailg.Service
         /// <returns></returns>
         public RpcResponse<object> GetMonthOutput()
         {
+            // 返回静态缓存
+            var timespan = (DateTime.Now - (DateTime)StaticCache["GetMonthOutput"]["Time"]).TotalSeconds;
+            if (timespan < staticCacheDuration)
+                return new RpcResponse<object>() { Data = StaticCache["GetMonthOutput"]["Cache"], Message = null };
+
             var sql = $"SELECT YEAR(StartTime_Dt) AS 年份, MONTH(StartTime_Dt) AS 月份, " +
                 $"WorkShopId_Str AS 车间号, ProductionLineId_Str AS 产线号, COUNT(*) AS 产量 " +
                 $"FROM APP_TaiLing_ProductionRecord " +
                 $"GROUP BY YEAR(StartTime_Dt), MONTH(StartTime_Dt), WorkShopId_Str, ProductionLineId_Str";
-            var res = DAL.ReadDataTable(sql);
-            return new RpcResponse<object>() { Data = res, Message = null };
+            var dt = Env.SgIDAL.ReadDataTable(sql);
+
+            // 设置静态缓存
+            StaticCache["GetMonthOutput"] = new Dictionary<string, object>()
+                { { "Time", DateTime.Now}, { "Cache", dt} };
+            return new RpcResponse<object>() { Data = dt, Message = null };
         }
 
 
@@ -162,6 +221,10 @@ namespace SCADA_DAQ.Plugin.Tailg.Service
         /// <returns></returns>
         public RpcResponse<object> GetPerCapitaOutputPerHour()
         {
+            // 返回静态缓存
+            var timespan = (DateTime.Now - (DateTime)StaticCache["GetPerCapitaOutputPerHour"]["Time"]).TotalSeconds;
+            if (timespan < staticCacheDuration)
+                return new RpcResponse<object>() { Data = StaticCache["GetPerCapitaOutputPerHour"]["Cache"], Message = null };
 
             // 三表联查,人均小时产出率直接用sql算出来
             var sql = "SELECT tb1.年份, tb1.月份, tb1.车间号, tb1.产线号, tb1.时长, tb2.产量, tb3.NumberOfPeople_Int AS 人数, " +
@@ -178,10 +241,12 @@ namespace SCADA_DAQ.Plugin.Tailg.Service
                 "ON tb1.年份 = tb2.年份 AND tb1.月份 = tb2.月份 AND tb1.车间号 = tb2.车间号 AND tb1.产线号 = tb2.产线号) " +
                 "LEFT JOIN APP_TaiLing_ProductionLineManagement AS tb3 " +
                 "ON tb1.车间号 = tb3.WorkShopId_Str AND tb1.产线号 = tb3.ProductionLineId_Str";
-            var res = DAL.ReadDataTable(sql);
-
+            var dt = Env.SgIDAL.ReadDataTable(sql);
 
-            return new RpcResponse<object>() { Data = res, Message = null };
+            // 设置静态缓存
+            StaticCache["GetPerCapitaOutputPerHour"] = new Dictionary<string, object>()
+                { { "Time", DateTime.Now}, { "Cache", dt} };
+            return new RpcResponse<object>() { Data = dt, Message = null };
         }
 
 

+ 34 - 34
SCADA_DAQ/Customer/Jobs/SyncRunTime.cs

@@ -20,6 +20,7 @@ namespace SCADA_DAQ.Customer.Jobs
 {
     /// <summary>
     /// 同步运行时间任务
+    /// 弃用,加到Systemcontrol里
     /// </summary>
     [DisplayName("同步运行时间任务")]
     public class SyncRunTime : BaseJob
@@ -57,43 +58,42 @@ namespace SCADA_DAQ.Customer.Jobs
             var excuteMsg =new JobExcuteFinishEventArgs();
             //TODO:这里执行需要的逻辑
 
-            //var localTable = Env.LocalDAL.SysApp_DayStatistics.GetData($"DayStartTime_Dt={DateTime.Now}").Select();
-            var localValue = Env.LocalDAL.SysApp_DayStatistics?.GetTopOne($"DayStartTime_Dt='{DateTime.Now.Date.Format()}'", "Value_Dec", "DayStartTime_Dt desc");
-            if (localValue == null)
-                localValue = 0;
+            //var localValue = Env.LocalDAL.SysApp_DayStatistics?.GetTopOne($"DayStartTime_Dt='{DateTime.Now.Date.Format()}'", "Value_Dec", "DayStartTime_Dt desc");
+            //if (localValue == null)
+            //    localValue = 0;
 
             
-            var filterStr = $"ProductionLineId_Str='{CustomerEnv.ProductionLineConfigValue.ProductionLineId}' " +
-                        $"AND WorkShopId_Str='{CustomerEnv.ProductionLineConfigValue.WorkShopId}' " +
-                        $"AND DATEDIFF(dd, StartTime_Dt, GETDATE())=0";
-            ProductionLineStateModel tableInfo = null;
-            if (Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord != null && Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord.Exist(filterStr))
-            {
-                tableInfo = Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord?
-                    .GetData<ProductionLineStateModel>(filterStr)
-                    .OrderBy(t => t.ID).Last();
-            }
-            else
-            {
-                tableInfo = null;
-            }
+            //var filterStr = $"ProductionLineId_Str='{CustomerEnv.ProductionLineConfigValue.ProductionLineId}' " +
+            //            $"AND WorkShopId_Str='{CustomerEnv.ProductionLineConfigValue.WorkShopId}' " +
+            //            $"AND DATEDIFF(dd, StartTime_Dt, GETDATE())=0";
+            //ProductionLineStateModel tableInfo = null;
+            //if (Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord != null && Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord.Exist(filterStr))
+            //{
+            //    tableInfo = Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord?
+            //        .GetData<ProductionLineStateModel>(filterStr)
+            //        .OrderBy(t => t.ID).Last();
+            //}
+            //else
+            //{
+            //    tableInfo = null;
+            //}
 
-            if (tableInfo == null)
-            {
-                Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord?.Insert(
-                    new UpdateItem("ProductionLineId_Str", CustomerEnv.ProductionLineConfigValue.ProductionLineId),
-                    new UpdateItem("WorkShopId_Str", CustomerEnv.ProductionLineConfigValue.WorkShopId),
-                    new UpdateItem("ProductionLineState_Str", "Running"),
-                    new UpdateItem("StartTime_Dt", DateTime.Now.Date.Format()),
-                    new UpdateItem("EndTime_Dt", DateTime.Now.AddDays(1).Date.Format()),
-                    new UpdateItem("DurationSec_Int", localValue)
-                    );
-            }
-            else
-            {
-                Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord?.Update(filterStr,
-                    new UpdateItem("DurationSec_Int", localValue));
-            }
+            //if (tableInfo == null)
+            //{
+            //    Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord?.Insert(
+            //        new UpdateItem("ProductionLineId_Str", CustomerEnv.ProductionLineConfigValue.ProductionLineId),
+            //        new UpdateItem("WorkShopId_Str", CustomerEnv.ProductionLineConfigValue.WorkShopId),
+            //        new UpdateItem("ProductionLineState_Str", "Running"),
+            //        new UpdateItem("StartTime_Dt", DateTime.Now.Date.Format()),
+            //        new UpdateItem("EndTime_Dt", DateTime.Now.AddDays(1).Date.Format()),
+            //        new UpdateItem("DurationSec_Int", localValue)
+            //        );
+            //}
+            //else
+            //{
+            //    Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord?.Update(filterStr,
+            //        new UpdateItem("DurationSec_Int", localValue));
+            //}
 
             excuteMsg.IsSuccess= true;
             return excuteMsg;

+ 32 - 14
SCADA_DAQ/Customer/Machines/ScannerMachine.cs

@@ -78,7 +78,8 @@ namespace SCADA_DAQ.Customer.Machines
             //    $"AND WorkShopId_Str='{scanItem.WorkShopId}' AND ProductionLineId_Str='{scanItem.ProductionLineId}'");
 
             Init();
-
+            if (lastOrderId == "")
+                Log.Warn("上次生产的工单号数据已丢失");
         }
 
         /// <summary>
@@ -184,21 +185,22 @@ namespace SCADA_DAQ.Customer.Machines
 
             if (BaseDevice.DeviceID == "上料扫码枪")
             {
-                currentOrderId = scanRecordItem.OrderId;
-                currentMotorcycleTypeName = scanRecordItem.MotorcycleTypeName;
+                currentOrderId = taskInfoItem.OrderId;
+                currentMotorcycleTypeName = taskInfoItem.MotorcycleTypeName;
+                CustomerEnv.CurrentTaskInfo.OrderSequence = taskInfoItem.OrderSequence;
                 CustomerEnv.CurrentTaskInfo.OrderId = currentOrderId;
                 CustomerEnv.CurrentTaskInfo.MotorcycleTypeName = currentMotorcycleTypeName;
                 CustomerEnv.CurrentTaskInfo.CurrentProduction = taskInfoItem.CurrentProduction;
             }
             else if (BaseDevice.DeviceID == "下料扫码枪")
             {
-                lastOrderId = scanRecordItem.OrderId;
-                if (lastOrderId == "")
-                    Log.Warn("上次生产的工单号数据已丢失");
-                CustomerEnv.CurrentTaskInfo.OrderId = scanRecordItem.OrderId;
-                CustomerEnv.CurrentTaskInfo.MotorcycleTypeName = scanRecordItem.MotorcycleTypeName;
+                lastOrderId = taskInfoItem.OrderId;
+                CustomerEnv.CurrentTaskInfo.OrderSequence = taskInfoItem.OrderSequence;
+                CustomerEnv.CurrentTaskInfo.OrderId = taskInfoItem.OrderId;
+                CustomerEnv.CurrentTaskInfo.MotorcycleTypeName = taskInfoItem.MotorcycleTypeName;
                 CustomerEnv.CurrentTaskInfo.CurrentProduction = taskInfoItem.CurrentProduction;
             }
+            
         }
 
 
@@ -261,6 +263,7 @@ namespace SCADA_DAQ.Customer.Machines
             }
             else if (QRInfo.Count() == 3 && QRInfo[0] == "change")
             {
+                CustomerEnv.CurrentTaskInfo.OrderSequence = -1;
                 CustomerEnv.CurrentTaskInfo.OrderId = "";
                 CustomerEnv.CurrentTaskInfo.MotorcycleTypeName = "";
 
@@ -280,10 +283,11 @@ namespace SCADA_DAQ.Customer.Machines
                         && t.OrderState != "已生产"
                         && t.WorkShopId == CustomerEnv.ProductionLineConfigValue.WorkShopId
                         && t.ProductionLineId == CustomerEnv.ProductionLineConfigValue.ProductionLineId)
-                    .Select(t => t.OrderId).ToList();
-
+                    .ToList();
+                
                 if (taskList == null)
                 {
+                    CustomerEnv.CurrentTaskInfo.OrderSequence = -1;
                     CustomerEnv.CurrentTaskInfo.OrderId = "";
                     CustomerEnv.CurrentTaskInfo.MotorcycleTypeName = "查无工单任务\r\n请先添加工单";
                     Log.Warn("查无工单任务,请先添加工单");
@@ -291,37 +295,43 @@ namespace SCADA_DAQ.Customer.Machines
                 }
                 if (taskList.Count <= 0)
                 {
+                    CustomerEnv.CurrentTaskInfo.OrderSequence = -1;
                     CustomerEnv.CurrentTaskInfo.OrderId = "";
                     CustomerEnv.CurrentTaskInfo.MotorcycleTypeName = "查无工单任务\r\n请先添加工单";
                     Log.Warn("查无工单任务,请先添加工单");
                     return;
                 }
 
+                var OrderSequence = -1;
                 // 工单切换
                 if (lastScanCode != scanMsg)  // 换码
                 {
                     orderIndex = 0;
                     lastScanCode = scanMsg;
                 }
-                if (currentOrderId != taskList[orderIndex])
+                if (currentOrderId != taskList[orderIndex].OrderId)
                 {
-                    currentOrderId = taskList[orderIndex];
+                    currentOrderId = taskList[orderIndex].OrderId;
+                    OrderSequence = taskList[orderIndex].OrderSequence;
                 }
                 else
                 {
                     if (orderIndex < taskList.Count - 1)
                     {
                         orderIndex++;
-                        currentOrderId = taskList[orderIndex];
+                        currentOrderId = taskList[orderIndex].OrderId;
+                        OrderSequence = taskList[orderIndex].OrderSequence;
                     }
                     else
                     {
                         // 循环切换
                         orderIndex = 0;
-                        currentOrderId = taskList[orderIndex];
+                        currentOrderId = taskList[orderIndex].OrderId;
+                        OrderSequence = taskList[orderIndex].OrderSequence;
                     }
                 }
 
+                CustomerEnv.CurrentTaskInfo.OrderSequence = OrderSequence;
                 CustomerEnv.CurrentTaskInfo.OrderId = currentOrderId;
                 CustomerEnv.CurrentTaskInfo.MotorcycleTypeName = currentMotorcycleTypeName;
 
@@ -440,6 +450,7 @@ namespace SCADA_DAQ.Customer.Machines
             {
                 //CustomerEnv.CurrentOrderId = $"请先将“{scanMsg}”绑定车型";
                 //CustomerEnv.CurrentMotorcycleTypeName = "";
+                CustomerEnv.CurrentTaskInfo.OrderSequence = -1;
                 CustomerEnv.CurrentTaskInfo.OrderId = "";
                 CustomerEnv.CurrentTaskInfo.MotorcycleTypeName = $"请先将\r\n“{scanMsg}”\r\n绑定车型";
                 Log.Warn($"请先将“{scanMsg}”绑定车型");
@@ -453,6 +464,13 @@ namespace SCADA_DAQ.Customer.Machines
             CustomerEnv.CurrentTaskInfo.OrderId = currentOrderId;
             CustomerEnv.CurrentTaskInfo.MotorcycleTypeName = currentMotorcycleTypeName;
 
+            var taskInfo = DAL.APP_TaiLing_TaskManagement.GetData<TaskManagementModel>()?
+                .Where(t => t.OrderId == currentOrderId
+                    && t.WorkShopId == CustomerEnv.ProductionLineConfigValue.WorkShopId
+                    && t.ProductionLineId == CustomerEnv.ProductionLineConfigValue.ProductionLineId)
+                .OrderBy(t => t.ID).Last();
+            CustomerEnv.CurrentTaskInfo.OrderSequence = taskInfo.OrderSequence;
+
             // 进队列
             scanQueue.Enqueue(new ScanRecordModel
             {

+ 0 - 302
SCADA_DAQ/Customer/Models/AlarmTable/AddAlarmTable.cs

@@ -1,302 +0,0 @@
-using SCADA.CommonLib;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace SCADA_DAQ.Customer.Models.AlarmTable
-{
-    public class AddAlarmTable :ObservableObject
-    {
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public int OrgID
-        {
-            get { return _OrgID; }
-            set
-            {
-                if (value != _OrgID)
-                {
-                    _OrgID = value;
-                    OnPropertyChanged(nameof(OrgID));
-                }
-            }
-        }
-        private int _OrgID;
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public string AlarmId
-        {
-            get { return _AlarmId; }
-            set
-            {
-                if (value != _AlarmId)
-                {
-                    _AlarmId = value;
-                    OnPropertyChanged(nameof(AlarmId));
-                }
-            }
-        }
-        private string _AlarmId;
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public string Device
-        {
-            get { return _Device; }
-            set
-            {
-                if (value != _Device)
-                {
-                    _Device = value;
-                    OnPropertyChanged(nameof(Device));
-                }
-            }
-        }
-        private string _Device;
-
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public string TagName
-        {
-            get { return _TagName; }
-            set
-            {
-                if (value != _TagName)
-                {
-                    _TagName = value;
-                    OnPropertyChanged(nameof(TagName));
-                }
-            }
-        }
-        private string _TagName;
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public string AlarmCode
-        {
-            get { return _AlarmCode; }
-            set
-            {
-                if (value != _AlarmCode)
-                {
-                    _AlarmCode = value;
-                    OnPropertyChanged(nameof(AlarmCode));
-                }
-            }
-        }
-        private string _AlarmCode;
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public string Helper
-        {
-            get { return _Helper; }
-            set
-            {
-                if (value != _Helper)
-                {
-                    _Helper = value;
-                    OnPropertyChanged(nameof(Helper));
-                }
-            }
-        }
-        private string _Helper;
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public string Remark
-        {
-            get { return _Remark; }
-            set
-            {
-                if (value != _Remark)
-                {
-                    _Remark = value;
-                    OnPropertyChanged(nameof(Remark));
-                }
-            }
-        }
-        private string _Remark;
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public string TriggedTime
-        {
-            get { return _TriggedTime; }
-            set
-            {
-                if (value != _TriggedTime)
-                {
-                    _TriggedTime = value;
-                    OnPropertyChanged(nameof(TriggedTime));
-                }
-            }
-        }
-        private string _TriggedTime;
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public DateTime RecoverTime
-        {
-            get { return _RecoverTime; }
-            set
-            {
-                if (value != _RecoverTime)
-                {
-                    _RecoverTime = value;
-                    OnPropertyChanged(nameof(RecoverTime));
-                }
-            }
-        }
-        private DateTime _RecoverTime;
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public string DurationStr
-        {
-            get { return _DurationStr; }
-            set
-            {
-                if (value != _DurationStr)
-                {
-                    _DurationStr = value;
-                    OnPropertyChanged(nameof(DurationStr));
-                }
-            }
-        }
-        private string _DurationStr;
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public int DurationInt
-        {
-            get { return _DurationInt; }
-            set
-            {
-                if (value != _DurationInt)
-                {
-                    _DurationInt = value;
-                    OnPropertyChanged(nameof(DurationInt));
-                }
-            }
-        }
-        private int _DurationInt;
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public bool IsClosed
-        {
-            get { return _IsClosed; }
-            set
-            {
-                if (value != _IsClosed)
-                {
-                    _IsClosed = value;
-                    OnPropertyChanged(nameof(IsClosed));
-                }
-            }
-        }
-        private bool _IsClosed;
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public string CreateUser
-        {
-            get { return _CreateUser; }
-            set
-            {
-                if (value != _CreateUser)
-                {
-                    _CreateUser = value;
-                    OnPropertyChanged(nameof(CreateUser));
-                }
-            }
-        }
-        private string _CreateUser;
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public DateTime CreateTime
-        {
-            get { return _CreateTime; }
-            set
-            {
-                if (value != _CreateTime)
-                {
-                    _CreateTime = value;
-                    OnPropertyChanged(nameof(CreateTime));
-                }
-            }
-        }
-        private DateTime _CreateTime;
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public DateTime ModifyTime
-        {
-            get { return _ModifyTime; }
-            set
-            {
-                if (value != _ModifyTime)
-                {
-                    _ModifyTime = value;
-                    OnPropertyChanged(nameof(ModifyTime));
-                }
-            }
-        }
-        private DateTime _ModifyTime;
-
-
-        /// <summary>
-        /// 
-        /// </summary>
-        public string ModifyUser
-        {
-            get { return _ModifyUser; }
-            set
-            {
-                if (value != _ModifyUser)
-                {
-                    _ModifyUser = value;
-                    OnPropertyChanged(nameof(ModifyUser));
-                }
-            }
-        }
-        private string _ModifyUser;
-
-    }
-}

+ 0 - 14
SCADA_DAQ/Customer/Models/AlarmTable/AlarmTableModel.cs

@@ -1,14 +0,0 @@
-using SCADA.CommonLib;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace SCADA_DAQ.Customer.Models.AlarmTable
-{
-    public class AlarmTableModel : ObservableObject
-    {
-
-    }
-}

+ 0 - 21
SCADA_DAQ/Customer/Models/AlarmTable/QueryAlarmTableModel.cs

@@ -1,21 +0,0 @@
-using SCADA.CommonLib.CommonModel;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace SCADA_DAQ.Customer.Models.AlarmTable
-{
-    public class QueryAlarmTableModel:BaseQuery
-    {
-        private static SqlSchema.DIL.DILDB DAL = Env.SgIDAL;
-
-
-        public QueryAlarmTableModel() : base(DAL.APP_TaiLing_DeviceManagement)
-        {
-
-        }
-
-    }
-}

+ 3 - 1
SCADA_DAQ/Customer/Models/DeviceMap/DeviceMapModel.cs

@@ -7,7 +7,9 @@ using System.Threading.Tasks;
 
 namespace SCADA_DAQ.Customer.Models.DeviceMap
 {
-    // 设备映射类
+    /// <summary>
+    /// 设备映射类
+    /// </summary>
     public class DeviceMapModel : ObservableObject
     {
 

+ 28 - 23
SCADA_DAQ/Customer/Models/ProductionLineManagement/AddProductionLineManagementModel.cs

@@ -8,34 +8,37 @@ using System.Threading.Tasks;
 
 namespace SCADA_DAQ.Customer.Models.ProductionLineManagement
 {
+    /// <summary>
+    /// 添加产线模块
+    /// </summary>
     [Table(nameof(SqlSchema.DBModel.APP_TaiLing_ProductionLineManagement))]
     public class AddProductionLineManagementModel : ObservableObject
     {
         
 
-        /// <summary>
-        /// ID
-        /// </summary>
-        [Column(T_Col_Name.APP_TaiLing_ProductionLineManagement.ID)]
-        public int ID
-        {
-            get { return _ID; }
-            set
-            {
-                if (value != _ID)
-                {
-                    _ID = value;
-                    OnPropertyChanged(nameof(ID));
-                }
-            }
-        }
-        private int _ID;
+        ///// <summary>
+        ///// ID
+        ///// </summary>
+        //[Column(T_Col_Name.APP_TaiLing_ProductionLineManagement.ID)]
+        //public int ID
+        //{
+        //    get { return _ID; }
+        //    set
+        //    {
+        //        if (value != _ID)
+        //        {
+        //            _ID = value;
+        //            OnPropertyChanged(nameof(ID));
+        //        }
+        //    }
+        //}
+        //private int _ID;
 
 
         /// <summary>
         /// 车间号
         /// </summary>
-        [AutoViewProperty("车间号", Icon = "",IsEnable = false)]
+        [AutoViewProperty("车间号", Icon = "",IsEnable = true)]
         [Column(T_Col_Name.APP_TaiLing_ProductionLineManagement.WorkShopId_Str)]
         public string WorkShopId
         {
@@ -49,12 +52,13 @@ namespace SCADA_DAQ.Customer.Models.ProductionLineManagement
                 }
             }
         }
-        private string _WorkShopId = CustomerEnv.ProductionLineConfigValue?.WorkShopId;
+        //private string _WorkShopId = CustomerEnv.ProductionLineConfigValue?.WorkShopId;
+        private string _WorkShopId;
 
         /// <summary>
         /// 产线号
         /// </summary>
-        [AutoViewProperty("产线号", Icon = "", IsEnable = false)]
+        [AutoViewProperty("产线号", Icon = "", IsEnable = true)]
         [Column(T_Col_Name.APP_TaiLing_ProductionLineManagement.ProductionLineId_Str)]
         public string ProductionLineId
         {
@@ -68,15 +72,16 @@ namespace SCADA_DAQ.Customer.Models.ProductionLineManagement
                 }
             }
         }
-        private string _ProductionLineId = CustomerEnv.ProductionLineConfigValue?.ProductionLineId;
+        //private string _ProductionLineId = CustomerEnv.ProductionLineConfigValue?.ProductionLineId;
+        private string _ProductionLineId;
 
 
         private string _ProductionLineName;
-        [AutoViewProperty("产线名称", Icon = "")]
-        [Column(T_Col_Name.APP_TaiLing_ProductionLineManagement.ProductionLineName_Str)]
         /// <summary>
         /// 产线名称
         /// </summary>
+        [AutoViewProperty("产线名称", Icon = "")]
+        [Column(T_Col_Name.APP_TaiLing_ProductionLineManagement.ProductionLineName_Str)]
         public string ProductionLineName
         {
             get { return _ProductionLineName; }

+ 1 - 1
SCADA_DAQ/Customer/Models/ProductionLineManagement/ProductionLineManagementModel.cs

@@ -10,7 +10,7 @@ using System.Threading.Tasks;
 namespace SCADA_DAQ.Customer.Models.ProductionLineManagement
 {
     /// <summary>
-    /// 
+    /// 产线管理模块
     /// </summary>
     public class ProductionLineManagementModel : ObservableObject
     {

+ 1 - 1
SCADA_DAQ/Customer/Models/ProductionLineManagement/ProductionLineStateModel.cs

@@ -9,7 +9,7 @@ using System.Threading.Tasks;
 namespace SCADA_DAQ.Customer.Models.ProductionLineManagement
 {
     /// <summary>
-    /// 
+    /// 产线状态模块
     /// </summary>
     public class ProductionLineStateModel : ObservableObject
     {

+ 1 - 1
SCADA_DAQ/Customer/Models/ProductionLineManagement/ProductionManagementStation.cs

@@ -9,7 +9,7 @@ using System.Threading.Tasks;
 namespace SCADA_DAQ.Customer.Models.ProductionLineManagement
 {
     /// <summary>
-    /// 
+    /// 产线工位管理模块
     /// </summary>
     public class ProductionManagementStation : ObservableObject
     {

+ 9 - 5
SCADA_DAQ/Customer/Models/ProductionLineManagement/QueryProductionLineManagementModel.cs

@@ -18,7 +18,9 @@ namespace SCADA_DAQ.Customer.Models.ProductionLineManagement
         // 数据库对象
         private static SqlSchema.DIL.DILDB DAL = Env.SgIDAL;
 
-
+        /// <summary>
+        /// 
+        /// </summary>
         public QueryProductionLineManagementModel() : base(DAL.APP_TaiLing_ProductionLineManagement)
         {
 
@@ -46,8 +48,7 @@ namespace SCADA_DAQ.Customer.Models.ProductionLineManagement
         /// <summary>
         /// 车间号
         /// </summary>
-        private string _WorkShopId = CustomerEnv.ProductionLineConfigValue.WorkShopId;
-        [AutoViewProperty("车间号", Icon = "AlignJustify", IsEnable = false)]
+        [AutoViewProperty("车间号", Icon = "AlignJustify", IsEnable = true)]
         [Query(T_Col_Name.APP_TaiLing_TaskManagement.WorkShopId_Str, QueryOperator.Like)]
         public string WorkShopId
         {
@@ -61,12 +62,13 @@ namespace SCADA_DAQ.Customer.Models.ProductionLineManagement
                 }
             }
         }
+        //private string _WorkShopId = CustomerEnv.ProductionLineConfigValue.WorkShopId;
+        private string _WorkShopId;
 
         /// <summary>
         /// 产线号
         /// </summary>
-        private string _ProductionLineId = CustomerEnv.ProductionLineConfigValue.ProductionLineId;
-        [AutoViewProperty("产线号", Icon = "AlignJustify", IsEnable = false)]
+        [AutoViewProperty("产线号", Icon = "AlignJustify", IsEnable = true)]
         [Query(T_Col_Name.APP_TaiLing_TaskManagement.ProductionLineId_Str, QueryOperator.Like)]
         public string ProductionLineId
         {
@@ -80,6 +82,8 @@ namespace SCADA_DAQ.Customer.Models.ProductionLineManagement
                 }
             }
         }
+        //private string _ProductionLineId = CustomerEnv.ProductionLineConfigValue.ProductionLineId;
+        private string _ProductionLineId ;
 
 
         //private int _ProductionID;

+ 39 - 27
SCADA_DAQ/Customer/Models/TaskManagement/QueryTaskModel.cs

@@ -18,6 +18,9 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
     {
         private static SqlSchema.DIL.DILDB DAL = Env.SgIDAL;
 
+        /// <summary>
+        /// 
+        /// </summary>
         public QueryTaskModel() : base(DAL.APP_TaiLing_TaskManagement)
         {
 
@@ -26,7 +29,6 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
         /// <summary>
         /// 车间号
         /// </summary>
-        private string _WorkShopId = CustomerEnv.ProductionLineConfigValue.WorkShopId;
         [AutoViewProperty("车间号", Icon = "AlignJustify", IsEnable =false)]
         [Query(T_Col_Name.APP_TaiLing_TaskManagement.WorkShopId_Str, QueryOperator.Like)]
         public string WorkShopId
@@ -41,11 +43,11 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private string _WorkShopId = CustomerEnv.ProductionLineConfigValue.WorkShopId;
 
         /// <summary>
         /// 产线号
         /// </summary>
-        private string _ProductionLineId = CustomerEnv.ProductionLineConfigValue.ProductionLineId;
         [AutoViewProperty("产线号", Icon = "AlignJustify", IsEnable = false)]
         [Query(T_Col_Name.APP_TaiLing_TaskManagement.ProductionLineId_Str, QueryOperator.Like)]
         public string ProductionLineId
@@ -60,30 +62,12 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private string _ProductionLineId = CustomerEnv.ProductionLineConfigValue.ProductionLineId;
 
-        /// <summary>
-        /// 批次号
-        /// </summary>
-        private string _OrderId;
-        [AutoViewProperty("批次号", Icon = "AlignJustify")]
-        [Query(T_Col_Name.APP_TaiLing_TaskManagement.OrderId_Str)]
-        public string OrderId
-        {
-            get { return _OrderId; }
-            set
-            {
-                if (value != _OrderId)
-                {
-                    _OrderId = value;
-                    OnPropertyChanged(nameof(OrderId));
-                }
-            }
-        }
 
         /// <summary>
         /// 工单日期
         /// </summary>
-        private DateRange _OrderDatetime = new DateRange(Env.Schedual) { TimeInterval = DateRangeInterval.CurrentDay };
         [AutoViewProperty("工单日期", Icon = "Timetable")]
         [Query(T_Col_Name.APP_TaiLing_TaskManagement.OrderDatetime_Dt)]
         public DateRange OrderDatetime
@@ -98,12 +82,12 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private DateRange _OrderDatetime = new DateRange(Env.Schedual) { TimeInterval = DateRangeInterval.CurrentDay };
 
 
         /// <summary>
         /// 开始生产时间
         /// </summary>
-        private DateRange _WorkStartTime = new DateRange(Env.Schedual) { TimeInterval = DateRangeInterval.All };
         [AutoViewProperty("开始生产时间", Icon = "Timetable")]
         [Query(T_Col_Name.APP_TaiLing_TaskManagement.WorkStartTime_Dt)]
         public DateRange WorkStartTime
@@ -118,11 +102,11 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private DateRange _WorkStartTime = new DateRange(Env.Schedual) { TimeInterval = DateRangeInterval.All };
 
         /// <summary>
         /// 结束生产时间
         /// </summary>
-        private DateRange _WorkEndTime = new DateRange(Env.Schedual) { TimeInterval = DateRangeInterval.All };
         [AutoViewProperty("结束生产时间", Icon = "Timetable")]
         [Query(T_Col_Name.APP_TaiLing_TaskManagement.WorkEndTime_Dt)]
         public DateRange WorkEndTime
@@ -137,12 +121,36 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private DateRange _WorkEndTime = new DateRange(Env.Schedual) { TimeInterval = DateRangeInterval.All };
+
+
+        /// <summary>
+        /// 批次号
+        /// </summary>
+        [AutoViewProperty("批次号", Icon = "AlignJustify")]
+        [Query(T_Col_Name.APP_TaiLing_TaskManagement.OrderId_Str)]
+        public string OrderId
+        {
+            get { return _OrderId; }
+            set
+            {
+                if (value != _OrderId)
+                {
+                    _OrderId = value;
+                    OnPropertyChanged(nameof(OrderId));
+                }
+            }
+        }
+        private string _OrderId;
+
 
         /// <summary>
         /// 工单状态
         /// </summary>
-        private string _OrderState;
-        [AutoViewProperty("工单状态", Icon = "", OptionItemsSource = nameof(OrderStateList), StringType = StringType.IsNotNullOrEmpty)]
+        [AutoViewProperty("工单状态", Icon = "", OptionItemsSource = nameof(OrderStateDic), 
+            StringType = StringType.IsLimited,
+            DisplayMemberPath = "Key",
+            SelectedValuePath = "Value")]
         [Query(T_Col_Name.APP_TaiLing_TaskManagement.OrderState_Str)]
         public string OrderState
         {
@@ -156,9 +164,13 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
-        public List<string> OrderStateList { get; set; } = new List<string>()
+        private string _OrderState;
+        /// <summary>
+        /// 
+        /// </summary>
+        public Dictionary<string, string> OrderStateDic { get; set; } = new Dictionary<string, string>()
         {
-           "待生产", "生产中", "已生产"
+            {"全部","" }, {"待生产","待生产" },{"生产中","生产中" },{"已生产","已生产" }
         };
 
 

+ 16 - 14
SCADA_DAQ/Customer/Models/TaskManagement/TaskManagementModel.cs

@@ -8,7 +8,9 @@ using System.Threading.Tasks;
 
 namespace SCADA_DAQ.Customer.Models.TaskManagement
 {
-
+    /// <summary>
+    /// 工单管理模块
+    /// </summary>
     public class TaskManagementModel : ObservableObject
     {
 
@@ -35,7 +37,6 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
         /// <summary>
         /// 车间号
         /// </summary>
-        private string _WorkShopId;
         [AutoViewProperty("车间号", Icon = "")]
         [Column(T_Col_Name.APP_TaiLing_TaskManagement.WorkShopId_Str)]
         public string WorkShopId
@@ -50,11 +51,11 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private string _WorkShopId;
 
         /// <summary>
         /// 产线号
         /// </summary>
-        private string _ProductionLineId;
         [AutoViewProperty("产线号", Icon = "")]
         [Column(T_Col_Name.APP_TaiLing_TaskManagement.ProductionLineId_Str)]
         public string ProductionLineId
@@ -69,11 +70,11 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private string _ProductionLineId;
 
         /// <summary>
         /// 批次号
         /// </summary>
-        private string _OrderId;
         [AutoViewProperty("批次号", Icon = "")]
         [Column(T_Col_Name.APP_TaiLing_TaskManagement.OrderId_Str)]
         public string OrderId
@@ -88,11 +89,11 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private string _OrderId;
 
         /// <summary>
         /// 工单日期
         /// </summary>
-        private DateTime _OrderDatetime;
         [AutoViewProperty("工单日期", Icon = "")]
         [Column(T_Col_Name.APP_TaiLing_TaskManagement.OrderDatetime_Dt)]
         public DateTime OrderDatetime
@@ -107,11 +108,11 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private DateTime _OrderDatetime;
 
         /// <summary>
         /// 工单顺序
         /// </summary>
-        private int _OrderSequence;
         [AutoViewProperty("工单顺序", Icon = "")]
         [Column(T_Col_Name.APP_TaiLing_TaskManagement.OrderSequence_Int)]
         public int OrderSequence
@@ -126,11 +127,11 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private int _OrderSequence;
 
         /// <summary>
         /// 计划产量
         /// </summary>
-        private int _ScheduledProduction;
         [AutoViewProperty("计划产量", Icon = "")]
         [Column(T_Col_Name.APP_TaiLing_TaskManagement.ScheduledProduction_Int)]
         public int ScheduledProduction
@@ -145,11 +146,11 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private int _ScheduledProduction;
 
         /// <summary>
         /// 当前产量
         /// </summary>
-        private int _CurrentProduction;
         [AutoViewProperty("当前产量", Icon = "")]
         [Column(T_Col_Name.APP_TaiLing_TaskManagement.CurrentProduction_Int)]
         public int CurrentProduction
@@ -164,11 +165,11 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private int _CurrentProduction;
 
         /// <summary>
         /// 开始生产时间
         /// </summary>
-        private DateTime _WorkStartTime;
         [AutoViewProperty("开始生产时间", Icon = "")]
         [Column(T_Col_Name.APP_TaiLing_TaskManagement.WorkStartTime_Dt)]
         public DateTime WorkStartTime
@@ -183,11 +184,11 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private DateTime _WorkStartTime;
 
         /// <summary>
         /// 结束生产时间
         /// </summary>
-        private DateTime _WorkEndTime;
         [AutoViewProperty("结束生产时间", Icon = "")]
         [Column(T_Col_Name.APP_TaiLing_TaskManagement.WorkEndTime_Dt)]
         public DateTime WorkEndTime
@@ -202,11 +203,11 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private DateTime _WorkEndTime;
 
         /// <summary>
         /// 工单状态
         /// </summary>
-        private string _OrderState;
         [AutoViewProperty("工单状态", Icon = "")]
         [Column(T_Col_Name.APP_TaiLing_TaskManagement.OrderState_Str)]
         public string OrderState
@@ -221,11 +222,11 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private string _OrderState;
 
         /// <summary>
         /// 车型名称
         /// </summary>
-        private string _MotorcycleTypeName;
         [AutoViewProperty("车型名称", Icon = "")]
         [Column(T_Col_Name.APP_TaiLing_TaskManagement.MotorcycleTypeName_Str)]
         public string MotorcycleTypeName
@@ -240,11 +241,11 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private string _MotorcycleTypeName;
 
         /// <summary>
         /// 生产总时长
         /// </summary>
-        private int _DurationSec;
         [AutoViewProperty("生产总时长", Icon = "")]
         [Column(T_Col_Name.APP_TaiLing_TaskManagement.DurationSec_Int)]
         public int DurationSec
@@ -259,8 +260,9 @@ namespace SCADA_DAQ.Customer.Models.TaskManagement
                 }
             }
         }
+        private int _DurationSec;
+
 
-        
 
 
     }

+ 7 - 9
SCADA_DAQ/Customer/Service/CustomerServiceConfig.cs

@@ -12,13 +12,11 @@ namespace SCADA_DAQ.Customer.Service
     /// </summary>
     public class CustomerServiceConfig:ObservableObject
     {
-
-		private int _MyProperty;
-		[AutoViewProperty("test")]
-		/// <summary>
-		/// 
-		/// </summary>
-		public int MyProperty
+        /// <summary>
+        /// 
+        /// </summary>
+        [AutoViewProperty("test")]
+        public int MyProperty
 		{
 			get { return _MyProperty; }
 			set
@@ -30,6 +28,6 @@ namespace SCADA_DAQ.Customer.Service
 				}
 			}
 		}
-
-	}
+        private int _MyProperty;
+    }
 }

+ 6 - 8
SCADA_DAQ/Customer/UctFrmCodeScanningGun.xaml.cs

@@ -35,8 +35,8 @@ namespace SCADA_DAQ.Customer
     [UctMenu("扫码界面", Icon = "看板")]
     public partial class UctFrmCodeScanningGun : BaseUctFrm
     {
-        public ScannerMachine FirstMachinelCodeScanningSun = MachineServer.GetInstance().GetMachine<ScannerMachine>("上料扫码枪");
-        public ScannerMachine SencndMachinelCodeScanningSun = MachineServer.GetInstance().GetMachine<ScannerMachine>("下料扫码枪");
+        private ScannerMachine FirstMachinelCodeScanningSun = MachineServer.GetInstance().GetMachine<ScannerMachine>("上料扫码枪");
+        private ScannerMachine SencndMachinelCodeScanningSun = MachineServer.GetInstance().GetMachine<ScannerMachine>("下料扫码枪");
 
         private List<SolidColorBrush> brushesList = new List<SolidColorBrush>()
         {
@@ -44,6 +44,9 @@ namespace SCADA_DAQ.Customer
         };
         private int brushListIndex = 0;
 
+        /// <summary>
+        /// 
+        /// </summary>
         public UctFrmCodeScanningGun()
         {
             InitializeComponent();
@@ -74,8 +77,6 @@ namespace SCADA_DAQ.Customer
         {
             Dispatcher.Invoke(() =>
                 {
-                    //OrderInfoText.Text = CustomerEnv.CurrentOrderId + "\r\n" + CustomerEnv.CurrentMotorcycleTypeName;
-                    //OrderInfoText.Text = CustomerEnv.CurrentTaskInfo.OrderId + "\r\n" + CustomerEnv.CurrentTaskInfo.MotorcycleTypeName;
                     TextContent.Text = e.Barcode;
                     TextContent.Background = brushesList[brushListIndex];
                     brushListIndex++;
@@ -95,10 +96,7 @@ namespace SCADA_DAQ.Customer
             {
                 Dispatcher.Invoke(() =>
                 {
-                    //OrderInfoText.Text = CustomerEnv.CurrentOrderId + "\r\n" + CustomerEnv.CurrentMotorcycleTypeName;
-                    OrderInfoText.Text = CustomerEnv.CurrentTaskInfo.OrderId + "\r\n" + CustomerEnv.CurrentTaskInfo.MotorcycleTypeName;
-
-                    //productionInfo.Text = CustomerEnv.CurrentTaskInfoDic["CurrentProduction"].ToString();
+                    OrderInfoText.Text = CustomerEnv.CurrentTaskInfo.OrderSequence + "\r\n" + CustomerEnv.CurrentTaskInfo.MotorcycleTypeName;
                     productionInfo.Text = CustomerEnv.CurrentTaskInfo.CurrentProduction.ToString();
 
                     // 扫码队列

+ 0 - 4
SCADA_DAQ/Customer/UctFrmMotorcycleTypeManagement.xaml.cs

@@ -64,10 +64,6 @@ namespace SCADA_DAQ.Customer
             //ToolBar.Items.Add(bt);
         }
 
-        private void Bt_Click(object sender, RoutedEventArgs e)
-        {
-            
-        }
 
         private void OpenBtn_Click(object sender, ToolBarOpenFile.OpenFileButtonBouseEventArgs e)
         {

+ 11 - 0
SCADA_DAQ/Customer/UctFrmProductionLineManagement.xaml.cs

@@ -43,6 +43,17 @@ namespace SCADA_DAQ.Customer
             //MainGrid.IsAutoUpdate = true;  //表格更新时允许更新到数据库
             MainGrid.SourceTable = QueryModel.SourceTable;   //指定绑定更新的表
             MainGrid.DataTableColumnLables = SmartGridHeaderMapping.CreateMapping<ProductionLineManagementModel>();
+            MainGrid.ExportSheetName = "产线管理";
+
+            var openBtn = new ToolBarOpenFile();
+            openBtn.Click += OpenBtn_Click;
+            ToolBar.Items.Add(openBtn);
+            MainGrid.FileDragDrop += FileDragDrop;
+        }
+
+        private void OpenBtn_Click(object sender, ToolBarOpenFile.OpenFileButtonBouseEventArgs e)
+        {
+            ImportFile(e.OpenFileName, MainGrid.ExportSheetName);
         }
 
         /// <summary>

+ 0 - 1
SCADA_DAQ/SCADA_DAQ.csproj

@@ -293,7 +293,6 @@
 
   <ItemGroup>
     <Folder Include="Customer\Dashboard\" />
-    <Folder Include="Customer\Models\Statistics\" />
   </ItemGroup>
 
   <ItemGroup>

+ 45 - 0
SCADA_DAQ/SystemControl.cs

@@ -2,9 +2,11 @@
 using DBNames;
 using log4net;
 using SCADA.CommonLib;
+using SCADA.CommonLib.Data.DIL;
 using SCADA.CommonLib.Helper;
 using SCADA_DAQ.Customer;
 using SCADA_DAQ.Customer.Models;
+using SCADA_DAQ.Customer.Models.ProductionLineManagement;
 using SCADA_DAQ.Plugin.Core;
 using SCADA_DAQ.Plugin.Core.License;
 using SCADA_DAQ.Plugin.CoreUI;
@@ -118,6 +120,7 @@ namespace SCADA_DAQ
                 CreateBackGroundTask(ReportOnLine, 10 * 1000 * 60, 10 * 1000, true, "ReportAppInfo");
                 CreateBackGroundTask(Plugin.CoreUI.SystemApp.SystemStatictics.UpdateLastOnLineTime, 1 * 1000 * 60, 10 * 1000, true, "UpdateLastTime");
                 CreateBackGroundTask(Plugin.CoreUI.SystemApp.SystemStatictics.StatisticsRunTime, 30 * 1000, 15 * 1000, true, "StatisticsRunTime");
+                CreateBackGroundTask(SyncRunTime, 60 * 1000, 10 * 1000, true, "SyncRunTime");  // 同步运行时长
             });
 
             initServer = Task.Factory.StartNew(() =>
@@ -435,6 +438,48 @@ namespace SCADA_DAQ
         }
 
 
+        /// <summary>
+        /// 同步运行时长到服务器
+        /// </summary>
+        public void SyncRunTime()
+        {
+            var localValue = Env.LocalDAL.SysApp_DayStatistics?.GetTopOne($"DayStartTime_Dt='{DateTime.Now.Date.Format()}'", "Value_Dec", "DayStartTime_Dt desc");
+            if (localValue == null)
+                localValue = 0;
+
+            var filterStr = $"ProductionLineId_Str='{CustomerEnv.ProductionLineConfigValue.ProductionLineId}' " +
+                        $"AND WorkShopId_Str='{CustomerEnv.ProductionLineConfigValue.WorkShopId}' " +
+                        $"AND DATEDIFF(dd, StartTime_Dt, GETDATE())=0";
+            ProductionLineStateModel tableInfo = null;
+            if (Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord != null && Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord.Exist(filterStr))
+            {
+                tableInfo = Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord?
+                    .GetData<ProductionLineStateModel>(filterStr)
+                    .OrderBy(t => t.ID).Last();
+            }
+            else
+            {
+                tableInfo = null;
+            }
+
+            if (tableInfo == null)
+            {
+                Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord?.Insert(
+                    new UpdateItem("ProductionLineId_Str", CustomerEnv.ProductionLineConfigValue.ProductionLineId),
+                    new UpdateItem("WorkShopId_Str", CustomerEnv.ProductionLineConfigValue.WorkShopId),
+                    new UpdateItem("ProductionLineState_Str", "Running"),
+                    new UpdateItem("StartTime_Dt", DateTime.Now.Date.Format()),
+                    new UpdateItem("EndTime_Dt", DateTime.Now.AddDays(1).Date.Format()),
+                    new UpdateItem("DurationSec_Int", localValue)
+                    );
+            }
+            else
+            {
+                Env.SgIDAL.APP_TaiLing_ProductionLineStateRecord?.Update(filterStr,
+                    new UpdateItem("DurationSec_Int", localValue));
+            }
+        }
+
 
         /// <summary>
         /// 创建一个后台任务

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov