Browse Source

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

章政 7 năm trước cách đây
mục cha
commit
42dd161090

+ 2 - 2
UAS-MES/FunctionCode/Query/Query_ExeProgress.cs

@@ -86,7 +86,7 @@ namespace UAS_MES.Query
                 {
                     ms_ids.Append("'"+ms_id.Rows[i]["ms_id"].ToString()+"',");
                 }
-                ListA = (DataTable)dh.ExecuteSql("select ms_beforesn,ms_sncode,ms_makecode from makeserial where ms_id in ("+ms_ids.ToString().Substring(0,ms_ids.ToString().Length-1)+")","select");
+                ListA = (DataTable)dh.ExecuteSql("select ms_beforesn,ms_sncode,ms_firstsn,ms_makecode from makeserial where ms_id in (" + ms_ids.ToString().Substring(0,ms_ids.ToString().Length-1)+")","select");
                 dt = (DataTable)dh.ExecuteSql("select ms_status,ms_nextstepcode,ms_paststep,ms_stepcode,NVL(ms_ifrework, 0) ms_ifrework,NVL(ms_reworkstatus, 0) ms_reworkstatus from makeserial where ms_id in (" + ms_ids.ToString().Substring(0, ms_ids.ToString().Length - 1) + ") order by ms_id", "select");
                 if (dt.Rows.Count > 0)
                 {
@@ -278,7 +278,7 @@ namespace UAS_MES.Query
                     for (int i=0;i<ListA.Rows.Count;i++)
                     {
                         //sql  mp_sncode
-                        mp_sncodes.Append("'" + ListA.Rows[i]["ms_sncode"].ToString() + "',"+(ListA.Rows[i]["ms_beforesn"].ToString()==""?"":(" '"+ListA.Rows[i]["ms_beforesn"].ToString()+"',")));
+                        mp_sncodes.Append("'" + ListA.Rows[i]["ms_sncode"].ToString() + "',"+(ListA.Rows[i]["ms_firstsn"].ToString()==""?"":(" '"+ListA.Rows[i]["ms_firstsn"].ToString()+"',")));
                         //sql ma_code
                         makecodes.Append("'"+ListA.Rows[i]["ms_makecode"].ToString()+"',");
                     }

+ 7 - 4
UAS_MES_NEW/FunctionCode/Make/Make_SpecialCartonPack.cs

@@ -29,6 +29,7 @@ namespace UAS_MES_NEW.Make
         string oMsID = "";
         string ActWeigh;
         string oMsStatus = "";
+        Regex re = new Regex("\\d+.\\d+\\w+");
 
         //称量的标准重量
         double Weight;
@@ -115,7 +116,7 @@ namespace UAS_MES_NEW.Make
                         {
                             try
                             {
-                                weight.Text = serialPort1.ReadLine();
+                                weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value;
                                 ActWeigh = weight.Text.Replace("kg", "").Trim();
                             }
                             catch (Exception)
@@ -330,8 +331,8 @@ namespace UAS_MES_NEW.Make
                                     if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == int.Parse(pr_outboxinnerqty.Text))
                                     {
                                         ActWeigh = weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Trim();
-                                        float weigh = float.Parse(ActWeigh);
-                                        dh.UpdateByCondition("package", "pa_status=1,pa_packageqty=pa_currentqty,pa_weight='" + weight.Text + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                        float weighA = float.Parse(ActWeigh);
+                                        dh.UpdateByCondition("package", "pa_status=1,pa_packageqty=pa_currentqty,pa_weight='" + weighA + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                                         pa_standardqty.Text = "";
                                         pa_status.Text = "1";
                                         OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "满箱封箱成功\n", Color.Green);
@@ -410,8 +411,10 @@ namespace UAS_MES_NEW.Make
                 string Seal = MessageBox.Show(this.ParentForm, "是否确认封箱?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
                 if (Seal == "Yes")
                 {
+                    ActWeigh = weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Trim();
+                    float weigh = float.Parse(ActWeigh);
                     OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "采集完成,手动封箱成功\n", Color.Green);
-                    dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                    dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty,pa_weight=" + weigh + "", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                     pa_status.Text = "1";
                     pa_standardqty.Text = "";
                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "装箱采集", "封箱成功", pa_outboxcode.Text, "");

+ 2 - 2
UAS_MES_NEW/FunctionCode/Query/Query_ExeProgress.cs

@@ -86,7 +86,7 @@ namespace UAS_MES_NEW.Query
                 {
                     ms_ids.Append("'"+ms_id.Rows[i]["ms_id"].ToString()+"',");
                 }
-                ListA = (DataTable)dh.ExecuteSql("select ms_beforesn,ms_sncode,ms_makecode from makeserial where ms_id in ("+ms_ids.ToString().Substring(0,ms_ids.ToString().Length-1)+")","select");
+                ListA = (DataTable)dh.ExecuteSql("select ms_beforesn,ms_firstsn,ms_sncode,ms_makecode from makeserial where ms_id in (" + ms_ids.ToString().Substring(0,ms_ids.ToString().Length-1)+")","select");
                 dt = (DataTable)dh.ExecuteSql("select ms_status,ms_nextstepcode,ms_paststep,ms_stepcode,NVL(ms_ifrework, 0) ms_ifrework,NVL(ms_reworkstatus, 0) ms_reworkstatus from makeserial where ms_id in (" + ms_ids.ToString().Substring(0, ms_ids.ToString().Length - 1) + ") order by ms_id", "select");
                 if (dt.Rows.Count > 0)
                 {
@@ -278,7 +278,7 @@ namespace UAS_MES_NEW.Query
                     for (int i=0;i<ListA.Rows.Count;i++)
                     {
                         //sql  mp_sncode
-                        mp_sncodes.Append("'" + ListA.Rows[i]["ms_sncode"].ToString() + "',"+(ListA.Rows[i]["ms_beforesn"].ToString()==""?"":(" '"+ListA.Rows[i]["ms_beforesn"].ToString()+"',")));
+                        mp_sncodes.Append("'" + ListA.Rows[i]["ms_sncode"].ToString() + "',"+(ListA.Rows[i]["ms_firstsn"].ToString()==""?"":(" '"+ListA.Rows[i]["ms_firstsn"].ToString()+"',")));
                         //sql ma_code
                         makecodes.Append("'"+ListA.Rows[i]["ms_makecode"].ToString()+"',");
                     }