From 291fdb29daf239a13fcfb3f5e08a2f5bf9167534 Mon Sep 17 00:00:00 2001
From: chenhaozhe <gaozhechen26@gmail.com>
Date: 星期六, 07 三月 2026 17:37:07 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/QC_ManagementController.cs |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/WebAPI/Controllers/QC_ManagementController.cs b/WebAPI/Controllers/QC_ManagementController.cs
index 82ca164..98ddd9d 100644
--- a/WebAPI/Controllers/QC_ManagementController.cs
+++ b/WebAPI/Controllers/QC_ManagementController.cs
@@ -297,13 +297,13 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_PatrolProcCheckBillList where  鍏抽棴浜�='' order by hmainid desc ", "h_v_QC_PatrolProcCheckBillList");
+                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_PatrolProcCheckBillMainList where  鍏抽棴浜�='' order by hmainid desc ", "h_v_QC_PatrolProcCheckBillMainList");
                 }
                 else
                 {
-                    string sql1 = "select * from h_v_QC_PatrolProcCheckBillList where 鍏抽棴浜�='' ";
+                    string sql1 = "select * from h_v_QC_PatrolProcCheckBillMainList where 鍏抽棴浜�='' ";
                     string sql = sql1 + sqlWhere+ " order by 鍒跺崟鏃ユ湡 desc ";
-                    ds = oCN.RunProcReturn(sql, "h_v_QC_PatrolProcCheckBillList");
+                    ds = oCN.RunProcReturn(sql, "h_v_QC_PatrolProcCheckBillMainList");
                 }
             }
             catch (Exception e)
@@ -1353,8 +1353,21 @@
                 {
                     //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳
                     DataSet ds;
-                    string sql = "select * from  Gy_QCCheckProjectMain  where HInterID = " + HInterID;
+                    string sql;
+                    if(HInterID=="0")
+                    {
+                        sql = "select top 1 * from  Gy_QCCheckProjectMain  order by HInterID desc";
+                        
+                    }
+                    else
+                     sql = "select * from  Gy_QCCheckProjectMain  where HInterID = " + HInterID;
                     ds = oCN.RunProcReturn(sql, oBill.MvarItemKey);
+                    if(ds!=null)
+                    {
+                        oBill.omodel.HInterID = Convert.ToInt64(ds.Tables[0].Rows[0]["HInterID"]);
+                        HInterID = Convert.ToInt64(ds.Tables[0].Rows[0]["HInterID"]).ToString();
+                    }
+                    
                     if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
                     {
                         objJsonResult.code = "0";
@@ -2119,7 +2132,7 @@
                     UserName = oItem.HMaker;
                     oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                     oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
-                    oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+                    oItem.HDate=oItem.HDate.ToString()==""? DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")) : oItem.HDate;
                     oItem.HBillType = "7506";
                     oItem.HBillSubType = "7506";
                     oItem.HBillStatus = 0;

--
Gitblit v1.9.1