Kaynağa Gözat

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

Hcsy 7 yıl önce
ebeveyn
işleme
29040865a2

+ 1 - 1
PLCDataReader/Device/Information/DeviceStatusInfo.cs

@@ -63,7 +63,7 @@ namespace UAS_PLCDataReader.Device.Infomation
             sql.Clear();
             sql.Append("select '接收'||nvl(dpg_receivedatasize,0)||'字节' dpg_receivedatasize,'发送'||nvl(dpg_senddatasize,0)||'字节' dpg_senddatasize");
             sql.Append(",dpg_onlinetime,dpg_offlinetime,'IP:'||dnc_ip dnc_ip,'端口:'|| dnc_port||',间隔'||dpg_interval||'S' dnc_port,");
-            sql.Append("round(to_number(sysdate-DPG_ONLINETIME )*1440) dpg_runtime from devicepollinglog left join DEVICENETCONFIG on dnc_decode=dpg_decode ");
+            sql.Append("round(to_number(sysdate-DPG_STARTTIME )*1440) dpg_runtime from devicepollinglog left join DEVICENETCONFIG on dnc_decode=dpg_decode ");
             sql.Append("where dpg_id=(select max(dpg_id) from devicepollinglog where dpg_decode='" + de_code + "')");
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             if (dt.Rows.Count > 0)

+ 0 - 8
PLCDataReader/Entity/DeviceStatus.cs

@@ -7,14 +7,6 @@ namespace UAS_PLCDataReader.Entity
 {
     class DeviceStatus
     {
-        private static string running;
-
-        private static string stopped;
-
-        private static string noanswer;
-
-        private static string disconnect;
-
         public static string Running
         {
             get

+ 32 - 32
PLCDataReader/Entity/User.cs

@@ -19,14 +19,14 @@ namespace UAS_PLCDataReader.Entity
         /// 用户岗位
         /// </summary>
         public static string UserPosition;//岗位 em_position
-        /// <summary>
-        /// 当前工序编号
-        /// </summary>
-        public static string CurrentStepCode;//工序 sc_stepcode
-        /// <summary>
-        /// 当前工序名称
-        /// </summary>
-        public static string CurrentStepName;//工序名称
+        ///// <summary>
+        ///// 当前工序编号
+        ///// </summary>
+        //public static string CurrentStepCode;//工序 sc_stepcode
+        ///// <summary>
+        ///// 当前工序名称
+        ///// </summary>
+        //public static string CurrentStepName;//工序名称
         /// <summary>
         /// 用户部门
         /// </summary>
@@ -39,29 +39,29 @@ namespace UAS_PLCDataReader.Entity
         /// 用户类型,admin表示超级管理员,normal表示普通用户
         /// </summary>
         public static string UserAccountType;//用户类型  em_type
-        /// <summary>
-        /// 岗位资源编号
-        /// </summary>
-        public static string UserSourceCode;//岗位资源  ur_resourecode
-        /// <summary>
-        /// 用户分组
-        /// </summary>
-        public static string UserGroup;//用户分组  ug_name
-        /// <summary>
-        ///  用户分组编码
-        /// </summary>
-        public static string UserGroupCode;//用户分组编码   ug_code
-        /// <summary>
-        /// 用户所属的线别
-        /// </summary>
-        public static string UserLineCode;
-        /// <summary>
-        /// 资源所属工作中心
-        /// </summary>
-        public static string WorkCenter;
-        /// <summary>
-        /// 默认不良组别
-        /// </summary>
-        public static string DefaultBadGroup;
+        ///// <summary>
+        ///// 岗位资源编号
+        ///// </summary>
+        //public static string UserSourceCode;//岗位资源  ur_resourecode
+        ///// <summary>
+        ///// 用户分组
+        ///// </summary>
+        //public static string UserGroup;//用户分组  ug_name
+        ///// <summary>
+        /////  用户分组编码
+        ///// </summary>
+        //public static string UserGroupCode;//用户分组编码   ug_code
+        ///// <summary>
+        ///// 用户所属的线别
+        ///// </summary>
+        //public static string UserLineCode;
+        ///// <summary>
+        ///// 资源所属工作中心
+        ///// </summary>
+        //public static string WorkCenter;
+        ///// <summary>
+        ///// 默认不良组别
+        ///// </summary>
+        //public static string DefaultBadGroup;
     }
 }

+ 1 - 1
PLCDataReader/Login.Designer.cs

@@ -123,7 +123,7 @@
             this.FormBorderEffect = DevExpress.XtraEditors.FormBorderEffect.None;
             this.Name = "Login";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = " 设备管理平台";
+            this.Text = "设备管理平台";
             this.Load += new System.EventHandler(this.Login_Load);
             ((System.ComponentModel.ISupportInitialize)(this.UserName.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.PassWord.Properties)).EndInit();

+ 76 - 21
PLCDataReader/Main.Designer.cs

@@ -209,6 +209,10 @@ namespace UAS_PLCDataReader
             this.drr_doman = new DevExpress.XtraGrid.Columns.GridColumn();
             this.drr_remark = new DevExpress.XtraGrid.Columns.GridColumn();
             this.PageClientParam = new DevExpress.XtraTab.XtraTabPage();
+            this.label2 = new System.Windows.Forms.Label();
+            this.CheckOUTQTY = new DevExpress.XtraEditors.CheckEdit();
+            this.CheckPARAM = new DevExpress.XtraEditors.CheckEdit();
+            this.CheckINQTY = new DevExpress.XtraEditors.CheckEdit();
             this.ButtonSaveClientParam = new DevExpress.XtraEditors.SimpleButton();
             this.UpdateTimeSpan = new System.Windows.Forms.NumericUpDown();
             this.label1 = new System.Windows.Forms.Label();
@@ -285,6 +289,9 @@ namespace UAS_PLCDataReader
             ((System.ComponentModel.ISupportInitialize)(this.GridDeviceRunLog)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GirdViewDeviceRunLog)).BeginInit();
             this.PageClientParam.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.CheckOUTQTY.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.CheckPARAM.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.CheckINQTY.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.UpdateTimeSpan)).BeginInit();
             this.PageDeviceData.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.GridDeviceData)).BeginInit();
@@ -942,7 +949,7 @@ namespace UAS_PLCDataReader
             this.PageCommandSet.Controls.Add(this.GridCommandSetting);
             this.PageCommandSet.Name = "PageCommandSet";
             this.PageCommandSet.PageVisible = false;
-            this.PageCommandSet.Size = new System.Drawing.Size(1034, 454);
+            this.PageCommandSet.Size = new System.Drawing.Size(1034, 578);
             this.PageCommandSet.Text = "设备指令设置";
             this.PageCommandSet.VisibleChanged += new System.EventHandler(this.PageCommandSet_VisibleChanged);
             // 
@@ -1019,7 +1026,7 @@ namespace UAS_PLCDataReader
             this.CommandSetRepositoryItemComboBox1,
             this.repositoryItemDateEdit1});
             this.GridCommandSetting.RowCount = 0;
-            this.GridCommandSetting.Size = new System.Drawing.Size(1034, 423);
+            this.GridCommandSetting.Size = new System.Drawing.Size(1034, 547);
             this.GridCommandSetting.TabIndex = 1;
             this.GridCommandSetting.TableName = null;
             this.GridCommandSetting.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1193,7 +1200,7 @@ namespace UAS_PLCDataReader
             this.PageDeviceNetSetting.Controls.Add(this.GridDeviceNetSetting);
             this.PageDeviceNetSetting.Name = "PageDeviceNetSetting";
             this.PageDeviceNetSetting.PageVisible = false;
