Browse Source

修改截取比例限制

callm 1 week ago
parent
commit
e74b3ed3ae
1 changed files with 2 additions and 2 deletions
  1. 2 2
      UAS_MES_YDCY/PublicMethod/LogicHandler.cs

+ 2 - 2
UAS_MES_YDCY/PublicMethod/LogicHandler.cs

@@ -1354,10 +1354,10 @@ namespace UAS_MES_NEW.PublicMethod
                             {
                                 double precent = double.Parse(kind[i].Split('#')[1]);
                                 string subfix = (kind[i].Split('#')[0]);
-                                if (iSN.Substring(iSN.Length - 1) == subfix)
+                                if (iSN.Substring(iSN.Length - subfix.Length) == subfix)
                                 {
                                     double total = ma_qty * precent;
-                                    int count = dh.getRowCount("craftmaterial", "cm_makecode='" + iMakeCode + "' and cm_fsoncode='" + iFSonCode + "' and cm_status=0 and substr(cm_barcode,-1)='" + subfix + "'");
+                                    int count = dh.getRowCount("craftmaterial", "cm_makecode='" + iMakeCode + "' and cm_fsoncode='" + iFSonCode + "' and cm_status=0 and substr(cm_barcode,-" + subfix.Length + ")='" + subfix + "'");
                                     if (count >= total)
                                     {
                                         ErrMessage = "条码" + iSN + "比例不允许超过工单设置比例,已上料" + count + "工单设置数量" + total;