Quellcode durchsuchen

优化SOP上传

callm vor 3 Tagen
Ursprung
Commit
30fbec0725

+ 36 - 45
UAS_MES_ZKLH/FunctionCode/Query/Query_SOP.Designer.cs

@@ -40,7 +40,6 @@ namespace UAS_MES_NEW.Query
             this.OperatResult = new System.Windows.Forms.RichTextBox();
             this.SendSop = new System.Windows.Forms.Button();
             this.JPG = new System.Windows.Forms.RadioButton();
-            this.label5 = new System.Windows.Forms.Label();
             this.SendDGV = new System.Windows.Forms.DataGridView();
             this.ChooseALL = new System.Windows.Forms.Button();
             this.GetSOP = new System.Windows.Forms.Button();
@@ -52,12 +51,13 @@ namespace UAS_MES_NEW.Query
             this.label7 = new System.Windows.Forms.Label();
             this.X = new System.Windows.Forms.NumericUpDown();
             this.Y = new System.Windows.Forms.NumericUpDown();
+            this.label8 = new System.Windows.Forms.Label();
+            this.ps_code = new System.Windows.Forms.Label();
             this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.li_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.ps_prodcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.CheckColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.fp_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -101,7 +101,7 @@ namespace UAS_MES_NEW.Query
             // 
             // ChooseFile
             // 
-            this.ChooseFile.Location = new System.Drawing.Point(218, 666);
+            this.ChooseFile.Location = new System.Drawing.Point(216, 613);
             this.ChooseFile.Name = "ChooseFile";
             this.ChooseFile.Size = new System.Drawing.Size(160, 42);
             this.ChooseFile.TabIndex = 8;
@@ -111,7 +111,7 @@ namespace UAS_MES_NEW.Query
             // 
             // UploadSOP
             // 
-            this.UploadSOP.Location = new System.Drawing.Point(424, 666);
+            this.UploadSOP.Location = new System.Drawing.Point(422, 613);
             this.UploadSOP.Name = "UploadSOP";
             this.UploadSOP.Size = new System.Drawing.Size(160, 42);
             this.UploadSOP.TabIndex = 9;
@@ -142,7 +142,7 @@ namespace UAS_MES_NEW.Query
             // 
             // SendSop
             // 
-            this.SendSop.Location = new System.Drawing.Point(640, 666);
+            this.SendSop.Location = new System.Drawing.Point(638, 613);
             this.SendSop.Name = "SendSop";
             this.SendSop.Size = new System.Drawing.Size(160, 42);
             this.SendSop.TabIndex = 13;
@@ -162,16 +162,6 @@ namespace UAS_MES_NEW.Query
             this.JPG.Text = "图片";
             this.JPG.UseVisualStyleBackColor = true;
             // 
-            // label5
-            // 
-            this.label5.AutoSize = true;
-            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label5.Location = new System.Drawing.Point(19, 580);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(82, 41);
-            this.label5.TabIndex = 20;
-            this.label5.Text = "线别";
-            // 
             // SendDGV
             // 
             this.SendDGV.AllowUserToAddRows = false;
@@ -214,7 +204,7 @@ namespace UAS_MES_NEW.Query
             // 
             // ChoosePrint
             // 
-            this.ChoosePrint.Location = new System.Drawing.Point(651, 779);
+            this.ChoosePrint.Location = new System.Drawing.Point(649, 726);
             this.ChoosePrint.Name = "ChoosePrint";
             this.ChoosePrint.Size = new System.Drawing.Size(160, 42);
             this.ChoosePrint.TabIndex = 27;
@@ -225,7 +215,7 @@ namespace UAS_MES_NEW.Query
             // PrintPath
             // 
             this.PrintPath.Enabled = false;
-            this.PrintPath.Location = new System.Drawing.Point(218, 785);
+            this.PrintPath.Location = new System.Drawing.Point(216, 732);
             this.PrintPath.Name = "PrintPath";
             this.PrintPath.Size = new System.Drawing.Size(416, 35);
             this.PrintPath.TabIndex = 28;
@@ -234,7 +224,7 @@ namespace UAS_MES_NEW.Query
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label3.Location = new System.Drawing.Point(12, 779);
+            this.label3.Location = new System.Drawing.Point(10, 726);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(178, 41);
             this.label3.TabIndex = 29;
@@ -244,7 +234,7 @@ namespace UAS_MES_NEW.Query
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label4.Location = new System.Drawing.Point(12, 860);
+            this.label4.Location = new System.Drawing.Point(10, 807);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(178, 41);
             this.label4.TabIndex = 30;