-            this.PageDeviceNetSetting.Size = new System.Drawing.Size(1034, 454);
+            this.PageDeviceNetSetting.Size = new System.Drawing.Size(1034, 578);
             this.PageDeviceNetSetting.Text = "设备网络配置";
             // 
             // ButtonDeleteNetConfig
@@ -1243,7 +1250,7 @@ namespace UAS_PLCDataReader
             this.GridDeviceNetSetting.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
             this.dpc_enableCheckEdit});
             this.GridDeviceNetSetting.RowCount = 0;
-            this.GridDeviceNetSetting.Size = new System.Drawing.Size(1031, 420);
+            this.GridDeviceNetSetting.Size = new System.Drawing.Size(1031, 544);
             this.GridDeviceNetSetting.TabIndex = 0;
             this.GridDeviceNetSetting.TableName = null;
             this.GridDeviceNetSetting.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1353,7 +1360,7 @@ namespace UAS_PLCDataReader
             this.PagePollingSetting.Controls.Add(this.GridPollingSetting);
             this.PagePollingSetting.Name = "PagePollingSetting";
             this.PagePollingSetting.PageVisible = false;
-            this.PagePollingSetting.Size = new System.Drawing.Size(1034, 454);
+            this.PagePollingSetting.Size = new System.Drawing.Size(1034, 578);
             this.PagePollingSetting.Text = "设备轮询配置";
             this.PagePollingSetting.VisibleChanged += new System.EventHandler(this.PagePollingSetting_VisibleChanged);
             // 
@@ -1428,7 +1435,7 @@ namespace UAS_PLCDataReader
             this.PollSettingItemSearchLookUpEdit,
             this.PollSettingDeviceSearchLookUpEdit});
             this.GridPollingSetting.RowCount = 0;
-            this.GridPollingSetting.Size = new System.Drawing.Size(1034, 420);
+            this.GridPollingSetting.Size = new System.Drawing.Size(1034, 544);
             this.GridPollingSetting.TabIndex = 0;
             this.GridPollingSetting.TableName = null;
             this.GridPollingSetting.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1650,14 +1657,14 @@ namespace UAS_PLCDataReader
             this.PagePolling.Controls.Add(this.GridPolling);
             this.PagePolling.Name = "PagePolling";
             this.PagePolling.PageVisible = false;
-            this.PagePolling.Size = new System.Drawing.Size(1034, 454);
+            this.PagePolling.Size = new System.Drawing.Size(1034, 578);
             this.PagePolling.Text = "xtraTabPage1";
             // 
             // ButtonAddPolling
             // 
             this.ButtonAddPolling.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.ButtonAddPolling.Grid = null;
-            this.ButtonAddPolling.Location = new System.Drawing.Point(885, 428);
+            this.ButtonAddPolling.Location = new System.Drawing.Point(885, 552);
             this.ButtonAddPolling.Name = "ButtonAddPolling";
             this.ButtonAddPolling.Size = new System.Drawing.Size(64, 23);
             this.ButtonAddPolling.TabIndex = 9;
@@ -1667,7 +1674,7 @@ namespace UAS_PLCDataReader
             // 
             this.ButtonDeletePolling.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.ButtonDeletePolling.Grid = null;
-            this.ButtonDeletePolling.Location = new System.Drawing.Point(814, 428);
+            this.ButtonDeletePolling.Location = new System.Drawing.Point(814, 552);
             this.ButtonDeletePolling.Name = "ButtonDeletePolling";
             this.ButtonDeletePolling.Size = new System.Drawing.Size(64, 23);
             this.ButtonDeletePolling.TabIndex = 8;
@@ -1678,7 +1685,7 @@ namespace UAS_PLCDataReader
             this.ButtonSavePolling.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.ButtonSavePolling.Grid = null;
             this.ButtonSavePolling.HandlerOtherFirst = false;
-            this.ButtonSavePolling.Location = new System.Drawing.Point(956, 428);
+            this.ButtonSavePolling.Location = new System.Drawing.Point(956, 552);
             this.ButtonSavePolling.Name = "ButtonSavePolling";
             this.ButtonSavePolling.Size = new System.Drawing.Size(64, 23);
             this.ButtonSavePolling.TabIndex = 7;
@@ -1700,7 +1707,7 @@ namespace UAS_PLCDataReader
             this.GridPolling.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
             this.dpc_enableCheckEdit});
             this.GridPolling.RowCount = 0;
-            this.GridPolling.Size = new System.Drawing.Size(1034, 426);
+            this.GridPolling.Size = new System.Drawing.Size(1034, 550);
             this.GridPolling.TabIndex = 0;
             this.GridPolling.TableName = null;
             this.GridPolling.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1793,7 +1800,7 @@ namespace UAS_PLCDataReader
             this.PageDeviceStatus.Controls.Add(this.PanelDeviceStatus);
             this.PageDeviceStatus.Name = "PageDeviceStatus";
             this.PageDeviceStatus.PageVisible = false;
-            this.PageDeviceStatus.Size = new System.Drawing.Size(1034, 454);
+            this.PageDeviceStatus.Size = new System.Drawing.Size(1034, 578);
             this.PageDeviceStatus.Text = "设备状态查看";
             this.PageDeviceStatus.VisibleChanged += new System.EventHandler(this.PageDeviceStatus_VisibleChanged);
             // 
@@ -1908,7 +1915,7 @@ namespace UAS_PLCDataReader
             | System.Windows.Forms.AnchorStyles.Right)));
             this.PanelDeviceStatus.Location = new System.Drawing.Point(0, 35);
             this.PanelDeviceStatus.Name = "PanelDeviceStatus";
-            this.PanelDeviceStatus.Size = new System.Drawing.Size(1034, 419);
+            this.PanelDeviceStatus.Size = new System.Drawing.Size(1034, 543);
             this.PanelDeviceStatus.TabIndex = 0;
             // 
             // PageWorkCenterStatus
@@ -1916,7 +1923,7 @@ namespace UAS_PLCDataReader
             this.PageWorkCenterStatus.Controls.Add(this.GridWorkCenterStatus);
             this.PageWorkCenterStatus.Name = "PageWorkCenterStatus";
             this.PageWorkCenterStatus.PageVisible = false;
-            this.PageWorkCenterStatus.Size = new System.Drawing.Size(1034, 454);
+            this.PageWorkCenterStatus.Size = new System.Drawing.Size(1034, 578);
             this.PageWorkCenterStatus.Text = "设备工作中心";
             // 
             // GridWorkCenterStatus
@@ -1933,7 +1940,7 @@ namespace UAS_PLCDataReader
             this.GridWorkCenterStatus.MenuManager = this.RibbonNav;
             this.GridWorkCenterStatus.Name = "GridWorkCenterStatus";
             this.GridWorkCenterStatus.RowCount = 0;
-            this.GridWorkCenterStatus.Size = new System.Drawing.Size(1031, 451);
+            this.GridWorkCenterStatus.Size = new System.Drawing.Size(1031, 575);
             this.GridWorkCenterStatus.TabIndex = 0;
             this.GridWorkCenterStatus.TableName = null;
             this.GridWorkCenterStatus.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1954,7 +1961,7 @@ namespace UAS_PLCDataReader
             this.PageDeviceRunLog.Controls.Add(this.GridDeviceRunLog);
             this.PageDeviceRunLog.Name = "PageDeviceRunLog";
             this.PageDeviceRunLog.PageVisible = false;
