Browse Source

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

Hcsy 8 years ago
parent
commit
7f65858c1b

+ 24 - 16
UAS-MES/FunctionCode/Make/Make_BigBoxCollection.cs

@@ -339,20 +339,24 @@ namespace UAS_MES.Make
             {
                 if (dh.getFieldDataByCondition("package", "pa_mothercode", "pa_outboxcode='" + bigoutboxcode.Text + "'").ToString() == "")
                 {
-                    if (dh.getFieldDataByCondition("package", "pa_nextstep", "pa_mothercode='" + bigoutboxcode.Text + "'").ToString() != "")
-                        LogicHandler.OutBoxDrawStepPass(bigoutboxcode.Text, pa_makecode.Text, User.UserSourceCode);
-                    else
+                    string Delete = MessageBox.Show(this.ParentForm, "是否确认拆箱?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                    if (Delete == "Yes")
                     {
-                        List<string> SQLS = new List<string>();
-                        SQLS.Add("delete from packagedetail where pd_outboxcode='" + bigoutboxcode.Text + "'");
-                        SQLS.Add("update package set pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + bigoutboxcode.Text + "'");
-                        SQLS.Add("update package set pa_mothercode='' where pa_mothercode='" + bigoutboxcode.Text + "'");
-                        dh.ExecuteSQLTran(SQLS.ToArray());
+                        if (dh.getFieldDataByCondition("package", "pa_nextstep", "pa_mothercode='" + bigoutboxcode.Text + "'").ToString() != "")
+                            LogicHandler.OutBoxDrawStepPass(bigoutboxcode.Text, pa_makecode.Text, User.UserSourceCode);
+                        else
+                        {
+                            List<string> SQLS = new List<string>();
+                            SQLS.Add("delete from packagedetail where pd_outboxcode='" + bigoutboxcode.Text + "'");
+                            SQLS.Add("update package set pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + bigoutboxcode.Text + "'");
+                            SQLS.Add("update package set pa_mothercode='' where pa_mothercode='" + bigoutboxcode.Text + "'");
+                            dh.ExecuteSQLTran(SQLS.ToArray());
+                        }
+                        //将子箱的母箱编号置成空
+                        OperateResult.AppendText(">>箱号" + bigoutboxcode.Text + "解除成功\n", Color.Green);
+                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱采集", "解除大箱" + bigoutboxcode.Text + "成功", bigoutboxcode.Text, "");
+                        palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
                     }
-                    //将子箱的母箱编号置成空
-                    OperateResult.AppendText(">>箱号" + bigoutboxcode.Text + "解除成功\n", Color.Green);
-                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱采集", "解除大箱" + bigoutboxcode.Text + "成功", bigoutboxcode.Text, "");
-                    palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
                 }
                 else OperateResult.AppendText(">>箱号" + bigoutboxcode.Text + "已装箱,不能取消解除装箱\n", Color.Red);
             }
@@ -376,10 +380,14 @@ namespace UAS_MES.Make
                 {
                     if (dt.Rows[0]["pa_status"].ToString() == "0")
                     {
-                        OperateResult.AppendText(">>大箱号" + bigoutboxcode.Text + "装大箱成功\n", Color.Green);
-                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱采集", "装箱" + bigoutboxcode.Text + "成功", outboxcode.Text, "");
-                        dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + bigoutboxcode.Text + "'", "update");
-                        pa_status.Text = "1";
+                        string Seal = MessageBox.Show(this.ParentForm, "是否确认封箱?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                        if (Seal == "Yes")
+                        {
+                            OperateResult.AppendText(">>大箱号" + bigoutboxcode.Text + "装大箱成功\n", Color.Green);
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱采集", "装箱" + bigoutboxcode.Text + "成功", outboxcode.Text, "");
+                            dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + bigoutboxcode.Text + "'", "update");
+                            pa_status.Text = "1";
+                        }
                     }
                     else OperateResult.AppendText(">>大箱号" + bigoutboxcode.Text + "已封大箱\n", Color.Red);
                 }

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

@@ -140,8 +140,13 @@ namespace UAS_MES.Make
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || dh.CheckExist("makeserial", "ms_sncode='" + sn_code.Text + "' and ms_status=2"))
+                    dt = (DataTable)dh.ExecuteSql("select ms_id from makeserial where ms_sncode ='" + sn_code.Text + "' and ms_status=2 order by ms_id desc", "select");
+                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0))
                     {
+                        if (oMsID == "" || oMsID == "null")
+                        {
+                            oMsID = dt.Rows[0]["ms_id"].ToString();
+                        }
                         //获取序列号信息
                         sql.Clear();
                         sql.Append("select pr_code,ms_makecode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,");

+ 6 - 1
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -217,8 +217,13 @@ namespace UAS_MES.Make
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || dh.CheckExist("makeserial", "ms_sncode='" + sn_code.Text + "' and ms_status=2"))
+                    dt = (DataTable)dh.ExecuteSql("select ms_id from makeserial where ms_sncode ='" + sn_code.Text + "' and ms_status=2 order by ms_id desc", "select");
+                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0))
                     {
+                        if (oMsID == "" || oMsID == "null")
+                        {
+                            oMsID = dt.Rows[0]["ms_id"].ToString();
+                        }
                         sql.Clear();
                         sql.Append("select ms_makecode,pr_code,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,");
                         sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");

+ 24 - 16
UAS-MES/FunctionCode/Make/Make_PalletCollection.cs

@@ -301,20 +301,24 @@ namespace UAS_MES.Make
         {
             if (dh.getRowCount("packagedetail", "pd_outboxcode='" + palletcode.Text + "'") > 0)
             {
-                //如果含有下一执行步骤的撤销过站,否则直接删除
-                if (dh.getFieldDataByCondition("package", "pa_nextstep", "pa_mothercode='" + palletcode.Text + "'").ToString() != "")
-                    LogicHandler.OutBoxDrawStepPass(palletcode.Text, pa_makecode.Text, User.UserSourceCode);
-                else
+                string Delete = MessageBox.Show(this.ParentForm, "是否确认拆栈板?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                if (Delete == "Yes")
                 {
-                    List<string> SQLS = new List<string>();
-                    SQLS.Add("delete from packagedetail where pd_outboxcode='" + palletcode.Text + "'");
-                    SQLS.Add("update package set pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + palletcode.Text + "'");
-                    SQLS.Add("update package set pa_mothercode='' where pa_mothercode='" + palletcode.Text + "'");
-                    dh.ExecuteSQLTran(SQLS.ToArray());
+                    //如果含有下一执行步骤的撤销过站,否则直接删除
+                    if (dh.getFieldDataByCondition("package", "pa_nextstep", "pa_mothercode='" + palletcode.Text + "'").ToString() != "")
+                        LogicHandler.OutBoxDrawStepPass(palletcode.Text, pa_makecode.Text, User.UserSourceCode);
+                    else
+                    {
+                        List<string> SQLS = new List<string>();
+                        SQLS.Add("delete from packagedetail where pd_outboxcode='" + palletcode.Text + "'");
+                        SQLS.Add("update package set pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + palletcode.Text + "'");
+                        SQLS.Add("update package set pa_mothercode='' where pa_mothercode='" + palletcode.Text + "'");
+                        dh.ExecuteSQLTran(SQLS.ToArray());
+                    }
+                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "栈板采集", "解除栈板" + palletcode.Text + "成功", palletcode.Text, "");
+                    OperateResult.AppendText(">>栈板号" + palletcode.Text + "解除成功\n", Color.Green);
+                    palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
                 }
-                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "栈板采集", "解除栈板" + palletcode.Text + "成功", palletcode.Text, "");
-                OperateResult.AppendText(">>栈板号" + palletcode.Text + "解除成功\n", Color.Green);
-                palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
             }
             else OperateResult.AppendText(">>栈板号" + palletcode.Text + "未采集箱\n", Color.Red);
         }
@@ -336,10 +340,14 @@ namespace UAS_MES.Make
                 {
                     if (dt.Rows[0]["pa_status"].ToString() == "0")
                     {
-                        OperateResult.AppendText(">>栈板号" + palletcode.Text + "装栈板成功\n", Color.Green);
-                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "栈板采集", "装栈板" + palletcode.Text + "成功", outboxcode.Text, "");
-                        dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + palletcode.Text + "'", "update");
-                        pa_status.Text = "1";
+                        string Seal = MessageBox.Show(this.ParentForm, "是否确认封栈板?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                        if (Seal == "Yes")
+                        {
+                            OperateResult.AppendText(">>栈板号" + palletcode.Text + "装栈板成功\n", Color.Green);
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "栈板采集", "装栈板" + palletcode.Text + "成功", outboxcode.Text, "");
+                            dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + palletcode.Text + "'", "update");
+                            pa_status.Text = "1";
+                        }
                     }
                     else OperateResult.AppendText(">>栈板号" + palletcode.Text + "已封栈板\n", Color.Red);
                 }

