From b2faba41f3dba638713b7a2a95901cc9357016d8 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 19 八月 2024 13:59:49 +0800
Subject: [PATCH] 1

---
 WebAPI/DLL/ClsSc_MESBeginWorkBill.cs |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/WebAPI/DLL/ClsSc_MESBeginWorkBill.cs b/WebAPI/DLL/ClsSc_MESBeginWorkBill.cs
index 2d5d494..5a2de6c 100644
--- a/WebAPI/DLL/ClsSc_MESBeginWorkBill.cs
+++ b/WebAPI/DLL/ClsSc_MESBeginWorkBill.cs
@@ -349,14 +349,22 @@
                     string HSourceID = ds.Tables[0].Rows[0]["HSourceID"].ToString();
 
                     ds = oCn.RunProcReturn(@"select  HMouldID from Sc_MouldUpperBillMain a
-inner join Sc_MouldUpperBillSub b on a.HInterID = b.HInterID where HICMOInterID=" + HICMOInterID + " and HICMOEntryID=" + HICMOEntryID + " and HProcExchInterID=" + HSourceInterID + " and  HProcExchEntryID=" + HSourceEntryID + " and HSourceID=" + HSourceID + " order by HMakeDate desc", "Sc_MouldUpperBillMain");
+                        inner join Sc_MouldUpperBillSub b on a.HInterID = b.HInterID where HICMOInterID=" + HICMOInterID + " and HICMOEntryID=" + HICMOEntryID + " and HProcExchInterID=" + HSourceInterID + " and  HProcExchEntryID=" + HSourceEntryID + " and HSourceID=" + HSourceID + " order by HMakeDate desc", "Sc_MouldUpperBillMain");
                     if (ds.Tables[0].Rows.Count > 0)
                     {
                         oCn.RunProc("update Sc_ICMOBillStatus_Tmp set HMouldID= " + ds.Tables[0].Rows[0]["HMouldID"].ToString() + " where HInterID=" + omodel.HMainSourceInterID.ToString());
                     }
-
+                    else
+                    {
+                        ds = oCn.RunProcReturn(@"select  HMouldID from Sc_MouldUpperBillMain a
+                        inner join Sc_MouldUpperBillSub b on a.HInterID = b.HInterID where  HSourceID=" + HSourceID + " order by HMakeDate desc", "Sc_MouldUpperBillMain");
+                        if (ds.Tables[0].Rows.Count > 0)
+                        {
+                            oCn.RunProc("update Sc_ICMOBillStatus_Tmp set HMouldID= " + ds.Tables[0].Rows[0]["HMouldID"].ToString() + " where HInterID=" + omodel.HMainSourceInterID.ToString());
+                        }
+                    }
                 }
-               
+
                 sReturn = omodel.HInterID.ToString();
                 oCn.Commit();
                 return true;

--
Gitblit v1.9.1