-            this.PageDeviceRunLog.Size = new System.Drawing.Size(1034, 454);
+            this.PageDeviceRunLog.Size = new System.Drawing.Size(1034, 578);
             this.PageDeviceRunLog.Text = "设备运行日志";
             // 
             // ButtonSearchDeviceRunLog
@@ -1997,7 +2004,7 @@ namespace UAS_PLCDataReader
             this.GridDeviceRunLog.MenuManager = this.RibbonNav;
             this.GridDeviceRunLog.Name = "GridDeviceRunLog";
             this.GridDeviceRunLog.RowCount = 0;
-            this.GridDeviceRunLog.Size = new System.Drawing.Size(1035, 430);
+            this.GridDeviceRunLog.Size = new System.Drawing.Size(1035, 554);
             this.GridDeviceRunLog.TabIndex = 0;
             this.GridDeviceRunLog.TableName = null;
             this.GridDeviceRunLog.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -2098,18 +2105,59 @@ namespace UAS_PLCDataReader
             // 
             // PageClientParam
             // 
+            this.PageClientParam.Controls.Add(this.label2);
+            this.PageClientParam.Controls.Add(this.CheckOUTQTY);
+            this.PageClientParam.Controls.Add(this.CheckPARAM);
+            this.PageClientParam.Controls.Add(this.CheckINQTY);
             this.PageClientParam.Controls.Add(this.ButtonSaveClientParam);
             this.PageClientParam.Controls.Add(this.UpdateTimeSpan);
             this.PageClientParam.Controls.Add(this.label1);
             this.PageClientParam.Name = "PageClientParam";
             this.PageClientParam.PageVisible = false;
-            this.PageClientParam.Size = new System.Drawing.Size(1034, 454);
+            this.PageClientParam.Size = new System.Drawing.Size(1034, 578);
             this.PageClientParam.Text = "客户端参数设置";
             this.PageClientParam.VisibleChanged += new System.EventHandler(this.PageClientParam_VisibleChanged);
             // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label2.Location = new System.Drawing.Point(28, 78);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(106, 21);
+            this.label2.TabIndex = 6;
+            this.label2.Text = "立即更新参数";
+            // 
+            // CheckOUTQTY
+            // 
+            this.CheckOUTQTY.Location = new System.Drawing.Point(221, 80);
+            this.CheckOUTQTY.MenuManager = this.RibbonNav;
+            this.CheckOUTQTY.Name = "CheckOUTQTY";
+            this.CheckOUTQTY.Properties.Caption = "产出";
+            this.CheckOUTQTY.Size = new System.Drawing.Size(75, 19);
+            this.CheckOUTQTY.TabIndex = 5;
+            // 
+            // CheckPARAM
+            // 
+            this.CheckPARAM.Location = new System.Drawing.Point(302, 80);
+            this.CheckPARAM.MenuManager = this.RibbonNav;
+            this.CheckPARAM.Name = "CheckPARAM";
+            this.CheckPARAM.Properties.Caption = "其他参数";
+            this.CheckPARAM.Size = new System.Drawing.Size(75, 19);
+            this.CheckPARAM.TabIndex = 4;
+            // 
+            // CheckINQTY
+            // 
+            this.CheckINQTY.Location = new System.Drawing.Point(140, 80);
+            this.CheckINQTY.MenuManager = this.RibbonNav;
+            this.CheckINQTY.Name = "CheckINQTY";
+            this.CheckINQTY.Properties.Caption = "投入";
+            this.CheckINQTY.Size = new System.Drawing.Size(75, 19);
+            this.CheckINQTY.TabIndex = 3;
+            // 
             // ButtonSaveClientParam
             // 
-            this.ButtonSaveClientParam.Location = new System.Drawing.Point(140, 122);
+            this.ButtonSaveClientParam.Location = new System.Drawing.Point(140, 129);
             this.ButtonSaveClientParam.Name = "ButtonSaveClientParam";
             this.ButtonSaveClientParam.Size = new System.Drawing.Size(64, 23);
             this.ButtonSaveClientParam.TabIndex = 2;
@@ -2139,7 +2187,7 @@ namespace UAS_PLCDataReader
             this.PageDeviceData.Controls.Add(this.GridDeviceData);
             this.PageDeviceData.Name = "PageDeviceData";
             this.PageDeviceData.PageVisible = false;
-            this.PageDeviceData.Size = new System.Drawing.Size(1034, 454);
+            this.PageDeviceData.Size = new System.Drawing.Size(1034, 578);
             this.PageDeviceData.Text = "设备运行数据";
             // 
             // ButtonRefreshDeviceData
@@ -2167,7 +2215,7 @@ namespace UAS_PLCDataReader
             this.GridDeviceData.MenuManager = this.RibbonNav;
             this.GridDeviceData.Name = "GridDeviceData";
             this.GridDeviceData.RowCount = 0;
-            this.GridDeviceData.Size = new System.Drawing.Size(1034, 422);
+            this.GridDeviceData.Size = new System.Drawing.Size(1034, 546);
             this.GridDeviceData.TabIndex = 0;
             this.GridDeviceData.TableName = null;
             this.GridDeviceData.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -2412,6 +2460,9 @@ namespace UAS_PLCDataReader
             ((System.ComponentModel.ISupportInitialize)(this.GirdViewDeviceRunLog)).EndInit();
             this.PageClientParam.ResumeLayout(false);
             this.PageClientParam.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.CheckOUTQTY.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.CheckPARAM.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.CheckINQTY.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.UpdateTimeSpan)).EndInit();
             this.PageDeviceData.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.GridDeviceData)).EndInit();
@@ -2623,5 +2674,9 @@ namespace UAS_PLCDataReader
         private DevExpress.XtraGrid.Columns.GridColumn dr_value9;
         private DevExpress.XtraGrid.Columns.GridColumn dr_value10;
         private CustomerControl.Button.ButtonDeleteRow ButtonRefreshDeviceData;
+        private System.Windows.Forms.Label label2;
+        private CheckEdit CheckOUTQTY;
+        private CheckEdit CheckPARAM;
+        private CheckEdit CheckINQTY;
     }
 }

+ 24 - 0
PLCDataReader/Main.cs

@@ -161,6 +161,12 @@ namespace UAS_PLCDataReader
             e.Handled = true;
         }
 
