Ver código fonte

不限制包装物料回流

callm 4 semanas atrás
pai
commit
409c3d1e45

+ 1 - 1
UAS_MES_YDCY/FunctionCode/Make/Make_DecomposeCJ.Designer.cs

@@ -234,7 +234,7 @@
             this.nochange.TabIndex = 194;
             this.nochange.TabStop = true;
             this.nochange.Text = "拆解";
-            this.nochange.Visible = false;
+            this.nochange.Visible = true;
             this.nochange.UseVisualStyleBackColor = true;
             // 
             // dataGridViewCheckBoxColumn1

+ 2 - 2
UAS_MES_YDCY/FunctionCode/Make/Make_FeedingCollection.cs

@@ -552,9 +552,9 @@ namespace UAS_MES_NEW.Make
             else
             {
                 sql.Clear();
-                sql.Append("insert into Craftmaterial (cm_id ,cm_makecode,cm_maid,cm_maprodcode, cm_soncode, cm_mscode, cm_sncode, cm_stepcode, cm_stepname,cm_fsoncode,");
+                sql.Append("insert into Craftmaterial (cm_id ,cm_prodtype,cm_makecode,cm_maid,cm_maprodcode, cm_soncode, cm_mscode, cm_sncode, cm_stepcode, cm_stepname,cm_fsoncode,");
                 sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid,cm_status,cm_materialtype,cm_firstsn)");
-                sql.Append("select Craftmaterial_seq.nextval, ma_code, ma_id, ma_prodcode,:soncode,ms_code,ms_sncode,mcd_stepcode,");
+                sql.Append("select Craftmaterial_seq.nextval,sp_prodtype, ma_code, ma_id, ma_prodcode,:soncode,ms_code,ms_sncode,mcd_stepcode,");
                 sql.Append("mcd_stepname,sp_fsoncode,ms_craftcode,ms_craftname,:barcode,1,sysdate,'" + User.UserCode + "','" + User.UserLineCode + "',ma_wccode,");
                 sql.Append("'" + User.UserSourceCode + "',:sp_id,0,1,ms_firstsn from make left join makecraftdetail on mcd_maid=ma_id  left join stepproduct on sp_stepcode=mcd_stepcode ");
                 sql.Append(" and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code and sp_craftcode=ms_craftcode ");

+ 3 - 3
UAS_MES_YDCY/FunctionCode/Make/Make_FeedingCollectionBadOnly.cs

@@ -547,9 +547,9 @@ namespace UAS_MES_NEW.Make
             else
             {
                 sql.Clear();
-                sql.Append("insert into Craftmaterial (cm_id ,cm_makecode,cm_maid,cm_maprodcode, cm_soncode, cm_mscode, cm_sncode, cm_stepcode, cm_stepname,cm_fsoncode,");
+                sql.Append("insert into Craftmaterial (cm_id ,cm_prodtype,cm_makecode,cm_maid,cm_maprodcode, cm_soncode, cm_mscode, cm_sncode, cm_stepcode, cm_stepname,cm_fsoncode,");
                 sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid,cm_status,cm_materialtype,cm_firstsn)");
-                sql.Append("select Craftmaterial_seq.nextval, ma_code, ma_id, ma_prodcode,:soncode,ms_code,ms_sncode,sp_stepcode,");
+                sql.Append("select Craftmaterial_seq.nextval,sp_prodcode, ma_code, ma_id, ma_prodcode,:soncode,ms_code,ms_sncode,sp_stepcode,");
                 sql.Append("ms_stepname,sp_fsoncode,ms_craftcode,ms_craftname,:barcode,1,sysdate,'" + User.UserCode + "','" + User.UserLineCode + "',ma_wccode,");
                 sql.Append("'" + User.UserSourceCode + "',:sp_id,0,1,ms_firstsn from make left join stepproduct on instr('"+ms_paststep+"',sp_stepcode)>0 ");
                 sql.Append(" and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code and sp_craftcode=ms_craftcode ");
@@ -590,7 +590,7 @@ namespace UAS_MES_NEW.Make
                 CollectDataSonCode.Clear();
                 //采集成功,设置序列号栏目为空
                 RemainIndex = 0;
