Browse Source

工单SN防呆

callm 3 years ago
parent
commit
9b4a69e2df

+ 2 - 1
UAS_MES_MAXMADE/FunctionCode/Make/Make_Repair.cs

@@ -85,9 +85,10 @@ namespace UAS_MES_NEW.Make
             nrg_name.ValueField = "nrg_code";
             nrg_name.Condition = " 1=1 and nrg_wccode='" + User.WorkCenter + "' ORDER BY ROWNUM asc";
 
-            nr_name.TableName = "QUA_NGREASONGROUPDET left join QUA_NGREASONGROUP on nrgd_nrgid=nrg_id left join QUA_NGReason on nrgd_nrcode=nr_code left join DATAINPUTRECORD ON nr_name = DIR_COMMENT AND DIR_GROUP = '不良原因' and  DIR_SOURCECODE = '" + User.UserSourceCode + "' ";
+            nr_name.TableName = "QUA_NGREASONGROUPDET left join QUA_NGREASONGROUP on nrgd_nrgid=nrg_id left join QUA_NGReason on nrgd_nrcode=nr_code left join DATAINPUTRECORD ON nr_name = DIR_COMMENT AND DIR_GROUP = '不良原因' and  DIR_SOURCECODE = '" + User.UserSourceCode + "'  ";
             nr_name.Field = "nr_name";
             nr_name.ValueField = "nr_code";
+            nr_name.Condition = "1=1 order by nvl(dir_number,0) desc";
 
             mbr_dutyname.TableName = "(select nd_name,nd_code,nd_wccode from  ngduty left join DATAINPUTRECORD ON nd_name = DIR_COMMENT  AND DIR_GROUP = '责任别' and DIR_SOURCECODE = '" + User.UserSourceCode + "' ORDER BY NVL(DIR_NUMBER,0) DESC) ";
             mbr_dutyname.Field = "nd_name";

+ 3 - 3
UAS_MES_MAXMADE/FunctionCode/Query/Query_SpecialReport.Designer.cs

@@ -51,7 +51,7 @@
             this.Export.Image = null;
             this.Export.IsShowBorder = true;
             this.Export.Location = new System.Drawing.Point(362, 506);
-            this.Export.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.Export.Margin = new System.Windows.Forms.Padding(6);
             this.Export.MoveImage = ((System.Drawing.Image)(resources.GetObject("Export.MoveImage")));
             this.Export.Name = "Export";
             this.Export.NormalImage = ((System.Drawing.Image)(resources.GetObject("Export.NormalImage")));
@@ -68,7 +68,7 @@
             this.Prefix.BackColor = System.Drawing.Color.White;
             this.Prefix.ID = null;
             this.Prefix.Location = new System.Drawing.Point(362, 85);
-            this.Prefix.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.Prefix.Margin = new System.Windows.Forms.Padding(6);
             this.Prefix.Name = "Prefix";
             this.Prefix.Power = null;
             this.Prefix.Size = new System.Drawing.Size(278, 35);
@@ -196,7 +196,7 @@
             this.Controls.Add(this.label5);
             this.Controls.Add(this.Export);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.Margin = new System.Windows.Forms.Padding(6);
             this.Name = "Query_SpecialReport";
             this.Tag = "Query!SpecialReport";
             this.Text = "Query_SpecialReport";

+ 44 - 12
UAS_MES_MAXMADE/FunctionCode/SystemSetting/SystemSetting_PrinterTest.Designer.cs

@@ -42,6 +42,8 @@
             this.Prefix = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.label5 = new System.Windows.Forms.Label();
             this.Export = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.label4 = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // ma_salecode_label
@@ -76,7 +78,7 @@
             this.PrintTest.Image = ((System.Drawing.Image)(resources.GetObject("PrintTest.Image")));
             this.PrintTest.IsShowBorder = true;
             this.PrintTest.Location = new System.Drawing.Point(826, 120);
