Prechádzať zdrojové kódy

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

Hcsy 8 rokov pred
rodič
commit
6519107f51

+ 33 - 8
UAS-MES/CustomControl/TextBoxWithIcon/TextBoxGeneratePaCode.cs

@@ -39,18 +39,46 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
             }
         }
 
-        private string errorMsg;
+        private string MakeCode1;
+        private string Caller1;
+        private string ProdCode1;
 
-        public string ErrorMsg
+        public string MakeCode
         {
             get
             {
-                return errorMsg;
+                return MakeCode1;
             }
 
             set
             {
-                errorMsg = value;
+                MakeCode1 = value;
+            }
+        }
+
+        public string Caller
+        {
+            get
+            {
+                return Caller1;
+            }
+
+            set
+            {
+                Caller1 = value;
+            }
+        }
+
+        public string ProdCode
+        {
+            get
+            {
+                return ProdCode1;
+            }
+
+            set
+            {
+                ProdCode1 = value;
             }
         }
 
@@ -58,10 +86,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
         {
             IconClick?.Invoke(sender, new EventArgs());
             //如果未实现则继续
-            if (pr_id != "" && pr_id != null)
-            {
-                enterTextBox1.Text = LogicHandler.GetOutBoxCode(pr_id, "2");
-            }
+            enterTextBox1.Text = LogicHandler.GetOutBoxCode(Caller1, MakeCode1, ProdCode1, Entity.User.UserLineCode);
         }
 
         //定义委托

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.Designer.cs

@@ -280,7 +280,7 @@
             this.pr_code.AutoSize = true;
             this.pr_code.CutLength = null;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(333, 16);
+            this.pr_code.Location = new System.Drawing.Point(331, 16);
             this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_code.Name = "pr_code";
             this.pr_code.Size = new System.Drawing.Size(0, 21);
@@ -292,7 +292,7 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(554, 16);
+            this.pr_detail.Location = new System.Drawing.Point(550, 16);
             this.pr_detail.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 21);

+ 11 - 9
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -145,6 +145,7 @@ namespace UAS_MES.Make
                                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                             }
                         }
+                        else  OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                     }
                     else
                     {
@@ -175,19 +176,20 @@ namespace UAS_MES.Make
                                 if (RemainIndex == ListA.Rows.Count)
                                 {
                                     OperateResult.AppendText(">>序列号" + ms_sncode.Text + "对应的工单已经采集完成\n", Color.Green);
-                                    Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, code.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+                                    Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                                     RemainIndex = 0;
-                                    code.Clear();
-                                    LoadCollectNum();
-                                    BaseUtil.CleanDataTableData(ListA);
+                                    if (LogicHandler.UpdateMakeMessage(ms_sncode.Text, ms_makecode.Text, "彩盒上料打印", User.UserSourceCode, User.UserCode, "上料成功", out ErrorMessage))
+                                    {
+                                        mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
+                                        code.Clear();
+                                        LoadCollectNum();
+                                        BaseUtil.CleanDataTableData(ListA);
+                                    }
+                                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
                                     return;
                                 }
                             }
-                            else
-                            {
-                                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                                code.Clear();
-                            }
+                            else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
                         }
                     }
                 }

+ 45 - 85
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.Designer.cs

@@ -42,14 +42,8 @@
             this.panel4 = new System.Windows.Forms.Panel();
             this.label15 = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
-            this.Temp1 = new System.Windows.Forms.Label();
-            this.panel3 = new System.Windows.Forms.Panel();
-            this.Temp2 = new System.Windows.Forms.Label();
-            this.panel2 = new System.Windows.Forms.Panel();
             this.ma_qty_label = new System.Windows.Forms.Label();
             this.ma_salecode_label = new System.Windows.Forms.Label();
-            this.Temp3 = new System.Windows.Forms.Label();
-            this.panel1 = new System.Windows.Forms.Panel();
             this.ms_makecode_label = new System.Windows.Forms.Label();
             this.PrintLabel = new System.Windows.Forms.ComboBox();
             this.Printer_label = new System.Windows.Forms.Label();
@@ -73,11 +67,13 @@
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.BaudRate = new System.Windows.Forms.Label();
             this.ComList = new System.Windows.Forms.Label();
+            this.WeighRecord = new System.Windows.Forms.ListView();
+            this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.panel6.SuspendLayout();
             this.panel4.SuspendLayout();
-            this.panel3.SuspendLayout();
-            this.panel2.SuspendLayout();
-            this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             this.SuspendLayout();
             // 
@@ -225,47 +221,6 @@
             this.pr_detail_label.TabIndex = 53;
             this.pr_detail_label.Text = "产品型号";
             // 