+        public static string inqty = BaseUtil.GetCacheData("INQTY").ToString();
+
+        public static string outqty = BaseUtil.GetCacheData("OUTQTY").ToString();
+
+        public static string param = BaseUtil.GetCacheData("PARAM").ToString();
+
         private void Main_Load(object sender, EventArgs e)
         {
             //设备列表
@@ -991,6 +997,21 @@ namespace UAS_PLCDataReader
         private void ButtonSaveClientParam_Click(object sender, EventArgs e)
         {
             BaseUtil.SetCacheData("UpdateTime", UpdateTimeSpan.Value);
+            if (CheckINQTY.Checked)
+            {
+                BaseUtil.SetCacheData("INQTY", -1); inqty = "-1";
+            }
+            else { BaseUtil.SetCacheData("INQTY", 0); inqty = "0"; }
+            if (CheckOUTQTY.Checked)
+            {
+                BaseUtil.SetCacheData("OUTQTY", -1); outqty = "-1";
+            }
+            else { BaseUtil.SetCacheData("OUTQTY", 0); outqty = "0"; }
+            if (CheckPARAM.Checked)
+            {
+                BaseUtil.SetCacheData("PARAM", -1); param = "-1";
+            }
+            else { BaseUtil.SetCacheData("PARAM", 0); param = "0"; }
             XtraMessageBox.Show("保存成功!");
         }
 
@@ -998,6 +1019,9 @@ namespace UAS_PLCDataReader
         {
             if (PageClientParam.PageVisible)
             {
+                if (inqty == "-1") { CheckINQTY.Checked = true; }
+                if (outqty == "-1") { CheckOUTQTY.Checked = true; }
+                if (param == "-1") { CheckPARAM.Checked = true; }
                 decimal time = 0;
                 if (decimal.TryParse(BaseUtil.GetCacheData("UpdateTime").ToString(), out time))
                 {

+ 2 - 0
PLCDataReader/Program.cs

@@ -42,6 +42,8 @@ namespace UAS_PLCDataReader
                 FileStream fs = new FileStream(LogManager.LogAddress + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
                 fs.Close();
                 DevExpress.Skins.SkinManager.EnableFormSkins();
+                if (!Directory.Exists(SystemInf.CacheFolder))
+                    Directory.CreateDirectory(SystemInf.CacheFolder);
                 FileStream fcaches = new FileStream(SystemInf.CacheFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);
                 fcaches.Close();
                 //判断是否xml文件大小为0

+ 1 - 1
PLCDataReader/PublicMethod/BaseUtil.cs

@@ -223,7 +223,7 @@ namespace UAS_PLCDataReader.PublicMethod
             foreach (var item in B)
             {
                 //不对比产量和产出
-                if (A.ContainsKey(item.Key) && item.Key != "INQTY" && item.Key != "OUTQTY")
+                if (A.ContainsKey(item.Key) && (Main.inqty == "-1" || Main.outqty == "-1" || Main.param == "-1"))
                 {
                     if (A[item.Key] != item.Value)
                     {

+ 17 - 6
PLCDataReader/PublicMethod/LogicHandler.cs

@@ -263,17 +263,28 @@ namespace UAS_PLCDataReader.PublicMethod
         public static void UpdateDeviceStatus(string iDecode, string iDename, string iErrMessage, string iDestatus, int iType)
         {
             StringBuilder sql = new StringBuilder();
-            sql.Clear();
-            sql.Append("MERGE INTO DeviceRunstatus alias1 USING (select '" + iDecode + "' dr_decode from  dual) alias2 ");
-            sql.Append("ON (alias1.dr_decode=alias2.dr_decode) WHEN MATCHED THEN  UPDATE  SET dr_startdate =sysdate,Dr_runstatus='" + iDestatus + "' ");
-            sql.Append("WHEN NOT MATCHED THEN INSERT (Dr_id,dr_decode,dr_dename,Dr_runstatus,dr_startdate) VALUES (DeviceRunstatus_seq.nextval,");
-            sql.Append("'" + iDecode + "','" + iDename + "','" + iDestatus + "',sysdate)");
+            if (iDestatus == DeviceStatus.Running)
+            {
+                sql.Clear();
+                sql.Append("MERGE INTO DeviceRunstatus alias1 USING (select '" + iDecode + "' dr_decode from  dual) alias2 ");
+                sql.Append("ON (alias1.dr_decode=alias2.dr_decode) WHEN MATCHED THEN  UPDATE  SET dr_startdate =sysdate,Dr_runstatus='" + iDestatus + "',dr_getdatatime=(sysdate-dr_updatestatusdate)* 24 * 60 * 60*1000 ");
+                sql.Append("WHEN NOT MATCHED THEN INSERT (Dr_id,dr_decode,dr_dename,Dr_runstatus,dr_startdate,dr_updatestatusdate) VALUES (DeviceRunstatus_seq.nextval,");
+                sql.Append("'" + iDecode + "','" + iDename + "','" + iDestatus + "',sysdate,sysdate)");
+            }
+            else
+            {
+                sql.Clear();
+                sql.Append("MERGE INTO DeviceRunstatus alias1 USING (select '" + iDecode + "' dr_decode from  dual) alias2 ");
+                sql.Append("ON (alias1.dr_decode=alias2.dr_decode) WHEN MATCHED THEN  UPDATE  SET dr_startdate=sysdate,Dr_runstatus='" + iDestatus + "',dr_updatestatusdate=sysdate ");
+                sql.Append("WHEN NOT MATCHED THEN INSERT (Dr_id,dr_decode,dr_dename,Dr_runstatus,dr_startdate,dr_updatestatusdate) VALUES (DeviceRunstatus_seq.nextval,");
+                sql.Append("'" + iDecode + "','" + iDename + "','" + iDestatus + "',sysdate,sysdate)");
+            }
             Main.QueueUpdateDevice.Enqueue(sql.ToString());
             if (iType == -1)
             {
                 sql.Clear();
                 sql.Append("insert into DeviceRunRecord(drr_id,drr_decode,drr_dename,drr_date,drr_doman,drr_remark,drr_logstatus,drr_type)");
-                sql.Append("values(DeviceRunRecord_seq.nextval,'" + iDecode + "','" + iDename + "',sysdate,'" + User.UserName + "','" + iErrMessage + "','" + iDestatus + "'," + iType + ")");
+                sql.Append("values(DeviceRunRecord_seq.nextval,'" + iDecode + "','" + iDename + "',sysdate,'" + User.UserName + "','" + iErrMessage.Replace("'", "") + "','" + iDestatus + "'," + iType + ")");
                 Main.QueueUpdateDevice.Enqueue(sql.ToString());
             }
         }

+ 40 - 126
UAS-出货标签管理(吉利通)/PowerSetting.Designer.cs

@@ -30,25 +30,17 @@
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PowerSetting));
             this.PowerSetDGV = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
-            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.lpp_emcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.lpp_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.em_na = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.lpp_cleandetail = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.lpp_savedetail = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.lpp_gencode = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.lpp_collectstrategy = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.lpp_allcollect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.lpp_labelmatain = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.SaveGrid = new UAS_LabelMachine.CustomControl.NormalButton();
-            this.AddRow = new UAS_LabelMachine.CustomControl.NormalButton();
-            this.Delete = new UAS_LabelMachine.CustomControl.NormalButton();
-            this.ChooseAll = new UAS_LabelMachine.CustomControl.ChooseAllButton();
             this.em_name = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.si_expression4_label = new System.Windows.Forms.Label();
             this.em_code = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.label1 = new System.Windows.Forms.Label();
             this.Screen = new UAS_LabelMachine.CustomControl.ChooseAllButton();
+            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.lpp_emcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.lpp_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.em_na = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.lpp_manual = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.PowerSetDGV)).BeginInit();
             this.SuspendLayout();
             // 
@@ -61,85 +53,17 @@
             this.lpp_emcode,
             this.lpp_id,
             this.em_na,
-            this.lpp_cleandetail,
-            this.lpp_savedetail,
-            this.lpp_gencode,
-            this.lpp_collectstrategy,
-            this.lpp_allcollect,
-            this.lpp_labelmatain});
+            this.lpp_manual});
             this.PowerSetDGV.Location = new System.Drawing.Point(0, 55);
             this.PowerSetDGV.Name = "PowerSetDGV";
             this.PowerSetDGV.RowTemplate.Height = 23;
             this.PowerSetDGV.Size = new System.Drawing.Size(1056, 441);
             this.PowerSetDGV.TabIndex = 0;
             // 