-            this.PrintTest.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.PrintTest.Margin = new System.Windows.Forms.Padding(4);
             this.PrintTest.MoveImage = ((System.Drawing.Image)(resources.GetObject("PrintTest.MoveImage")));
             this.PrintTest.Name = "PrintTest";
             this.PrintTest.NormalImage = ((System.Drawing.Image)(resources.GetObject("PrintTest.NormalImage")));
@@ -96,7 +98,7 @@
             this.Setting.Image = ((System.Drawing.Image)(resources.GetObject("Setting.Image")));
             this.Setting.IsShowBorder = true;
             this.Setting.Location = new System.Drawing.Point(988, 120);
-            this.Setting.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Setting.Margin = new System.Windows.Forms.Padding(4);
             this.Setting.MoveImage = ((System.Drawing.Image)(resources.GetObject("Setting.MoveImage")));
             this.Setting.Name = "Setting";
             this.Setting.NormalImage = ((System.Drawing.Image)(resources.GetObject("Setting.NormalImage")));
@@ -111,7 +113,7 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(211, 597);
+            this.label3.Location = new System.Drawing.Point(211, 616);
             this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(82, 41);
@@ -123,7 +125,7 @@
             this.Rn.AllPower = null;
             this.Rn.BackColor = System.Drawing.Color.White;
             this.Rn.ID = null;
-            this.Rn.Location = new System.Drawing.Point(356, 603);
+            this.Rn.Location = new System.Drawing.Point(356, 622);
             this.Rn.Margin = new System.Windows.Forms.Padding(6);
             this.Rn.Name = "Rn";
             this.Rn.Power = null;
@@ -138,7 +140,7 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(211, 376);
+            this.label2.Location = new System.Drawing.Point(211, 395);
             this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(82, 41);
@@ -149,7 +151,7 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(211, 490);
+            this.label1.Location = new System.Drawing.Point(211, 509);
             this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(82, 41);
@@ -161,7 +163,7 @@
             this.Num.AllPower = null;
             this.Num.BackColor = System.Drawing.Color.White;
             this.Num.ID = null;
-            this.Num.Location = new System.Drawing.Point(356, 496);
+            this.Num.Location = new System.Drawing.Point(356, 515);
             this.Num.Margin = new System.Windows.Forms.Padding(6);
             this.Num.Name = "Num";
             this.Num.Power = null;
@@ -173,7 +175,7 @@
             // 
             // Date
             // 
-            this.Date.Location = new System.Drawing.Point(356, 376);
+            this.Date.Location = new System.Drawing.Point(356, 395);
             this.Date.Name = "Date";
             this.Date.Size = new System.Drawing.Size(278, 35);
             this.Date.TabIndex = 26;
@@ -183,7 +185,7 @@
             this.Prefix.AllPower = null;
             this.Prefix.BackColor = System.Drawing.Color.White;
             this.Prefix.ID = null;
-            this.Prefix.Location = new System.Drawing.Point(356, 271);
+            this.Prefix.Location = new System.Drawing.Point(356, 290);
             this.Prefix.Margin = new System.Windows.Forms.Padding(6);
             this.Prefix.Name = "Prefix";
             this.Prefix.Power = null;
@@ -197,7 +199,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(211, 265);
+            this.label5.Location = new System.Drawing.Point(211, 284);
             this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(82, 41);
@@ -211,7 +213,7 @@
             this.Export.DownImage = ((System.Drawing.Image)(resources.GetObject("Export.DownImage")));
             this.Export.Image = null;
             this.Export.IsShowBorder = true;
-            this.Export.Location = new System.Drawing.Point(356, 693);
+            this.Export.Location = new System.Drawing.Point(356, 712);
             this.Export.Margin = new System.Windows.Forms.Padding(6);
             this.Export.MoveImage = ((System.Drawing.Image)(resources.GetObject("Export.MoveImage")));
             this.Export.Name = "Export";
@@ -223,11 +225,39 @@
             this.Export.UseVisualStyleBackColor = false;
             this.Export.Click += new System.EventHandler(this.Export_Click);
             // 