-            // Temp1
-            // 
-            this.Temp1.AutoSize = true;
-            this.Temp1.Font = new System.Drawing.Font("微软雅黑", 20F);
-            this.Temp1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.Temp1.Location = new System.Drawing.Point(57, 35);
-            this.Temp1.Name = "Temp1";
-            this.Temp1.Size = new System.Drawing.Size(0, 35);
-            this.Temp1.TabIndex = 38;
-            // 
-            // panel3
-            // 
-            this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.panel3.Controls.Add(this.Temp1);
-            this.panel3.Location = new System.Drawing.Point(405, 218);
-            this.panel3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.panel3.Name = "panel3";
-            this.panel3.Size = new System.Drawing.Size(381, 98);
-            this.panel3.TabIndex = 52;
-            // 
-            // Temp2
-            // 
-            this.Temp2.AutoSize = true;
-            this.Temp2.Font = new System.Drawing.Font("微软雅黑", 20F);
-            this.Temp2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.Temp2.Location = new System.Drawing.Point(57, 32);
-            this.Temp2.Name = "Temp2";
-            this.Temp2.Size = new System.Drawing.Size(0, 35);
-            this.Temp2.TabIndex = 39;
-            // 
-            // panel2
-            // 
-            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.panel2.Controls.Add(this.Temp2);
-            this.panel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.panel2.Location = new System.Drawing.Point(405, 337);
-            this.panel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(381, 98);
-            this.panel2.TabIndex = 51;
-            // 
             // ma_qty_label
             // 
             this.ma_qty_label.AutoSize = true;
@@ -286,26 +241,6 @@
             this.ma_salecode_label.TabIndex = 54;
             this.ma_salecode_label.Text = "订单编号";
             // 
-            // Temp3
-            // 
-            this.Temp3.AutoSize = true;
-            this.Temp3.Font = new System.Drawing.Font("微软雅黑", 20F);
-            this.Temp3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.Temp3.Location = new System.Drawing.Point(57, 33);
-            this.Temp3.Name = "Temp3";
-            this.Temp3.Size = new System.Drawing.Size(0, 35);
-            this.Temp3.TabIndex = 40;
-            // 
-            // panel1
-            // 
-            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.panel1.Controls.Add(this.Temp3);
-            this.panel1.Location = new System.Drawing.Point(405, 454);
-            this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(381, 98);
-            this.panel1.TabIndex = 50;
-            // 
             // ms_makecode_label
             // 
             this.ms_makecode_label.AutoSize = true;
@@ -600,11 +535,46 @@
             this.ComList.Text = "ComList";
             this.ComList.Visible = false;
             // 
+            // WeighRecord
+            // 
+            this.WeighRecord.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader1,
+            this.columnHeader2,
+            this.columnHeader3,
+            this.columnHeader4});
+            this.WeighRecord.Location = new System.Drawing.Point(412, 218);
+            this.WeighRecord.Name = "WeighRecord";
+            this.WeighRecord.Size = new System.Drawing.Size(380, 334);
+            this.WeighRecord.TabIndex = 173;
+            this.WeighRecord.UseCompatibleStateImageBehavior = false;
+            this.WeighRecord.View = System.Windows.Forms.View.Details;
+            // 
+            // columnHeader1
+            // 
+            this.columnHeader1.Text = "";
+            this.columnHeader1.Width = 23;
+            // 
+            // columnHeader2
+            // 
+            this.columnHeader2.Text = "序列号";
+            this.columnHeader2.Width = 127;
+            // 
+            // columnHeader3
+            // 
+            this.columnHeader3.Text = "重量";
+            this.columnHeader3.Width = 99;
+            // 
+            // columnHeader4
+            // 
+            this.columnHeader4.Text = "时间";
+            this.columnHeader4.Width = 130;
+            // 
             // Make_ColorBoxWeigh
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1042, 584);
+            this.Controls.Add(this.WeighRecord);
             this.Controls.Add(this.ComList);
             this.Controls.Add(this.BaudRate);
             this.Controls.Add(this.label1);
@@ -633,12 +603,9 @@
             this.Controls.Add(this.panel4);
             this.Controls.Add(this.label15);
             this.Controls.Add(this.pr_detail_label);
-            this.Controls.Add(this.panel3);
-            this.Controls.Add(this.panel2);
             this.Controls.Add(this.ma_qty_label);
             this.Controls.Add(this.ma_salecode_label);
             this.Controls.Add(this.OperateResult);