-            // Choose
-            // 
-            this.Choose.HeaderText = "勾选";
-            this.Choose.Name = "Choose";
-            this.Choose.Width = 50;
-            // 
-            // lpp_emcode
-            // 
-            this.lpp_emcode.DataPropertyName = "lpp_emcode";
-            this.lpp_emcode.HeaderText = "员工编号";
-            this.lpp_emcode.Name = "lpp_emcode";
-            // 
-            // lpp_id
-            // 
-            this.lpp_id.DataPropertyName = "lpp_id";
-            this.lpp_id.HeaderText = "lpp_id";
-            this.lpp_id.Name = "lpp_id";
-            this.lpp_id.Visible = false;
-            // 
-            // em_na
-            // 
-            this.em_na.DataPropertyName = "em_name";
-            this.em_na.HeaderText = "员工姓名";
-            this.em_na.Name = "em_na";
-            this.em_na.ReadOnly = true;
-            // 
-            // lpp_cleandetail
-            // 
-            this.lpp_cleandetail.DataPropertyName = "lpp_cleandetail";
-            this.lpp_cleandetail.HeaderText = "清除明细";
-            this.lpp_cleandetail.Name = "lpp_cleandetail";
-            // 
-            // lpp_savedetail
-            // 
-            this.lpp_savedetail.DataPropertyName = "lpp_savedetail";
-            this.lpp_savedetail.HeaderText = "保存明细";
-            this.lpp_savedetail.Name = "lpp_savedetail";
-            // 
-            // lpp_gencode
-            // 
-            this.lpp_gencode.DataPropertyName = "lpp_gencode";
-            this.lpp_gencode.HeaderText = "生成条码";
-            this.lpp_gencode.Name = "lpp_gencode";
-            // 
-            // lpp_collectstrategy
-            // 
-            this.lpp_collectstrategy.DataPropertyName = "lpp_collectstrategy";
-            this.lpp_collectstrategy.HeaderText = "查看采集策略";
-            this.lpp_collectstrategy.Name = "lpp_collectstrategy";
-            this.lpp_collectstrategy.Width = 110;
-            // 
-            // lpp_allcollect
-            // 
-            this.lpp_allcollect.DataPropertyName = "lpp_allcollect";
-            this.lpp_allcollect.HeaderText = "全部采集";
-            this.lpp_allcollect.Name = "lpp_allcollect";
-            // 
-            // lpp_labelmatain
-            // 
-            this.lpp_labelmatain.DataPropertyName = "lpp_labelmatain";
-            this.lpp_labelmatain.HeaderText = "标签维护";
-            this.lpp_labelmatain.Name = "lpp_labelmatain";
-            // 
             // SaveGrid
             // 
             this.SaveGrid.Image = ((System.Drawing.Image)(resources.GetObject("SaveGrid.Image")));
-            this.SaveGrid.Location = new System.Drawing.Point(578, 503);
+            this.SaveGrid.Location = new System.Drawing.Point(491, 504);
             this.SaveGrid.Name = "SaveGrid";
             this.SaveGrid.Size = new System.Drawing.Size(75, 29);
             this.SaveGrid.TabIndex = 1;
@@ -147,37 +71,6 @@
             this.SaveGrid.UseVisualStyleBackColor = true;
             this.SaveGrid.Click += new System.EventHandler(this.SaveGrid_Click);
             // 
-            // AddRow
-            // 
-            this.AddRow.Image = ((System.Drawing.Image)(resources.GetObject("AddRow.Image")));
-            this.AddRow.Location = new System.Drawing.Point(407, 503);
-            this.AddRow.Name = "AddRow";
-            this.AddRow.Size = new System.Drawing.Size(75, 29);
-            this.AddRow.TabIndex = 2;
-            this.AddRow.Text = "新增";
-            this.AddRow.UseVisualStyleBackColor = true;
-            this.AddRow.Click += new System.EventHandler(this.AddRow_Click);
-            // 
-            // Delete
-            // 
-            this.Delete.Image = ((System.Drawing.Image)(resources.GetObject("Delete.Image")));
-            this.Delete.Location = new System.Drawing.Point(491, 503);
-            this.Delete.Name = "Delete";
-            this.Delete.Size = new System.Drawing.Size(75, 29);
-            this.Delete.TabIndex = 3;
-            this.Delete.Text = "删除";
-            this.Delete.UseVisualStyleBackColor = true;
-            this.Delete.Click += new System.EventHandler(this.Delete_Click);
-            // 
-            // ChooseAll
-            // 
-            this.ChooseAll.Location = new System.Drawing.Point(1, 55);
-            this.ChooseAll.Name = "ChooseAll";
-            this.ChooseAll.Size = new System.Drawing.Size(40, 22);
-            this.ChooseAll.TabIndex = 4;
-            this.ChooseAll.Text = "全选";
-            this.ChooseAll.UseVisualStyleBackColor = true;
-            // 
             // em_name
             // 
             this.em_name.ID = null;
@@ -234,6 +127,38 @@
             this.Screen.UseVisualStyleBackColor = true;
             this.Screen.Click += new System.EventHandler(this.Screen_Click);
             // 
+            // Choose
+            // 
+            this.Choose.HeaderText = "勾选";
+            this.Choose.Name = "Choose";
+            this.Choose.Width = 50;
+            // 
+            // lpp_emcode
+            // 
+            this.lpp_emcode.DataPropertyName = "em_code";
+            this.lpp_emcode.HeaderText = "员工编号";
+            this.lpp_emcode.Name = "lpp_emcode";
+            // 
+            // lpp_id
+            // 
+            this.lpp_id.DataPropertyName = "lpp_id";
+            this.lpp_id.HeaderText = "lpp_id";
+            this.lpp_id.Name = "lpp_id";
+            this.lpp_id.Visible = false;
+            // 
+            // em_na
+            // 
+            this.em_na.DataPropertyName = "em_name";
+            this.em_na.HeaderText = "员工姓名";
+            this.em_na.Name = "em_na";
+            this.em_na.ReadOnly = true;
+            // 
+            // lpp_manual
+            // 
+            this.lpp_manual.DataPropertyName = "lpp_manual";
+            this.lpp_manual.HeaderText = "允许手动采集";
+            this.lpp_manual.Name = "lpp_manual";
+            // 
             // PowerSetting
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -244,9 +169,6 @@
             this.Controls.Add(this.label1);
             this.Controls.Add(this.em_name);
             this.Controls.Add(this.si_expression4_label);
-            this.Controls.Add(this.ChooseAll);
-            this.Controls.Add(this.Delete);
-            this.Controls.Add(this.AddRow);
             this.Controls.Add(this.SaveGrid);
             this.Controls.Add(this.PowerSetDGV);
             this.Name = "PowerSetting";
@@ -262,9 +184,6 @@
 
         private CustomControl.DataGridViewWithSerialNum PowerSetDGV;
         private CustomControl.NormalButton SaveGrid;
-        private CustomControl.NormalButton AddRow;
-        private CustomControl.NormalButton Delete;
-        private CustomControl.ChooseAllButton ChooseAll;
         private CustomControl.EnterTextBox em_name;
         private System.Windows.Forms.Label si_expression4_label;
         private CustomControl.EnterTextBox em_code;
@@ -274,11 +193,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn lpp_emcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn lpp_id;
         private System.Windows.Forms.DataGridViewTextBoxColumn em_na;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_cleandetail;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_savedetail;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_gencode;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_collectstrategy;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_allcollect;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_labelmatain;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_manual;
     }
 }

+ 13 - 30
UAS-出货标签管理(吉利通)/PowerSetting.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Data;
+using System.Text;
 using System.Windows.Forms;
 using UAS_LabelMachine.Entity;
 
