فهرست منبع

工单计数未修改BUG调整

章政 7 سال پیش
والد
کامیت
4a130fa83b

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

@@ -422,7 +422,7 @@ namespace UAS_MES.Make
                                             OperateResult.AppendText(">>卡通箱" + pa_outboxcode.Text + "满箱处于称重工序,请在卡通箱称重界面进行称重打印\n", Color.Black, sn_code);
                                             return;
                                         }
-                                        LogicHandler.OutBoxStepPass(pa_outboxcode.Text, pa_makecode.Text, User.UserSourceCode, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", "");
+                                        LogicHandler.OutBoxStepPass(pa_outboxcode.Text, ms_makecode, User.UserSourceCode, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", "");
                                         dh.UpdateByCondition("package", "pa_nextstep='" + dh.getFieldDataByCondition("packagedetail left join makeserial on ms_sncode=pd_barcode and ms_makecode=pd_makecode", "max(ms_nextstepcode)", "pd_outboxcode='" + pa_outboxcode.Text + "'").ToString() + "', PA_CURRENTSTEP = '' ", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                                         LoadCollectedNum();
                                         LoadCheckQTY();
@@ -541,7 +541,7 @@ namespace UAS_MES.Make
                         OperateResult.AppendText(">>卡通箱" + pa_outboxcode.Text + "处于称重工序,请在卡通箱称重界面进行操作\n", Color.Black, sn_code);
                         return;
                     }
-                    LogicHandler.OutBoxStepPass(pa_outboxcode.Text, pa_makecode.Text, User.UserSourceCode, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", "");
+                    LogicHandler.OutBoxStepPass(pa_outboxcode.Text, ms_makecode.Text, User.UserSourceCode, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", "");
                     dh.UpdateByCondition("package", "pa_nextstep='" + dh.getFieldDataByCondition("packagedetail left join makeserial on ms_sncode=pd_barcode and ms_makecode=pd_makecode", "max(ms_nextstepcode)", "pd_outboxcode='" + pa_outboxcode.Text + "'").ToString() + "', PA_CURRENTSTEP = '' ", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                     LoadCheckQTY();
                 }

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

@@ -449,7 +449,7 @@ namespace UAS_MES.Make
                                         OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "满箱封箱成功\n", Color.Green);
                                         LogicHandler.RecordProdWeight(pa_outboxcode.Text, "CARTON", float.Parse(ActWeigh.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
                                         LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量完成:" + weight.Text.Trim(), pa_outboxcode.Text, "");
-                                        LogicHandler.OutBoxStepPass(pa_outboxcode.Text, pa_makecode.Text, User.UserSourceCode, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", "");
+                                        LogicHandler.OutBoxStepPass(pa_outboxcode.Text, ms_makecode, User.UserSourceCode, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", "");
                                         dh.UpdateByCondition("package", "pa_nextstep='" + dh.getFieldDataByCondition("packagedetail left join makeserial on ms_sncode=pd_barcode and ms_makecode=pd_makecode", "max(ms_nextstepcode)", "pd_outboxcode='" + pa_outboxcode.Text + "'").ToString() + "', PA_CURRENTSTEP = '' ", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                                         LoadCheckQTY();
                                         LoadCollectedNum();
@@ -572,7 +572,7 @@ namespace UAS_MES.Make
                     OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "封箱成功\n", Color.Green);
                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量完成:" + weight.Text.Trim(), pa_outboxcode.Text, "");
                     LogicHandler.RecordProdWeight(pa_outboxcode.Text, "CARTON", float.Parse(ActWeigh.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
-                    LogicHandler.OutBoxStepPass(pa_outboxcode.Text, pa_makecode.Text, User.UserSourceCode, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", "");
+                    LogicHandler.OutBoxStepPass(pa_outboxcode.Text, ms_makecode.Text, User.UserSourceCode, User.UserCode, "卡通箱:" + pa_outboxcode.Text + "整箱过站", "");
                     dh.UpdateByCondition("package", "pa_nextstep='" + dh.getFieldDataByCondition("packagedetail left join makeserial on ms_sncode=pd_barcode and ms_makecode=pd_makecode", "max(ms_nextstepcode)", "pd_outboxcode='" + pa_outboxcode.Text + "'").ToString() + "', PA_CURRENTSTEP = '' ", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                     LoadCheckQTY();
                     if (!CollecRemark.Checked)

+ 15 - 6
UAS-MES/PublicMethod/LogicHandler.cs

@@ -468,12 +468,16 @@ namespace UAS_MES.PublicMethod
             sql.Append("and ms_sncode=v_barcode left join make on ma_code=ms_makecode where v_outboxcode='" + iOutBoxCode + "'");
             ExeSQL.Add(sql.ToString());
             //获取子箱的总数
-            string totalcount = dh.getFieldDataByCondition("package", "nvl(pa_totalqty,0) pa_totalqty", "pa_outboxcode='" + iOutBoxCode + "'").ToString();
-            //更新过站数量
             sql.Clear();
-            sql.Append("update makecraftdetail set mcd_inqty=mcd_inqty+" + totalcount + ",mcd_outqty = mcd_outqty + " + totalcount + ", ");
-            sql.Append("mcd_okqty = mcd_okqty + " + totalcount + " where mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + CurrentStep + "'");
-            ExeSQL.Add(sql.ToString());
+            sql.Append("select pd_makecode,count(1) num from packagedetail left join makeserial  ");
+            sql.Append("on ms_sncode=pd_barcode and ms_makecode=pd_makecode where pd_outboxcode='" + iOutBoxCode + "' group by pd_makecode");
+            DataTable MakeQTY = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+            for (int i = 0; i < MakeQTY.Rows.Count; i++)
+            {
+                string ma_code = MakeQTY.Rows[i]["pd_makecode"].ToString();
+                string num = MakeQTY.Rows[i]["num"].ToString();
+                ExeSQL.Add("update makecraftdetail set mcd_inqty=mcd_inqty+" + num + ",mcd_outqty=mcd_outqty+" + num + ",mcd_okqty=mcd_okqty+" + num + " where mcd_macode='" + ma_code + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+            }
             dh.ExecuteSQLTran(ExeSQL.ToArray());
             ExeSQL.Clear();
             //获取途程和产品信息
@@ -536,7 +540,12 @@ namespace UAS_MES.PublicMethod
                     sql.Append("ms_paststep || case when " + ifpast + " > 0 then ',' || '" + CurrentStep + "' end");
                     ExeSQL.Add(sql.ToString());
                     //更新完工数量
-                    ExeSQL.Add("update make set ma_madeqty=nvl(ma_madeqty,0)+" + totalcount + " where ma_code='" + iMakeCode + "'");
+                    for (int i = 0; i < MakeQTY.Rows.Count; i++)
+                    {
+                        string ma_code = MakeQTY.Rows[i]["pd_makecode"].ToString();
+                        string num = MakeQTY.Rows[i]["num"].ToString();
+                        ExeSQL.Add("update make set ma_madeqty=nvl(ma_madeqty,0)+" + num + " where ma_code='" + ma_code + "'");
+                    }
                 }
                 string ifoqc = dh.getFieldDataByCondition("craftdetail", "cd_ifoqc", "cd_crid=" + cr_id + " and cd_stepcode='" + nextstepcode + "'").ToString();
                 //如果下一道工序是OQC需要生成送检批次