-            this.Controls.Add(this.panel1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Name = "Make_ColorBoxWeigh";
@@ -651,12 +618,6 @@
             this.panel6.PerformLayout();
             this.panel4.ResumeLayout(false);
             this.panel4.PerformLayout();
-            this.panel3.ResumeLayout(false);
-            this.panel3.PerformLayout();
-            this.panel2.ResumeLayout(false);
-            this.panel2.PerformLayout();
-            this.panel1.ResumeLayout(false);
-            this.panel1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
@@ -678,15 +639,9 @@
         private System.Windows.Forms.Panel panel4;
         private System.Windows.Forms.Label label15;
         private System.Windows.Forms.Label pr_detail_label;
-        private System.Windows.Forms.Label Temp1;
-        private System.Windows.Forms.Panel panel3;
-        private System.Windows.Forms.Label Temp2;
-        private System.Windows.Forms.Panel panel2;
         private System.Windows.Forms.Label ma_qty_label;
         private System.Windows.Forms.Label ma_salecode_label;
-        private System.Windows.Forms.Label Temp3;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
-        private System.Windows.Forms.Panel panel1;
         private System.Windows.Forms.Label ms_makecode_label;
         private CustomControl.ValueLabel.ValueLabel ma_salecode;
         private CustomControl.ValueLabel.ValueLabel pr_detail;
@@ -708,5 +663,10 @@
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label BaudRate;
         private System.Windows.Forms.Label ComList;
+        private System.Windows.Forms.ListView WeighRecord;
+        private System.Windows.Forms.ColumnHeader columnHeader1;
+        private System.Windows.Forms.ColumnHeader columnHeader2;
+        private System.Windows.Forms.ColumnHeader columnHeader3;
+        private System.Windows.Forms.ColumnHeader columnHeader4;
     }
 }

