From 81f8de8c84f6f936369d01880c347b2d4cf9cdc4 Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期三, 10 十二月 2025 17:08:10 +0800
Subject: [PATCH] 模具档案优化,增加附件上传功能,器具校准记录单增加附件上传功能

---
 WebAPI/Models/Gy_Mould.cs                                    |   11 +
 WebAPI/Properties/PublishProfiles/FolderProfile8.pubxml.user |   18 +-
 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs          |  267 +++++++++++++++++++++++++---
 WebAPI/WebAPI.csproj.user                                    |    7 
 WebAPI/Controllers/Sc_MouldRepairInBillListController.cs     |  227 ++++++++++++++++++++----
 WebAPI/Controllers/WebAPIController.cs                       |    2 
 6 files changed, 440 insertions(+), 92 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 5e293cd..39b6d14 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -2584,11 +2584,8 @@
             }
         }
         #endregion
-        /// <summary>
-        /// 鏂板妯″叿妗f-淇濆瓨鎸夐挳
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
+
+        #region[鍣ㄥ叿妗f淇濆瓨涓庝慨鏀逛繚瀛樻柟娉昡
         [Route("Gy_Mould_Edit/AddBill")]
         [HttpPost]
         public object AddBill([FromBody] JObject oMain)
@@ -2702,6 +2699,16 @@
                 int HMouldHeight = mainList[0].HMouldHeight;          //楂�
                 int HMouldFoldHeight = mainList[0].HMouldFoldHeight;  //鎶樺彔楂樺害
 
+                int HUserID = mainList[0].HUserID;  // 浣跨敤浜猴紙Gy_Employee锛�
+                string HBrand = mainList[0].HBrand;  // 鍝佺墝
+                string HCalibrationType = mainList[0].HCalibrationType;  // 鏍″噯绫诲瀷 (鍐�/澶栨牎)
+                string HLocation = mainList[0].HLocation;  // 浣嶇疆
+                DateTime HCalibrationDate = mainList[0].HCalibrationDate;  // 鏍″噯鏃ユ湡
+                string HCalibrationCycle = mainList[0].HCalibrationCycle;  // 鏍″噯鍛ㄦ湡
+                string HProductDesignSize = mainList[0].HProductDesignSize;  // 浜у搧璁捐灏哄
+                string HGaugeDesignSize = mainList[0].HGaugeDesignSize;  // 妫�鍏疯璁″昂瀵�
+                int HProductQTY = mainList[0].HProductQTY;  // 浜у搧鏁伴噺
+
                 //淇濆瓨鍓嶆帶鍒�=========================================
                 string HBillNote = "";
                 ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFileMain_BeforeSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_MouldFileMain_BeforeSaveCtrl");
@@ -2737,19 +2744,21 @@
                 ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife,HNowSupID,HNowSupTypeID" +
                 ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode,HMadeSupID" +
                 ",HMouldClass,HNowWHID,HNowSPID,HInitLife,HMouldUseStatus,HCREATEORGID,HUSEORGID " +
-                 ",HMouldLength,HMouldWidth,HMouldHeight,HMouldFoldHeight,HTransPackFlag,HSendPackFlag ) " +
+                 ",HMouldLength,HMouldWidth,HMouldHeight,HMouldFoldHeight,HTransPackFlag,HSendPackFlag," +
+                 "HUserID,HBrand,HCalibrationType,HLocation,HCalibrationDate,HCalibrationCycle,HProductDesignSize,HGaugeDesignSize,HProductQTY ) " +
 
                " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
-                        "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
-                        ",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" +
-                        ",'" + HSubjoin + "','" + HSubjoin2 + "','" + HPICNo + "','" + HWorkMaterModel + "'" +
-                        "," + HMaterID + ",'" + HMaterNumber + "'," + HMouleTypeID + "," + HUnitID +
-                        ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
-                        "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty +
-                        "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" +
-                        ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
-                        ",'" + HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "','" + HMouldUseStatus + "'," + HCREATEORGID + "," + HUSEORGID +
-                        "," + HMouldLength + "," + HMouldWidth + "," + HMouldHeight + "," + HMouldFoldHeight + "," + Convert.ToString(HTransPackFlag ? 1 : 0) + "," + Convert.ToString(HSendPackFlag ? 1 : 0) + ") ");
+                "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
+                ",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" +
+                ",'" + HSubjoin + "','" + HSubjoin2 + "','" + HPICNo + "','" + HWorkMaterModel + "'" +
+                "," + HMaterID + ",'" + HMaterNumber + "'," + HMouleTypeID + "," + HUnitID +
+                ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
+                "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty +
+                "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" +
+                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
+                ",'" + HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "','" + HMouldUseStatus + "'," + HCREATEORGID + "," + HUSEORGID +
+                "," + HMouldLength + "," + HMouldWidth + "," + HMouldHeight + "," + HMouldFoldHeight + "," + Convert.ToString(HTransPackFlag ? 1 : 0) + "," + Convert.ToString(HSendPackFlag ? 1 : 0) + "," +
+                "'" + HUserID + "','" + HBrand + "','" + HCalibrationType + "','" + HLocation + "','" + HCalibrationDate + "','" + HCalibrationCycle + "','" + HProductDesignSize + "','" + HGaugeDesignSize + "','" + HProductQTY + "') ");
 
                 //瀛愯〃
                 oCN.RunProc("Insert into Gy_MouldFileSub " +
@@ -2796,6 +2805,7 @@
 
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
+                objJsonResult.HInterID = HInterID.ToString();
                 objJsonResult.Message = null;
                 objJsonResult.data = null;
                 return objJsonResult;
@@ -2811,12 +2821,6 @@
             }
         }
 