+            // ma_code
+            // 
+            this.ma_code.AllPower = null;
+            this.ma_code.BackColor = System.Drawing.Color.White;
+            this.ma_code.ID = null;
+            this.ma_code.Location = new System.Drawing.Point(356, 196);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(6);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = null;
+            this.ma_code.Size = new System.Drawing.Size(278, 35);
+            this.ma_code.Str = null;
+            this.ma_code.Str1 = null;
+            this.ma_code.Str2 = null;
+            this.ma_code.TabIndex = 34;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label4.Location = new System.Drawing.Point(211, 190);
+            this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(114, 41);
+            this.label4.TabIndex = 33;
+            this.label4.Text = "工单号";
+            // 
             // SystemSetting_PrinterTest
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(2034, 1118);
+            this.Controls.Add(this.ma_code);
+            this.Controls.Add(this.label4);
             this.Controls.Add(this.Export);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.Rn);
@@ -242,7 +272,7 @@
             this.Controls.Add(this.PrintTest);
             this.Controls.Add(this.ma_salecode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.Margin = new System.Windows.Forms.Padding(6);
             this.Name = "SystemSetting_PrinterTest";
             this.Tag = "Setup!PrinterTest";
             this.Text = "打印机调试";
@@ -266,5 +296,7 @@
         private CustomControl.TextBoxWithIcon.EnterTextBox Prefix;
         private System.Windows.Forms.Label label5;
         private CustomControl.ButtonUtil.NormalButton Export;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ma_code;
+        private System.Windows.Forms.Label label4;
     }
 }

+ 17 - 1
UAS_MES_MAXMADE/FunctionCode/SystemSetting/SystemSetting_PrinterTest.cs

@@ -8,6 +8,8 @@ using System.Drawing.Printing;
 using System.Linq;
 using System.Text;
 using System.Windows.Forms;
+using UAS_MES_NEW.DataOperate;
+using UAS_MES_NEW.Entity;
 
 namespace UAS_MES_NEW.SystemSetting
 {
@@ -18,6 +20,8 @@ namespace UAS_MES_NEW.SystemSetting
 
         LabelFormatDocument format;
 
+        DataHelper dh = SystemInf.dh;
+
         public SystemSetting_PrinterTest()
         {
             InitializeComponent();
@@ -51,7 +55,12 @@ namespace UAS_MES_NEW.SystemSetting
 
         private void Export_Click(object sender, EventArgs e)
         {
-            for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text)+ int.Parse(Rn.Text)); i = i + 4)
+            if (!dh.CheckExist("make", "ma_code='" + ma_code.Text + "'"))
+            {
+                MessageBox.Show("工单号不存在");
+                return;
+            }
+            for (int i = int.Parse(Rn.Text); i < (int.Parse(Num.Text) + int.Parse(Rn.Text)); i = i + 4)
             {
                 int temp = i;
                 for (int j = 0; j < format.SubStrings.Count; j++)
@@ -60,15 +69,22 @@ namespace UAS_MES_NEW.SystemSetting
                     {
                         case "RN1":
                             format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(4, (temp).ToString()));
+                            dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type)values(makesnlist_seq.nextval,sysdate,'"+ma_code.Text+"','"+ format.SubStrings[j].Value + "','before')", "insert");
                             break;
                         case "RN2":
                             format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(4, (temp + 1).ToString()));
+                            dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before')", "insert");
+
                             break;
                         case "RN3":
                             format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(4, (temp + 2).ToString()));
+                            dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before')", "insert");
+
                             break;
                         case "RN4":
                             format.SubStrings[j].Value = (Prefix.Text + Date.Value.ToString("yyMMdd") + lpad(4, (temp + 3).ToString()));
+                            dh.ExecuteSql("insert into makesnlist(msl_id,msl_indate,msl_makecode,msl_sncode,msl_type)values(makesnlist_seq.nextval,sysdate,'" + ma_code.Text + "','" + format.SubStrings[j].Value + "','before')", "insert");
+
                             break;
                         default:
                             break;