+ 5 - 3
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -117,10 +117,12 @@ namespace UAS_MES.Make
                         int ActualWeight = int.Parse(weight.Text == "" ? "0" : weight.Text);
                         if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
                         {
+                            ListViewItem lsi = new ListViewItem();
+                            lsi.SubItems.Add(sncode.Text);
+                            lsi.SubItems.Add(ActualWeight.ToString());
+                            lsi.SubItems.Add(System.DateTime.Now.ToString());
+                            WeighRecord.Items.Add(lsi);
                             //显示最近的三个称量记录
-                            Temp3.Text = Temp2.Text;
-                            Temp2.Text = Temp1.Text;
-                            Temp1.Text = sncode.Text;
                             if (LogicHandler.UpdateMakeMessage(sncode.Text, ms_makecode.Text, "彩盒称量", User.UserSourceCode, User.UserCode, "称量合格", out ErrorMessage))
                             {
                                 OperateResult.AppendText(">>" + sncode.Text + "重量检测检测合格\n", Color.Green);

+ 6 - 5
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -137,11 +137,11 @@ namespace UAS_MES.Make
                                         sql.Clear();
                                         sql.Append("insert into Craftmaterial (cm_id, cm_makecode,cm_maid,cm_maprodcode,");
                                         sql.Append("cm_soncode,cm_mscode,cm_sncode,cm_stepcode,cm_stepname,cm_craftcode,cm_craftname,");
-                                        sql.Append("cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid) ");
+                                        sql.Append("cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid,cm_status,cm_materialtype,cm_firstsn) ");
                                         sql.Append("select Craftmaterial_seq.nextval, ma_code, ma_id, ma_prodcode, sp_soncode,");
                                         sql.Append("'" + code.Text + "','" + code.Text + "',mcd_stepcode,mcd_stepname,ma_craftcode");
                                         sql.Append(",ma_craftname,'" + code.Text + "',1,sysdate,'" + User.UserName + "',ma_linecode,ma_wccode,");
-                                        sql.Append("'" + User.UserSourceCode + "','" + sp_id + "' from make left join makecraftdetail on mcd_macode=ma_code");
+                                        sql.Append("'" + User.UserSourceCode + "','" + sp_id + "',0,1,ms_firstsn from make left join makecraftdetail on mcd_macode=ma_code");
                                         sql.Append(" left join stepproduct on sp_stepcode=mcd_stepcode  where ma_code = '" + make_code + "'and ");
                                         sql.Append("sp_id = " + sp_id + " and mcd_stepcode='" + nextstepcode + "'");
                                         dh.ExecuteSql(sql.GetString(), "insert");
@@ -376,7 +376,8 @@ namespace UAS_MES.Make
                 BaseUtil.SetFormValue(this.Controls, dt);
                 string oMakeCode = "";
                 string oMsID = "";
-                if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage)) {
+                if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
+                {
                     if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                     {
                         //单独用一个DataTable存储一个
@@ -427,10 +428,10 @@ namespace UAS_MES.Make
             {
                 sql.Clear();
                 sql.Append("insert into Craftmaterial (cm_id ,cm_makecode,cm_maid,cm_maprodcode, cm_soncode, cm_mscode, cm_sncode, cm_stepcode, cm_stepname,");
-                sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid,cm_status,cm_materialtype)");
+                sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid,cm_status,cm_materialtype,cm_firstsn)");
                 sql.Append("select Craftmaterial_seq.nextval, ma_code, ma_id, ma_prodcode, sp_soncode,ms_code,ms_sncode,mcd_stepcode,");
                 sql.Append("mcd_stepname,ma_craftcode,ma_craftname,:barcode,1,sysdate,'" + User.UserCode + "',ma_linecode,ma_wccode,");
-                sql.Append("'" + User.UserSourceCode + "','" + sp_id + "',0,1 from make left join makecraftdetail on mcd_macode=ma_code  left join stepproduct on sp_stepcode=mcd_stepcode ");
+                sql.Append("'" + User.UserSourceCode + "','" + sp_id + "',0,1,ms_firstsn from make left join makecraftdetail on mcd_macode=ma_code  left join stepproduct on sp_stepcode=mcd_stepcode ");
                 sql.Append("and sp_craftcode=ma_craftcode and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code ");
                 sql.Append("where ma_code='" + make_code + "'and sp_id=" + sp_id + " and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode + "'");
                 dh.BatchInsert(sql.GetString(), new string[] { "barcode" }, CollectData.ToArray());

+ 0 - 1
UAS-MES/FunctionCode/Make/Make_NewPallet.Designer.cs

@@ -83,7 +83,6 @@
             // 
             // pa_outboxcode
             // 
-            this.pa_outboxcode.ErrorMsg = null;
             this.pa_outboxcode.Location = new System.Drawing.Point(96, 151);
             this.pa_outboxcode.Name = "pa_outboxcode";
             this.pa_outboxcode.Pr_id = null;

+ 6 - 4
UAS-MES/FunctionCode/Make/Make_NewPallet.cs

@@ -13,22 +13,24 @@ namespace UAS_MES.Make
         //生成的箱类型,2表示大箱号,3表示栈板号
         string pa_type = "";
 
-        public Make_NewPallet(string Caller)
+        public Make_NewPallet(string Caller,string MakeCode)
         {
             InitializeComponent();
             switch (Caller)
             {
-                case "Make!BigBoxWeigh":
+                case "PACKAGE":
                     title.Text = "新增大箱号";
                     pa_type = "2";
                     break;
-                case "Make!PalletWeigh":
+                case "PALLET":
                     title.Text = "新增栈板号";
                     pa_type = "3";
                     break;
                 default:
                     break;
             }
+            pa_outboxcode.Caller = Caller;
+            pa_outboxcode.MakeCode = MakeCode;
         }
 
         private void 新增栈板_Load(object sender, EventArgs e)
@@ -49,7 +51,7 @@ namespace UAS_MES.Make
 
         private void pr_code_UserControlTextChanged(object sender, EventArgs e)
         {
-            pa_outboxcode.Pr_id = dh.getFieldDataByCondition("product", "pr_id", "pr_code='" + pr_code.Text + "'").ToString();
+            pa_outboxcode.ProdCode = pr_code.Text;
         }
 
         private void pa_outboxcode_IconClick(object sender, EventArgs e)

+ 0 - 17
UAS-MES/FunctionCode/Make/Make_PackageCollection.Designer.cs

@@ -46,7 +46,6 @@
             this.pa_id = new System.Windows.Forms.Label();
             this.PrintLabel = new System.Windows.Forms.ComboBox();
             this.label3 = new System.Windows.Forms.Label();
-            this.pr_id = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.PrintNum = new System.Windows.Forms.NumericUpDown();
             this.pa_outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode();
@@ -250,19 +249,6 @@
             this.label3.TabIndex = 160;
             this.label3.Text = "打印标签";
             // 
-            // pr_id
-            // 
-            this.pr_id.AutoSize = true;
-            this.pr_id.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_id.Location = new System.Drawing.Point(964, 79);
-            this.pr_id.Name = "pr_id";
-            this.pr_id.Size = new System.Drawing.Size(47, 21);
-            this.pr_id.TabIndex = 161;
-            this.pr_id.Tag = "pr_id";
-            this.pr_id.Text = "pr_id";
-            this.pr_id.Visible = false;
-            this.pr_id.TextChanged += new System.EventHandler(this.pr_id_TextChanged);
-            // 
             // label2
             // 
             this.label2.AutoSize = true;
@@ -288,7 +274,6 @@
             // 
             // pa_outboxcode
             // 
-            this.pa_outboxcode.ErrorMsg = null;
             this.pa_outboxcode.Location = new System.Drawing.Point(109, 54);
             this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(4);
             this.pa_outboxcode.Name = "pa_outboxcode";
@@ -535,7 +520,6 @@
             this.Controls.Add(this.PrintNum);
             this.Controls.Add(this.pa_outboxcode);
             this.Controls.Add(this.label2);
-            this.Controls.Add(this.pr_id);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.PrintLabel);
             this.Controls.Add(this.PrintList);
@@ -611,7 +595,6 @@
         private CustomControl.ComBoxWithFocus.PrinterCombox PrintList;
         private System.Windows.Forms.ComboBox PrintLabel;
         private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.Label pr_id;
         private System.Windows.Forms.Label label2;
         private CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode pa_outboxcode;
         private System.Windows.Forms.NumericUpDown PrintNum;

+ 3 - 5
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -273,6 +273,9 @@ namespace UAS_MES.Make
 
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
+            pa_outboxcode.MakeCode = ma_code.Text;
+            pa_outboxcode.ProdCode = pr_code.Text;
+            pa_outboxcode.Caller = "PACKAGE";
             dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc ", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_laname";
@@ -286,11 +289,6 @@ namespace UAS_MES.Make
             }
         }
 