@@ -23,47 +24,29 @@ namespace UAS_LabelMachine
         {
             dh = SystemInf.dh;
             LoadData();
-            ChooseAll.ChooseAll(PowerSetDGV);
-        }
-
-        private void AddRow_Click(object sender, EventArgs e)
-        {
-            if (PowerSetDGV.DataSource as DataTable != null)
-                (PowerSetDGV.DataSource as DataTable).Rows.Add();
         }
 
         private void SaveGrid_Click(object sender, EventArgs e)
         {
-            dt = (DataTable)PowerSetDGV.DataSource;
-            string sql = "insert into labelprintpower(lpp_id,lpp_emcode,LPP_CLEANDETAIL,LPP_GENCODE,LPP_LABELMATAIN,LPP_SAVEDETAIL,LPP_COLLECTSTRATEGY,";
-            sql += "LPP_ALLCOLLECT) values(labelprintpower_seq.nextval,:lpp_emcode,:LPP_CLEANDETAIL,:LPP_GENCODE,:LPP_LABELMATAIN,:LPP_SAVEDETAIL,";
-            sql += ":LPP_COLLECTSTRATEGY,:LPP_ALLCOLLECT)";
-            dh.UpDateTableByCondition(dt.GetChanges(), "labelprintpower", "lpp_id", sql.ToLower());
-            dh.ExecuteSql("insert into MessageLog (ml_id,ml_date,ml_man,ml_content,code) select MessageLog_seq.nextval,sysdate,'"+User.UserName+"','修改打印权限','LabelPrint' from dual", "insert");
-            LoadData();
-        }
-
-        private void Delete_Click(object sender, EventArgs e)
-        {
-            dt = (DataTable)PowerSetDGV.DataSource;
-            List<string> deleteid = new List<string>();
+            dt = ((DataTable)PowerSetDGV.DataSource).GetChanges();
+            StringBuilder sql = new StringBuilder();
+            List<string> SQLS = new List<string>();
             for (int i = 0; i < dt.Rows.Count; i++)
             {
-                if (PowerSetDGV.Rows[i].Cells["Choose"].FormattedValue.ToString() == "True")
-                {
-                    deleteid.Add(PowerSetDGV.Rows[i].Cells["lpp_id"].Value.ToString());
-                }
-            }
-            if (deleteid.ToArray().Length > 0)
-            {
-                dh.DeleteDataByID("labelprintpower", "lpp_id", deleteid.ToArray());
-                LoadData();
+                sql.Clear();
+                sql.Append("MERGE INTO labelprintpower alias1 USING (select '" + dt.Rows[i]["em_code"].ToString() + "' em_code from  dual) alias2 ");
+                sql.Append("ON (alias1.lpp_emcode=alias2.em_code) WHEN MATCHED THEN  UPDATE  SET lpp_manual = '" + dt.Rows[i]["lpp_manual"].ToString() + "' ");
+                sql.Append("WHEN NOT MATCHED THEN INSERT (lpp_id,lpp_emcode,lpp_manual) VALUES (labelprintpower_seq.nextval,");
+                sql.Append(" '" + dt.Rows[i]["em_code"].ToString() + "', '" + dt.Rows[i]["lpp_manual"].ToString() + "')");
+                SQLS.Add(sql.ToString());
             }
+            dh.ExecuteSQLTran(SQLS.ToArray());
+            LoadData();
         }
 
         private void LoadData()
         {
-            string sql = " select lpp_emcode,em_name,lpp_id,LPP_CLEANDETAIL,LPP_GENCODE,LPP_LABELMATAIN,LPP_SAVEDETAIL,LPP_COLLECTSTRATEGY,LPP_ALLCOLLECT from labelprintpower left join employee on em_code = lpp_emcode " + condition;
+            string sql = "select em_code,em_name,lpp_id,lpp_emcode,lpp_manual from employee left join labelprintpower on em_code = lpp_emcode " + condition;
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             BaseUtil.FillDgvWithDataTable(PowerSetDGV, dt);
         }

+ 1 - 40
UAS-出货标签管理(吉利通)/PowerSetting.resx

@@ -129,22 +129,7 @@
   <metadata name="em_na.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="lpp_cleandetail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="lpp_savedetail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="lpp_gencode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="lpp_collectstrategy.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="lpp_allcollect.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="lpp_labelmatain.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="lpp_manual.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -158,30 +143,6 @@
         w4gTK17MuLHjow0iS55MubLly5gza958lIHnz6BDix5NurTp06iPGljNurXr17Bjy55Nu/bRALhz697N
         u7fv38CDCz9aoLjx48iTK1/OvLnz50cBSJ9Ovbr169iza9/O/eiA7+DDi0EfT768+fPo0x+FwL69+/fw
         48ufT7++/fX28+vfzz/+UQIABijggAQWaOCBCCao4FEaNejggxBG1NCEFFZoIUIBAQA7
-</value>
-  </data>
-  <data name="AddRow.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        R0lGODlhUgAXAIQAAK/G1qjB1dzn6bTK2MfZ46rE1arD1/D4+/n//d/o7/X6/ez1/K7D1tLj6+Pt9ubx
-        877S3fT09DxZeQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBF
-        Mi4wAwEBAAAh+QQAAAAAACwAAAAAUgAXAAAI/wAlCBxIsKDBgwgTKlzIsGCEhxAjSpxIsaLFixgzPhQY
-        AYHHjyBDihxJsqTJkygjcFTAsqXLlzBjypxJs6ZNlRIiHNjJs6fPn0CDCh1KtCjOCAuSKl3KtKnTp1Cj
-        Sp169IHVq1izat3KtavXr2Crgh1LtqzZrUcdqF3Ltq3bt3Djyp1L92iCu3jz6t3Lt6/fv4ADHxVAuLDh
-        w4gTK17MuLHjow0iS55MubLly5gza958lIHnz6BDix5NurTp06iPGljNurXr17Bjy55Nu/bRALhz697N
-        u7fv38CDCz9aoLjx48iTK1/OvLnz50cBSJ9Ovbr169iza9/O/eiA7+DDi0EfT768+fPo0x+FwL69+/fw
-        48ufT7++/fX28+vfzz/+UQIABijggAQWaOCBCCao4FEaNejggxBG1NCEFFZoIUIBAQA7
-</value>
-  </data>
-  <data name="Delete.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        R0lGODlhUgAXAIQAAK/G1qjB1dzn6bTK2MfZ46rE1arD1/D4+/n//d/o7/X6/ez1/K7D1tLj6+Pt9ubx
-        877S3fT09DxZeQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBF
-        Mi4wAwEBAAAh+QQAAAAAACwAAAAAUgAXAAAI/wAlCBxIsKDBgwgTKlzIsGCEhxAjSpxIsaLFixgzPhQY
-        AYHHjyBDihxJsqTJkygjcFTAsqXLlzBjypxJs6ZNlRIiHNjJs6fPn0CDCh1KtCjOCAuSKl3KtKnTp1Cj
-        Sp169IHVq1izat3KtavXr2Crgh1LtqzZrUcdqF3Ltq3bt3Djyp1L92iCu3jz6t3Lt6/fv4ADHxVAuLDh
-        w4gTK17MuLHjow0iS55MubLly5gza958lIHnz6BDix5NurTp06iPGljNurXr17Bjy55Nu/bRALhz697N
-        u7fv38CDCz9aoLjx48iTK1/OvLnz50cBSJ9Ovbr169iza9/O/eiA7+DDi0EfT768+fPo0x+FwL69+/fw
-        48ufT7++/fX28+vfzz/+UQIABijggAQWaOCBCCao4FEaNejggxBG1NCEFFZoIUIBAQA7
 </value>
   </data>
 </root>

