瀏覽代碼

标签核对提示语修改,转号加合同防呆

shim 8 年之前
父節點
當前提交
3a1be17e86
共有 2 個文件被更改,包括 18 次插入2 次删除
  1. 2 2
      UAS-MES/FunctionCode/Make/Make_LabelCheck.cs
  2. 16 0
      UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_LabelCheck.cs

@@ -229,14 +229,14 @@ namespace UAS_MES.Make
             {
                 //从makeserial表中查询对应字段的值
                 needCheckedInfo = dh.getFieldDataByCondition("makeserial","ms_"+ checkItemInfo.Rows[index]["checkitem"].ToString(),"ms_id ='"+ dt.Rows[0]["ms_id"].ToString() + "'").ToString();
-                OperateResult.AppendText("<<序列号" + SN + "对应的"+ checkItemInfo.Rows[index]["checkitem"].ToString() + "为:" + needCheckedInfo + "\n", Color.Green);
+                OperateResult.AppendText("<<序列号" + SN + "对应的"+ checkItemInfo.Rows[index]["checkitem"].ToString() + "为" + needCheckedInfo + "\n", Color.Green);
                 OperateResult.AppendText(">>请采集"+ checkItemInfo.Rows[index]["checkitem"].ToString() + "\n", Color.Black, sncode);
             }
             else//为上料信息
             {
                 //从craftmaterial中查询上料记录
                 needCheckedInfo = dh.getFieldDataByCondition("craftmaterial", "cm_barcode", "cm_makecode='"+ dt.Rows[0]["ms_makecode"].ToString() + "' and cm_sncode in ('"+SN+"'"+(TSN==""?"":(",'"+TSN+"'"))+") and cm_fsoncode='"+checkItemInfo.Rows[index]["fsoncode"].ToString()+"' and cm_status=0").ToString();
-                OperateResult.AppendText("<<序列号" + SN + "上料物料:"+ checkItemInfo.Rows[index]["checkitem"].ToString() + "的条码号为:" + needCheckedInfo + "\n", Color.Green);
+                OperateResult.AppendText("<<序列号" + SN + "上料物料"+ checkItemInfo.Rows[index]["checkitem"].ToString() + "的条码号为" + needCheckedInfo + "\n", Color.Green);
                 OperateResult.AppendText(">>请采集物料"+ checkItemInfo.Rows[index]["checkitem"].ToString() + "条码\n", Color.Black, sncode);
             }
         }

+ 16 - 0
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -55,6 +55,8 @@ namespace UAS_MES.Make
         string oMsid = "";
         bool onlyPass = false;
 
+        DataTable macRange;//记录macBT范围
+
         StringBuilder insertSninfoFields;//存插入sninfo的字段
 
         StringBuilder insertSninfoValues;//存插入sninfo的值
@@ -416,6 +418,20 @@ namespace UAS_MES.Make
                     break;
                 case "BT":
                 case "MAC":
+                    //验证是否符合合同防呆
+                    sql.Clear();
+                    sql.Append("select sr_startcode,sr_endcode from SaleMacBTRange where sr_sacode = '" + dh.getFieldDataByCondition("makeserial", "ms_salecode","ms_id='"+oMsid+"'") + "' and sr_type = '" + type + "'");
+                    macRange = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    if (macRange.Rows.Count > 0)
+                    {
+                        if (!(macRange.Rows[0]["sr_startcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(macOrBt) <= 0 && macRange.Rows[0]["sr_endcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(macOrBt) >= 0))
+                        {
+                            OperateResult.AppendText(">>" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误,不在合同防呆范围内\n", Color.Red);
+                            OperateResult.AppendText(">>请输入" + ListA.Rows[step - 2]["psr_type"].ToString() + "\n", Color.Black, code);
+                            return false;
+                        }
+                    }
+                    //验证是否已被使用
                     if (!ChangeResult.Checked && checkExist("ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  MS_" + type + "='" + macOrBt + "'")
                         || ChangeResult.Checked && checkExist("ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  MS_" + type + "='" + macOrBt + "' and ms_id <> '" + oMsid + "'"))
                     {