-        private void pr_id_TextChanged(object sender, EventArgs e)
-        {
-            pa_outboxcode.Pr_id = pr_id.Text;
-        }
-
         private void 包装采集_FormClosing(object sender, FormClosingEventArgs e)
         {
             lbl.Quit();

+ 0 - 15
UAS-MES/FunctionCode/Make/Make_PackageCollection.resx

@@ -395,19 +395,4 @@
   <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pd_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pa_outboxcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pd_innerqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pa_indate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
 </root>

+ 3 - 3
UAS-MES/FunctionCode/Make/Make_PalletCollection.cs

@@ -59,7 +59,7 @@ namespace UAS_MES.Make
                     SearchPallet.Text = "大箱查询";
                     CheckOutBoxCondition = " pa_type=1 ";
                     break;
-                case "Make!PalletWeigh":
+                case "Make!PalletCollection":
                     palletcode_label.Text = "栈板号";
                     pa_type = "3";
                     pl_labeltype1 = "栈板标";
@@ -90,7 +90,7 @@ namespace UAS_MES.Make
                 sql.Append("select pa_prodcode,nvl(pd_barcode,PD_INNERBOXCODE) code ,pd_innerqty,");
                 sql.Append("pa_salecode,pa_makecode,pa_custcode,pa_packageqty  from package left join product ");
                 sql.Append("on pr_code=pa_prodcode left join  packagedetail on pd_paid=pa_id  where ");
-                sql.Append("pa_outboxcode='" + palletcode.Text + "' and pa_type=" + pa_type);
+                sql.Append("pa_outboxcode='" + palletcode.Text + "' and pa_type='" + pa_type+"'");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 if (dt.Rows.Count > 0)
                 {
@@ -190,7 +190,7 @@ namespace UAS_MES.Make
 
         private void NewPallet_Click(object sender, EventArgs e)
         {
-            Make_NewPallet NewPallet = new Make_NewPallet(Tag.ToString());
+            Make_NewPallet NewPallet = new Make_NewPallet("PALLET",pa_makecode.Text);
             BaseUtil.SetFormCenter(NewPallet);
             NewPallet.ShowDialog();
         }

+ 16 - 11
UAS-MES/FunctionCode/Make/Make_PositionStock.cs

@@ -73,7 +73,8 @@ namespace UAS_MES.Make
                     if (ma_code.Text != "")
                     {
                         string ErrMessage = "";
-                        if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrMessage)) {
+                        if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrMessage))
+                        {
                             sql.Clear();
                             sql.Append("select cr_code from craft left join craftdetail on cd_crid=cr_id where cr_code in (" + craftcode_condition + ") ");
                             sql.Append("and cr_prodcode='" + ma_prodcode.Text + "'  and  cr_statuscode='AUDITED'  and  cd_stepcode='" + User.CurrentStepCode + "'");
@@ -115,7 +116,7 @@ namespace UAS_MES.Make
                             }
                             else OperateResult.AppendText(">>当前岗位资源工序不在工单对应的途程中\n", Color.Red);
                         }
-                        else OperateResult.AppendText(">>"+ErrMessage+"\n", Color.Red);
+                        else OperateResult.AppendText(">>" + ErrMessage + "\n", Color.Red);
                     }
                     else OperateResult.AppendText(">>工单号不能为空\n", Color.Red, pr_batchnum);
                 }
@@ -130,7 +131,7 @@ namespace UAS_MES.Make
             sql.Append("select nvl(mss_id,0) mss_id,sp_soncode,mss_prodcode,sp_oneuseqty,mss_barcode,nvl(mss_qty,0) mss_qty ,mss_remain,");
             sql.Append("pr_detail,nvl(mss_useqty,0) mss_useqty from stepbom left join stepproduct on sp_sbid=sb_id left join product on ");
             sql.Append("pr_code=sp_mothercode left join makesourcestock on mss_makecode='" + ma_code.Text + "' and  mss_craftcode=sb_craftcode ");
-            sql.Append("and mss_stepcode=sp_stepcode where sb_prodcode='" + ma_prodcode.Text + "' and sb_craftcode='" + ma_craftcode.Text + "' ");
+            sql.Append("and mss_stepcode=sp_stepcode and sp_soncode=mss_prodcode where sb_prodcode='" + ma_prodcode.Text + "' and sb_craftcode='" + ma_craftcode.Text + "' ");
             sql.Append("and sp_stepcode='" + User.CurrentStepCode + "' and sp_tracekind=2");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             BaseUtil.FillDgvWithDataTable(BatchProductDGV, dt);
