Bläddra i källkod

拆箱代码BUG修改

章政 8 år sedan
förälder
incheckning
67df8e9278

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

@@ -98,7 +98,10 @@ namespace UAS_MES.Make
             {
                 //记录该数据保证在修改不被允许的前提下能偶回复之前的值
                 StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
-                //ms_salecode.Text = dt.Rows[0]["pa_salecode"].ToString();
+                if (dt.Rows[0]["pa_salecode"].ToString() != "")
+                {
+                    ms_salecode.Text = dt.Rows[0]["pa_salecode"].ToString();
+                }
                 BaseUtil.SetFormValue(this.Controls, dt);
                 if (pa_standardqty.Text != "0")
                 {
@@ -659,8 +662,8 @@ namespace UAS_MES.Make
                                     if (pa_checkno != "")
                                     {
                                         SQLS1.Add("update makeserial set ms_checkno='' where ms_sncode='" + ms_sncode + "' and ms_makecode='" + ma_code + "'");
-                                        SQLS1.Add("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-1 where ob_checkno='" + pa_checkno + "'");
-                                        SQLS1.Add("delete from oqcbatchdetail where obd_checkno='" + pa_checkno + "' and obd_sncode='" + ms_sncode + "'");
+                                        SQLS1.Add("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-(select count(1) from oqcbatchdetail where obd_outboxcode='" + pa_outboxcode.Text + "') where ob_checkno='" + pa_checkno + "'");
+                                        SQLS1.Add("delete from oqcbatchdetail where obd_outboxcode='"+pa_outboxcode.Text+"'");
                                     }
                                     dh.ExecuteSQLTran(SQLS1.ToArray());
                                 }

+ 4 - 4
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.Designer.cs

@@ -1278,13 +1278,13 @@
             this.Load += new System.EventHandler(this.Make_PackageCollectionWeigh_Load);
             this.SizeChanged += new System.EventHandler(this.Make_PackageCollectionWeigh_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).EndInit();
-            this.groupBoxWithBorder1.ResumeLayout(false);
+            this.groupBoxWithBorder1.ResumeLayout(true);
             this.groupBoxWithBorder1.PerformLayout();
-            this.groupBoxWithBorder2.ResumeLayout(false);
+            this.groupBoxWithBorder2.ResumeLayout(true);
             this.groupBoxWithBorder2.PerformLayout();
-            this.groupBoxWithBorder3.ResumeLayout(false);
+            this.groupBoxWithBorder3.ResumeLayout(true);
             this.groupBoxWithBorder3.PerformLayout();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

+ 8 - 4
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -86,7 +86,7 @@ namespace UAS_MES.Make
             try
             {
                 OutBoxLength.Text = BaseUtil.GetCacheData("OutBoxLength").ToString();
-                PreFix.Text= BaseUtil.GetCacheData("PreFix").ToString();
+                PreFix.Text = BaseUtil.GetCacheData("PreFix").ToString();
             }
             catch (Exception) { }
             thread = new Thread(getSerialData);
@@ -172,6 +172,10 @@ namespace UAS_MES.Make
                 string _maxweight = dt.Rows[0]["pr_cartonmaxw"].ToString();
                 string _minweight = dt.Rows[0]["pr_cartonminw"].ToString();
                 PR_CHECKCARTONW = dt.Rows[0]["PR_CHECKCARTONW"].ToString();
+                if (dt.Rows[0]["pa_salecode"].ToString() != "")
+                {
+                    ms_salecode.Text = dt.Rows[0]["pa_salecode"].ToString();
+                }
                 if (PR_CHECKCARTONW != "0")
                     checkweightlabel.Text = "需要检测重量";
                 else
@@ -460,7 +464,7 @@ namespace UAS_MES.Make
                         {
                             if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
                             {
-                                dh.UpdateByCondition("makeserial", "ms_outboxcode=''", "ms_id='"+oMsID+"'");
+                                dh.UpdateByCondition("makeserial", "ms_outboxcode=''", "ms_id='" + oMsID + "'");
                                 dh.ExecuteSql("update packagedetail set pd_innerqty=(select pa_packageqty from package where pa_outboxcode='" + pa_outboxcode.Text + "') where pd_innerboxcode='" + pa_outboxcode.Text + "'", "update");
                                 //如果母箱号不为空,需要更新总数
                                 if (MotherBoxCode != "")
@@ -730,8 +734,8 @@ namespace UAS_MES.Make
                                     if (pa_checkno != "")
                                     {
                                         SQLS1.Add("update makeserial set ms_checkno='' where ms_sncode='" + ms_sncode + "' and ms_makecode='" + ma_code + "'");
-                                        SQLS1.Add("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-1 where ob_checkno='" + pa_checkno + "'");
-                                        SQLS1.Add("delete from oqcbatchdetail where obd_checkno='" + pa_checkno + "' and obd_sncode='" + ms_sncode + "'");
+                                        SQLS1.Add("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-(select count(1) from oqcbatchdetail where obd_outboxcode='" + pa_outboxcode.Text + "') where ob_checkno='" + pa_checkno + "'");
+                                        SQLS1.Add("delete from oqcbatchdetail where obd_outboxcode='" + pa_outboxcode.Text + "'");
                                     }
                                     dh.ExecuteSQLTran(SQLS1.ToArray());
                                 }