+ 16 - 7
UAS-出货标签管理(吉利通)/PublicMethod/DataHelper.cs

@@ -956,17 +956,17 @@ namespace UAS_LabelMachine
             {
                 if (names[0][i - 1].ToString().ToUpper().Contains("DATE"))
                 {
+                    DateTime[] time = new DateTime[names[i].Length];
+                    for (int j = 0; j < names[i].Length; j++)
+                    {
+                        time[j] = Convert.ToDateTime(names[i][j]);
+                    }
                     try
                     {
-                        DateTime[] time = new DateTime[names[i].Length];
-                        for (int j = 0; j < names[i].Length; j++)
-                        {
-                            time[j] = Convert.ToDateTime(names[i][j]);
-                        }
                         command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Date, time, ParameterDirection.Input));
                     }
                     catch (Exception)
-                    {   
+                    {
                         command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
                     }
                 }
@@ -975,7 +975,16 @@ namespace UAS_LabelMachine
                     command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
                 }
             }
-            command.ExecuteNonQuery();
+            try
+            {
+                command.ExecuteNonQuery();
+            }
+            catch (Exception)
+            {
+                command.Connection = new OracleConnection(DBConnectionString);
+                command.Connection.Open();
+                command.ExecuteNonQuery();
+            }
             command.Dispose();
         }
 

+ 8 - 47
UAS-出货标签管理(吉利通)/PublicMethod/GlobalEventsHandler.cs

@@ -24,9 +24,9 @@ namespace UAS_Labeling.PublicMethod
             //通过句柄去获取具体触发事件的控件
             Control c = Control.FromHandle(m.HWnd);
             //可进行数据操作的控件需要进行权限的判断,结合WM_LBUTTONDOWN对按钮进行判断
-            if (c != null && m.Msg == WM_LBUTTONDOWN && c is Button)
+            if (c != null && m.Msg == WM_LBUTTONDOWN && c is RadioButton)
             {
-                LogManager.DoLog("点击【" + c.Text+"】");
+                LogManager.DoLog("点击【" + c.Text + "】");
                 return CheckPower(c);
             }
             else
@@ -46,60 +46,21 @@ namespace UAS_Labeling.PublicMethod
             {
                 if (dh.getRowCount("labelprintpower") > 0)
                 {
-                    string sql = " select LPP_CLEANDETAIL,LPP_GENCODE,LPP_LABELMATAIN,LPP_SAVEDETAIL,LPP_COLLECTSTRATEGY,LPP_ALLCOLLECT from labelprintpower left join employee on em_code = lpp_emcode where lpp_emcode = '" + User.UserCode + "'";
+                    string sql = " select * from labelprintpower where lpp_emcode = '" + User.UserCode + "' and lpp_manual=1";
                     DataTable dt = (DataTable)dh.ExecuteSql(sql, "select");
                     if (dt.Rows.Count > 0)
                     {
-                        switch (c.Text)
+                        switch (c.Name)
                         {
-                            case "采集策略设置":
-                                if (dt.Rows[0]["LPP_COLLECTSTRATEGY"].ToString() != "1")
-                                {
-                                    MessageBox.Show("没有" + c.Text + "的权限");
-                                    return true;
-                                }
-                                break;
-                            case "生成条码":
-                                if (dt.Rows[0]["LPP_GENCODE"].ToString() != "1")
-                                {
-                                    MessageBox.Show("没有" + c.Text + "的权限");
-                                    return true;
-                                }
-                                break;
-                            case "标签维护":
-                                if (dt.Rows[0]["LPP_LABELMATAIN"].ToString() != "1")
-                                {
-                                    MessageBox.Show("没有" + c.Text + "的权限");
-                                    return true;
-                                }
-                                break;
-                            case "保存明细":
-                                if (dt.Rows[0]["LPP_SAVEDETAIL"].ToString() != "1")
-                                {
-                                    MessageBox.Show("没有" + c.Text + "的权限");
-                                    return true;
-                                }
-                                break;
-                            case "清除明细":
-                                if (dt.Rows[0]["LPP_CLEANDETAIL"].ToString() != "1")
-                                {
-                                    MessageBox.Show("没有" + c.Text + "的权限");
-                                    return true;
-                                }
-                                break;
-                            case "全部已采":
-                                if (dt.Rows[0]["LPP_ALLCOLLECT"].ToString() != "1")
-                                {
-                                    MessageBox.Show("没有" + c.Text + "的权限");
-                                    return true;
-                                }
+                            case "ManualCollection":
                                 break;
                             default:
                                 break;
                         }
                     }
-                    else {
-                        MessageBox.Show("尚未配置权限,请与管理员联系");
+                    else
+                    {
+                        MessageBox.Show("尚未配置权限,请与管理员联系", "提示");
                         return true;
                     }
                 }

+ 31 - 30
UAS-出货标签管理(吉利通)/UAS_出货标签管理.Designer.cs

@@ -115,8 +115,8 @@
             this.RecheckCuprodcode = new System.Windows.Forms.RadioButton();
             this.DetailRange = new System.Windows.Forms.CheckBox();
             this.label21 = new System.Windows.Forms.Label();
-            this.radioButton1 = new System.Windows.Forms.RadioButton();
-            this.radioButton2 = new System.Windows.Forms.RadioButton();
+            this.ManualCollection = new System.Windows.Forms.RadioButton();
+            this.AutoCollection = new System.Windows.Forms.RadioButton();
             this.Process_midboxcode = new System.Windows.Forms.Label();
             this.Process_outboxcode = new System.Windows.Forms.Label();
             this.CollectedCount = new System.Windows.Forms.Label();
@@ -563,7 +563,8 @@
             "附加信息设置",
             "客户标签维护",
             "客户采集规则",
-            "参数配置"});
+            "参数配置",
+            "权限管理"});
             this.ListButtonMenu.Location = new System.Drawing.Point(232, 89);
             this.ListButtonMenu.Name = "ListButtonMenu";
             this.ListButtonMenu.Size = new System.Drawing.Size(97, 84);
@@ -789,8 +790,8 @@
             this.CollectionProcess.Controls.Add(this.RecheckCuprodcode);
             this.CollectionProcess.Controls.Add(this.DetailRange);
             this.CollectionProcess.Controls.Add(this.label21);
-            this.CollectionProcess.Controls.Add(this.radioButton1);
-            this.CollectionProcess.Controls.Add(this.radioButton2);
+            this.CollectionProcess.Controls.Add(this.ManualCollection);
+            this.CollectionProcess.Controls.Add(this.AutoCollection);
             this.CollectionProcess.Controls.Add(this.Process_midboxcode);
             this.CollectionProcess.Controls.Add(this.Process_outboxcode);
             this.CollectionProcess.Controls.Add(this.CollectedCount);
@@ -1096,29 +1097,29 @@
             this.label21.TabIndex = 90;
             this.label21.Text = "-";
             // 
