Browse Source

修改上料提示

章政 8 years ago
parent
commit
6ee00cafa7

+ 14 - 12
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -130,23 +130,25 @@ namespace UAS_MES.Make
                                 code.Text = "";
                             }
                             sql.Clear();
-                            sql.Append("select sp_id,sp_tracekind,sp_barcoderule,sp_ifuseregex,sp_ifforsn,sp_length,sp_soncode,sp_repcode");
-                            sql.Append(",pr_id,sp_type,sp_prefix,sp_regex,sp_fsoncode from stepproduct left join product on pr_code=sp_soncode where ");
-                            sql.Append("sp_bomversion='" + ma_bomversion.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode + "'");
-                            sql.Append("And sp_mothercode ='" + pr_code.Text + "' and((( sp_tracekind <> 2 or sp_tracekind is null))or sp_type <> '物料')");
-                            sql.Append("and not exists(select 1 from craftmaterial where (cm_sncode='" + ms_firstsn + "' or cm_sncode in (select sn from makesnrelation where firstsn='" + ms_firstsn + "')) and cm_makecode='" + ma_code.Text + "' and cm_soncode=");
-                            sql.Append("sp_soncode and cm_status=0) order by SP_DETNO asc");
+                            sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,sp_fsoncode,max(sp_barcoderule)");
+                            sql.Append("sp_barcoderule,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
+                            sql.Append("sp_ifforsn,max(sp_length)sp_length,max(sp_type)sp_type,max(sp_prefix)sp_prefix,max(sp_regex)");
+                            sql.Append("sp_regex,max(pr_detail)pr_detail from stepproduct left join product on pr_code=sp_fsoncode where ");
+                            sql.Append("sp_bomversion='" + ma_bomversion.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode + "' ");
+                            sql.Append("And sp_mothercode ='" + pr_code.Text + "' and sp_tracekind=1 and not exists(select 1 from craftmaterial where (cm_sncode='" + ms_firstsn + "' or ");
+                            sql.Append("cm_sncode in (select sn from makesnrelation where firstsn='" + ms_firstsn + "')) and cm_makecode='" + ma_code.Text + "' and cm_soncode=");
+                            sql.Append("sp_soncode and cm_status=0) group by sp_fsoncode order by SP_DETNO asc");
                             ListA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             //获取对应 产品的机身标的打印模板
                             if (ListA.Rows.Count > 0)
                             {
-                                OperateResult.AppendText(">>请采集" + ListA.Rows[RemainIndex]["sp_fsoncode"].ToString() + "或" + ListA.Rows[RemainIndex]["sp_soncode"].ToString() + "的物料数据\n");
                                 string fsoncode = ListA.Rows[RemainIndex]["sp_fsoncode"].ToString();
                                 string soncode = ListA.Rows[RemainIndex]["sp_soncode"].ToString();
+                                string prdetail = ListA.Rows[RemainIndex]["pr_detail"].ToString();
                                 if (fsoncode == soncode)
-                                    OperateResult.AppendText("<<请采集" + fsoncode + "的物料数据\n", Color.Black);
+                                    OperateResult.AppendText("<<请采集" + fsoncode + "("+ prdetail + ")的物料数据\n", Color.Black);
                                 else
-                                    OperateResult.AppendText("<<请采集" + fsoncode + "或" + soncode + "的物料数据\n", Color.Black);
+                                    OperateResult.AppendText("<<请采集" + fsoncode + "或" + soncode + "(" + prdetail + ")的物料数据\n", Color.Black);
                                 code.Clear();
                             }
                             else
@@ -208,7 +210,6 @@ namespace UAS_MES.Make
                         string length = ListA.Rows[RemainIndex]["sp_length"].ToString();
                         string sp_id = ListA.Rows[RemainIndex]["sp_id"].ToString();
                         string sp_ifforsn = ListA.Rows[RemainIndex]["sp_ifforsn"].ToString();
-                        string sp_tracekind = ListA.Rows[RemainIndex]["sp_tracekind"].ToString();
                         string sp_barcoderule = ListA.Rows[RemainIndex]["sp_barcoderule"].ToString();
                         if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
                         {
@@ -228,10 +229,11 @@ namespace UAS_MES.Make
                         {
                             string fsoncode = ListA.Rows[RemainIndex]["sp_fsoncode"].ToString();
                             string soncode = ListA.Rows[RemainIndex]["sp_soncode"].ToString();
+                            string prdetail = ListA.Rows[RemainIndex]["pr_detail"].ToString();
                             if (fsoncode == soncode)
-                                OperateResult.AppendText(">>请采集物料编号为" + fsoncode + "的物料数据\n");
+                                OperateResult.AppendText("<<请采集" + fsoncode + "(" + prdetail + ")的物料数据\n", Color.Black);
                             else
-                                OperateResult.AppendText(">>请采集物料编号为" + fsoncode + "或" + soncode + "的物料数据\n");
+                                OperateResult.AppendText("<<请采集" + fsoncode + "或" + soncode + "(" + prdetail + ")的物料数据\n", Color.Black);
                         }
                         if (RemainIndex == ListA.Rows.Count)
                         {

+ 16 - 14
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -141,7 +141,6 @@ namespace UAS_MES.Make
                             string length = dt1.Rows[RemainIndex]["sp_length"].ToString();
                             string sp_id = dt1.Rows[RemainIndex]["sp_id"].ToString();
                             string sp_ifforsn = dt1.Rows[RemainIndex]["sp_ifforsn"].ToString();
-                            string sp_tracekind = dt1.Rows[RemainIndex]["sp_tracekind"].ToString();
                             string sp_barcoderule = dt1.Rows[RemainIndex]["sp_barcoderule"].ToString();
                             if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
                                 Save_OtherCode(sp_soncode, make_code, sn_code.Text, sp_id);
@@ -170,7 +169,6 @@ namespace UAS_MES.Make
                                 string cm_status = dt.Rows[0]["cm_status"].ToString();
                                 string cm_makecode = dt.Rows[0]["cm_makecode"].ToString();
                                 string cm_craftcode = dt.Rows[0]["cm_craftcode"].ToString();
-                            
                                 //清除已被使用的序列号
                                 sql.Clear();
                                 sql.Append("update makeserial set ms_nextmacode='' where ms_sncode in(select cm_barcode from craftmaterial where ");
@@ -314,12 +312,14 @@ namespace UAS_MES.Make
             //单独用一个DataTable存储一个
             dt1 = new DataTable();
             sql.Clear();
-            sql.Append("select sp_id,sp_tracekind,sp_barcoderule,sp_ifuseregex,sp_ifforsn,sp_length,sp_soncode,sp_repcode");
-            sql.Append(",pr_id,sp_type,sp_prefix,sp_fsoncode,sp_regex from stepproduct left join product on pr_code=sp_soncode where ");
-            sql.Append("sp_bomversion='" + mabomversion + "' and sp_craftcode='" + ms_craftcode + "' and sp_stepcode='" + User.CurrentStepCode + "'");
-            sql.Append("And sp_mothercode ='" + make_prodcode + "' and((( sp_tracekind <> 2 or sp_tracekind is null))or sp_type <> '物料')");
-            sql.Append("and not exists(select 1 from craftmaterial where (cm_sncode='" + ms_firstsn + "' or cm_sncode in (select sn from makesnrelation where firstsn='" + ms_firstsn + "')) and cm_makecode='" + ma_code.Text + "' and cm_soncode=");
-            sql.Append("sp_soncode and cm_status=0) order by SP_DETNO asc");
+            sql.Append("select max(sp_id)sp_id,max(sp_detno)sp_detno,sp_fsoncode,max(sp_barcoderule)");
+            sql.Append("sp_barcoderule,wm_concat(sp_soncode) sp_soncode,max(sp_ifuseregex)sp_ifuseregex,max(sp_ifforsn)");
+            sql.Append("sp_ifforsn,max(sp_length)sp_length,max(sp_type)sp_type,max(sp_prefix)sp_prefix,max(sp_regex)");
+            sql.Append("sp_regex,max(pr_detail)pr_detail from stepproduct left join product on pr_code=sp_fsoncode where ");
+            sql.Append("sp_bomversion='" + ma_bomversion.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode + "' ");
+            sql.Append("And sp_mothercode ='" + ma_prodcode.Text + "' and sp_tracekind=1 and not exists(select 1 from craftmaterial where (cm_sncode='" + ms_firstsn + "' or ");
+            sql.Append("cm_sncode in (select sn from makesnrelation where firstsn='" + ms_firstsn + "')) and cm_makecode='" + ma_code.Text + "' and cm_soncode=");
+            sql.Append("sp_soncode and cm_status=0) group by sp_fsoncode order by SP_DETNO asc");
             dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             code.Clear();
             //用于记录提醒的数据长度
@@ -328,11 +328,12 @@ namespace UAS_MES.Make
             {
                 string fsoncode = dt1.Rows[i]["sp_fsoncode"].ToString();
                 string soncode = dt1.Rows[i]["sp_soncode"].ToString();
+                string prdetail = dt1.Rows[i]["pr_detail"].ToString();
                 if (fsoncode == soncode)
-                    RemainList[i] = fsoncode;
+                    RemainList[i] = fsoncode + "(" + prdetail + ")";
                 else
-                    RemainList[i] = fsoncode + "或" + soncode;
-                
+                    RemainList[i] = fsoncode + "或" + soncode + "(" + prdetail + ")";
+
             }
             if (dt1.Rows.Count > 0)
             {
@@ -341,10 +342,11 @@ namespace UAS_MES.Make
                     CollectDataSonCode.Add(dt1.Rows[RemainIndex]["sp_soncode"].ToString());
                     string fsoncode = dt1.Rows[RemainIndex]["sp_fsoncode"].ToString();
                     string soncode = dt1.Rows[RemainIndex]["sp_soncode"].ToString();
+                    string prdetail = dt1.Rows[RemainIndex]["pr_detail"].ToString();
                     if (fsoncode == soncode)
-                        OperateResult.AppendText("<<请采集" + fsoncode + "的物料数据\n", Color.Black);
+                        OperateResult.AppendText("<<请采集" + fsoncode + "("+ prdetail + ")的物料数据\n", Color.Black);
                     else
-                        OperateResult.AppendText("<<请采集" + fsoncode + "或" + soncode + "的物料数据\n", Color.Black);
+                        OperateResult.AppendText("<<请采集" + fsoncode + "或" + soncode + "("+ prdetail + ")的物料数据\n", Color.Black);
                 }
                 catch (Exception)
                 {
@@ -384,7 +386,7 @@ namespace UAS_MES.Make
             if (RemainIndex < RemainList.Length)
             {
                 CollectDataSonCode.Add(dt1.Rows[RemainIndex]["sp_soncode"].ToString());
-                OperateResult.AppendText("<<请采集" + RemainList[RemainIndex] + "的" + dt1.Rows[RemainIndex]["sp_type"].ToString() + "数据\n", Color.Black);
+                OperateResult.AppendText("<<请采集" + RemainList[RemainIndex] + "的物料数据\n", Color.Black);
             }
             else
             {