@@ -254,7 +244,7 @@ namespace UAS_MES_NEW.Query
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label6.Location = new System.Drawing.Point(211, 860);
+            this.label6.Location = new System.Drawing.Point(209, 807);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(39, 41);
             this.label6.TabIndex = 31;
@@ -264,7 +254,7 @@ namespace UAS_MES_NEW.Query
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label7.Location = new System.Drawing.Point(405, 860);
+            this.label7.Location = new System.Drawing.Point(403, 807);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(37, 41);
             this.label7.TabIndex = 32;
@@ -272,7 +262,7 @@ namespace UAS_MES_NEW.Query
             // 
             // X
             // 
-            this.X.Location = new System.Drawing.Point(258, 866);
+            this.X.Location = new System.Drawing.Point(256, 813);
             this.X.Name = "X";
             this.X.Size = new System.Drawing.Size(120, 35);
             this.X.TabIndex = 33;
@@ -284,11 +274,30 @@ namespace UAS_MES_NEW.Query
             // 
             // Y
             // 
-            this.Y.Location = new System.Drawing.Point(464, 866);
+            this.Y.Location = new System.Drawing.Point(462, 813);
             this.Y.Name = "Y";
             this.Y.Size = new System.Drawing.Size(120, 35);
             this.Y.TabIndex = 34;
             // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label8.Location = new System.Drawing.Point(19, 205);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(114, 41);
+            this.label8.TabIndex = 35;
+            this.label8.Text = "流水号";
+            // 
+            // ps_code
+            // 
+            this.ps_code.AutoSize = true;
+            this.ps_code.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ps_code.Location = new System.Drawing.Point(211, 205);
+            this.ps_code.Name = "ps_code";
+            this.ps_code.Size = new System.Drawing.Size(0, 41);
+            this.ps_code.TabIndex = 36;
+            // 
             // dataGridViewCheckBoxColumn1
             // 
             this.dataGridViewCheckBoxColumn1.DataPropertyName = "CheckColumn";
@@ -330,24 +339,6 @@ namespace UAS_MES_NEW.Query
             this.dataGridViewTextBoxColumn4.Visible = false;
             this.dataGridViewTextBoxColumn4.Width = 200;
             // 
-            // li_code
-            // 
-            this.li_code.AllPower = null;
-            this.li_code.Caller = null;
-            this.li_code.Condition = null;
-            this.li_code.DBTitle = null;
-            this.li_code.FormName = null;
-            this.li_code.Location = new System.Drawing.Point(218, 580);
-            this.li_code.Name = "li_code";
-            this.li_code.Power = null;
-            this.li_code.ReturnData = null;
-            this.li_code.SelectField = null;
-            this.li_code.SetValueField = null;
-            this.li_code.Size = new System.Drawing.Size(582, 41);
-            this.li_code.TabIndex = 25;
-            this.li_code.TableName = null;
-            this.li_code.TextBoxEnable = false;
-            // 
             // ps_prodcode
             // 
             this.ps_prodcode.AllPower = null;
@@ -413,6 +404,8 @@ namespace UAS_MES_NEW.Query
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1945, 1234);
+            this.Controls.Add(this.ps_code);
+            this.Controls.Add(this.label8);
             this.Controls.Add(this.Y);
             this.Controls.Add(this.X);
             this.Controls.Add(this.label7);
@@ -422,11 +415,9 @@ namespace UAS_MES_NEW.Query
             this.Controls.Add(this.PrintPath);
             this.Controls.Add(this.ChoosePrint);
             this.Controls.Add(this.GetSOP);
-            this.Controls.Add(this.li_code);
             this.Controls.Add(this.ps_prodcode);
             this.Controls.Add(this.ChooseALL);
             this.Controls.Add(this.SendDGV);
-            this.Controls.Add(this.label5);
             this.Controls.Add(this.JPG);
             this.Controls.Add(this.SendSop);
             this.Controls.Add(this.OperatResult);
@@ -461,11 +452,9 @@ namespace UAS_MES_NEW.Query
         private System.Windows.Forms.RichTextBox OperatResult;
         private System.Windows.Forms.Button SendSop;
         private System.Windows.Forms.RadioButton JPG;
-        private System.Windows.Forms.Label label5;
         private System.Windows.Forms.DataGridView SendDGV;
         private System.Windows.Forms.Button ChooseALL;
         private SearchTextBox ps_prodcode;
-        private SearchTextBox li_code;
         private System.Windows.Forms.Button GetSOP;
         private System.Windows.Forms.DataGridViewCheckBoxColumn CheckColumn;
         private System.Windows.Forms.DataGridViewTextBoxColumn fp_name;
