Browse Source

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

Hcsy 8 years ago
parent
commit
9c165c57b9

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

@@ -299,7 +299,7 @@ namespace UAS_MES.Make
                             //已存在,错误
                             //已存在,错误
                             if (checkExist(container.ToString().Substring(4))) {
                             if (checkExist(container.ToString().Substring(4))) {
                                 flag = false;
                                 flag = false;
-                                OperateResult.AppendText(">>请重新输入TSN,重新转换\n", Color.Green);
+                                OperateResult.AppendText(">>部分信息已存在,请重新输入TSN,重新转换\n", Color.Green);
                                 //清空信息
                                 //清空信息
                                 clearInfo();
                                 clearInfo();
                             }
                             }
@@ -312,14 +312,14 @@ namespace UAS_MES.Make
                             //已存在
                             //已存在
                             if (checkExist(logsql.GetString())){
                             if (checkExist(logsql.GetString())){
                                 flag = false;
                                 flag = false;
-                                OperateResult.AppendText(">>请重新输入TSN,重新转换\n", Color.Green);
+                                OperateResult.AppendText(">>部分信息已存在,请重新输入TSN,重新转换\n", Color.Green);
                                 //清空信息
                                 //清空信息
                                 clearInfo();
                                 clearInfo();
                             }
                             }
                         }
                         }
 
 
                         //根据flag判断关联采集信息二次校验结果
                         //根据flag判断关联采集信息二次校验结果
-                        if (flag=true) {
+                        if (flag==true) {
                             //说明SN和关联采集信息二次校验通过,则进行转换和采集信息绑定
                             //说明SN和关联采集信息二次校验通过,则进行转换和采集信息绑定
                             //查询ms_firstsn
                             //查询ms_firstsn
                             string firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_sncode='" + TSN + "'").ToString();
                             string firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_sncode='" + TSN + "'").ToString();

+ 29 - 6
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -47,6 +47,8 @@ namespace UAS_MES.Make
         /// </summary>
         /// </summary>
         List<string> WaitList = new List<string>();
         List<string> WaitList = new List<string>();
 
 
+        bool AutoCut = false;
+
         public Make_TestCollection()
         public Make_TestCollection()
         {
         {
             InitializeComponent();
             InitializeComponent();
@@ -483,23 +485,35 @@ namespace UAS_MES.Make
             string condition = "";
             string condition = "";
             int nowcheckqty = int.Parse(ob_nowcheckqty.Text == "" ? "0" : ob_nowcheckqty.Text);
             int nowcheckqty = int.Parse(ob_nowcheckqty.Text == "" ? "0" : ob_nowcheckqty.Text);
             int batchqty = int.Parse(ob_batchqty.Text == "" ? "0" : ob_batchqty.Text);
             int batchqty = int.Parse(ob_batchqty.Text == "" ? "0" : ob_batchqty.Text);
-            if (nowcheckqty + 1 == batchqty)
+            if (nowcheckqty + 1 == batchqty && AutoCut)
             {
             {
                 condition = "and ob_status='UNCHECK' and ob_checkno='" + ob_checkno.Text + "'";
                 condition = "and ob_status='UNCHECK' and ob_checkno='" + ob_checkno.Text + "'";
             }
             }
             else
             else
             {
             {
-                if (nowcheckqty > batchqty)
-                {
-                    OperateResult.AppendText(">>已采集批数已超过抽检批数\n", Color.Red);
-                }
                 condition = "and ob_status='ENTERING' ";
                 condition = "and ob_status='ENTERING' ";
             }
             }
             sql.Append("select ob_batchqty,ob_nowcheckqty,ob_checkno from oqcbatch where ");
             sql.Append("select ob_batchqty,ob_nowcheckqty,ob_checkno from oqcbatch where ");
             sql.Append("ob_linecode='" + User.UserLineCode + "' and ob_prodcode='" + ma_prodcode.Text + "' and ");
             sql.Append("ob_linecode='" + User.UserLineCode + "' and ob_prodcode='" + ma_prodcode.Text + "' and ");
             sql.Append("ob_stepcode='" + User.CurrentStepCode + "' " + condition);
             sql.Append("ob_stepcode='" + User.CurrentStepCode + "' " + condition);
             DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-            BaseUtil.SetFormValue(this.Controls, dt);
+            if (dt.Rows.Count > 0)
+            {
+                BaseUtil.SetFormValue(this.Controls, dt);
+                nowcheckqty = int.Parse(ob_nowcheckqty.Text == "" ? "0" : ob_nowcheckqty.Text);
+                batchqty = int.Parse(ob_batchqty.Text == "" ? "0" : ob_batchqty.Text);
+                if (nowcheckqty > batchqty)
+                {
+                    OperateResult.AppendText(">>已采集批数已超过抽检批数\n", Color.Red);
+                }
+            }
+            else
+            {
+                ob_batchqty.Text = "";
+                ob_nowcheckqty.Text = "";
+                ob_checkno.Text = "";
+                SendCheck.Enabled = false;
+            }
             if (ob_batchqty.Text != "")
             if (ob_batchqty.Text != "")
             {
             {
                 SendCheck.Enabled = true;
                 SendCheck.Enabled = true;
@@ -545,6 +559,15 @@ namespace UAS_MES.Make
         {
         {
             if (ob_checkno.Text != "")
             if (ob_checkno.Text != "")
             {
             {
+                string Cut = dh.getFieldDataByCondition("product left join oqcbatch on ob_prodcode=pr_code", "pr_ifautocutcheckno", "ob_checkno='" + ob_checkno.Text + "'").ToString();
+                if (Cut == "" || Cut == "0")
+                {
+                    AutoCut = false;
+                }
+                else
+                {
+                    AutoCut = true;
+                }
                 SendCheck.Enabled = true;
                 SendCheck.Enabled = true;
             }
             }
         }
         }