-
-        /// <summary>
-        /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
         [Route("Gy_Mould_Edit/AddBill1")]
         [HttpPost]
         public object AddBill1([FromBody] JObject oMain)
@@ -2908,6 +2912,18 @@
                 int HMouldWidth = mainList[0].HMouldWidth;            //瀹�
                 int HMouldHeight = mainList[0].HMouldHeight;          //楂�
                 int HMouldFoldHeight = mainList[0].HMouldFoldHeight;  //鎶樺彔楂樺害
+
+
+                int HUserID = mainList[0].HUserID;  // 浣跨敤浜猴紙Gy_Employee锛�
+                string HBrand = mainList[0].HBrand;  // 鍝佺墝
+                string HCalibrationType = mainList[0].HCalibrationType;  // 鏍″噯绫诲瀷 (鍐�/澶栨牎)
+                string HLocation = mainList[0].HLocation;  // 浣嶇疆
+                DateTime HCalibrationDate = mainList[0].HCalibrationDate;  // 鏍″噯鏃ユ湡
+                string HCalibrationCycle = mainList[0].HCalibrationCycle;  // 鏍″噯鍛ㄦ湡
+                string HProductDesignSize = mainList[0].HProductDesignSize;  // 浜у搧璁捐灏哄
+                string HGaugeDesignSize = mainList[0].HGaugeDesignSize;  // 妫�鍏疯璁″昂瀵�
+                int HProductQTY = mainList[0].HProductQTY;  // 浜у搧鏁伴噺
+
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCN.BeginTran();
 
@@ -2996,12 +3012,16 @@
                  ",HInitLife='" + HInitLife +
                  "',HNextMainDate='" + HNextMainDate +
                  "',HMouldUseStatus='" + HMouldUseStatus +
-                  "' where HInterID=" + HInterID.ToString());
-
-                //淇敼瀛愰」鐩唬鐮�
-                //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
-                //灏嗕笂绾� 涓洪潪鏈骇
-                // oCN.RunProc("Update Gy_Department set HEndflag=0 where HItemID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                 "',HUserID='" + HUserID +
+                 "',HBrand='" + HBrand +
+                 "',HCalibrationType='" + HCalibrationType +
+                 "',HLocation='" + HLocation +
+                 "',HCalibrationDate='" + HCalibrationDate +
+                 "',HCalibrationCycle='" + HCalibrationCycle +
+                 "',HProductDesignSize='" + HProductDesignSize +
+                 "',HGaugeDesignSize='" + HGaugeDesignSize +
+                 "',HProductQTY='" + HProductQTY +
+                 "' where HInterID=" + HInterID.ToString());             
 
                 oCN.RunProc("delete from Gy_MouldFileSub_SubMater where HInterID='" + HInterID + "'");
                 oCN.RunProc("delete from Gy_MouldFileSub_MaintainRule where HInterID='" + HInterID + "'");
@@ -3035,7 +3055,7 @@
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�";
-                //objJsonResult.data = null;
+                objJsonResult.HInterID = HInterID.ToString();
                 return objJsonResult;
             }
             catch (Exception e)
@@ -3130,11 +3150,9 @@
             return objJsonResult;
         }
 
-        /// <summary>
-        /// 纾ㄥ叿妗f淇敼鎸夐挳鏂规硶-璁$畻涓嬫淇濆吇/鏍℃鏃ユ湡-鑾峰彇妗f鏈�杩戜竴娆$殑淇濆吇璁板綍
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
+        #endregion
+
+        #region [妯″叿妗f淇敼鎸夐挳鏂规硶-璁$畻涓嬫淇濆吇/鏍℃鏃ユ湡-鑾峰彇妗f鏈�杩戜竴娆$殑淇濆吇璁板綍]
         [Route("Gy_Mould_Edit/calculateHNextMainDate")]
         [HttpGet]
         public object calculateHNextMainDate(long HInterID)
@@ -3164,6 +3182,8 @@
                 return objJsonResult;
             }
         }
+        #endregion
+
 
         /// <summary>
         /// 纾ㄥ叿妗f淇敼鎸夐挳鏂规硶
@@ -4896,6 +4916,185 @@
         #endregion
         #endregion
 
