Explorar el Código

修改栈板撤销时工序问题

章政 hace 7 años
padre
commit
b45ea3fd38
Se han modificado 1 ficheros con 16 adiciones y 4 borrados
  1. 16 4
      UAS-MES/PublicMethod/LogicHandler.cs

+ 16 - 4
UAS-MES/PublicMethod/LogicHandler.cs

@@ -484,11 +484,23 @@ namespace UAS_MES.PublicMethod
             string CurrentStepName = "";
             List<string> ExeSQL = new List<string>();
             GetStepCodeAndNameAndLineBySource(iSourceCode, ref CurrentStep, ref CurrentStepName, ref LineCode);
+            //判断是否是线外采集
+            string unfinpack = dh.getFieldDataByCondition("Line", "nvl(li_allowUnFinPack,0)", "li_code='" + User.UserLineCode + "'").ToString();
             //更新工序会上一执行步骤
-            sql.Clear();
-            sql.Append("merge into makeserial using mes_package_view on (v_outboxcode='" + iOutBoxCode + "' and ms_sncode=");
-            sql.Append("v_barcode and ms_makecode=v_makecode) when matched then update set ms_nextstepcode=ms_stepcode");
-            sql.Append(",ms_status=1,ms_sccode='" + iSourceCode + "' ");
+            if (unfinpack != "" && unfinpack != "0")
+            {
+                sql.Clear();
+                sql.Append("merge into makeserial using mes_package_view on (v_outboxcode='" + iOutBoxCode + "' and ms_sncode=");
+                sql.Append("v_barcode and ms_makecode=v_makecode) when matched then update set ms_nextstepcode=ms_nextstepcode");
+                sql.Append(",ms_status=1,ms_sccode='" + iSourceCode + "' ");
+            }
+            else
+            {
+                sql.Clear();
+                sql.Append("merge into makeserial using mes_package_view on (v_outboxcode='" + iOutBoxCode + "' and ms_sncode=");
+                sql.Append("v_barcode and ms_makecode=v_makecode and ms_status=2) when matched then update set ms_nextstepcode=ms_stepcode");
+                sql.Append(",ms_status=1,ms_sccode='" + iSourceCode + "' ");
+            }
             ExeSQL.Add(sql.ToString());
             //更新完工数量
             ExeSQL.Add("update make set ma_madeqty=(select count(1) from makeserial where ms_makecode='" + iMakeCode + "' and ms_status=2) where ma_code='" + iMakeCode + "'");