@@ -138,8 +139,7 @@ namespace UAS_MES.Make
 
         private void Confirm_Click(object sender, EventArgs e)
         {
-            KeyEventArgs e1 = new KeyEventArgs(Keys.Enter);
-            pr_batchnum_KeyDown(sender, e1);
+            pr_batchnum_KeyDown(sender, new KeyEventArgs(Keys.Enter));
         }
 
         private void Screen_Click(object sender, EventArgs e)
@@ -167,11 +167,14 @@ namespace UAS_MES.Make
         {
             if (BatchProductDGV.Columns[e.ColumnIndex].Name == "DeleteRow")
             {
-                string id = BatchProductDGV.Rows[e.RowIndex].Cells["mss_id"].Value.ToString();
-                if (id != "0")
+                if (e.RowIndex >= 0)
                 {
-                    BatchProductDGV.Rows.RemoveAt(e.RowIndex);
-                    dh.ExecuteSql("delete from makesourcestock where mss_id='" + id + "'", "delete");
+                    string id = BatchProductDGV.Rows[e.RowIndex].Cells["mss_id"].Value.ToString();
+                    if (id != "0")
+                    {
+                        BatchProductDGV.Rows.RemoveAt(e.RowIndex);
+                        dh.ExecuteSql("delete from makesourcestock where mss_id='" + id + "'", "delete");
+                    }
                 }
             }
         }
@@ -207,7 +210,7 @@ namespace UAS_MES.Make
         private void BatchProductDGV_CellEndEdit(object sender, DataGridViewCellEventArgs e)
         {
             string id = BatchProductDGV.Rows[e.RowIndex].Cells["mss_id"].Value.ToString();
-            string qty ="0";
+            string qty = "0";
             if (id != "0")
             {
                 try
@@ -224,8 +227,10 @@ namespace UAS_MES.Make
                 }
                 catch (Exception)
                 {
+                    OperateResult.AppendText(">>数量必须大于0\n", Color.Red);
+                    return;
                 }
-                dh.UpdateByCondition("makesourcestock", "mss_qty='"+ qty + "'", "mss_id='" + id + "'");
+                dh.UpdateByCondition("makesourcestock", "mss_qty='" + qty + "'", "mss_id='" + id + "'");
             }
         }
     }

+ 9 - 0
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -417,6 +417,11 @@ namespace UAS_MES.Make
             SNLength.Enabled = true;
             SNPre.Enabled = true;
 
+            TSNPre_checkBox.Enabled = true;
+            TSNLength_checkBox.Enabled = true;
+            SNPre_checkBox.Enabled = true;
+            SNLength_checkBox.Enabled = true;
+
             //查询表工单序列号防呆规则表
             dt = (DataTable)dh.ExecuteSql("select msr_type, msr_prefix ,msr_length from makesnrule where msr_makecode='" + ms_macode.Text + "'", "select");
             if (dt.Rows.Count > 0)
@@ -440,6 +445,7 @@ namespace UAS_MES.Make
                             TSNPre.Enabled = false;
                             //勾选
                             TSNPre_checkBox.Checked = true;
+                            TSNPre_checkBox.Enabled = false;
                         }
                         if (length != "" && length != null)
                         {
@@ -449,6 +455,7 @@ namespace UAS_MES.Make
                             TSNLength.Enabled = false;
                             //勾选
                             TSNLength_checkBox.Checked = true;
+                            TSNLength_checkBox.Enabled = false;
                         }
                     }
                     else if (dr["msr_type"].ToString().ToLower() == "after")
@@ -467,6 +474,7 @@ namespace UAS_MES.Make
                             SNPre.Enabled = false;
                             //勾选
                             SNPre_checkBox.Checked = true;
+                            SNPre_checkBox.Enabled = false;
                         }
                         if (length != "" && length != null)
                         {
@@ -476,6 +484,7 @@ namespace UAS_MES.Make
                             SNLength.Enabled = false;
                             //勾选
                             SNLength_checkBox.Checked = true;
+                            SNLength_checkBox.Enabled = false;
                         }
                     }
                 }

+ 16 - 2
UAS-MES/FunctionCode/Make/Make_SeqTransform.cs

@@ -71,9 +71,11 @@ namespace UAS_MES.Make
                             //定义传入方法的变量
                             string oMakeCode = "";
                             string oMsId = "";
-                            if (!LogicHandler.GetMakeInfo(sncode.Text,out oMakeCode,out errorMessage))
+                            string ms_id = dh.getFieldDataByCondition("MakeSerial", "max(ms_id) ms_id", "upper(ms_sncode)='" + sncode.Text.ToUpper() + "' or ms_firstsn in (select firstsn from makesnrelation where upper(beforesn)='" + sncode.Text.ToUpper() + "')").ToString();
+                            oMakeCode = dh.getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_id='" + ms_id + "'").ToString();
+                            if (oMakeCode=="")
                             {
-                                OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red);
+                                OperateResult.AppendText(">>序列号:" + sncode.Text + " 未归属工单\n", Color.Red);
                                 OperateResult.AppendText(">>请输入转换前的序列号\n", Color.Black);
                                 return;
                             }