+        #region 鍣ㄥ叿妗f 鏂囦欢涓婁紶
+        [Route("Gy_MouldFileBIllMain/UploadFile_Gy_MouldFilen")]
+        [HttpPost]
+        public object UploadFile_Gy_MouldFilen()
+        {
+
+            string HBillNo = HttpContext.Current.Request.Params["HBillNo"];  //鍗曟嵁鍙�
+            string HRemark = HttpContext.Current.Request.Params["HRemark"];  //澶囨敞
+            string HUserName = HttpContext.Current.Request.Params["HUserName"];  //鍒涘缓浜�
+            HttpPostedFile files = HttpContext.Current.Request.Files["file"];
+            string path = HttpContext.Current.Server.MapPath("~/../Files/Gy_MouldFilen/" + HBillNo);
+            dynamic dyResult = UploadFile_Gy_MouldFilen(files, path, HBillNo, HRemark, HUserName);
+            if (dyResult != null && dyResult.result == 1)
+            {
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "涓婁紶鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = dyResult.returnval;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+
+        }
+
+        public dynamic UploadFile_Gy_MouldFilen(HttpPostedFile files, string path, string HBillNo, string HRemark, string HUserName)
+        {
+            dynamic Result_Ob = new { result = 1, returnval = "涓婁紶鎴愬姛锛�" };
+            string filePath = Path.GetFullPath(files.FileName);//鏂囦欢涓婁紶璺緞
+            string fileExtension = Path.GetExtension(files.FileName);// 鏂囦欢鎵╁睍鍚�
+            string filename = files.FileName;//鏂囦欢鍚�
+            string fileSavePath = path;// 涓婁紶淇濆瓨璺緞
+            int filesize = files.ContentLength;//鑾峰彇涓婁紶鏂囦欢鐨勫ぇ灏忓崟浣嶄负瀛楄妭byte
+            int Maxsize = 40000 * 1024;//瀹氫箟涓婁紶鏂囦欢鐨勬渶澶х┖闂村ぇ灏忎负40M
+            try
+            {
+                if (files == null || files.ContentLength <= 0)
+                {
+                    Result_Ob = new { result = 0, returnval = "鏂囦欢涓嶈兘涓虹┖!" };
+                    return Result_Ob;
+                }
+                if (filesize >= Maxsize)
+                {
+                    Result_Ob = new { result = 0, returnval = "涓婁紶鏂囦欢瓒呰繃40M锛屼笉鑳戒笂浼狅紒" };
+                    return Result_Ob;
+                }
+
+                string fileurl = Path.Combine(fileSavePath, filename);
+                if (Directory.Exists(fileurl) == true)  //濡傛灉瀛樺湪閲嶅悕鏂囦欢灏辨彁绀�  
+                {
+                    Result_Ob = new { result = 0, returnval = "瀛樺湪鍚屽悕鏂囦欢锛�" };
+                    return Result_Ob;
+                }
+                //鍒犻櫎鏁版嵁琛ㄦ暟鎹�
+                ds = oCN.RunProcReturn("delete from MES_AccessoriesList where HSourceBillNo ='" + HBillNo + "' and HFileName='" + filename + "'", "MES_AccessoriesList");
+                if (Directory.Exists(path))
+                {
+                    File.Delete(fileurl);      //鍒犻櫎鎸囧畾鏂囦欢
+                    files.SaveAs(fileurl);
+                    string StrPath = "/files/Gy_MouldFilen/" + HBillNo + "/" + filename;
+                    if (File.Exists(fileurl))
+                    {
+                        //杩欓噷鍙互鎵ц涓�浜涘叾瀹冪殑鎿嶄綔锛屾瘮濡傛洿鏂版暟鎹簱
+                        //鍐欏叆鏁版嵁琛�
+                        oCN.RunProc("Insert into MES_AccessoriesList (HFileName,HFilePath,HFilePath_Cus,HFileType" +
+                                    ",HLoadMan,HLoadDate,HRemark,HVerNum,HFileSize" +
+                                    ",HFileClsID,HSourceBillNo" +
+                                   ") values('"
+                                    + filename.ToString() + "','" + StrPath.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" +
+                                    ",'" + HUserName + "',getdate(),'" + HRemark + "','V1','" + filesize +
+                                    "','" + 0 + "','" + HBillNo +
+                                   "') ");
+                    }
+                    else
+                    {
+                        Result_Ob = new { result = 0, returnval = "涓婁紶澶辫触锛佹鏂囦欢涓烘伓鎰忔枃浠�" };
+                    }
+                }
+                else
+                {
+                    Directory.CreateDirectory(fileSavePath); //娣诲姞鏂囦欢澶�
+                    files.SaveAs(fileurl);
+                    string StrPath = "/files/Gy_MouldFilen/" + HBillNo + "/" + filename;
+                    if (File.Exists(fileurl))
+                    {
+                        //杩欓噷鍙互鎵ц涓�浜涘叾瀹冪殑鎿嶄綔锛屾瘮濡傛洿鏂版暟鎹簱
+                        //鍐欏叆鏁版嵁琛�
+                        oCN.RunProc("Insert into MES_AccessoriesList (HFileName,HFilePath,HFilePath_Cus,HFileType" +
+                                    ",HLoadMan,HLoadDate,HRemark,HVerNum,HFileSize" +
+                                    ",HFileClsID,HSourceBillNo" +
+                                   ") values('"
+                                    + filename.ToString() + "','" + StrPath.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" +
+                                    ",'" + HUserName + "',getdate(),'" + HRemark + "','V1','" + filesize +
+                                    "','" + 0 + "','" + HBillNo +
+                                   "') ");
+                    }
+                    else
+                    {
+                        Result_Ob = new { result = 0, returnval = "涓婁紶澶辫触锛佹鏂囦欢涓烘伓鎰忔枃浠�" };
+                    }
+                }
+
+            }
+            catch (Exception e)
+            {
+                Result_Ob = new { result = 0, returnval = e.Message };
+            }
+            return Result_Ob;
+        }
+
+        /// <summary>
+        /// 鏍规嵁鍗曟嵁鍙锋煡鎵句笂浼犳枃浠跺垪琛�
+        /// </summary>
+        /// <param name="sWhere"></param>
+        /// <returns></returns>
+        [Route("Gy_MouldFileBIllMain/Gy_MouldFilen_Filelist")]
+        [HttpGet]
+        public object Gy_MouldFilen_Filelist(string HBillNo)
+        {
+            var url = fileip + "/Files/Gy_MouldFilen/" + HBillNo + "/";
+
+            try
+            {
+                ds = oCN.RunProcReturn("select *,'" + url + "'+CAST(HFileName as varchar(200))as url  from MES_AccessoriesList where HSourceBillNo='" + HBillNo + "'", "MES_AccessoriesList");
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        /// <summary>
+        /// 鏍规嵁ID,鍗曟嵁鍙�,鏂囦欢鍚� 鍒犻櫎鏂囦欢
+        /// </summary>
+        /// <param name="sWhere"></param>
+        /// <returns></returns>
+        [Route("Gy_MouldFileBIllMain/Gy_MouldFilen_DeleteFilelist")]
+        [HttpGet]
+        public object Gy_MouldFilen_DeleteFilelist(string HItemID, string HSourceBillNo, string HFileName)
+        {
+            try
+            {
+
+                oCN.RunProc("delete from MES_AccessoriesList where HItemID =" + HItemID);
+                string fileurl = Path.Combine(HttpContext.Current.Server.MapPath("~/../Files/Gy_MouldFilen/" + HSourceBillNo), HFileName);
+                File.Delete(fileurl);      //鍒犻櫎鎸囧畾鏂囦欢
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
 
         //鏍规嵁鏉$爜鎵剧墿鏂欎俊鎭�
         [Route("Gy_Material/findMaterialByNumber")]
diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
index ea72be2..8c05fd9 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -14756,7 +14756,7 @@
         #endregion
 
         #region 鍣ㄥ叿淇濆吇璁板綍鎷嶇収涓婁紶
-        [Route("Sc_MouldMaintainBill/UploadFile")]
+        [Route("Sc_MouldMaintainBill/UploadFile_Maintain")]
         [HttpPost]
         public object UploadFile_Maintain()
         {
@@ -15511,56 +15511,20 @@
         }
         #endregion
 
-
-        #region[缂栬緫鏃惰幏鍙栬〃澶存暟鎹甝
-        [Route("Gy_QCVerificationBillMain/Gy_QCVerificationBillMainCheckDetai")]
+        #region[缂栬緫鏃惰幏鍙栨暟鎹甝
+        [Route("Gy_QCVerificationBillMain/Gy_QCVerificationBillDetail")]
         [HttpGet]
-        public ApiResult<DataSet> Gy_QCVerificationBillMainCheckDetai(string HID)
+        public ApiResult<DataSet> Gy_QCVerificationBillDetail(string HID)
         {
             if (string.IsNullOrEmpty(HID))
                 return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" };
             SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_QCVerificationBillMain_Edit  where hmainid= " + HID + " ", "h_v_Gy_QCVerificationBillMain");
+            var dataSet = oCN.RunProcReturn("select  * from h_v_Gy_QCVerificationBillMain_Edit  where hmainid= " + HID + " ", "h_v_Gy_QCVerificationBillMain_Edit");
             if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                 return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄥ崟鍙�" };
             return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
         }
-        #endregion
-
-        #region[缂栬緫鏃惰幏鍙栬〃浣撴暟鎹甝
-        [Route("Gy_QCVerificationBillMain/SGy_QCVerificationBillMainListProjectDetai")]
-        [HttpGet]
-        public object SGy_QCVerificationBillMainListProjectDetai(string sqlWhere)
-        {
-            DataSet ds;
-            List<object> list = new List<object>();
-            try
-            {
-                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-
-                string sql = "select HInspectInstruMentID,妫�楠屼华鍣ㄤ唬鐮� HInspectInstruMentNumber,妫�楠屼华鍣ㄥ悕绉� HInspectInstruMentName,鐢熸晥鏃ユ湡 HBeginDate,澶辨晥鏃ユ湡 HEndDate,鏍″噯鐘舵�� HHCalibrationStatus  from h_v_Gy_QCVerificationBillMain_Edit where 1 = 1 " + sqlWhere;
-                ds = oCN.RunProcReturn(sql, "h_v_Gy_QCVerificationBillMain_Edit");
-
-                list.Add(ds.Tables[0]);
-
-                objJsonResult.code = "0";
-                objJsonResult.count = 1;
-                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                objJsonResult.data = null;
-                objJsonResult.list = list;
-
-            }
-            catch (Exception e)
-            {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
-                objJsonResult.data = null;
-            }
-            return objJsonResult;
-        }
-        #endregion
-
+        #endregion       
 
         #region 鍣ㄥ叿鏍″噯璁板綍鍗� 淇濆瓨/缂栬緫
         
@@ -15671,6 +15635,185 @@
             }
         }
         #endregion
+
+        #region 鍣ㄥ叿鏍″噯璁板綍 鏂囦欢涓婁紶
+        [Route("Gy_QCVerificationBillMain/UploadFile_Gy_QCVerification")]
+        [HttpPost]
+        public object UploadFile_Gy_QCVerification()
+        {
+
+            string HBillNo = HttpContext.Current.Request.Params["HBillNo"];  //鍗曟嵁鍙�
+            string HRemark = HttpContext.Current.Request.Params["HRemark"];  //澶囨敞
+            string HUserName = HttpContext.Current.Request.Params["HUserName"];  //鍒涘缓浜�
+            HttpPostedFile files = HttpContext.Current.Request.Files["file"];
+            string path = HttpContext.Current.Server.MapPath("~/../Files/Gy_QCVerification/" + HBillNo);
+            dynamic dyResult = UploadFile_Gy_QCVerification(files, path, HBillNo, HRemark, HUserName);
+            if (dyResult != null && dyResult.result == 1)
+            {
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "涓婁紶鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = dyResult.returnval;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+
+        }
+
+        public dynamic UploadFile_Gy_QCVerification(HttpPostedFile files, string path, string HBillNo, string HRemark, string HUserName)
+        {
+            dynamic Result_Ob = new { result = 1, returnval = "涓婁紶鎴愬姛锛�" };
+            string filePath = Path.GetFullPath(files.FileName);//鏂囦欢涓婁紶璺緞
+            string fileExtension = Path.GetExtension(files.FileName);// 鏂囦欢鎵╁睍鍚�
+            string filename = files.FileName;//鏂囦欢鍚�
+            string fileSavePath = path;// 涓婁紶淇濆瓨璺緞
+            int filesize = files.ContentLength;//鑾峰彇涓婁紶鏂囦欢鐨勫ぇ灏忓崟浣嶄负瀛楄妭byte
+            int Maxsize = 40000 * 1024;//瀹氫箟涓婁紶鏂囦欢鐨勬渶澶х┖闂村ぇ灏忎负40M
+            try
+            {
+                if (files == null || files.ContentLength <= 0)
+                {
+                    Result_Ob = new { result = 0, returnval = "鏂囦欢涓嶈兘涓虹┖!" };
+                    return Result_Ob;
+                }
+                if (filesize >= Maxsize)
+                {
+                    Result_Ob = new { result = 0, returnval = "涓婁紶鏂囦欢瓒呰繃40M锛屼笉鑳戒笂浼狅紒" };
+                    return Result_Ob;
+                }
+
+                string fileurl = Path.Combine(fileSavePath, filename);
+                if (Directory.Exists(fileurl) == true)  //濡傛灉瀛樺湪閲嶅悕鏂囦欢灏辨彁绀�  
+                {
+                    Result_Ob = new { result = 0, returnval = "瀛樺湪鍚屽悕鏂囦欢锛�" };
+                    return Result_Ob;
+                }
+                //鍒犻櫎鏁版嵁琛ㄦ暟鎹�
+                ds = oCN.RunProcReturn("delete from MES_AccessoriesList where HSourceBillNo ='" + HBillNo + "' and HFileName='" + filename + "'", "MES_AccessoriesList");
+                if (Directory.Exists(path))
+                {
+                    File.Delete(fileurl);      //鍒犻櫎鎸囧畾鏂囦欢
+                    files.SaveAs(fileurl);
+                    string StrPath = "/files/Gy_QCVerification/" + HBillNo + "/" + filename;
+                    if (File.Exists(fileurl))
+                    {
+                        //杩欓噷鍙互鎵ц涓�浜涘叾瀹冪殑鎿嶄綔锛屾瘮濡傛洿鏂版暟鎹簱
+                        //鍐欏叆鏁版嵁琛�
+                        oCN.RunProc("Insert into MES_AccessoriesList (HFileName,HFilePath,HFilePath_Cus,HFileType" +
+                                    ",HLoadMan,HLoadDate,HRemark,HVerNum,HFileSize" +
+                                    ",HFileClsID,HSourceBillNo" +
+                                   ") values('"
+                                    + filename.ToString() + "','" + StrPath.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" +
+                                    ",'" + HUserName + "',getdate(),'" + HRemark + "','V1','" + filesize +
+                                    "','" + 0 + "','" + HBillNo +
+                                   "') ");
+                    }
+                    else
+                    {
+                        Result_Ob = new { result = 0, returnval = "涓婁紶澶辫触锛佹鏂囦欢涓烘伓鎰忔枃浠�" };
+                    }
+                }
+                else
+                {
+                    Directory.CreateDirectory(fileSavePath); //娣诲姞鏂囦欢澶�
+                    files.SaveAs(fileurl);
+                    string StrPath = "/files/Gy_QCVerification/" + HBillNo + "/" + filename;
+                    if (File.Exists(fileurl))
+                    {
+                        //杩欓噷鍙互鎵ц涓�浜涘叾瀹冪殑鎿嶄綔锛屾瘮濡傛洿鏂版暟鎹簱
+                        //鍐欏叆鏁版嵁琛�
+                        oCN.RunProc("Insert into MES_AccessoriesList (HFileName,HFilePath,HFilePath_Cus,HFileType" +
+                                    ",HLoadMan,HLoadDate,HRemark,HVerNum,HFileSize" +
+                                    ",HFileClsID,HSourceBillNo" +
+                                   ") values('"
+                                    + filename.ToString() + "','" + StrPath.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" +
+                                    ",'" + HUserName + "',getdate(),'" + HRemark + "','V1','" + filesize +
+                                    "','" + 0 + "','" + HBillNo +
+                                   "') ");
+                    }
+                    else
+                    {
+                        Result_Ob = new { result = 0, returnval = "涓婁紶澶辫触锛佹鏂囦欢涓烘伓鎰忔枃浠�" };
+                    }
+                }
+
+            }
+            catch (Exception e)
+            {
+                Result_Ob = new { result = 0, returnval = e.Message };
+            }
+            return Result_Ob;
+        }
+
+        /// <summary>
+        /// 鏍规嵁鍗曟嵁鍙锋煡鎵句笂浼犳枃浠跺垪琛�
+        /// </summary>
+        /// <param name="sWhere"></param>
+        /// <returns></returns>
+        [Route("Gy_QCVerificationBillMain/Gy_QCVerification_Filelist")]
+        [HttpGet]
+        public object Gy_QCVerification_Filelist(string HBillNo)
+        {
+            var url = fileip + "/Files/Gy_QCVerification/" + HBillNo + "/";
+
+            try
+            {
+                ds = oCN.RunProcReturn("select *,'" + url + "'+CAST(HFileName as varchar(200))as url  from MES_AccessoriesList where HSourceBillNo='" + HBillNo + "'", "MES_AccessoriesList");
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        /// <summary>
+        /// 鏍规嵁ID,鍗曟嵁鍙�,鏂囦欢鍚� 鍒犻櫎鏂囦欢
+        /// </summary>
+        /// <param name="sWhere"></param>
+        /// <returns></returns>
+        [Route("Gy_QCVerificationBillMain/Gy_QCVerification_DeleteFilelist")]
+        [HttpGet]
+        public object Gy_QCVerification_DeleteFilelist(string HItemID, string HSourceBillNo, string HFileName)
+        {
+            try
+            {
+
+                oCN.RunProc("delete from MES_AccessoriesList where HItemID =" + HItemID);
+                string fileurl = Path.Combine(HttpContext.Current.Server.MapPath("~/../Files/Gy_QCVerification/" + HSourceBillNo), HFileName);
+                File.Delete(fileurl);      //鍒犻櫎鎸囧畾鏂囦欢
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
         #endregion
 
 
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 797bf97..e7530e9 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -22415,7 +22415,7 @@
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
 
-                ds = oCN.RunProcReturn("Select * from Xt_BillType where HNumber = '" + HModuleType + "'", "Xt_BillType");
+                ds = oCN.RunProcReturn("Select * from Xt_BillType  with(nolock) where HNumber = '" + HModuleType + "'", "Xt_BillType");
 
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
diff --git a/WebAPI/Models/Gy_Mould.cs b/WebAPI/Models/Gy_Mould.cs
index 689bca4..2897b2e 100644
--- a/WebAPI/Models/Gy_Mould.cs
+++ b/WebAPI/Models/Gy_Mould.cs
@@ -80,5 +80,16 @@
         public string HMouldUseStatus { get; set; }
 
         public DateTime HNextMainDate { get; set; }
+
+        public int HUserID { get; set; }  // 浣跨敤浜猴紙Gy_Employee锛�
+        public string HBrand { get; set; }  // 鍝佺墝
+        public string HCalibrationType { get; set; }  // 鏍″噯绫诲瀷 (鍐�/澶栨牎)
+        public string HLocation { get; set; }  // 浣嶇疆
+        public DateTime HCalibrationDate { get; set; }  // 鏍″噯鏃ユ湡
+        public string HCalibrationCycle { get; set; }  // 鏍″噯鍛ㄦ湡
+        public string HProductDesignSize { get; set; }  // 浜у搧璁捐灏哄
+        public string HGaugeDesignSize { get; set; }  // 妫�鍏疯璁″昂瀵�
+        public int HProductQTY { get; set; }  // 浜у搧鏁伴噺
+
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Properties/PublishProfiles/FolderProfile8.pubxml.user b/WebAPI/Properties/PublishProfiles/FolderProfile8.pubxml.user
index 2ad2c3b..018a239 100644
--- a/WebAPI/Properties/PublishProfiles/FolderProfile8.pubxml.user
+++ b/WebAPI/Properties/PublishProfiles/FolderProfile8.pubxml.user
@@ -5,7 +5,7 @@
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <_PublishTargetUrl>D:\缃戠珯鍙戝竷\鏅轰簯MESWMS\API</_PublishTargetUrl>
-    <History>True|2025-12-04T01:53:53.3381625Z;False|2025-12-04T09:51:54.1953606+08:00;True|2025-12-03T20:17:43.6822978+08:00;False|2025-12-03T20:17:13.6794411+08:00;True|2025-12-03T20:04:33.7080472+08:00;False|2025-12-03T20:03:18.9092172+08:00;True|2025-12-03T17:55:36.8190814+08:00;True|2025-12-03T17:31:16.1192761+08:00;False|2025-12-03T17:25:01.3978650+08:00;True|2025-12-03T17:12:24.4237446+08:00;True|2025-12-03T16:54:15.1801517+08:00;False|2025-12-03T16:53:42.7976484+08:00;True|2025-12-03T12:26:32.8151086+08:00;True|2025-12-03T10:22:12.3177261+08:00;False|2025-12-03T10:21:38.7919750+08:00;True|2025-12-03T10:18:00.9077028+08:00;True|2025-12-03T10:02:30.4022692+08:00;False|2025-12-03T09:58:15.6880929+08:00;True|2025-12-02T20:20:19.5577161+08:00;True|2025-12-02T19:59:44.5694165+08:00;True|2025-12-02T18:53:53.4696294+08:00;True|2025-12-02T12:31:02.0786003+08:00;False|2025-12-02T12:30:35.5116200+08:00;True|2025-12-02T09:16:07.2877709+08:00;True|2025-02-12T14:57:08.1380239+08:00;True|2025-02-12T14:47:58.0901509+08:00;True|2025-02-12T14:15:10.5288654+08:00;True|2025-02-12T14:12:22.5382196+08:00;True|2025-02-12T14:07:11.7831540+08:00;True|2024-11-29T13:29:48.1554947+08:00;</History>
+    <History>True|2025-12-09T04:04:27.5887901Z;False|2025-12-09T12:02:37.2146599+08:00;True|2025-12-08T14:20:26.4878391+08:00;True|2025-12-08T12:37:30.4953352+08:00;True|2025-12-08T11:42:08.8772270+08:00;True|2025-12-08T11:38:52.8463177+08:00;True|2025-12-08T10:04:02.0917227+08:00;False|2025-12-08T10:03:46.8962836+08:00;True|2025-12-08T10:00:15.0547300+08:00;False|2025-12-08T09:58:28.7217278+08:00;True|2025-12-08T09:32:28.1251567+08:00;True|2025-12-08T09:29:41.3856966+08:00;False|2025-12-08T09:27:36.8951905+08:00;True|2025-12-05T16:39:06.2892731+08:00;True|2025-12-05T15:48:40.9542261+08:00;True|2025-12-05T14:08:26.7097242+08:00;False|2025-12-05T14:08:07.6105127+08:00;True|2025-12-05T12:59:40.2026457+08:00;True|2025-12-05T10:35:19.2246561+08:00;False|2025-12-05T10:32:23.4813105+08:00;True|2025-12-04T09:53:53.3381625+08:00;False|2025-12-04T09:51:54.1953606+08:00;True|2025-12-03T20:17:43.6822978+08:00;False|2025-12-03T20:17:13.6794411+08:00;True|2025-12-03T20:04:33.7080472+08:00;False|2025-12-03T20:03:18.9092172+08:00;True|2025-12-03T17:55:36.8190814+08:00;True|2025-12-03T17:31:16.1192761+08:00;False|2025-12-03T17:25:01.3978650+08:00;True|2025-12-03T17:12:24.4237446+08:00;True|2025-12-03T16:54:15.1801517+08:00;False|2025-12-03T16:53:42.7976484+08:00;True|2025-12-03T12:26:32.8151086+08:00;True|2025-12-03T10:22:12.3177261+08:00;False|2025-12-03T10:21:38.7919750+08:00;True|2025-12-03T10:18:00.9077028+08:00;True|2025-12-03T10:02:30.4022692+08:00;False|2025-12-03T09:58:15.6880929+08:00;True|2025-12-02T20:20:19.5577161+08:00;True|2025-12-02T19:59:44.5694165+08:00;True|2025-12-02T18:53:53.4696294+08:00;True|2025-12-02T12:31:02.0786003+08:00;False|2025-12-02T12:30:35.5116200+08:00;True|2025-12-02T09:16:07.2877709+08:00;True|2025-02-12T14:57:08.1380239+08:00;True|2025-02-12T14:47:58.0901509+08:00;True|2025-02-12T14:15:10.5288654+08:00;True|2025-02-12T14:12:22.5382196+08:00;True|2025-02-12T14:07:11.7831540+08:00;True|2024-11-29T13:29:48.1554947+08:00;</History>
   </PropertyGroup>
   <ItemGroup>
     <File Include="apiapp.json">
@@ -45,19 +45,19 @@
       <publishTime>02/22/2013 16:43:40</publishTime>
     </File>
     <File Include="bin/BLL.dll">
-      <publishTime>12/03/2025 22:11:14</publishTime>
+      <publishTime>12/08/2025 11:37:12</publishTime>
     </File>
     <File Include="bin/BLL.pdb">
-      <publishTime>12/03/2025 22:11:14</publishTime>
+      <publishTime>12/08/2025 11:37:12</publishTime>
     </File>
     <File Include="bin/BouncyCastle.Crypto.dll">
       <publishTime>12/18/2020 05:32:28</publishTime>
     </File>
     <File Include="bin/DAL.dll">
-      <publishTime>12/03/2025 22:10:50</publishTime>
+      <publishTime>12/08/2025 11:36:48</publishTime>
     </File>
     <File Include="bin/DAL.pdb">
-      <publishTime>12/03/2025 22:10:50</publishTime>
+      <publishTime>12/08/2025 11:36:48</publishTime>
     </File>
     <File Include="bin/Dapper.dll">
       <publishTime>07/22/2016 22:52:40</publishTime>
@@ -285,19 +285,19 @@
       <publishTime>05/09/2023 10:43:40</publishTime>
     </File>
     <File Include="bin/TopSdk.dll">
-      <publishTime>12/02/2025 09:07:14</publishTime>
+      <publishTime>12/04/2025 15:04:18</publishTime>
     </File>
     <File Include="bin/TopSdk.pdb">
-      <publishTime>12/02/2025 09:07:14</publishTime>
+      <publishTime>12/04/2025 15:04:18</publishTime>
     </File>
     <File Include="bin/WebActivatorEx.dll">
       <publishTime>11/24/2014 19:18:48</publishTime>
     </File>
     <File Include="bin/WebAPI.dll">
-      <publishTime>12/04/2025 09:53:50</publishTime>
+      <publishTime>12/09/2025 12:04:18</publishTime>
     </File>
     <File Include="bin/WebAPI.pdb">
-      <publishTime>12/04/2025 09:53:50</publishTime>
+      <publishTime>12/09/2025 12:04:18</publishTime>
     </File>
     <File Include="bin/WebAPI.XmlSerializers.dll">
       <publishTime>02/12/2025 14:57:06</publishTime>
diff --git a/WebAPI/WebAPI.csproj.user b/WebAPI/WebAPI.csproj.user
index 5b018f4..8d01cc4 100644
--- a/WebAPI/WebAPI.csproj.user
+++ b/WebAPI/WebAPI.csproj.user
@@ -5,17 +5,12 @@
     <NameOfLastUsedPublishProfile>C:\Users\86130\Desktop\鏅轰簯杩堟�漒MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
     <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
     <NameOfLastUsedPublishProfile>C:\Users\86130\Desktop\鏅轰簯杩堟�漒MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
-    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
+    <LastActiveSolutionConfig>Debug|x86</LastActiveSolutionConfig>
     <NameOfLastUsedPublishProfile>C:\Users\86130\Desktop\鏅轰簯杩堟�漒MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
     <NameOfLastUsedPublishProfile>C:\Users\19858\Desktop\鏅轰簯杩堟�漒MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
     <NameOfLastUsedPublishProfile>C:\Users\19858\Desktop\鏅轰簯杩堟�漒MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
     <NameOfLastUsedPublishProfile>C:\Users\19858\Desktop\鏅轰簯杩堟�漒MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
-<<<<<<< HEAD
-    <NameOfLastUsedPublishProfile>C:\Users\19858\Desktop\鏅轰簯杩堟�漒MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
-    <NameOfLastUsedPublishProfile>C:\Users\19858\Desktop\鏅轰簯杩堟�漒MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
-=======
     <NameOfLastUsedPublishProfile>D:\宸ヤ綔浠g爜\鏅轰簯杩堟�漒MES\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile8.pubxml</NameOfLastUsedPublishProfile>
->>>>>>> fccf02cb2cc7b88e649f8e66230e190dce41abc1
     <UseIISExpress>true</UseIISExpress>
     <Use64BitIISExpress />
     <IISExpressSSLPort />

--
Gitblit v1.9.1