Browse Source

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

Hcsy 7 years ago
parent
commit
8f367a9f77

+ 33 - 24
UAS_AutoUpdate/CheckUpdateWindow.cs

@@ -40,38 +40,47 @@ namespace UAS_AutoUpdate
                 doc.AppendChild(xeRoot);
                 doc.Save(ConfigFile);
             }
-            WebClient wc = new WebClient();
-            wc.DownloadFile(new Uri(GetCacheData(ConfigFile, "ServerConfigPath").ToString()), ServerConfigFile);
-            //服务器获取的配置文件
-            Version ver1 = new Version(GetCacheData(ServerConfigFile, "Version").ToString());
-            //本地的配置文件
-            Version ver2 = new Version(GetCacheData(ConfigFile, "Version").ToString());
-            //进行版本的比较
-            if (ver1 > ver2)
+            try
             {
-                Process[] pro = Process.GetProcessesByName("UAS_MES_NEW");
-                if (pro.Length > 0)
+                WebClient wc = new WebClient();
+                wc.DownloadFile(new Uri(GetCacheData(ConfigFile, "ServerConfigPath").ToString()), ServerConfigFile);
+                //服务器获取的配置文件
+                Version ver1 = new Version(GetCacheData(ServerConfigFile, "Version").ToString());
+                //本地的配置文件
+                Version ver2 = new Version(GetCacheData(ConfigFile, "Version").ToString());
+                //进行版本的比较
+                if (ver1 > ver2)
                 {
-                    string CloseProcess = MessageBox.Show(this.ParentForm, "检测到程序仍在运行,是否关闭", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-                    if (CloseProcess == "Yes")
+                    Process[] pro = Process.GetProcessesByName("UAS_MES_NEW");
+                    if (pro.Length > 0)
                     {
-                        for (int i = 0; i < pro.Length; i++)
+                        string CloseProcess = MessageBox.Show(this.ParentForm, "检测到程序仍在运行,是否关闭", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                        if (CloseProcess == "Yes")
                         {
-                            Process.GetProcessById(pro[i].Id).Kill();
+                            for (int i = 0; i < pro.Length; i++)
+                            {
+                                Process.GetProcessById(pro[i].Id).Kill();
+                            }
+                        }
+                        else
+                        {
+                            CloseWhenFinished = true;
+                            Close();
+                            return;
                         }
                     }
-                    else
-                    {
-                        CloseWhenFinished = true;
-                        Close();
-                        return;
-                    }
+                    wc.DownloadProgressChanged += Wc_DownloadProgressChanged;
+                    wc.DownloadFileAsync(new Uri(GetCacheData(ConfigFile, "UpdatePath").ToString()), "UAS_MES.zip");
+                    SetCacheData(ConfigFile, "Version", ver1.ToString());
+                }
+                else
+                {
+                    Process p = Process.Start("UAS_MES_NEW.exe");
+                    CloseWhenFinished = true;
+                    Close();
                 }
-                wc.DownloadProgressChanged += Wc_DownloadProgressChanged;
-                wc.DownloadFileAsync(new Uri(GetCacheData(ConfigFile, "UpdatePath").ToString()), "UAS_MES.zip");
-                SetCacheData(ConfigFile, "Version", ver1.ToString());
             }
-            else
+            catch (Exception)
             {
                 Process p = Process.Start("UAS_MES_NEW.exe");
                 CloseWhenFinished = true;

+ 1 - 1
UAS_MES_NEW/CustomControl/AccordionMenu/NavagationBar.cs

@@ -49,7 +49,7 @@ namespace UAS_MES_NEW.CustomControl.AccordionMenu
                 sql.Append("select  sn_id,sn_detno,sn_module,sn_displayname,sn_modulecode,sn_classname,ugp_caller,max(ugp_ifdelete)ugp_ifdelete,max(ugp_ifread)ugp_ifread");
                 sql.Append(",max(ugp_ifspecial)ugp_ifspecial,max(ugp_ifwrite)ugp_ifwrite,max(ugp_ifall)ugp_ifall from CS$USERGROUPPOWER ");
                 sql.Append("left join CS$SYSNAVATION on sn_caller=ugp_caller  where sn_using=1 and ugp_groupcode in ( select eg_groupcode from cs$empgroup ");
-                sql.Append("left join cs$userresource on ur_groupcode = eg_groupcode where eg_emcode = '" + User.UserCode + "') group by sn_id,sn_caller,sn_detno,sn_modulecode,sn_classname,sn_module,sn_displayname,ugp_caller order by sn_detno");
+                sql.Append("left join cs$userresource on ur_groupcode = eg_groupcode where eg_emcode = '" + User.UserCode + "') group by sn_id,sn_caller,sn_detno,sn_modulecode,sn_classname,sn_module,sn_displayname,ugp_caller order by sn_modulecode,sn_detno");
             }
             DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             if (dt.Rows.Count == 0 && User.UserAccountType != "admin")

+ 7 - 7
UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxWeigh.Designer.cs

@@ -293,7 +293,7 @@
             // columnHeader4
             // 
             this.columnHeader4.Text = "时间";
-            this.columnHeader4.Width = 130;
+            this.columnHeader4.Width = 140;
             // 
             // pr_sendchecktype
             // 
@@ -454,7 +454,7 @@
             // 
             this.ob_checkno_label.AutoSize = true;
             this.ob_checkno_label.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_checkno_label.Location = new System.Drawing.Point(21, 74);
+            this.ob_checkno_label.Location = new System.Drawing.Point(20, 73);
             this.ob_checkno_label.Name = "ob_checkno_label";
             this.ob_checkno_label.Size = new System.Drawing.Size(82, 24);
             this.ob_checkno_label.TabIndex = 180;
@@ -464,7 +464,7 @@
             // 
             this.ob_checkno.AutoSize = true;
             this.ob_checkno.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_checkno.Location = new System.Drawing.Point(115, 74);
+            this.ob_checkno.Location = new System.Drawing.Point(114, 73);
             this.ob_checkno.Name = "ob_checkno";
             this.ob_checkno.Size = new System.Drawing.Size(0, 24);
             this.ob_checkno.TabIndex = 179;
@@ -474,7 +474,7 @@
             // 
             this.ob_nowcheckqty.AutoSize = true;
             this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_nowcheckqty.Location = new System.Drawing.Point(290, 28);
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(289, 27);
             this.ob_nowcheckqty.Name = "ob_nowcheckqty";
             this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 24);
             this.ob_nowcheckqty.TabIndex = 178;
@@ -483,7 +483,7 @@
             // 
             this.ob_batchqty.AutoSize = true;
             this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_batchqty.Location = new System.Drawing.Point(115, 28);
+            this.ob_batchqty.Location = new System.Drawing.Point(114, 27);
             this.ob_batchqty.Name = "ob_batchqty";
             this.ob_batchqty.Size = new System.Drawing.Size(0, 24);
             this.ob_batchqty.TabIndex = 177;
@@ -492,7 +492,7 @@
             // 
             this.ob_nowcheckqty_label.AutoSize = true;
             this.ob_nowcheckqty_label.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(196, 28);
+            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(195, 27);
             this.ob_nowcheckqty_label.Name = "ob_nowcheckqty_label";
             this.ob_nowcheckqty_label.Size = new System.Drawing.Size(82, 24);
             this.ob_nowcheckqty_label.TabIndex = 176;
@@ -502,7 +502,7 @@
             // 
             this.ob_batchqty_label.AutoSize = true;
             this.ob_batchqty_label.Font = new System.Drawing.Font("微软雅黑", 13F);
-            this.ob_batchqty_label.Location = new System.Drawing.Point(21, 28);
+            this.ob_batchqty_label.Location = new System.Drawing.Point(20, 27);
             this.ob_batchqty_label.Name = "ob_batchqty_label";
             this.ob_batchqty_label.Size = new System.Drawing.Size(82, 24);
             this.ob_batchqty_label.TabIndex = 175;

+ 7 - 6
UAS_MES_NEW/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -276,12 +276,13 @@ namespace UAS_MES_NEW.OQC
                             string[] id = new string[oi_itemcode_insert.Count];
                             id = dh.GetSEQ("OQCItemSamples_SEQ", id.Length);
                             sql.Clear();
-                            sql.Append("insert when (not exists (select ois_id from OQCItemSamples where ois_checkno='" + ob_checkno.Text + "' and ois_sncode='" + sncode.Text + "' and ois_itemcode =:ois_itemcode)) then ");
-                            sql.Append("into OQCItemSamples (ois_id,ois_checkno,ois_makecode, ois_sncode,ois_projectcode,ois_itemcode,");
-                            sql.Append("ois_ifng,ois_defectlevel,ois_remark,ois_indate)select :id,'" + ob_checkno.Text + "',");
-                            sql.Append("'" + ob_makecode.Text + "','" + sncode.Text + "','" + ob_projectcode.Text + "',:ois_itemcode,:ois_ifng,:ois_defectlevel,:ois_remark,sysdate from dual");
-                            dh.BatchInsert(sql.GetString(), new string[] { "ois_itemcode", "id", "ois_itemcode", "ois_ifng", "ois_defectlevel", "ois_remark" },
-                                 oi_itemcode_insert.ToArray(), id, oi_itemcode_insert.ToArray(), ois_ifng_insert.ToArray(), ois_defectlevel_insert.ToArray(), ois_remark_insert.ToArray());
+                            //when () then 
+                            sql.Append("insert into OQCItemSamples (ois_id,ois_checkno,ois_makecode, ois_sncode,ois_projectcode,ois_itemcode,");
+                            sql.Append("ois_ifng,ois_defectlevel,ois_remark,ois_indate)select :id,'" + ob_checkno.Text + "','" + ob_makecode.Text + "'");
+                            sql.Append(",'" + sncode.Text + "','" + ob_projectcode.Text + "',:ois_itemcode,:ois_ifng,:ois_defectlevel,:ois_remark,sysdate from dual ");
+                            sql.Append("where not exists (select ois_id from OQCItemSamples where ois_checkno='" + ob_checkno.Text + "' and ois_sncode='" + sncode.Text + "' and ois_itemcode =:ois_itemcode)");
+                            dh.BatchInsert(sql.GetString(), new string[] { "id", "ois_itemcode", "ois_ifng", "ois_defectlevel", "ois_remark", "ois_itemcode" },
+                                id, oi_itemcode_insert.ToArray(), ois_ifng_insert.ToArray(), ois_defectlevel_insert.ToArray(), ois_remark_insert.ToArray(), oi_itemcode_insert.ToArray());
                         }
                         //采集不良信息
                         List<string> bc_code = new List<string>();