@@ -104,6 +106,7 @@ namespace UAS_MES.Make
                                             bsncode = sncode.Text;
                                             sncode.Text = "";
                                             OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green);
+                                            ChangeResult.Enabled = false;
                                         }
                                         else
                                         {
@@ -122,6 +125,7 @@ namespace UAS_MES.Make
                                             bsncode = sncode.Text;
                                             sncode.Text = "";
                                             OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green);
+                                            ChangeResult.Enabled = false;
                                         }
                                         else
                                         //不为空,进行过转换。不勾选修改结果,就不能再修改
@@ -184,6 +188,7 @@ namespace UAS_MES.Make
                                     bsncode = "";
                                     //更新数量
                                     changenum.Text = int.Parse(changenum.Text) + 1 + "";
+                                    ChangeResult.Enabled = true;
                                 }
                                 else
                                     OperateResult.AppendText(">>序列号" + sncode.Text + "已存在,请输入其他序列号\n", Color.Red);
@@ -221,6 +226,7 @@ namespace UAS_MES.Make
         {
             bsncode = "";
             OperateResult.AppendText(">>请输需要转换的序列号\n", Color.Green);
+            ChangeResult.Enabled = true;
         }
         /// <summary>
         /// 工单号keydown
@@ -257,6 +263,10 @@ namespace UAS_MES.Make
             afterTransSNLength.Enabled = true;
             afterTransSNPre.Enabled = true;
 
+            beforeTransSNPre_checkBox.Enabled = true;
+            beforeTransSNLength_checkBox.Enabled = true;
+            afterTransSNPre_checkBox.Enabled = true;
+            afterTransSNLength_checkBox.Enabled = true;
             //查询表工单序列号防呆规则表
             dt = (DataTable)dh.ExecuteSql("select msr_type, msr_prefix ,msr_length from makesnrule where msr_makecode='" + ma_code.Text + "'", "select");
             if (dt.Rows.Count > 0)
@@ -280,6 +290,7 @@ namespace UAS_MES.Make
                             beforeTransSNPre.Enabled = false;
                             //勾选
                             beforeTransSNPre_checkBox.Checked = true;
+                            beforeTransSNPre_checkBox.Enabled = false;
                         }
                         if (length != "" && length != null)
                         {
@@ -289,6 +300,7 @@ namespace UAS_MES.Make
                             beforeTransSNLength.Enabled = false;
                             //勾选
                             beforeTransSNLength_checkBox.Checked = true;
+                            beforeTransSNLength_checkBox.Enabled = false;
                         }
                     }
                     else if (dr["msr_type"].ToString().ToLower() == "after")
@@ -307,6 +319,7 @@ namespace UAS_MES.Make
                             afterTransSNPre.Enabled = false;
                             //勾选
                             afterTransSNPre_checkBox.Checked = true;
+                            afterTransSNPre_checkBox.Enabled = false;
                         }
                         if (length != "" && length != null)
                         {
@@ -316,6 +329,7 @@ namespace UAS_MES.Make
                             afterTransSNLength.Enabled = false;
                             //勾选
                             afterTransSNLength_checkBox.Checked = true;
+                            afterTransSNLength_checkBox.Enabled = false;
                         }
                     }
                 }

+ 11 - 36
UAS-MES/PublicMethod/LogicHandler.cs

@@ -926,14 +926,14 @@ namespace UAS_MES.PublicMethod
             }
             else
             {
-                return CS_SetResult(iMakeCode, iSourceCode, iSN, iUserCode,iResult, out oErrorMessage);
+                return CS_SetResult(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrorMessage);
             }
         }
 