+ 6 - 1
UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.cs

@@ -222,8 +222,13 @@ namespace UAS_MES.Make
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || dh.CheckExist("makeserial", "ms_sncode='" + sn_code.Text + "' and ms_status=2"))
+                    dt = (DataTable)dh.ExecuteSql("select ms_id from makeserial where ms_sncode ='" + sn_code.Text + "' and ms_status=2 order by ms_id desc", "select");
+                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || dt.Rows.Count > 0)
                     {
+                        if (oMsID == "" || oMsID == "null")
+                        {
+                            oMsID = dt.Rows[0]["ms_id"].ToString();
+                        }
                         if (pa_outboxcode.Text == "")
                         {
                             LoadData();

+ 1 - 1
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -20,7 +20,7 @@ namespace UAS_MES.OQC
 
         List<DataGridViewRow> dgvr = new List<DataGridViewRow>();
         LogStringBuilder sql = new LogStringBuilder();
-        string[] LevelDefect = new string[] { "A#A", "B#B", "C#C", "D#D" };
+        string[] LevelDefect = new string[] { "CR#CR", "MI#MI", "MA#MA" };
 
         string ifrework = "";
 

+ 1 - 1
UAS-MES/PublicMethod/Print.cs

@@ -4,8 +4,8 @@ using System.Data;
 using System.Text;
 using System.IO;
 using UAS_MES.Entity;
-using System.Windows;
 using System.Text.RegularExpressions;
+using System.Windows.Forms;
 
 namespace UAS_MES.PublicMethod
 {