-                OperateResult.AppendText(">>序列号" + sn_code.Text + "上料采集完成!\n", Color.Green);
+                OperateResult.AppendText(">>序列号" + sn_code.Text + "上料采集完成!\n", Color.Green,sn_code);
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "上料采集", "上料成功", sn_code.Text, "");
             }
         }

+ 30 - 30
UAS_MES_YDCY/FunctionCode/Make/Make_Repair.cs

@@ -571,37 +571,37 @@ namespace UAS_MES_NEW.Make
                 }
             }
             //查询拆解的物料
-            //sql.Clear();
-            //sql.Append("select distinct cm_soncode from craftmaterial where cm_sncode in (select '" + firstsn + "' from dual union ");
-            //sql.Append("select sn from makesnrelation where firstsn='" + firstsn + "') and cm_craftcode<>'" + cr_code.Text + "' and cm_makecode<>'" + ms_makecode.Text + "' and cm_status=-1 ");
-            //dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            sql.Clear();
+            sql.Append("select distinct cm_soncode from craftmaterial where cm_sncode in (select '" + firstsn + "' from dual union ");
+            sql.Append("select sn from makesnrelation where firstsn='" + firstsn + "') and nvl(cm_prodtype,' ')<>'包装物料' and cm_craftcode='" + cr_code.Text + "' and cm_makecode='" + ms_makecode.Text + "' and cm_status=-1 ");
+            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             ////如果含有序列号物料有被拆解过
-            //if (dt.Rows.Count > 0)
-            //{
-            //    string soncode = "";
-            //    for (int i = 0; i < dt.Rows.Count; i++)
-            //    {
-            //        soncode += "'" + dt.Rows[i][0].ToString() + "',";
-            //    }
-            //    //查询对应的上料记录
-            //    sql.Clear();
-            //    sql.Append("select cm_soncode from craftmaterial where cm_sncode in (select '" + firstsn + "' from dual union  select sn from ");
-            //    sql.Append(" makesnrelation where firstsn='" + firstsn + "') and cm_status=0 and cm_soncode in (" + soncode.Substring(0, soncode.Length - 1) + ")");
-            //    DataTable LoadSoncode = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-            //    //查询的结果不相等表示未完成上料
-            //    if (dt.Rows.Count != LoadSoncode.Rows.Count)
-            //    {
-            //        for (int i = 0; i < LoadSoncode.Rows.Count; i++)
-            //        {
-            //            if (soncode.Contains(LoadSoncode.Rows[i][0].ToString()))
-            //            {
-            //                soncode = soncode.Replace(LoadSoncode.Rows[i][0].ToString(), "");
-            //            }
-            //        }
-            //        OperatResult.AppendText(">>" + soncode.Replace("'", "") + "物料尚未备料,不允许回流\n", Color.Red);
-            //        return;
-            //    }
-            //}
+            if (dt.Rows.Count > 0)
+            {
+                string soncode = "";
+                for (int i = 0; i < dt.Rows.Count; i++)
+                {
+                    soncode += "'" + dt.Rows[i][0].ToString() + "',";
+                }
+                //查询对应的上料记录
+                sql.Clear();
+                sql.Append("select cm_soncode from craftmaterial where cm_sncode in (select '" + firstsn + "' from dual union  select sn from ");
+                sql.Append(" makesnrelation where firstsn='" + firstsn + "')and nvl(cm_prodtype,' ')<>'包装物料' and  cm_status=0 and cm_soncode in (" + soncode.Substring(0, soncode.Length - 1) + ")");
+                DataTable LoadSoncode = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                //查询的结果不相等表示未完成上料
+                if (dt.Rows.Count != LoadSoncode.Rows.Count)
+                {
+                    for (int i = 0; i < LoadSoncode.Rows.Count; i++)
+                    {
+                        if (soncode.Contains(LoadSoncode.Rows[i][0].ToString()))
+                        {
+                            soncode = soncode.Replace(LoadSoncode.Rows[i][0].ToString(), "");
+                        }
+                    }
+                    OperatResult.AppendText(">>" + soncode.Replace("'", "") + "物料尚未备料,不允许回流\n", Color.Red);
+                    return;
+                }
+            }
             dt = (DataTable)dh.ExecuteSql("select cr_id from craft where cr_statuscode='AUDITED' and cr_code='" + cr_code.Text + "'", "select");
             if (dt.Rows.Count == 0)
                 OperatResult.AppendText(">>回流工序不存在\n", Color.Red);