-            // radioButton1
-            // 
-            this.radioButton1.AutoSize = true;
-            this.radioButton1.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.radioButton1.Location = new System.Drawing.Point(64, 116);
-            this.radioButton1.Name = "radioButton1";
-            this.radioButton1.Size = new System.Drawing.Size(50, 21);
-            this.radioButton1.TabIndex = 77;
-            this.radioButton1.TabStop = true;
-            this.radioButton1.Text = "手动";
-            this.radioButton1.UseVisualStyleBackColor = true;
-            // 
-            // radioButton2
-            // 
-            this.radioButton2.AutoSize = true;
-            this.radioButton2.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.radioButton2.Location = new System.Drawing.Point(8, 116);
-            this.radioButton2.Name = "radioButton2";
-            this.radioButton2.Size = new System.Drawing.Size(50, 21);
-            this.radioButton2.TabIndex = 76;
-            this.radioButton2.TabStop = true;
-            this.radioButton2.Text = "自动";
-            this.radioButton2.UseVisualStyleBackColor = true;
+            // ManualCollection
+            // 
+            this.ManualCollection.AutoSize = true;
+            this.ManualCollection.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.ManualCollection.Location = new System.Drawing.Point(64, 116);
+            this.ManualCollection.Name = "ManualCollection";
+            this.ManualCollection.Size = new System.Drawing.Size(50, 21);
+            this.ManualCollection.TabIndex = 77;
+            this.ManualCollection.TabStop = true;
+            this.ManualCollection.Text = "手动";
+            this.ManualCollection.UseVisualStyleBackColor = true;
+            // 
+            // AutoCollection
+            // 
+            this.AutoCollection.AutoSize = true;
+            this.AutoCollection.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.AutoCollection.Location = new System.Drawing.Point(8, 116);
+            this.AutoCollection.Name = "AutoCollection";
+            this.AutoCollection.Size = new System.Drawing.Size(50, 21);
+            this.AutoCollection.TabIndex = 76;
+            this.AutoCollection.TabStop = true;
+            this.AutoCollection.Text = "自动";
+            this.AutoCollection.UseVisualStyleBackColor = true;
             // 
             // Process_midboxcode
             // 
@@ -2382,8 +2383,8 @@
         private System.Windows.Forms.Label CollectedCount;
         private System.Windows.Forms.Label Process_outboxcode;
         private System.Windows.Forms.Label Process_midboxcode;
-        private System.Windows.Forms.RadioButton radioButton2;
-        private System.Windows.Forms.RadioButton radioButton1;
+        private System.Windows.Forms.RadioButton AutoCollection;
+        private System.Windows.Forms.RadioButton ManualCollection;
         private System.Windows.Forms.Label label21;
         private System.Windows.Forms.CheckBox DetailRange;
         private System.Windows.Forms.RadioButton RecheckCuprodcode;

+ 6 - 1
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -306,7 +306,7 @@ namespace UAS_LabelMachine
                                 }
                                 else if (Expression.Checked)
                                 {
-                                    
+
                                 }
                                 if (msgArr[i] == LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
                                 {
@@ -1545,6 +1545,11 @@ namespace UAS_LabelMachine
                     BaseUtil.SetFormCenter(form2);
                     form2.ShowDialog();
                     break;
+                case "权限管理":
+                    PowerSetting pws = new PowerSetting();
+                    BaseUtil.SetFormCenter(pws);
+                    pws.ShowDialog();
+                    break;
                 default:
                     break;
             }

+ 18 - 4
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs

@@ -28,7 +28,6 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.components = new System.ComponentModel.Container();
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UAS_出货标签打印));
             this.pi_inoutno_label = new System.Windows.Forms.Label();
@@ -38,7 +37,7 @@
             this.pib_id = new System.Windows.Forms.Label();
             this.pi_cardcode = new System.Windows.Forms.Label();
             this.Fresh = new System.Windows.Forms.LinkLabel();
-            this.RefreshDBConnect = new System.Windows.Forms.Timer(this.components);
+            this.RefreshDBConnect = new System.Windows.Forms.Timer();
             this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -65,7 +64,7 @@
             this.dataGridViewTextBoxColumn21 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn22 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn23 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.MidSource = new System.Windows.Forms.BindingSource(this.components);
+            this.MidSource = new System.Windows.Forms.BindingSource();
             this.ChooseAll = new System.Windows.Forms.Button();
             this.ExportFileDialog = new System.Windows.Forms.FolderBrowserDialog();
             this.AttachInfo = new System.Windows.Forms.Button();
@@ -168,6 +167,7 @@
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
             this.Reset = new System.Windows.Forms.Button();
             this.GetPDdata = new System.Windows.Forms.Button();
+            this.OnlyOneRow = new System.Windows.Forms.CheckBox();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridPrcode)).BeginInit();
@@ -1441,6 +1441,7 @@
             // 
             // OutBoxLabel
             // 
+            this.OutBoxLabel.Controls.Add(this.OnlyOneRow);
             this.OutBoxLabel.Controls.Add(this.AllLabel);
             this.OutBoxLabel.Controls.Add(this.AddNewOutBox);
             this.OutBoxLabel.Controls.Add(this.LogingOut);
@@ -1465,7 +1466,7 @@
             // 
             this.AllLabel.AutoSize = true;
             this.AllLabel.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AllLabel.Location = new System.Drawing.Point(8, 93);
+            this.AllLabel.Location = new System.Drawing.Point(7, 93);
             this.AllLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.AllLabel.Name = "AllLabel";
             this.AllLabel.Size = new System.Drawing.Size(99, 21);
@@ -1603,6 +1604,18 @@
             this.GetPDdata.UseVisualStyleBackColor = true;
             this.GetPDdata.Click += new System.EventHandler(this.GetPDdata_Click);
             // 
+            // OnlyOneRow
+            // 
+            this.OnlyOneRow.AutoSize = true;
+            this.OnlyOneRow.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OnlyOneRow.Location = new System.Drawing.Point(107, 93);
+            this.OnlyOneRow.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.OnlyOneRow.Name = "OnlyOneRow";
+            this.OnlyOneRow.Size = new System.Drawing.Size(63, 21);
+            this.OnlyOneRow.TabIndex = 94;
+            this.OnlyOneRow.Text = "仅单行";
+            this.OnlyOneRow.UseVisualStyleBackColor = true;
+            // 
             // UAS_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1816,5 +1829,6 @@
         private System.Windows.Forms.Button AddNewOutBox;
         private System.Windows.Forms.Button GetPDdata;
         private System.Windows.Forms.CheckBox AllLabel;
+        private System.Windows.Forms.CheckBox OnlyOneRow;
     }
 }

+ 10 - 1
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -1056,7 +1056,16 @@ namespace UAS_LabelMachine
                     }
                 }
                 string pib_outboxcode2 = LabelInf.Rows[rowindex].Cells["pib_outboxcode2"].Value.ToString();
-                DataTable dt = (DataTable)dh.ExecuteSql("select * from prodiooutinfo_view where 出货单号='" + pi_inoutno.Text + "' and 外箱号='" + pib_outboxcode2 + "'", "select");
+                string SQL = "";
+                if (OnlyOneRow.Checked)
+                {
+                    SQL = "select * from prodiooutinfo_view where 出货单号 = '" + pi_inoutno.Text + "' and 外箱号 = '" + pib_outboxcode2 + "' and rownum=1";
+                }
+                else
+                {
+                    SQL = "select * from prodiooutinfo_view where 出货单号 = '" + pi_inoutno.Text + "' and 外箱号 = '" + pib_outboxcode2 + "'";
+                }
+                DataTable dt = (DataTable)dh.ExecuteSql(SQL, "select");
                 OutReport.RegisterData(dt, "prodiooutinfo_view");
                 OutReport.GetDataSource("prodiooutinfo_view").Enabled = true;
                 OutReport.PrintSettings.ShowDialog = false;