@@ -485,5 +474,7 @@ namespace UAS_MES_NEW.Query
         private System.Windows.Forms.Label label7;
         private System.Windows.Forms.NumericUpDown X;
         private System.Windows.Forms.NumericUpDown Y;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Label ps_code;
     }
 }

+ 6 - 25
UAS_MES_ZKLH/FunctionCode/Query/Query_SOP.cs

@@ -39,20 +39,13 @@ namespace UAS_MES_NEW.Query
             CheckForIllegalCrossThreadCalls = false;
 
             ps_prodcode.TableName = "productsop";
-            ps_prodcode.SelectField = "ps_prodcode # SOP编号";
+            ps_prodcode.SelectField = "ps_code # 流水号,ps_prodcode # SOP编号";
             ps_prodcode.FormName = Name;
             ps_prodcode.DBTitle = "SOP查询";
-            ps_prodcode.SetValueField = new string[] { "ps_prodcode" };
+            ps_prodcode.SetValueField = new string[] { "ps_code", "ps_prodcode" };
             ps_prodcode.Condition = "";
             ps_prodcode.DbChange += nr_rule_DBChange;
 
-            li_code.TableName = "line";
-            li_code.SelectField = "li_code # 线别编号,li_name # 线别名称";
-            li_code.FormName = Name;
-            li_code.DBTitle = "线别查询";
-            li_code.SetValueField = new string[] { "li_code" };
-            li_code.Condition = "";
-            li_code.DbChange += nr_rule_DBChange;
             dh = SystemInf.dh;
         }
 
@@ -75,6 +68,7 @@ namespace UAS_MES_NEW.Query
             if (dt.Rows.Count == 0)
             {
                 string code = LogicHandler.GetPiInoutCode("ProductSOP", "1");
+                ps_code.Text = code;
                 dh.ExecuteSql("insert into productsop(ps_id,ps_code,ps_prodcode,ps_indate,ps_inman,ps_status,ps_statuscode)values(productsop_seq.nextval,'" + code + "','" + ps_prodcode.Text + "',sysdate,'" + usercode + "','在录入','ENTERING')", "insert");
             }
             else
@@ -317,7 +311,7 @@ namespace UAS_MES_NEW.Query
         {
             try
             {
-                if (li_code.Text == "" || ps_prodcode.Text == "")
+                if (ps_prodcode.Text == "")
                 {
                     MessageBox.Show("线别和SOP文档不能为空");
                     return;
@@ -330,21 +324,8 @@ namespace UAS_MES_NEW.Query
                     Dictionary<string, object> map = new Dictionary<string, object>();
                     string path;
                     string pathroot = dh.GetConfig("filePathUrl", "sys").ToString();
-                    for (int i = 0; i < SendDGV.Rows.Count; i++)
-                    {
-                        if (SendDGV.Rows[i].Cells["CheckColumn"].FormattedValue.ToString().ToUpper() == "TRUE")
-                        {
-                            Dictionary<string, string> dic1 = new Dictionary<string, string>();
-                            path = SendDGV.Rows[i].Cells["fp_path"].Value.ToString();
-                            path = encryptBASE64(path.Replace("/app/uas/webapps/postattach", pathroot)).Replace("\\s*|\r|\n|\t", "");
-                            dic1.Add("path", path);
-                            dic1.Add("filename", SendDGV.Rows[i].Cells["fp_name"].Value.ToString().Replace(" ", "").Replace("(", "").Replace(")", ""));
-                            dic1.Add("ps_prodcode", ps_prodcode.Text);
-                            listr.Add(dic1);
-                            dh.ExecuteSql("insert into soprelease(SR_ID, SR_LINECODE, SR_PATH, SR_STATUS, SR_MACHINETYPE, SR_FILENAME,sr_ifkeyset)" +
-                          "values(soprelease_seq.nextval,'" + li_code.Text + "','" + path + "',0,'" + ps_prodcode.Text + "','" + SendDGV.Rows[i].Cells["fp_name"].Value.ToString().Replace(" ", "").Replace("(", "").Replace(")", "") + "','" + SendDGV.Rows[i].Cells["psd_iskey"].Value + "') ", "insert");
-                        }
-                    }
+                    dh.ExecuteSql("insert into soprelease(SR_ID, sr_pscode, SR_STATUS, SR_MACHINETYPE)" +
+                   "values(soprelease_seq.nextval,'" + ps_code.Text + "',0,'" + ps_prodcode.Text + "') ", "insert");
                     LogicHandler.DoCommandLog("SOP", usercode, "", "", sourcecode, "广播SOP", "广播成功", ps_prodcode.Text, "");
                     MessageBox.Show("文档[" + ps_prodcode.Text + "]下放成功");
                 }