Selaa lähdekoodia

Merge remote-tracking branch 'refs/remotes/origin/master'

章政 8 vuotta sitten
vanhempi
commit
474f4511c7

+ 7 - 2
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.cs

@@ -193,11 +193,16 @@ namespace UAS_MES.Make
                             dh.UpdateByCondition("makeserial", "ms_mac = '" + sncode.Text + "' ," + "ms_bt = '" + ms_bt + "'", "ms_id = '" + oMsID + "'");
                             ErrorMessage = "BT/MAC采集完成,执行更新";
                             OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                            sql.Clear();
+                            sql.Append("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
+                            sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + ms_makecode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            BaseUtil.SetFormValue(Controls, dt);
                             printcount++;
-                            BaseUtil.CleanForm(this);
                             mcd_okqty.Text = printcount + "";
-                            mcd_remainqty.Text = 0 + "";
                             isMAC = false;
+                            sncode.Text = "";
+                            sncode.Focus();
                         }
                         else
                         {

+ 8 - 2
UAS-MES/FunctionCode/Make/Make_CollectNetCode.Designer.cs

@@ -111,9 +111,11 @@
             // ms_makecode
             // 
             this.ms_makecode.AutoSize = true;
+            this.ms_makecode.CutLength = null;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(94, 22);
+            this.ms_makecode.Location = new System.Drawing.Point(92, 22);
             this.ms_makecode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.ms_makecode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ms_makecode.Name = "ms_makecode";
             this.ms_makecode.Size = new System.Drawing.Size(0, 21);
             this.ms_makecode.TabIndex = 198;
@@ -141,8 +143,10 @@
             // ma_prodcode
             // 
             this.ma_prodcode.AutoSize = true;
+            this.ma_prodcode.CutLength = null;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode.Location = new System.Drawing.Point(318, 26);
+            this.ma_prodcode.Location = new System.Drawing.Point(318, 22);
+            this.ma_prodcode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ma_prodcode.Name = "ma_prodcode";
             this.ma_prodcode.Size = new System.Drawing.Size(0, 21);
             this.ma_prodcode.TabIndex = 193;
@@ -150,8 +154,10 @@
             // pr_detail
             // 
             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(541, 22);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(200, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 21);
             this.pr_detail.TabIndex = 192;

+ 8 - 2
UAS-MES/FunctionCode/Make/Make_CollectNetCode.cs

@@ -127,11 +127,16 @@ namespace UAS_MES.Make
                             dh.UpdateByCondition("makeserial", "ms_netcode = '" + sncode.Text + "'", "ms_id = '" + oMsID + "'");
                             ErrorMessage = "网标采集完成,执行更新";
                             OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
-                            BaseUtil.CleanForm(this);
+                            sql.Clear();
+                            sql.Append("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
+                            sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + ms_makecode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            BaseUtil.SetFormValue(Controls, dt);
                             printcount++;
                             mcd_okqty.Text = printcount + "";
-                            mcd_remainqty.Text = 0 + "";
                             isnetcode = false;
+                            sncode.Text = "";
+                            sncode.Focus();
                         }
                         else
                         {
@@ -159,6 +164,7 @@ namespace UAS_MES.Make
             if (isnetcode)
             {
                 BaseUtil.CleanForm(this);
+                mcd_okqty.Text = printcount + "";
                 mcd_remainqty.Text = 0 + "";
                 OperateResult.AppendText(">>清除完成,清重新输入SN号\n", Color.Green);
                 isnetcode = false;

+ 3 - 1
UAS-MES/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.Designer.cs

@@ -273,7 +273,7 @@
             this.pr_code2.Str1 = null;
             this.pr_code2.Str2 = null;
             this.pr_code2.TabIndex = 206;
-            this.pr_code2.Tag = "pr_code";
+            this.pr_code2.Tag = "pr_code2";
             // 
             // Save
             // 
@@ -320,6 +320,7 @@
             this.la_code.Location = new System.Drawing.Point(111, 482);
             this.la_code.Name = "la_code";
             this.la_code.Power = null;
+            this.la_code.ReturnData = null;
             this.la_code.SelectField = null;
             this.la_code.SetValueField = null;
             this.la_code.Size = new System.Drawing.Size(161, 21);
@@ -504,6 +505,7 @@
             this.pr_code.Location = new System.Drawing.Point(674, 479);
             this.pr_code.Name = "pr_code";
             this.pr_code.Power = null;
+            this.pr_code.ReturnData = null;
             this.pr_code.SelectField = null;
             this.pr_code.SetValueField = null;
             this.pr_code.Size = new System.Drawing.Size(150, 21);

+ 17 - 0
UAS-MES/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.cs

@@ -489,6 +489,7 @@ namespace UAS_MES.SystemSetting
         private void Delete_Click(object sender, EventArgs e)
         {
             string[] deleteid = new string[LabelDataGridView.RowCount];
+            string[] deletelabname = new string[LabelDataGridView.RowCount];
             for (int i = 0; i < LabelDataGridView.RowCount; i++)
             {
                 if (LabelDataGridView.Rows[i].Cells["Choose"].Value != null)
@@ -498,11 +499,27 @@ namespace UAS_MES.SystemSetting
                         if ((bool)LabelDataGridView.Rows[i].Cells["Choose"].Value == true)
                         {
                             deleteid[i] = LabelDataGridView.Rows[i].Cells["pl_id"].Value.ToString();
+                            deletelabname[i] = LabelDataGridView.Rows[i].Cells["pl_labelname"].Value.ToString();
                         }
                     }
                 }
             }
             dh.DeleteDataByID("productlabel", "pl_id", deleteid);
+            ftpOperater ftp = new ftpOperater();
+            for (int i = 0; i < deletelabname.Length; i++)
+            {
+                if (deletelabname[i] != null)
+                {
+                    sql.Clear();
+                    sql.Append("select pl_labelname from productlabel left join product on pl_prodcode=pr_code left join label on pl_labelcode=la_code where pl_labelname = '" + deletelabname[i] + "'");
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    if (dt.Rows.Count == 0)
+                    {
+                        ftp.Delete(deletelabname[i]);
+                    }
+                }
+            }
+            sql.Clear();
             LoadData();
         }
     }