-        public static bool CS_SetResult(string iMakeCode, string iSourceCode, string iSN, string iUserCode,string iResult, out string oErrorMessage)
+        public static bool CS_SetResult(string iMakeCode, string iSourceCode, string iSN, string iUserCode, string iResult, out string oErrorMessage)
         {
             oErrorMessage = "";
-            string[] param = new string[] { iMakeCode, iSourceCode, iSN, iUserCode,iResult, oErrorMessage };
+            string[] param = new string[] { iMakeCode, iSourceCode, iSN, iUserCode, iResult, oErrorMessage };
             dh.CallProcedure("CS_SETSTEPRESULT", ref param);
             oErrorMessage = param[5];
             if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
@@ -1196,17 +1196,17 @@ namespace UAS_MES.PublicMethod
             DataTable dt = (DataTable)dh.ExecuteSql("select cm_id from craftmaterial  where cm_sncode='" + iSnCode + "' and cm_barcode='" + iBarcode + "' and cm_soncode='" + iSonCode + "'", "select");
             if (dt.Rows.Count > 0)
             {
-                oErrorMessage = "条码"+ iBarcode + "已经上料";
+                oErrorMessage = "条码" + iBarcode + "已经上料";
                 return false;
             }
             else
             {
                 sql.Clear();
                 sql.Append("insert into Craftmaterial (cm_id ,cm_makecode,cm_maid,cm_maprodcode, cm_soncode, cm_mscode, cm_sncode, cm_stepcode, cm_stepname,");
-                sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid,cm_status,cm_materialtype)");
+                sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid,cm_status,cm_firstsn)");
                 sql.Append("select Craftmaterial_seq.nextval, ma_code, ma_id, ma_prodcode, sp_soncode,ms_code,ms_sncode,mcd_stepcode,");
                 sql.Append("mcd_stepname,ma_craftcode,ma_craftname,'" + iBarcode + "',1,sysdate,'" + iUserCode + "',ma_linecode,ma_wccode,");
-                sql.Append("'" + iSourceCode + "','" + iSonID + "',0,1 from make left join makecraftdetail on mcd_macode=ma_code  left join stepproduct on sp_stepcode=mcd_stepcode ");
+                sql.Append("'" + iSourceCode + "','" + iSonID + "',0,ms_firstsn from make left join makecraftdetail on mcd_macode=ma_code  left join stepproduct on sp_stepcode=mcd_stepcode ");
                 sql.Append("and sp_craftcode=ma_craftcode and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code ");
                 sql.Append("where ma_code='" + iMakeCode + "'and sp_id=" + iSonID + " and mcd_stepcode = '" + StepCode + "' and ms_sncode='" + iSnCode + "'");
                 dh.ExecuteSql(sql.ToString(), "insert");
@@ -1381,43 +1381,18 @@ namespace UAS_MES.PublicMethod
             return dh.getFieldDataByCondition("source", "sc_stepcode", "sc_code='" + Source + "'").ToString();
         }
 
-        private static string lpad(int length, string number)
-        {
-            while (number.Length < length)
-            {
-                number = "0" + number;
-            }
-            number = number.Substring(number.Length - length, length);
-            return number;
-        }
-
         /// <summary>
         /// 获取箱号
         /// </summary>
         /// <param name="pr_id">物料主表的ID</param>
         /// <param name="kind">管控类型</param>
         /// <returns></returns>
-        public static string GetOutBoxCode(string pr_id, string kind)
+        public static string GetOutBoxCode(string Caller, string iMakeCode, string iProdCode, string iUserCode)
         {
-            StringBuilder code = new StringBuilder();
-            object pr_kind = dh.getFieldDataByCondition("product", "pr_tracekind", "pr_id=" + pr_id);
-            //if (pr_kind.ToString() != "")
-            //{
-                //if ((kind.Equals("1") && pr_kind.ToString() == "1") || (kind.Equals("2") && pr_kind.ToString() == "2"))
-                //{
-                    // 单间管控或者批管控
-                    DataTable dt = dh.getFieldsDataByCondition("barcodeSet", new string[] { "bs_id ,bs_lenprid,bs_lennum,bs_maxnum" }, "bs_type='PACK'");
-                    if (dt.Rows.Count > 0)
-                    {
-                        code.Append(lpad(int.Parse(dt.Rows[0]["bs_lenprid"].ToString()), pr_id));// PR_ID物料ID的长度
-                        code.Append(lpad(int.Parse(dt.Rows[0]["bs_lennum"].ToString()), dt.Rows[0]["bs_maxnum"].ToString()));// 当前流水号
-                        dh.UpdateByCondition("barcodeSet", "bs_maxnum=bs_maxnum+1", "bs_type='PACK' and  bs_id=" + dt.Rows[0]["bs_id"]);// 流水号增加1
-                    }
-                    else BaseUtil.ShowError("未定义包装箱号产生规则或规则未审核");
-                //}
-                //else BaseUtil.ShowError("物料管控类型错误!该物料管控类型为不管控");
-            //}
-            return code.ToString();
+            string BoxCode="";
+            string[] param = new string[] { Caller, iMakeCode, iProdCode, iUserCode, BoxCode };
+            dh.CallProcedure("SP_GETPACKORPALLETCODE", ref param);
+            return param[4];
         }
     }
 }

+ 1 - 0
UAS-出货标签管理/UAS_出货标签管理.cs

@@ -1318,6 +1318,7 @@ namespace UAS_LabelMachine
                     CurrentCount = CurrentCount + 1;
                 }
                 pib_id_string.Append(pib_id_arr[CurrentCount]);
+                CurrentCount = CurrentCount + 1;
                 pib_id_string.Append(")");
                 if (i + 1 != fivehundred_count)
                     pib_id_string.Append(" or pib_id in ");