فهرست منبع

优化中箱装栈板功能物料卡控

callm 4 روز پیش
والد
کامیت
3dd0b29eaa

+ 9 - 5
UAS_MES_YDCY/FunctionCode/Make/Make_SNLabelCheckMidBox.cs

@@ -10,12 +10,11 @@ using UAS_MES_NEW.PublicForm;
 using Seagull.BarTender.Print;
 using System.Threading;
 using System.Text.RegularExpressions;
-using static HslCommunication.Profinet.Knx.KnxCode;
 using System.IO.Ports;
 using System.Runtime.InteropServices;
 using System.IO;
 using System.Text;
-using static System.Runtime.CompilerServices.RuntimeHelpers;
+using NPOI.SS.Formula.Functions;
 
 namespace UAS_MES_NEW.Make
 {
@@ -185,7 +184,7 @@ namespace UAS_MES_NEW.Make
                                     if (sql != "")
                                     {
                                         Regex ConnoteA = new Regex("{\\w+}");
-                                        foreach (Match mch in ConnoteA.Matches(sql))
+                                        foreach (System.Text.RegularExpressions.Match mch in ConnoteA.Matches(sql))
                                         {
                                             string x = mch.Value.Trim();
                                             sql = sql.Replace(x, "'" + sn_code.Text + "'");
@@ -295,7 +294,7 @@ namespace UAS_MES_NEW.Make
                                 {
                                     double pr_miderror = double.Parse(dh.getFieldDataByCondition("product", "nvl(pr_miderror,0)", "pr_code='" + ma_prodcode.Text + "'").ToString());
                                     double avgweight = double.Parse(dh.getFieldDataByCondition("makeserial", "sum(ms_midboxweight)/50", " ms_makecode='" + ma_code.Text + "'").ToString());
-                                    dh.ExecuteSql("update product set PR_MIDBOXMINWEIGHT=(" + avgweight + "-" + pr_miderror + "), PR_MIDBOXMAXWEIGHT=(" + avgweight + "+" + pr_miderror + ") where pr_code='"+ ma_prodcode .Text+ "'", "update");
+                                    dh.ExecuteSql("update product set PR_MIDBOXMINWEIGHT=(" + avgweight + "-" + pr_miderror + "), PR_MIDBOXMAXWEIGHT=(" + avgweight + "+" + pr_miderror + ") where pr_code='" + ma_prodcode.Text + "'", "update");
                                 }
                                 sql.Clear();
                                 sql.Append("insert into labelchecklog(LCL_ID, LCL_SN, LCL_LABELTYPE, lcl_prefix,lcl_length, LCL_LABELVALUE, LCL_STEPCODE, LCL_SOURCECODE," +
@@ -399,6 +398,11 @@ namespace UAS_MES_NEW.Make
                     OperateResult.AppendText("<<序列号:" + code.Text + "下一工序是" + stname + ",不是当前岗位的工序\n", Color.Red, code);
                     return;
                 }
+                if (!LogicHandler.CheckMaterial(sn_code.Text, out ErrorMessage))
+                {
+                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
+                    return;
+                }
                 //将录入框的值给序列号
                 sn_code.Text = code.Text;
                 code.Str = "";
@@ -420,7 +424,7 @@ namespace UAS_MES_NEW.Make
                     ms_firstsn = dt.Rows[0]["ms_firstsn"].ToString();
                     MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
                     MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
-                    pr_weight.Text = _minweight + "-"+ _maxweight;
+                    pr_weight.Text = _minweight + "-" + _maxweight;
                     BaseUtil.SetFormValue(this.Controls, dt);
                     LockMakeCode.Checked = true;
                     //勾选了前一工单

+ 5 - 0
UAS_MES_YDCY/FunctionCode/Make/Make_SNLabelCheckMidBoxNoWeight.cs

@@ -369,6 +369,11 @@ namespace UAS_MES_NEW.Make
                     OperateResult.AppendText("<<序列号:" + code.Text + "下一工序是" + stname + ",不是当前岗位的工序\n", Color.Red, code);
                     return;
                 }
+                if (!LogicHandler.CheckMaterial(sn_code.Text, out ErrorMessage))
+                {
+                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);
+                    return;
+                }
                 //将录入框的值给序列号
                 sn_code.Text = code.Text;
                 code.Str = "";

+ 6 - 0
UAS_MES_YDCY/FunctionCode/Packing/Packing_PackageCollectionPallet.cs

@@ -314,6 +314,12 @@ namespace UAS_MES_NEW.Packing
                             OperateResult.AppendText("当前序列号下一道工序" + nextstepcode + ",当前资源不允许采集\n", Color.Red);
                             return;
                         }
+                        string Err = "";
+                        if (!LogicHandler.CheckMaterial(sn_code.Text, out Err))
+                        {
+                            OperateResult.AppendText(">>" + Err + "\n", Color.Red);
+                            return;
+                        }
                         PR_CHECKCARTONW = dh.getFieldDataByCondition("craftdetail left join craft on cr_id=cd_crid left join makeserial on ms_craftcode =cr_code and cr_prodcode = ms_prodcode", "nvl(cd_ifweigh,'0') cd_ifweigh", "ms_sncode='" + sn_code.Text + "' and ms_makecode='" + oMakeCode + "' and cd_stepcode = '" + User.CurrentStepCode + "'").ToString();
                         //获取序列号信息
                         sql.Clear();