From fba48d2d676cd9b6d493163aef9d87f6e5090aee Mon Sep 17 00:00:00 2001
From: 如洲 陈 <1278080563@qq.com>
Date: 星期五, 12 九月 2025 19:02:00 +0800
Subject: [PATCH] 出库检和退货检验

---
 MES.Service/Modes/QsQaItemThj02.cs                                            |  113 ++
 MESApplication/bin/Release/net8.0/publish/MESApplication.pdb                  |    0 
 MESApplication/bin/Release/net8.0/MESApplication.deps.json                    |   36 
 MESApplication/bin/Release/net8.0/publish/MESApplication.dll                  |    0 
 MESApplication/bin/Release/net8.0/Microsoft.AspNetCore.JsonPatch.dll          |    0 
 MESApplication/bin/Debug/net8.0/MESApplication.pdb                            |    0 
 MESApplication/bin/Release/net8.0/MES.Service.dll                             |    0 
 MESApplication/bin/Release/net8.0/MESApplication.dll                          |    0 
 MESApplication/bin/Release/net8.0/publish/MES.Service.pdb                     |    0 
 MESApplication/bin/Release/net8.0/MES.Service.pdb                             |    0 
 MESApplication/bin/Release/net8.0/MESApplication.pdb                          |    0 
 MESApplication/bin/Release/net8.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll |    0 
 MES.Service/bin/Debug/net8.0/MES.Service.pdb                                  |    0 
 MESApplication/bin/Release/net8.0/publish/MES.Service.dll                     |    0 
 MES.Service/service/QC/XJService.cs                                           |   66 +
 MES.Service/Dto/service/THJDto.cs                                             |  211 ++++
 MESApplication/bin/Debug/net8.0/MESApplication.xml                            |   57 +
 MES.Service/Modes/QsQaItemThj01.cs                                            |  149 ++
 MES.Service/Modes/MesQsImage.cs                                               |    4 
 MES.Service/service/QC/THJService.cs                                          |  824 +++++++++++++++
 MESApplication/bin/Debug/net8.0/MESApplication.exe                            |    0 
 MES.Service/bin/Release/net8.0/MES.Service.dll                                |    0 
 MES.Service/Modes/QsQaItemThj.cs                                              |  153 ++
 MES.Service/bin/Release/net8.0/MES.Service.pdb                                |    0 
 MES.Service/service/BasicData/MesItemsManager.cs                              |    6 
 MESApplication/bin/Release/net8.0/MESApplication.exe                          |    0 
 MESApplication/MESApplication.csproj                                          |    2 
 MESApplication/bin/Debug/net8.0/MES.Service.pdb                               |    0 
 MESApplication/bin/Release/net8.0/MESApplication.xml                          |   57 +
 MES.Service/service/QC/SJService.cs                                           |   83 +
 MESApplication/bin/Debug/net8.0/MES.Service.dll                               |    0 
 MESApplication/Controllers/QC/MesOqcItemsDetect02Controller.cs                |    3 
 MESApplication/bin/Debug/net8.0/Microsoft.AspNetCore.JsonPatch.dll            |    0 
 MESApplication/bin/Debug/net8.0/MESApplication.deps.json                      |   36 
 MESApplication/bin/Release/net8.0/publish/MESApplication.exe                  |    0 
 MES.Service/service/QC/BaseService.cs                                         |   72 +
 MES.Service/service/Warehouse/MesReturnwareManager.cs                         |  122 ++
 MESApplication/Controllers/QC/BaseController.cs                               |   25 
 MESApplication/bin/Debug/net8.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll   |    0 
 MESApplication/bin/Release/net8.0/publish/MESApplication.xml                  |   57 +
 MESApplication/Controllers/QC/THJController.cs                                |  604 +++++++++++
 MES.Service/Dto/webApi/ErpItems.cs                                            |   20 
 MES.Service/Modes/QsItemThjWorkno.cs                                          |   46 
 MESApplication/bin/Release/net8.0/publish/MESApplication.deps.json            |   36 
 MESApplication/bin/Debug/net8.0/MESApplication.dll                            |    0 
 MES.Service/bin/Debug/net8.0/MES.Service.dll                                  |    0 
 MES.Service/Modes/MesItems.cs                                                 |   13 
 MES.Service/service/QC/RKJService.cs                                          |  232 ++++
 MESApplication/Properties/PublishProfiles/FolderProfile.pubxml.user           |    2 
 package.json                                                                  |   29 
 MESApplication/Controllers/QC/RKJController.cs                                |   49 
 51 files changed, 2,995 insertions(+), 112 deletions(-)

diff --git a/MES.Service/Dto/service/THJDto.cs b/MES.Service/Dto/service/THJDto.cs
new file mode 100644
index 0000000..744d593
--- /dev/null
+++ b/MES.Service/Dto/service/THJDto.cs
@@ -0,0 +1,211 @@
+using System.ComponentModel.DataAnnotations;
+using MES.Service.Modes;
+
+namespace MES.Service.Dto.service;
+
+/// <summary>
+/// 閿�鍞��璐ф楠屽崟鍒嗛〉鏌ヨ缁撴灉
+/// </summary>
+public class THJPageResult
+{
+    /// <summary>
+    /// 涓婚敭ID
+    /// </summary>
+    public decimal? Id { get; set; }
+
+    /// <summary>
+    /// 妫�楠屽崟鍙�
+    /// </summary>
+    public string? ReleaseNo { get; set; }
+
+    /// <summary>
+    /// 鍒涘缓鏃ユ湡
+    /// </summary>
+    public DateTime? CreateDate { get; set; }
+
+    /// <summary>
+    /// 鍒涘缓浜�
+    /// </summary>
+    public string? CreateBy { get; set; }
+
+    /// <summary>
+    /// 鐗╂枡缂栫爜
+    /// </summary>
+    public string? ItemNo { get; set; }
+
+    /// <summary>
+    /// 鐗╂枡鍚嶇О
+    /// </summary>
+    public string? ItemName { get; set; }
+
+    /// <summary>
+    /// 瑙勬牸鍨嬪彿
+    /// </summary>
+    public string? ItemModel { get; set; }
+
+    /// <summary>
+    /// 宸ュ崟鏁伴噺
+    /// </summary>
+    public decimal? WorkQty { get; set; }
+
+    /// <summary>
+    /// 妫�楠屼汉
+    /// </summary>
+    public string? StatusUser { get; set; }
+
+    /// <summary>
+    /// 妫�楠岀粨鏋�
+    /// </summary>
+    public string? Result { get; set; }
+
+    /// <summary>
+    /// 閫�璐у崟鍒�
+    /// </summary>
+    public string? ReturnType { get; set; }
+
+    /// <summary>
+    /// 閫�璐у崟鍙�
+    /// </summary>
+    public string? ReturnNo { get; set; }
+
+    /// <summary>
+    /// 鍗曟嵁鏃ユ湡
+    /// </summary>
+    public DateTime? BillDate { get; set; }
+
+    /// <summary>
+    /// 瀹㈡埛鍚嶇О
+    /// </summary>
+    public string? CustomerName { get; set; }
+
+    /// <summary>
+    /// 閫�璐ф暟閲�
+    /// </summary>
+    public decimal? Sl { get; set; }
+
+    /// <summary>
+    /// 閫�璐у師鍥�
+    /// </summary>
+    public string? ReturnReason { get; set; }
+
+    /// <summary>
+    /// 涓嶅悎鏍兼弿杩�
+    /// </summary>
+    public string? Remarks { get; set; }
+
+    // 鍒嗛〉鍙傛暟
+    public int PageIndex { get; set; } = 1;
+    public int Limit { get; set; } = 20;
+}
+
+/// <summary>
+/// 閿�鍞��璐ф楠屽崟DTO
+/// </summary>
+public class THJDto
+{
+    /// <summary>
+    /// 涓昏〃淇℃伅
+    /// </summary>
+    public QsQaItemThj from { get; set; } = new();
+
+    /// <summary>
+    /// 妫�楠岄」鐩垪琛�
+    /// </summary>
+    public List<QsQaItemThj01> items { get; set; } = new();
+
+    /// <summary>
+    /// 妫�楠岀粨鏋滃垪琛�
+    /// </summary>
+    public List<QsQaItemThj02> Results { get; set; } = new();
+
+    /// <summary>
+    /// 鐢ㄦ埛缂栧彿
+    /// </summary>
+    public string userNo { get; set; } = "";
+
+    /// <summary>
+    /// 涓昏〃ID
+    /// </summary>
+    public decimal? gid { get; set; }
+
+    /// <summary>
+    /// 妫�楠岄」鐩富琛↖D
+    /// </summary>
+    public decimal? pid { get; set; }
+
+    /// <summary>
+    /// 妫�楠岄」鐩槑缁咺D
+    /// </summary>
+    public decimal? id { get; set; }
+
+    /// <summary>
+    /// 澶囨敞
+    /// </summary>
+    public string Remarks { get; set; } = "";
+
+    /// <summary>
+    /// 妫�楠岄」鐩富琛ㄤ俊鎭�
+    /// </summary>
+    public QsQaItemThj01 ItemThj01 { get; set; } = new();
+}
+
+/// <summary>
+/// 閫�璐у崟淇℃伅
+/// </summary>
+public class ReturnwareInfo
+{
+    /// <summary>
+    /// 閫�璐у崟鍒�
+    /// </summary>
+    public string? ReturnType { get; set; }
+
+    /// <summary>
+    /// 閫�璐у崟鍙�
+    /// </summary>
+    public string? ReturnNo { get; set; }
+
+    /// <summary>
+    /// 鍗曟嵁鏃ユ湡
+    /// </summary>
+    public DateTime? BillDate { get; set; }
+
+    /// <summary>
+    /// 瀹㈡埛鍚嶇О
+    /// </summary>
+    public string? CustomerName { get; set; }
+
+    /// <summary>
+    /// 涓氬姟浜哄憳
+    /// </summary>
+    public string? BusinessBy { get; set; }
+
+    /// <summary>
+    /// 鐗╂枡缂栫爜
+    /// </summary>
+    public string? ItemNo { get; set; }
+
+    /// <summary>
+    /// 鐗╂枡鍚嶇О
+    /// </summary>
+    public string? ItemName { get; set; }
+
+    /// <summary>
+    /// 瑙勬牸鍨嬪彿
+    /// </summary>
+    public string? ItemModel { get; set; }
+
+    /// <summary>
+    /// 鏁伴噺
+    /// </summary>
+    public decimal? Quantity { get; set; }
+
+    /// <summary>
+    /// 閫�璐т粨搴�
+    /// </summary>
+    public string? DepotCode { get; set; }
+
+    /// <summary>
+    /// 澶囨敞
+    /// </summary>
+    public string? Remarks { get; set; }
+}
diff --git a/MES.Service/Dto/webApi/ErpItems.cs b/MES.Service/Dto/webApi/ErpItems.cs
index 330691f..ed9a5dc 100644
--- a/MES.Service/Dto/webApi/ErpItems.cs
+++ b/MES.Service/Dto/webApi/ErpItems.cs
@@ -34,4 +34,24 @@
     public string? Expirationdate { get; set; }
     public string? Reviewperiod  { get; set; }
     public decimal? FLeadDays { get; set; }
+    
+    /// <summary>
+    /// 鑷畾涔夊瓧娈�4 - 鍗曚环
+    /// </summary>
+    public string? FRemark4 { get; set; }
+    
+    /// <summary>
+    /// 鑷畾涔夊瓧娈�5
+    /// </summary>
+    public string? FRemark5 { get; set; }
+    
+    /// <summary>
+    /// 鏈�灏忚绠辨暟
+    /// </summary>
+    public double? FMinPackageQty { get; set; }
+    
+    /// <summary>
+    /// 璐d换閮ㄩ棬
+    /// </summary>
+    public string? FDeportCode { get; set; }
 }
\ No newline at end of file
diff --git a/MES.Service/Modes/MesItems.cs b/MES.Service/Modes/MesItems.cs
index ec6e8ab..5300c9c 100644
--- a/MES.Service/Modes/MesItems.cs
+++ b/MES.Service/Modes/MesItems.cs
@@ -239,7 +239,13 @@
     public string? Reviewperiod { get; set; }
 
     /// <summary>
-    ///     鑷畾涔夊瓧娈�4
+    ///     鏈�灏忚绠辨暟
+    /// </summary>
+    [SugarColumn(ColumnName = "MINPACKAGEQTY")]
+    public double? MinPackageQty { get; set; }
+
+    /// <summary>
+    ///     鑷畾涔夊瓧娈�4 - 鍗曚环
     /// </summary>
     [SugarColumn(ColumnName = "REMARK4")]
     public string Remark4 { get; set; }
@@ -323,6 +329,11 @@
     [SugarColumn(ColumnName = "LEAD_DAYS")]
     public decimal? LeadDays { get; set; }
 
+    /// <summary>
+    ///     璐d换閮ㄩ棬
+    /// </summary>
+    [SugarColumn(ColumnName = "DEPORTCODE")]
+    public string? DeportCode { get; set; }
 
 
     [SugarColumn(IsIgnore = true)] public string? Type { get; set; }
diff --git a/MES.Service/Modes/MesQsImage.cs b/MES.Service/Modes/MesQsImage.cs
index 92c627d..6a0241b 100644
--- a/MES.Service/Modes/MesQsImage.cs
+++ b/MES.Service/Modes/MesQsImage.cs
@@ -36,11 +36,11 @@
     public byte[]? ImageData { get; set; }
 
     /// <summary>
-    ///     1涓洪妫�锛�2涓哄贰妫�锛�3涓哄叆搴撴
+    ///     1涓洪妫�锛�2涓哄贰妫�锛�3涓哄叆搴撴锛�8涓洪��璐ф楠�
     /// </summary>
     [Column("QS_TYPE")]
     [SugarColumn(ColumnName = "QS_TYPE")] //鐢ㄤ簬SqlSugar
-    [StringLength(1, ErrorMessage = "1涓洪妫�锛�2涓哄贰妫�锛�3涓哄叆搴撴闀垮害涓嶈兘瓒呭嚭1")]
+    [StringLength(1, ErrorMessage = "1涓洪妫�锛�2涓哄贰妫�锛�3涓哄叆搴撴锛�8涓洪��璐ф楠岄暱搴︿笉鑳借秴鍑�1")]
     public string? QsType { get; set; }
 
     /// <summary>
diff --git a/MES.Service/Modes/QsItemThjWorkno.cs b/MES.Service/Modes/QsItemThjWorkno.cs
new file mode 100644
index 0000000..62a175d
--- /dev/null
+++ b/MES.Service/Modes/QsItemThjWorkno.cs
@@ -0,0 +1,46 @@
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using SqlSugar;
+
+namespace MES.Service.Modes;
+
+/// <summary>
+///     閿�鍞��璐ф楠屽崟宸ュ崟琛�
+/// </summary>
+[Table("QS_ITEM_THJ_WORKNO")]
+[SugarTable("QS_ITEM_THJ_WORKNO")] //鐢ㄤ簬SqlSugar
+public class QsItemThjWorkno
+{
+    /// <summary>
+    ///     搴忓垪SEQ_QS_THJ
+    /// </summary>
+    [Key]
+    [Column("ID")]
+    [SugarColumn(IsPrimaryKey = true, OracleSequenceName = "SEQ_QS_THJ",
+        ColumnName = "ID")]
+    public decimal? Id { get; set; }
+
+    /// <summary>
+    ///     妫�楠屼富琛╥d
+    /// </summary>
+    [Column("PID")]
+    [SugarColumn(ColumnName = "PID")] //鐢ㄤ簬SqlSugar
+    public decimal? Pid { get; set; }
+
+    /// <summary>
+    ///     鐢熶骇宸ュ崟
+    /// </summary>
+    [Column("WORKNO")]
+    [SugarColumn(ColumnName = "WORKNO")] //鐢ㄤ簬SqlSugar
+    [StringLength(50, ErrorMessage = "宸ュ崟鍙烽暱搴︿笉鑳借秴鍑�50")]
+    public string? Workno { get; set; }
+
+    /// <summary>
+    ///     宸ュ崟鏁伴噺
+    /// </summary>
+    [Column("WORK_QTY")]
+    [SugarColumn(ColumnName = "WORK_QTY")] //鐢ㄤ簬SqlSugar
+    public decimal? WorkQty { get; set; }
+
+    [SugarColumn(IsIgnore = true)] public string? ItemName { get; set; }
+}
diff --git a/MES.Service/Modes/QsQaItemThj.cs b/MES.Service/Modes/QsQaItemThj.cs
new file mode 100644
index 0000000..31391dd
--- /dev/null
+++ b/MES.Service/Modes/QsQaItemThj.cs
@@ -0,0 +1,153 @@
+using System;
+using System.ComponentModel.DataAnnotations.Schema;
+using SqlSugar;
+
+namespace MES.Service.Modes;
+
+/// <summary>
+///     閿�鍞��璐ф楠屽崟涓昏〃
+/// </summary>
+[SugarTable("QS_QA_ITEM_THJ")]
+public class QsQaItemThj
+{
+    /// <summary>
+    ///     搴忓垪SEQ_QS_THJ
+    /// </summary>
+    [SugarColumn(IsPrimaryKey = true, OracleSequenceName = "SEQ_QS_THJ", ColumnName = "ID")]
+    public decimal? Id { get; set; }
+
+    /// <summary>
+    ///     妫�楠屽崟鍙�
+    /// </summary>
+    [SugarColumn(ColumnName = "RELEASE_NO")]
+    public string? ReleaseNo { get; set; }
+
+    /// <summary>
+    ///     鍒涘缓鏃ユ湡
+    /// </summary>
+    [Column("CREATE_DATE")]
+    [SugarColumn(ColumnName = "CREATE_DATE")]
+    public DateTime? CreateDate { get; set; }
+
+    /// <summary>
+    ///     鍒涘缓浜�
+    /// </summary>
+    [Column("CREATE_BY")]
+    [SugarColumn(ColumnName = "CREATE_BY")]
+    public string? CreateBy { get; set; }
+
+    /// <summary>
+    ///     鐗╂枡缂栫爜
+    /// </summary>
+    [Column("ITEM_NO")]
+    [SugarColumn(ColumnName = "ITEM_NO")]
+    public string? ItemNo { get; set; }
+
+    /// <summary>
+    ///     妫�楠屼汉鍛�
+    /// </summary>
+    [Column("FCHECK_BY")]
+    [SugarColumn(ColumnName = "FCHECK_BY")]
+    public string? FcheckBy { get; set; }
+
+    /// <summary>
+    ///     閫�璐ф暟閲�
+    /// </summary>
+    [Column("SL")]
+    [SugarColumn(ColumnName = "SL")]
+    public decimal? Sl { get; set; }
+
+    /// <summary>
+    ///     宸ュ崟鍙凤紙鍙敤浜庡瓨鍌ㄩ��璐у崟鍙凤級
+    /// </summary>
+    [Column("BILL_NO")]
+    [SugarColumn(ColumnName = "BILL_NO")]
+    public string? BillNo { get; set; }
+
+    /// <summary>
+    ///     澶囨敞
+    /// </summary>
+    [Column("REMARKS")]
+    [SugarColumn(ColumnName = "REMARKS")]
+    public string? Remarks { get; set; }
+
+    /// <summary>
+    ///     妫�楠岀粨鏋�
+    /// </summary>
+    [Column("FCHECK_RESU")]
+    [SugarColumn(ColumnName = "FCHECK_RESU")]
+    public string? FcheckResu { get; set; }
+
+    /// <summary>
+    ///     妫�楠屾棩鏈�
+    /// </summary>
+    [Column("FCHECK_DATE")]
+    [SugarColumn(ColumnName = "FCHECK_DATE")]
+    public DateTime? FcheckDate { get; set; }
+
+    /// <summary>
+    ///     鏇存柊浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "LASTUPDATE_BY")]
+    public string? LastupdateBy { get; set; }
+
+    /// <summary>
+    ///     鏇存柊鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "LASTUPDATE_DATE")]
+    public DateTime? LastupdateDate { get; set; }
+
+    /// <summary>
+    ///     淇敼浜�1
+    /// </summary>
+    [SugarColumn(ColumnName = "MODIFY1_BY")]
+    public string? Modify1By { get; set; }
+
+    /// <summary>
+    ///     鍗曚綅
+    /// </summary>
+    [SugarColumn(ColumnName = "ITEM_UNIT")]
+    public string? ItemUnit { get; set; }
+
+    /// <summary>
+    ///     妯″叿鍙�
+    /// </summary>
+    [SugarColumn(ColumnName = "MOID_NUM")]
+    public string? MoidNum { get; set; }
+
+    /// <summary>
+    ///     鎻愪氦浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "FSUBMIT_BY")]
+    public string? FsubmitBy { get; set; }
+
+    /// <summary>
+    ///     鎻愪氦鏃ユ湡
+    /// </summary>
+    [SugarColumn(ColumnName = "FSUBMIT_DATE")]
+    public DateTime? FsubmitDate { get; set; }
+
+    /// <summary>
+    ///     鎻愪氦鐘舵��
+    /// </summary>
+    [SugarColumn(ColumnName = "FSUBMIT")]
+    public decimal? Fsubmit { get; set; }
+
+    /// <summary>
+    ///     鐗╂枡ID
+    /// </summary>
+    [SugarColumn(ColumnName = "ITEM_ID")]
+    public decimal? ItemId { get; set; }
+
+    /// <summary>
+    ///     绾夸綋缂栧彿
+    /// </summary>
+    [SugarColumn(ColumnName = "LINE")]
+    public string? Line { get; set; }
+
+    /// <summary>
+    ///     涓嶅悎鏍兼弿杩�
+    /// </summary>
+    [SugarColumn(ColumnName = "BHGYY")]
+    public string? Bhgyy { get; set; }
+}
diff --git a/MES.Service/Modes/QsQaItemThj01.cs b/MES.Service/Modes/QsQaItemThj01.cs
new file mode 100644
index 0000000..0ac9db8
--- /dev/null
+++ b/MES.Service/Modes/QsQaItemThj01.cs
@@ -0,0 +1,149 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using SqlSugar;
+
+namespace MES.Service.Modes;
+
+/// <summary>
+///     閿�鍞��璐ф楠屽崟鏄庣粏琛�
+/// </summary>
+[Table("QS_QA_ITEM_THJ01")]
+[SugarTable("QS_QA_ITEM_THJ01")] //鐢ㄤ簬SqlSugar
+public class QsQaItemThj01
+{
+    /// <summary>
+    ///     搴忓垪SEQ_QS_THJ
+    /// </summary>
+    [Key]
+    [Column("ID")]
+    [SugarColumn(IsPrimaryKey = true, OracleSequenceName = "SEQ_QS_THJ",
+        ColumnName = "ID")] //鐢ㄤ簬SqlSugar
+    public decimal? Id { get; set; }
+
+    /// <summary>
+    ///     涓昏〃ID
+    /// </summary>
+    [SugarColumn(ColumnName = "PID")]
+    public decimal? Pid { get; set; }
+
+    /// <summary>
+    ///     椤圭洰鍚嶇О
+    /// </summary>
+    [SugarColumn(ColumnName = "PROJ_NAME")]
+    public string? ProjName { get; set; }
+
+    /// <summary>
+    ///     璐ㄩ噺瑕佹眰
+    /// </summary>
+    [SugarColumn(ColumnName = "ITEM_MOD")]
+    public string? ItemMod { get; set; }
+
+    /// <summary>
+    ///     妫�楠屾柟娉�
+    /// </summary>
+    [SugarColumn(ColumnName = "INSPECTION_METHOD")]
+    public string? InspectionMethod { get; set; }
+
+    /// <summary>
+    ///     浣跨敤浠櫒
+    /// </summary>
+    [SugarColumn(ColumnName = "USING_INSTRUMENTS")]
+    public string? UsingInstruments { get; set; }
+
+    /// <summary>
+    ///     妫�楠屼釜鏁�
+    /// </summary>
+    [SugarColumn(ColumnName = "LEVEL_NUM")]
+    public decimal? LevelNum { get; set; }
+
+    /// <summary>
+    ///     涓婇檺鍊�
+    /// </summary>
+    [SugarColumn(ColumnName = "MAX_VALUE")]
+    public decimal? MaxValue { get; set; }
+
+    /// <summary>
+    ///     鏍囧噯鍊�
+    /// </summary>
+    [SugarColumn(ColumnName = "STANDARD_VALUE")]
+    public decimal? StandardValue { get; set; }
+
+    /// <summary>
+    ///     涓嬮檺鍊�
+    /// </summary>
+    [SugarColumn(ColumnName = "MIN_VALUE")]
+    public decimal? MinValue { get; set; }
+
+    /// <summary>
+    ///     澶囨敞
+    /// </summary>
+    [SugarColumn(ColumnName = "NOTES")]
+    public string? Notes { get; set; }
+
+    /// <summary>
+    ///     妫�楠屾按骞�
+    /// </summary>
+    [SugarColumn(ColumnName = "FCHECK_LEVEL")]
+    public string? FcheckLevel { get; set; }
+
+    /// <summary>
+    ///     鎺ユ敹姘村钩
+    /// </summary>
+    [SugarColumn(ColumnName = "FAC_LEVEL")]
+    public string? FacLevel { get; set; }
+
+    /// <summary>
+    ///     璐ㄩ噺鏍囧噯浠g爜
+    /// </summary>
+    [SugarColumn(ColumnName = "QS_CODE")]
+    public string? QsCode { get; set; }
+
+    /// <summary>
+    ///     璐ㄩ噺鏍囧噯鍚嶇О
+    /// </summary>
+    [SugarColumn(ColumnName = "QS_NAME")]
+    public string? QsName { get; set; }
+
+    /// <summary>
+    ///     鏄惁鍚堟牸
+    /// </summary>
+    [SugarColumn(ColumnName = "IS_PASS")]
+    public decimal? IsPass { get; set; }
+
+    /// <summary>
+    ///     澶囨敞
+    /// </summary>
+    [SugarColumn(ColumnName = "REMARKS")]
+    public string? Remarks { get; set; }
+
+    /// <summary>
+    ///     妫�楠岀粨鏋滐紙鐢ㄤ簬鍓嶇鏄剧ず锛屼笉瀛樺偍鍒版暟鎹簱锛�
+    /// </summary>
+    [SugarColumn(IsIgnore = true)]
+    public string? result { get; set; }
+
+    /// <summary>
+    ///     宸叉楠屼釜鏁帮紙鐢ㄤ簬鍓嶇鏄剧ず锛屼笉瀛樺偍鍒版暟鎹簱锛�
+    /// </summary>
+    [SugarColumn(IsIgnore = true)]
+    public int? isCheck { get; set; }
+
+    /// <summary>
+    ///     鍥剧墖鏁版嵁锛堢敤浜庡墠绔樉绀猴紝涓嶅瓨鍌ㄥ埌鏁版嵁搴擄級
+    /// </summary>
+    [SugarColumn(IsIgnore = true)]
+    public string? imageData { get; set; }
+
+    /// <summary>
+    ///     鍥剧墖锛堢敤浜庡墠绔樉绀猴紝涓嶅瓨鍌ㄥ埌鏁版嵁搴擄級
+    /// </summary>
+    [SugarColumn(IsIgnore = true)]
+    public byte[]? Picture { get; set; }
+
+    /// <summary>
+    ///     鍥剧墖鍚嶇О锛堢敤浜庡墠绔樉绀猴紝涓嶅瓨鍌ㄥ埌鏁版嵁搴擄級
+    /// </summary>
+    [SugarColumn(IsIgnore = true)]
+    public string? Picturename { get; set; }
+}
diff --git a/MES.Service/Modes/QsQaItemThj02.cs b/MES.Service/Modes/QsQaItemThj02.cs
new file mode 100644
index 0000000..052ccbc
--- /dev/null
+++ b/MES.Service/Modes/QsQaItemThj02.cs
@@ -0,0 +1,113 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using SqlSugar;
+
+namespace MES.Service.Modes;
+
+/// <summary>
+///     閿�鍞��璐ф楠屽崟妫�楠岀粨鏋滆〃
+/// </summary>
+[Table("QS_QA_ITEM_THJ02")]
+[SugarTable("QS_QA_ITEM_THJ02")] //鐢ㄤ簬SqlSugar
+public class QsQaItemThj02
+{
+    /// <summary>
+    ///     搴忓垪SEQ_QS_THJ
+    /// </summary>
+    [Key]
+    [Column("ID")]
+    [SugarColumn(IsPrimaryKey = true, OracleSequenceName = "SEQ_QS_THJ",
+        ColumnName = "ID")] //鐢ㄤ簬SqlSugar
+    public decimal? Id { get; set; }
+
+    /// <summary>
+    ///     棣栨瀛愯〃id
+    /// </summary>
+    [SugarColumn(ColumnName = "PID")]
+    public decimal? Pid { get; set; }
+
+    /// <summary>
+    ///     棣栨涓昏〃id
+    /// </summary>
+    [SugarColumn(ColumnName = "GID")]
+    public decimal? Gid { get; set; }
+
+    /// <summary>
+    ///     妫�楠岀粨鏋�
+    /// </summary>
+    [SugarColumn(ColumnName = "FCHECK_RESU")]
+    public string? FcheckResu { get; set; }
+
+    /// <summary>
+    ///     鏍囧噯鍊�
+    /// </summary>
+    [SugarColumn(ColumnName = "FSTAND")]
+    public string? Fstand { get; set; }
+
+    /// <summary>
+    ///     鍒涘缓鏃堕棿
+    /// </summary>
+    [SugarColumn(ColumnName = "CREATE_DATE")]
+    public DateTime? CreateDate { get; set; }
+
+    /// <summary>
+    ///     鍒涘缓浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "CREATE_BY")]
+    public string? CreateBy { get; set; }
+
+    /// <summary>
+    ///     鏇存柊鏃堕棿
+    /// </summary>
+    [SugarColumn(ColumnName = "UPDATE_DATE")]
+    public DateTime? UpdateDate { get; set; }
+
+    /// <summary>
+    ///     鏇存柊浜�
+    /// </summary>
+    [SugarColumn(ColumnName = "UPDATE_BY")]
+    public string? UpdateBy { get; set; }
+
+    /// <summary>
+    ///     澶囨敞
+    /// </summary>
+    [SugarColumn(ColumnName = "REMARKS")]
+    public string? Remarks { get; set; }
+
+    /// <summary>
+    ///     宸ュ巶锛堢敤浜庡墠绔樉绀猴紝涓嶅瓨鍌ㄥ埌鏁版嵁搴擄級
+    /// </summary>
+    [SugarColumn(IsIgnore = true)]
+    public string? Factory { get; set; }
+
+    /// <summary>
+    ///     鍏徃锛堢敤浜庡墠绔樉绀猴紝涓嶅瓨鍌ㄥ埌鏁版嵁搴擄級
+    /// </summary>
+    [SugarColumn(IsIgnore = true)]
+    public string? Company { get; set; }
+
+    /// <summary>
+    ///     妫�楠屽崟鍙凤紙鐢ㄤ簬鍓嶇鏄剧ず锛屼笉瀛樺偍鍒版暟鎹簱锛�
+    /// </summary>
+    [SugarColumn(IsIgnore = true)]
+    public string? ReleaseNo { get; set; }
+
+    /// <summary>
+    ///     鏈�鍚庢洿鏂颁汉锛堢敤浜庡墠绔樉绀猴紝涓嶅瓨鍌ㄥ埌鏁版嵁搴擄級
+    /// </summary>
+    [SugarColumn(IsIgnore = true)]
+    public string? LastupdateBy { get; set; }
+
+    /// <summary>
+    ///     鏈�鍚庢洿鏂版棩鏈燂紙鐢ㄤ簬鍓嶇鏄剧ず锛屼笉瀛樺偍鍒版暟鎹簱锛�
+    /// </summary>
+    [SugarColumn(IsIgnore = true)]
+    public DateTime? LastupdateDate { get; set; }
+
+    /// <summary>
+    ///     妫�楠屼釜鏁帮紙鐢ㄤ簬鍓嶇鏄剧ず锛屼笉瀛樺偍鍒版暟鎹簱锛�
+    /// </summary>
+    [SugarColumn(IsIgnore = true)]
+    public int? count { get; set; }
+}
diff --git a/MES.Service/bin/Debug/net8.0/MES.Service.dll b/MES.Service/bin/Debug/net8.0/MES.Service.dll
index c635514..f5f79ef 100644
--- a/MES.Service/bin/Debug/net8.0/MES.Service.dll
+++ b/MES.Service/bin/Debug/net8.0/MES.Service.dll
Binary files differ
diff --git a/MES.Service/bin/Debug/net8.0/MES.Service.pdb b/MES.Service/bin/Debug/net8.0/MES.Service.pdb
index ead8e76..37b5eaf 100644
--- a/MES.Service/bin/Debug/net8.0/MES.Service.pdb
+++ b/MES.Service/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
diff --git a/MES.Service/bin/Release/net8.0/MES.Service.dll b/MES.Service/bin/Release/net8.0/MES.Service.dll
index e574157..1b5476b 100644
--- a/MES.Service/bin/Release/net8.0/MES.Service.dll
+++ b/MES.Service/bin/Release/net8.0/MES.Service.dll
Binary files differ
diff --git a/MES.Service/bin/Release/net8.0/MES.Service.pdb b/MES.Service/bin/Release/net8.0/MES.Service.pdb
index 02a90ce..2293692 100644
--- a/MES.Service/bin/Release/net8.0/MES.Service.pdb
+++ b/MES.Service/bin/Release/net8.0/MES.Service.pdb
Binary files differ
diff --git a/MES.Service/service/BasicData/MesItemsManager.cs b/MES.Service/service/BasicData/MesItemsManager.cs
index 1533419..75ccb66 100644
--- a/MES.Service/service/BasicData/MesItemsManager.cs
+++ b/MES.Service/service/BasicData/MesItemsManager.cs
@@ -160,7 +160,11 @@
             Inspectionmethod = item.Inspectionmethod,
             Expirationdate = item.Expirationdate,
             Reviewperiod   = item.Reviewperiod,
-            LeadDays       = item.FLeadDays
+            LeadDays       = item.FLeadDays,
+            Remark4        = item.FRemark4,
+            Remark5        = item.FRemark5,
+            MinPackageQty  = item.FMinPackageQty,
+            DeportCode    = item.FDeportCode
 
         };
     }
diff --git a/MES.Service/service/QC/BaseService.cs b/MES.Service/service/QC/BaseService.cs
index 48e6026..15a11fd 100644
--- a/MES.Service/service/QC/BaseService.cs
+++ b/MES.Service/service/QC/BaseService.cs
@@ -22,8 +22,23 @@
         mesQsImages.ForEach(s =>
         {
             if (!string.IsNullOrEmpty(s.base64Date))
+            {
                 //灏哹ase64杞崲涓篵yte鏁扮粍
                 s.ImageData = Convert.FromBase64String(s.base64Date);
+                
+                // 缁熶竴鏂囦欢鍚嶆牸寮忥細濡傛灉涓虹┖鎴朥UID鏍煎紡锛屽垯鐢熸垚鏃堕棿鎴虫牸寮忥紝鍚庣紑涓簆ng
+                if (string.IsNullOrEmpty(s.Picturename) || 
+                    (s.Picturename.Length > 30 && !s.Picturename.Contains(".")))
+                {
+                    s.Picturename = $"{DateTimeOffset.Now.ToUnixTimeMilliseconds()}.png";
+                }
+                else if (s.Picturename.Contains("."))
+                {
+                    // 濡傛灉鏂囦欢鍚嶅寘鍚墿灞曞悕锛岀粺涓�鏀逛负png鍚庣紑
+                    var nameWithoutExt = s.Picturename.Split('.')[0];
+                    s.Picturename = $"{nameWithoutExt}.png";
+                }
+            }
         });
 
         return SqlSugarHelper.UseTransactionWithOracle(db =>
@@ -85,4 +100,61 @@
         return mesQsImages;
     }
 
+    /// <summary>
+    /// 鑾峰彇THJ閫�璐ф楠岀殑鍥剧墖锛屾敮鎸佹牴鎹��璐у崟鍙锋煡鎵鹃澶栧浘鐗�
+    /// </summary>
+    public List<MesQsImage> getByThjFid(decimal id, string qsType)
+    {
+        var db = SqlSugarHelper.GetInstance();
+        var mesQsImages = db.Queryable<MesQsImage>()
+            .Where(s => s.Fid == id && s.QsType == qsType).ToList();
+
+        // 鑾峰彇THJ涓昏〃淇℃伅
+        var qsQaItemThj = db.Queryable<QsQaItemThj>()
+            .Where(s => s.Id == id).First();
+
+        if (qsQaItemThj?.BillNo != null)
+        {
+            // 鏍规嵁閫�璐у崟鍙锋煡鎵鹃澶栫殑鍥剧墖
+            var additionalImages = db.Queryable<MesQsImage>()
+                .Where(s => s.OrderNo == qsQaItemThj.BillNo && s.QsType == qsType)
+                .Where(s => !mesQsImages.Any(existing => existing.Id == s.Id))
+                .ToList();
+
+            mesQsImages.AddRange(additionalImages);
+
+            // 闄愬埗鏈�澶�9寮犲浘鐗�
+            if (mesQsImages.Count > 9)
+            {
+                mesQsImages = mesQsImages.Take(9).ToList();
+            }
+        }
+
+        mesQsImages.ForEach(s =>
+        {
+            if (s.ImageData is { Length: > 0 })
+            {
+                s.base64Date = Convert.ToBase64String(s.ImageData);
+                
+                // 纭繚鏂囦欢鍚嶆牸寮忔纭紝缁熶竴浣跨敤png鍚庣紑
+                if (string.IsNullOrEmpty(s.Picturename))
+                {
+                    s.Picturename = $"{DateTimeOffset.Now.ToUnixTimeMilliseconds()}.png";
+                }
+                else if (s.Picturename.Contains("."))
+                {
+                    // 濡傛灉鏂囦欢鍚嶅寘鍚墿灞曞悕锛岀粺涓�鏀逛负png鍚庣紑
+                    var nameWithoutExt = s.Picturename.Split('.')[0];
+                    s.Picturename = $"{nameWithoutExt}.png";
+                }
+            }
+            else
+            {
+                // 濡傛灉娌℃湁鍥剧墖鏁版嵁锛岃缃┖鐨刡ase64
+                s.base64Date = string.Empty;
+            }
+        });
+        return mesQsImages;
+    }
+
 }
\ No newline at end of file
diff --git a/MES.Service/service/QC/RKJService.cs b/MES.Service/service/QC/RKJService.cs
index ca300f8..70d4478 100644
--- a/MES.Service/service/QC/RKJService.cs
+++ b/MES.Service/service/QC/RKJService.cs
@@ -3,6 +3,7 @@
 using MES.Service.Modes;
 using MES.Service.util;
 using SqlSugar;
+using System.Data;
 
 namespace MES.Service.service.QC;
 
@@ -367,46 +368,239 @@
                 return commit;
             });
 
+        // 娉ㄩ噴鎺夎嚜鍔ㄦ彁浜ら�昏緫锛屾敼涓烘墜鍔ㄦ彁浜�
+        // var isNull = db.Queryable<QsItemOqcItem>()
+        //     .Where(s => s.Pid == detail.Gid && s.IsPass == null).Count();
+        //
+        // if (isNull > 0) return 1;
+        //
+        //
+        // //鑾峰彇妫�楠屽崟鐨勬楠岄」鐩殑涓暟
+        // var sum = db.Queryable<QsItemOqcItem>()
+        //     .Where(s => s.Pid == detail.Gid).Count();
+        //
+        // if (sum == 0) return 1;
+        //
+        // //鑾峰彇妫�楠屽崟涓嬬殑鍚堟牸鐨勬楠岄」鐩釜鏁�
+        // var icount = db.Queryable<QsItemOqcItem>()
+        //     .Where(s => s.Pid == detail.Gid && s.IsPass == 1).Count();
+        //
+        // var FcheckResu = "涓嶅悎鏍�";
+        //
+        // //瀹為檯涓暟绛変簬鐞嗚涓暟鏃跺妫�楠屽崟杩涜鍒ゅ畾
+        // if (sum == icount)
+        //     //鍚堟牸鐨勬楠岀粨鏋滅瓑浜庢�绘楠屾暟瑙嗕负鍚堟牸
+        //     FcheckResu = "鍚堟牸";
+        //
+        // SqlSugarHelper.UseTransactionWithOracle(db =>
+        // {
+        //     return db.Updateable<QsItemOqcReq>()
+        //         .SetColumns(s => s.FcheckResu == FcheckResu)
+        //         .SetColumns(s => s.FcheckDate == DateTime.Now)
+        //         .SetColumns(s => s.FcheckBy == detail.CreateBy)
+        //         .SetColumns(s => s.LastupdateBy == detail.CreateBy)
+        //         .SetColumns(s => s.LastupdateDate == DateTime.Now)
+        //         .Where(s => s.Id == detail.Gid)
+        //         .ExecuteCommand();
+        // });
+        //
+        // if (FcheckResu.Equals("涓嶅悎鏍�"))
+        //     //鑷姩鐢熸垚鍏ュ簱妫�寮傚父瀵圭瓥
+        //     saveDetect02(detail.Gid, detail.CreateBy);
+
+        return useTransactionWithOracle;
+    }
+
+    /// <summary>
+    /// 鎵嬪姩鎻愪氦鍏ュ簱妫�缁撴灉
+    /// </summary>
+    /// <param name="gid">鍏ュ簱妫�涓昏〃ID</param>
+    /// <param name="userNo">鎿嶄綔浜�</param>
+    /// <returns>鎻愪氦缁撴灉</returns>
+    public int SubmitRKJResult(decimal? gid, string userNo)
+    {
+        var db = SqlSugarHelper.GetInstance();
+
+        // 妫�鏌ユ槸鍚︽墍鏈夋楠岄」鐩兘宸插畬鎴�
         var isNull = db.Queryable<QsItemOqcItem>()
-            .Where(s => s.Pid == detail.Gid && s.IsPass == null).Count();
+            .Where(s => s.Pid == gid && s.IsPass == null).Count();
 
-        if (isNull > 0) return 1;
+        if (isNull > 0)
+        {
+            throw new Exception("杩樻湁妫�楠岄」鐩湭瀹屾垚锛屾棤娉曟彁浜�");
+        }
 
-
-        //鑾峰彇妫�楠屽崟鐨勬楠岄」鐩殑涓暟
+        // 鑾峰彇妫�楠屽崟鐨勬楠岄」鐩殑涓暟
         var sum = db.Queryable<QsItemOqcItem>()
-            .Where(s => s.Pid == detail.Gid).Count();
+            .Where(s => s.Pid == gid).Count();
 
-        if (sum == 0) return 1;
+        if (sum == 0)
+        {
+            throw new Exception("娌℃湁妫�楠岄」鐩紝鏃犳硶鎻愪氦");
+        }
 
-        //鑾峰彇妫�楠屽崟涓嬬殑鍚堟牸鐨勬楠岄」鐩釜鏁�
+        // 鑾峰彇妫�楠屽崟涓嬬殑鍚堟牸鐨勬楠岄」鐩釜鏁�
         var icount = db.Queryable<QsItemOqcItem>()
-            .Where(s => s.Pid == detail.Gid && s.IsPass == 1).Count();
+            .Where(s => s.Pid == gid && s.IsPass == 1).Count();
 
         var FcheckResu = "涓嶅悎鏍�";
 
-        //瀹為檯涓暟绛変簬鐞嗚涓暟鏃跺妫�楠屽崟杩涜鍒ゅ畾
+        // 瀹為檯涓暟绛変簬鐞嗚涓暟鏃跺妫�楠屽崟杩涜鍒ゅ畾
         if (sum == icount)
-            //鍚堟牸鐨勬楠岀粨鏋滅瓑浜庢�绘楠屾暟瑙嗕负鍚堟牸
+            // 鍚堟牸鐨勬楠岀粨鏋滅瓑浜庢�绘楠屾暟瑙嗕负鍚堟牸
             FcheckResu = "鍚堟牸";
 
-        SqlSugarHelper.UseTransactionWithOracle(db =>
+        Console.WriteLine($"妫�楠岀粨鏋滃垽瀹�: 鎬婚」鐩暟={sum}, 鍚堟牸椤圭洰鏁�={icount}, 鍒ゅ畾缁撴灉={FcheckResu}");
+
+        var result = SqlSugarHelper.UseTransactionWithOracle(db =>
         {
-            return db.Updateable<QsItemOqcReq>()
+            var updateResult = db.Updateable<QsItemOqcReq>()
                 .SetColumns(s => s.FcheckResu == FcheckResu)
                 .SetColumns(s => s.FcheckDate == DateTime.Now)
-                .SetColumns(s => s.FcheckBy == detail.CreateBy)
-                .SetColumns(s => s.LastupdateBy == detail.CreateBy)
+                .SetColumns(s => s.FcheckBy == userNo)
+                .SetColumns(s => s.LastupdateBy == userNo)
                 .SetColumns(s => s.LastupdateDate == DateTime.Now)
-                .Where(s => s.Id == detail.Gid)
+                .Where(s => s.Id == gid)
                 .ExecuteCommand();
+
+            // 濡傛灉涓嶅悎鏍硷紝鍦ㄤ簨鍔″唴璋冪敤瀛樺偍杩囩▼鐢熸垚寮傚父澶勭疆鍗�
+            if (FcheckResu.Equals("涓嶅悎鏍�"))
+            {
+                CallRKJUnqualifiedStoredProcedureInTransaction(db, gid, userNo);
+            }
+
+            return updateResult;
         });
 
-        if (FcheckResu.Equals("涓嶅悎鏍�"))
-            //鑷姩鐢熸垚鍏ュ簱妫�寮傚父瀵圭瓥
-            saveDetect02(detail.Gid, detail.CreateBy);
+        return result;
+    }
 
-        return useTransactionWithOracle;
+    /// <summary>
+    /// 璋冪敤鍏ュ簱妫�涓嶅悎鏍煎瓨鍌ㄨ繃绋嬶紙浜嬪姟鍐呰皟鐢級
+    /// </summary>
+    /// <param name="db">鏁版嵁搴撹繛鎺�</param>
+    /// <param name="gid">鍏ュ簱妫�涓昏〃ID</param>
+    /// <param name="userNo">鎿嶄綔浜�</param>
+    private void CallRKJUnqualifiedStoredProcedureInTransaction(ISqlSugarClient db, decimal? gid, string userNo)
+    {
+        try
+        {
+            Console.WriteLine($"寮�濮嬭皟鐢ㄥ叆搴撴涓嶅悎鏍煎瓨鍌ㄨ繃绋嬶紝gid: {gid}, userNo: {userNo}");
+            
+            // 鑾峰彇鍏ュ簱妫�鍗曚俊鎭�
+            var rkjInfo = db.Queryable<QsItemOqcReq>()
+                .Where(s => s.Id == gid)
+                .First();
+                
+            if (rkjInfo == null) 
+            {
+                Console.WriteLine($"鏈壘鍒板叆搴撴鍗曚俊鎭紝gid: {gid}");
+                return;
+            }
+
+            Console.WriteLine($"鎵惧埌鍏ュ簱妫�鍗曚俊鎭紝ReleaseNo: {rkjInfo.ReleaseNo}");
+
+            // 瀹氫箟杈撳嚭鍙傛暟
+            var outputResult = new SugarParameter("o_Result", null,
+                System.Data.DbType.Int32, ParameterDirection.Output, 4000);
+
+            var outputMessage = new SugarParameter("o_Msg", null,
+                System.Data.DbType.String, ParameterDirection.Output, 4000);
+
+            // 瀹氫箟杈撳叆鍙傛暟
+            var parameters = new List<SugarParameter>
+            {
+                new("p_Gid", gid, System.Data.DbType.Decimal, ParameterDirection.Input),
+                new("p_Release_No", rkjInfo.ReleaseNo, System.Data.DbType.String, ParameterDirection.Input),
+                new("p_User", userNo, System.Data.DbType.String, ParameterDirection.Input),
+                outputResult,
+                outputMessage
+            };
+
+            Console.WriteLine($"鍑嗗鎵ц瀛樺偍杩囩▼锛屽弬鏁�: gid={gid}, releaseNo={rkjInfo.ReleaseNo}, userNo={userNo}");
+
+            // 鎵ц瀛樺偍杩囩▼
+            db.Ado.ExecuteCommand(
+                "BEGIN PRC_MES_RKJ_UNQUALIFIED(:p_Gid, :p_Release_No, :p_User, :o_Result, :o_Msg); END;",
+                parameters.ToArray());
+
+            // 鑾峰彇杈撳嚭鍙傛暟鐨勫��
+            var resultValue = outputResult.Value?.ToString();
+            var messageValue = outputMessage.Value?.ToString();
+
+            Console.WriteLine($"瀛樺偍杩囩▼鎵ц瀹屾垚锛岀粨鏋�: {resultValue}, 娑堟伅: {messageValue}");
+
+            if ("1".Equals(resultValue)) 
+            {
+                throw new Exception($"鍏ュ簱妫�寮傚父澶勭疆鍗曠敓鎴愬け璐�: {messageValue}");
+            }
+            
+            Console.WriteLine("鍏ュ簱妫�寮傚父澶勭疆鍗曠敓鎴愭垚鍔�");
+        }
+        catch (Exception ex)
+        {
+            Console.WriteLine($"鍏ュ簱妫�寮傚父澶勭疆鍗曠敓鎴愬け璐�: {ex.Message}");
+            // 鍦ㄤ簨鍔″唴锛屽鏋滃瓨鍌ㄨ繃绋嬭皟鐢ㄥけ璐ワ紝搴旇鎶涘嚭寮傚父浠ュ洖婊氫簨鍔�
+            throw new Exception($"鍏ュ簱妫�寮傚父澶勭疆鍗曠敓鎴愬け璐�: {ex.Message}");
+        }
+    }
+
+    /// <summary>
+    /// 璋冪敤鍏ュ簱妫�涓嶅悎鏍煎瓨鍌ㄨ繃绋嬶紙浜嬪姟澶栬皟鐢紝鐢ㄤ簬鍏煎锛�
+    /// </summary>
+    /// <param name="gid">鍏ュ簱妫�涓昏〃ID</param>
+    /// <param name="userNo">鎿嶄綔浜�</param>
+    private void CallRKJUnqualifiedStoredProcedure(decimal? gid, string userNo)
+    {
+        try
+        {
+            var db = SqlSugarHelper.GetInstance();
+            
+            // 鑾峰彇鍏ュ簱妫�鍗曚俊鎭�
+            var rkjInfo = db.Queryable<QsItemOqcReq>()
+                .Where(s => s.Id == gid)
+                .First();
+                
+            if (rkjInfo == null) return;
+
+            // 瀹氫箟杈撳嚭鍙傛暟
+            var outputResult = new SugarParameter("o_Result", null,
+                System.Data.DbType.Int32, ParameterDirection.Output, 4000);
+
+            var outputMessage = new SugarParameter("o_Msg", null,
+                System.Data.DbType.String, ParameterDirection.Output, 4000);
+
+            // 瀹氫箟杈撳叆鍙傛暟
+            var parameters = new List<SugarParameter>
+            {
+                new("p_Gid", gid, System.Data.DbType.Decimal, ParameterDirection.Input),
+                new("p_Release_No", rkjInfo.ReleaseNo, System.Data.DbType.String, ParameterDirection.Input),
+                new("p_User", userNo, System.Data.DbType.String, ParameterDirection.Input),
+                outputResult,
+                outputMessage
+            };
+
+            // 鎵ц瀛樺偍杩囩▼
+            db.Ado.ExecuteCommand(
+                "BEGIN PRC_MES_RKJ_UNQUALIFIED(:p_Gid, :p_Release_No, :p_User, :o_Result, :o_Msg); END;",
+                parameters.ToArray());
+
+            // 鑾峰彇杈撳嚭鍙傛暟鐨勫��
+            var resultValue = outputResult.Value?.ToString();
+            var messageValue = outputMessage.Value?.ToString();
+
+            if ("1".Equals(resultValue)) 
+            {
+                throw new Exception($"鍏ュ簱妫�寮傚父澶勭疆鍗曠敓鎴愬け璐�: {messageValue}");
+            }
+        }
+        catch (Exception ex)
+        {
+            // 璁板綍鏃ュ織浣嗕笉褰卞搷涓绘祦绋�
+            Console.WriteLine($"鍏ュ簱妫�寮傚父澶勭疆鍗曠敓鎴愬け璐�: {ex.Message}");
+            // 鍙互鏍规嵁闇�瑕佸喅瀹氭槸鍚︽姏鍑哄紓甯�
+            // throw new Exception($"鍏ュ簱妫�寮傚父澶勭疆鍗曠敓鎴愬け璐�: {ex.Message}");
+        }
     }
 
     public int saveDetect02(decimal? gid, string? createBy)
diff --git a/MES.Service/service/QC/SJService.cs b/MES.Service/service/QC/SJService.cs
index f853ea4..4e6384f 100644
--- a/MES.Service/service/QC/SJService.cs
+++ b/MES.Service/service/QC/SJService.cs
@@ -6,6 +6,8 @@
 using SqlSugar;
 using System.Net;
 using System.Xml.Linq;
+using System.Data;
+using System.Data.Common;
 
 namespace MES.Service.service.QC;
 
@@ -439,7 +441,6 @@
         var count = db.Queryable<QsItemIpiItemDetail>()
             .Where(s => s.Pid == detail.Pid).Count();
 
-
         var result = 0;
 
         if (qsItemIpiItem.LevelNum != count) return 0;
@@ -460,7 +461,6 @@
                 return commit;
             });
 
-
         //鑷姩鍒ゅ畾鏄惁鍚堟牸
         //鑾峰彇妫�楠屽崟鐨勬楠岄」鐩悊璁轰釜鏁�
         var sum = db.Queryable<QsItemIpiItem>()
@@ -476,30 +476,71 @@
         //瀹為檯涓暟绛変簬鐞嗚涓暟鏃跺妫�楠屽崟杩涜鍒ゅ畾
         if (sum == icount)
         {
-            result = 0;
-
-            //鑾峰彇杩欎釜妫�楠屽崟涓嬬殑鎵�鏈夊悎鏍肩殑妫�楠岀粨鏋�
-            passCount = db.Queryable<QsItemIpiItemDetail>()
-                .Where(s => s.Gid == detail.Gid && s.Fstand == "鈭�").Count();
-
-            //鍚堟牸鐨勬楠岀粨鏋滅瓑浜庢�绘楠屾暟瑙嗕负鍚堟牸
-            if (icount == passCount) result = 1;
-
-            useTransactionWithOracle += SqlSugarHelper.UseTransactionWithOracle(
-                db =>
-                {
-                    return db.Updateable<QsItemIpiReq>()
-                        .SetColumns(s => s.IsPass == result)
-                        .SetColumns(s => s.StatusUser == detail.CreateBy)
-                        .SetColumns(s => s.CompleteTime == DateTime.Now)
-                        .Where(s => s.Id == detail.Gid)
-                        .ExecuteCommand();
-                });
+            // 璋冪敤瀛樺偍杩囩▼杩涜鑷姩鍒ゅ畾鍜屾彁浜�
+            CallSJAutoResultStoredProcedure(detail.Gid, detail.CreateBy);
         }
 
         return useTransactionWithOracle;
     }
 
+    /// <summary>
+    /// 璋冪敤棣栨鑷姩鍒ゅ畾鍜屾彁浜ゅ瓨鍌ㄨ繃绋�
+    /// </summary>
+    /// <param name="gid">棣栨涓昏〃ID</param>
+    /// <param name="createBy">鎿嶄綔浜�</param>
+    private void CallSJAutoResultStoredProcedure(decimal? gid, string createBy)
+    {
+        try
+        {
+            var db = SqlSugarHelper.GetInstance();
+            
+            // 鑾峰彇棣栨鍗曚俊鎭�
+            var sjInfo = db.Queryable<QsItemIpiReq>()
+                .Where(s => s.Id == gid)
+                .First();
+                
+            if (sjInfo == null) return;
+
+            // 瀹氫箟杈撳嚭鍙傛暟
+            var outputResult = new SugarParameter("o_Result", null,
+                System.Data.DbType.Int32, ParameterDirection.Output, 4000);
+
+            var outputMessage = new SugarParameter("o_Msg", null,
+                System.Data.DbType.String, ParameterDirection.Output, 4000);
+
+            // 瀹氫箟杈撳叆鍙傛暟
+            var parameters = new List<SugarParameter>
+            {
+                new("p_Gid", gid, System.Data.DbType.Decimal, ParameterDirection.Input),
+                new("p_Bill_No", sjInfo.BillNo, System.Data.DbType.String, ParameterDirection.Input),
+                new("p_User", createBy, System.Data.DbType.String, ParameterDirection.Input),
+                outputResult,
+                outputMessage
+            };
+
+            // 鎵ц瀛樺偍杩囩▼
+            db.Ado.ExecuteCommand(
+                "BEGIN PRC_MES_SJ_AUTO_RESULT(:p_Gid, :p_Bill_No, :p_User, :o_Result, :o_Msg); END;",
+                parameters.ToArray());
+
+            // 鑾峰彇杈撳嚭鍙傛暟鐨勫��
+            var resultValue = outputResult.Value?.ToString();
+            var messageValue = outputMessage.Value?.ToString();
+
+            if ("1".Equals(resultValue)) 
+            {
+                throw new Exception($"棣栨鑷姩鍒ゅ畾澶辫触: {messageValue}");
+            }
+        }
+        catch (Exception ex)
+        {
+            // 璁板綍鏃ュ織浣嗕笉褰卞搷涓绘祦绋�
+            Console.WriteLine($"棣栨鑷姩鍒ゅ畾瀛樺偍杩囩▼璋冪敤澶辫触: {ex.Message}");
+            // 鍙互鏍规嵁闇�瑕佸喅瀹氭槸鍚︽姏鍑哄紓甯�
+            // throw new Exception($"棣栨鑷姩鍒ゅ畾澶辫触: {ex.Message}");
+        }
+    }
+
     public int UpdateQSItemDetail(QsItemIpiItemDetail detail)
     {
         var withOracle = SqlSugarHelper.UseTransactionWithOracle(db =>
diff --git a/MES.Service/service/QC/THJService.cs b/MES.Service/service/QC/THJService.cs
new file mode 100644
index 0000000..f837801
--- /dev/null
+++ b/MES.Service/service/QC/THJService.cs
@@ -0,0 +1,824 @@
+using System;
+using System.Collections.Generic;
+using System.Dynamic;
+using System.Linq;
+using MES.Service.DB;
+using MES.Service.Dto.service;
+using MES.Service.Modes;
+using MES.Service.util;
+using SqlSugar;
+using System.Data;
+
+namespace MES.Service.service.QC;
+
+public class THJService
+{
+    private static readonly OracleSQLHelper SQLHelper = new();
+    private readonly BaseService _baseService = new();
+
+    /// <summary>
+    /// 鐢熸垚鏈�鏂扮殑妫�楠屽崟鍙�
+    /// </summary>
+    public string getMaxReleaseNo()
+    {
+        var db = SqlSugarHelper.GetInstance();
+        var date = DateTime.Now.ToString("yyyy-MM-dd");
+
+        // 浣跨敤鏈嬩箰鐨勫嚱鏁伴粯璁よ幏鍙栧崟鎹�
+        var sql = "select getbillcode1('1000','1000','THJYD') from dual";
+        var maxBillNo = db.Ado.SqlQuerySingle<string>(sql);
+
+        // 濡傛灉涓虹┖鐩存帴杩斿洖榛樿鍊�
+        return maxBillNo ?? "THJ" + DateTime.Now.ToString("yyMMdd") + "0001";
+    }
+
+    /// <summary>
+    /// 鍒嗛〉鏌ヨ妫�楠屽崟鍒楄〃
+    /// </summary>
+    public List<THJPageResult> getPage(THJPageResult queryObj)
+    {
+        var db = SqlSugarHelper.GetInstance();
+
+        // 鍩轰簬妫�楠屽崟鍙锋煡璇紝鍏宠仈閫�璐ф槑缁嗚幏鍙栭��璐у崟淇℃伅
+        var sql = @"
+            SELECT 
+                a.ID as Id,
+                a.RELEASE_NO as ReleaseNo,
+                a.CREATE_DATE as CreateDate,
+                a.CREATE_BY as CreateBy,
+                a.ITEM_NO as ItemNo,
+                a.SL as Sl,
+                a.FCHECK_BY as StatusUser,
+                a.FCHECK_RESU as Result,
+                COALESCE(m.ITEM_NAME, '') as ItemName,
+                COALESCE(m.ITEM_MODEL, '') as ItemModel,
+                a.SL as WorkQty,
+                COALESCE(rd.RETURN_TYPE, '') as ReturnType,
+                COALESCE(rd.RETURN_NO, '') as ReturnNo,
+                COALESCE(rw.BILL_DATE, a.CREATE_DATE) as BillDate,
+                COALESCE(c.CUST_NAME, '') as CustomerName,
+                COALESCE(rd.REMARKS, '') as ReturnReason,
+                COALESCE(a.BHGYY, '') as Remarks
+            FROM QS_QA_ITEM_THJ a
+            LEFT JOIN MES_ITEMS m ON a.ITEM_NO = m.ITEM_NO
+            LEFT JOIN MES_RETURNWARE_DETAILS rd ON a.ITEM_NO = rd.ITEM_NO 
+                AND a.BILL_NO = rd.RETURN_TYPE || '-' || rd.RETURN_NO
+            LEFT JOIN MES_RETURNWARE rw ON rd.RETURN_TYPE = rw.RETURN_TYPE 
+                AND rd.RETURN_NO = rw.RETURN_NO
+            LEFT JOIN MES_CUSTOMER c ON rw.CUST_NO = c.CUST_NO
+            WHERE 1=1";
+
+        var parameters = new List<SugarParameter>();
+
+        // 鏍规嵁ID绛涢��
+        if (queryObj.Id.HasValue && queryObj.Id > 0)
+        {
+            sql += " AND a.ID = :Id";
+            parameters.Add(new SugarParameter(":Id", queryObj.Id.Value));
+        }
+
+        // 鏍规嵁鐘舵�佺瓫閫�
+        if (!string.IsNullOrEmpty(queryObj.Result))
+        {
+            if (queryObj.Result == "鏈畬鎴�")
+            {
+                sql += " AND a.FCHECK_RESU IS NULL";
+            }
+            else if (queryObj.Result == "宸插畬鎴�")
+            {
+                sql += " AND a.FCHECK_RESU IS NOT NULL";
+            }
+        }
+
+        // 鏍规嵁妫�楠屼汉绛涢��
+        //if (!string.IsNullOrEmpty(queryObj.StatusUser))
+        //{
+        //    sql += " AND a.FCHECK_BY = :StatusUser";
+        //    parameters.Add(new SugarParameter(":StatusUser", queryObj.StatusUser));
+        //}
+
+        // 鏍规嵁鐗╂枡缂栫爜绛涢��
+        if (!string.IsNullOrEmpty(queryObj.ItemNo))
+        {
+            sql += " AND a.ITEM_NO = :ItemNo";
+            parameters.Add(new SugarParameter(":ItemNo", queryObj.ItemNo));
+        }
+
+        // 鏍规嵁妫�楠屽崟鍙风瓫閫�
+        if (!string.IsNullOrEmpty(queryObj.ReleaseNo))
+        {
+            sql += " AND a.RELEASE_NO = :ReleaseNo";
+            parameters.Add(new SugarParameter(":ReleaseNo", queryObj.ReleaseNo));
+        }
+
+        // 鏍规嵁鍒涘缓鏃ユ湡绛涢��
+        if (queryObj.CreateDate.HasValue)
+        {
+            sql += " AND TRUNC(a.CREATE_DATE) = TRUNC(:CreateDate)";
+            parameters.Add(new SugarParameter(":CreateDate", queryObj.CreateDate.Value));
+        }
+
+        // 鎺掑簭
+        sql += " ORDER BY a.CREATE_DATE DESC";
+
+        // 鍒嗛〉鏌ヨ
+        var pageList = db.Ado.SqlQuery<THJPageResult>(sql, parameters.ToArray());
+
+
+        if (pageList != null)
+        {
+            pageList = pageList.Skip((queryObj.PageIndex - 1) * queryObj.Limit)
+                              .Take(queryObj.Limit)
+                              .ToList();
+        }
+
+        return pageList ?? new List<THJPageResult>();
+    }
+
+    /// <summary>
+    /// 鑾峰彇妫�楠岄」鐩垪琛�
+    /// </summary>
+    public List<QsQaItemThj01> getQSItems(decimal? pid, decimal? id)
+    {
+        var db = SqlSugarHelper.GetInstance();
+        
+        
+        var qsQaItemThj01s = db.Queryable<QsQaItemThj01>()
+            .Where(a => a.Pid == pid)
+            .ToList();
+            
+
+        var array = qsQaItemThj01s.Select(s => s.Id).ToArray();
+        var qsQaItemDetails = db.Queryable<QsQaItemThj02>()
+            .Where(s => array.Contains(s.Pid))
+            .GroupBy(s => s.Pid)
+            .Select(s => new
+            {
+                s.Pid,
+                itemCount = SqlFunc.AggregateCount(s.Id)
+            }).ToList();
+
+        qsQaItemThj01s.ForEach(s =>
+        {
+            var find = qsQaItemDetails.Find(a => s.Id == a.Pid);
+            if (find == null)
+            {
+                s.isCheck = 0;
+                s.result = "鏈畬鎴�";
+            }
+            else
+            {
+                s.isCheck = find.itemCount;
+                // 淇绫诲瀷杞崲闂锛氬皢decimal?杞崲涓篿nt杩涜姣旇緝
+                var levelNum = s.LevelNum.HasValue ? (int)s.LevelNum.Value : 0;
+                if (find.itemCount == levelNum && s.IsPass == 1)
+                    s.result = "鍚堟牸";
+                else if (find.itemCount == levelNum && s.IsPass == 0)
+                    s.result = "涓嶅悎鏍�";
+                else
+                    s.result = "鏈畬鎴�";
+            }
+
+            // 杩囨护鍑哄浘鐗噄d涓嶄负绌虹殑鏁版嵁杞负base64
+            if (s.Picture is { Length: > 0 })
+                s.imageData = Convert.ToBase64String(s.Picture);
+        });
+
+        // 鎺掑簭锛屾湭瀹屾垚鐨勬帓鍦ㄥ墠闈�
+        qsQaItemThj01s = qsQaItemThj01s.OrderBy(s => s.isCheck).ToList();
+
+        return qsQaItemThj01s;
+    }
+
+    /// <summary>
+    /// 鏍规嵁ID鑾峰彇妫�楠岄」鐩鎯�
+    /// </summary>
+    public ExpandoObject getThjDetail02ById(decimal id)
+    {
+        try
+        {
+            var db = SqlSugarHelper.GetInstance();
+
+            // 鑾峰彇妫�楠岄」鐩富琛ㄤ俊鎭�
+            var qsQaItemThj01 = db.Queryable<QsQaItemThj01>()
+                .Where(s => s.Id == id)
+                .First();
+
+            if (qsQaItemThj01 == null)
+            {
+                throw new Exception($"妫�楠岄」鐩笉瀛樺湪锛孖D: {id}");
+            }
+        
+
+        if (qsQaItemThj01.IsPass == 0)
+            qsQaItemThj01.result = "涓嶅悎鏍�";
+        else if (qsQaItemThj01.IsPass == 1)
+            qsQaItemThj01.result = "鍚堟牸";
+        else
+            qsQaItemThj01.result = "鏈畬鎴�";
+
+        // 鑾峰彇涓昏〃淇℃伅锛堟楠屽崟淇℃伅锛�
+        var mainInfo = db.Queryable<QsQaItemThj>()
+            .Where(s => s.Id == qsQaItemThj01.Pid)
+            .First();
+        
+        // 妫�鏌ヤ富琛ㄤ俊鎭槸鍚︽纭幏鍙�
+        if (mainInfo == null)
+        {
+            throw new Exception($"涓昏〃淇℃伅涓嶅瓨鍦紝Pid: {qsQaItemThj01.Pid}");
+        }
+
+        // 鐩存帴浠庣墿鏂欒〃鑾峰彇鐗╂枡鍚嶇О
+        var itemInfo = db.Queryable<MesItems>()
+            .Where(i => i.ItemNo == mainInfo.ItemNo)
+            .Select(i => new { i.ItemName })
+            .First();
+
+        // 閫�璐у崟鍙峰氨鏄攢鍞��璐ф楠屽崟鐨刡ill_no
+        string returnOrderNo = mainInfo.BillNo;
+        string itemName = null;
+        decimal? returnQty = mainInfo.Sl;
+        string returnReason = mainInfo.Remarks;
+
+        // 鑾峰彇鐗╂枡鍚嶇О
+        if (itemInfo != null)
+        {
+            itemName = itemInfo.ItemName;
+        }
+
+        // 澶勭悊鍥剧墖鏁版嵁锛岄伩鍏岼SON搴忓垪鍖栭棶棰�
+        string imageData = null;
+        if (qsQaItemThj01.Picture is { Length: > 0 })
+        {
+            try
+            {
+                imageData = Convert.ToBase64String(qsQaItemThj01.Picture);
+            }
+            catch (Exception)
+            {
+                imageData = null;
+            }
+        }
+
+        // 鍒涘缓鎵╁睍鐨刬temThj01瀵硅薄锛屽寘鍚墍鏈夐渶瑕佺殑瀛楁锛岀‘淇濇墍鏈夊瓧娈甸兘鏄彲搴忓垪鍖栫殑
+        var extendedItemThj01 = new
+        {
+            // 鍘熸湁瀛楁 - 纭繚鎵�鏈夊瓧娈甸兘鏄彲搴忓垪鍖栫殑绫诲瀷
+            Id = qsQaItemThj01.Id,
+            Pid = qsQaItemThj01.Pid,
+            ProjName = qsQaItemThj01.ProjName ?? "",
+            ItemMod = qsQaItemThj01.ItemMod ?? "",
+            InspectionMethod = qsQaItemThj01.InspectionMethod ?? "",
+            UsingInstruments = qsQaItemThj01.UsingInstruments ?? "",
+            LevelNum = qsQaItemThj01.LevelNum,
+            MaxValue = qsQaItemThj01.MaxValue,
+            StandardValue = qsQaItemThj01.StandardValue,
+            MinValue = qsQaItemThj01.MinValue,
+            Notes = qsQaItemThj01.Notes ?? "",
+            FcheckLevel = qsQaItemThj01.FcheckLevel ?? "",
+            FacLevel = qsQaItemThj01.FacLevel ?? "",
+            QsCode = qsQaItemThj01.QsCode ?? "",
+            QsName = qsQaItemThj01.QsName ?? "",
+            IsPass = qsQaItemThj01.IsPass,
+            Remarks = qsQaItemThj01.Remarks ?? "",
+            result = qsQaItemThj01.result ?? "",
+
+            // 涓昏〃瀛楁
+            releaseNo = mainInfo.ReleaseNo ?? "",
+            itemNo = mainInfo.ItemNo ?? "",
+            billNo = mainInfo.BillNo ?? "",
+            // 娣诲姞涓嶅悎鏍兼弿杩板瓧娈碉紝鏄犲皠鍒颁富琛ㄧ殑BHGYY瀛楁
+            bhgyy = mainInfo.Bhgyy ?? "",
+
+            // 閫�璐ф槑缁嗗瓧娈�
+            returnOrderNo = returnOrderNo ?? "",
+            itemName = itemName ?? "",
+            returnQty = returnQty,
+            returnReason = returnReason ?? "",
+
+            // 鍏朵粬闇�瑕佺殑瀛楁
+            qualityStandard = qsQaItemThj01.QsName ?? "",
+
+            // 鍥剧墖鏁版嵁锛堣浆鎹负base64瀛楃涓诧紝閬垮厤搴忓垪鍖栭棶棰橈級
+            imageData = imageData ?? ""
+        };
+
+        // 鑾峰彇妫�楠岄」鐩槑缁嗭紝纭繚杩斿洖鐨勬暟鎹槸鍙簭鍒楀寲鐨�
+        var qsQaItemThj02s = db.Queryable<QsQaItemThj02>()
+            .Where(s => s.Pid == id)
+            .OrderBy(s => s.Id)
+            .Select(s => new
+            {
+                Id = s.Id,
+                Pid = s.Pid,
+                Gid = s.Gid,
+                FcheckResu = s.FcheckResu ?? "",
+                Fstand = s.Fstand ?? "",
+                CreateDate = s.CreateDate,
+                CreateBy = s.CreateBy ?? "",
+                UpdateDate = s.UpdateDate,
+                UpdateBy = s.UpdateBy ?? "",
+                Remarks = s.Remarks ?? ""
+            })
+            .ToList();
+
+        var result = new ExpandoObject();
+        ((IDictionary<string, object>)result)["itemThj01"] = extendedItemThj01;
+        ((IDictionary<string, object>)result)["itemThj02s"] = qsQaItemThj02s;
+
+        return result;
+        }
+        catch (Exception ex)
+        {
+            throw;
+        }
+    }
+
+    /// <summary>
+    /// 瀹夊叏鑾峰彇鍔ㄦ�佸璞″睘鎬у��
+    /// </summary>
+    private object GetDynamicValue(dynamic obj, string propertyName)
+    {
+        try
+        {
+            if (obj == null) return null;
+
+            var dict = (IDictionary<string, object>)obj;
+            return dict.ContainsKey(propertyName) ? dict[propertyName] : null;
+        }
+        catch
+        {
+            return null;
+        }
+    }
+
+    /// <summary>
+    /// 鑾峰彇閫�璐у崟鍒楄〃
+    /// </summary>
+    public List<dynamic> getReturnOrders()
+    {
+        var db = SqlSugarHelper.GetInstance();
+        var sql = @"
+            SELECT DISTINCT
+                rd.RETURN_TYPE || '-' || rd.RETURN_NO as returnOrderNo,
+                I.ITEM_NAME as itemName,
+                rd.QUANTITY as returnQty,
+                rd.REMARKS as returnReason
+            FROM MES_RETURNWARE_DETAILS rd
+            LEFT JOIN MES_ITEMS I ON I.ITEM_NO = rd.ITEM_NO
+            WHERE rd.RETURN_TYPE IS NOT NULL
+            AND rd.RETURN_NO IS NOT NULL
+            ORDER BY rd.RETURN_TYPE, rd.RETURN_NO";
+        var result = db.Ado.SqlQuery<dynamic>(sql);
+        return result;
+    }
+
+    /// <summary>
+    /// 鑾峰彇閫�璐ф槑缁嗕俊鎭�
+    /// </summary>
+    public List<dynamic> getReturnwareInfo(string returnType, string returnNo)
+    {
+        var db = SqlSugarHelper.GetInstance();
+        var sql = @"
+            SELECT 
+                rd.RETURN_TYPE || '-' || rd.RETURN_NO as returnOrderNo,
+                I.ITEM_NAME as itemName,
+                rd.QUANTITY as returnQty,
+                rd.REMARKS as returnReason,
+                rd.ITEM_NO as itemNo
+            FROM MES_RETURNWARE_DETAILS rd
+            LEFT JOIN MES_ITEMS I ON I.ITEM_NO = rd.ITEM_NO
+            WHERE rd.RETURN_TYPE = :returnType 
+            AND rd.RETURN_NO = :returnNo";
+        
+        var result = db.Ado.SqlQuery<dynamic>(sql, 
+            new SugarParameter(":returnType", returnType),
+            new SugarParameter(":returnNo", returnNo));
+
+        return result;
+    }
+
+    /// <summary>
+    /// 鑾峰彇閫�璐ф槑缁� - 鍩轰簬妫�楠屽崟鐨凚ILL_NO绮剧‘鍖归厤
+    /// </summary>
+    public List<dynamic> getReturnDetails(string pid)
+    {
+        var db = SqlSugarHelper.GetInstance();
+        var sql = @"
+            SELECT 
+                rd.RETURN_TYPE as returntype,
+                rd.RETURN_NO as returnno,
+                rd.QUANTITY as quantity,
+                rd.REMARKS as remarks,
+                rd.ITEM_NO as itemno,
+                I.ITEM_NAME as itemname
+            FROM MES_RETURNWARE_DETAILS rd
+            LEFT JOIN MES_ITEMS I ON I.ITEM_NO = rd.ITEM_NO
+            LEFT JOIN QS_QA_ITEM_THJ q ON q.ITEM_NO = rd.ITEM_NO 
+                AND q.BILL_NO = rd.RETURN_TYPE || '-' || rd.RETURN_NO
+            WHERE q.ID = :pid";
+        
+        var result = db.Ado.SqlQuery<dynamic>(sql, 
+            new SugarParameter(":pid", Convert.ToDecimal(pid)));
+        
+        return result;
+    }
+
+    /// <summary>
+    /// 璁剧疆妫�楠岄」鐩� - 璋冪敤瀛樺偍杩囩▼
+    /// </summary>
+    public List<QsQaItemThj01> setInspectItem(string gid, string updateBy = "绯荤粺")
+    {
+        var db = SqlSugarHelper.GetInstance();
+        
+        
+        // 楠岃瘉gid鍙傛暟
+        if (string.IsNullOrEmpty(gid) || !decimal.TryParse(gid, out decimal gidDecimal))
+        {
+            throw new Exception("妫�楠屽崟ID鏍煎紡涓嶆纭�");
+        }
+        
+        
+        try
+        {
+            // 鍏堟鏌ユ楠屽崟鏄惁瀛樺湪
+            var thjExists = db.Queryable<QsQaItemThj>()
+                .Where(s => s.Id == gidDecimal)
+                .Any();
+            
+            
+            if (!thjExists)
+            {
+                throw new Exception($"妫�楠屽崟ID {gidDecimal} 涓嶅瓨鍦�");
+            }
+            
+            // 瀹氫箟杈撳嚭鍙傛暟
+            var outputResult = new SugarParameter("c_result", null, System.Data.DbType.Int32, ParameterDirection.Output, 4000);
+            var outputMessage = new SugarParameter("c_msg", null, System.Data.DbType.String, ParameterDirection.Output, 4000);
+
+            // 瀹氫箟杈撳叆鍙傛暟 - 瀛樺偍杩囩▼鏈熸湜NUMBER绫诲瀷
+            var parameters = new List<SugarParameter>
+            {
+                new("p_gid", gidDecimal, System.Data.DbType.Decimal, ParameterDirection.Input),
+                new("p_user", updateBy, System.Data.DbType.String, ParameterDirection.Input),
+                outputResult,
+                outputMessage
+            };
+
+
+            // 璋冪敤瀛樺偍杩囩▼
+            db.Ado.ExecuteCommand(
+                "BEGIN PROC_ADD_INSPECT_ITEMS(:p_gid, :p_user, :c_result, :c_msg); END;",
+                parameters.ToArray());
+        
+            // 鑾峰彇杈撳嚭鍙傛暟鐨勫��
+            var resultValue = outputResult.Value;
+            var messageValue = outputMessage.Value?.ToString();
+            
+
+            // 妫�鏌ュ瓨鍌ㄨ繃绋嬫墽琛岀粨鏋� - 鏀寔澶氱鏁板�肩被鍨嬫瘮杈�
+            bool isError = false;
+            if (resultValue != null)
+            {
+                if (resultValue is int intVal && intVal == 1)
+                    isError = true;
+                else if (resultValue is decimal decimalVal && decimalVal == 1)
+                    isError = true;
+                else if (resultValue is double doubleVal && doubleVal == 1.0)
+                    isError = true;
+                else if (resultValue.ToString() == "1")
+                    isError = true;
+            }
+            
+            if (isError)
+            {
+                // 瀛樺偍杩囩▼鎵ц澶辫触锛屾姏鍑哄紓甯�
+                throw new Exception(messageValue ?? "鑾峰彇妫�楠岄」鐩け璐�");
+            }
+
+            // 瀛樺偍杩囩▼鎵ц鎴愬姛锛岃幏鍙栫敓鎴愮殑妫�楠岄」鐩�
+            var items = db.Queryable<QsQaItemThj01>()
+                .Where(s => s.Pid == gidDecimal)
+                .ToList();
+            
+
+            // 涓烘瘡涓」鐩缃粯璁ゅ��
+            items.ForEach(item =>
+            {
+                item.result = "鏈娴�";
+                item.isCheck = 0;
+            });
+
+            return items;
+        }
+        catch (Exception ex)
+        {
+            // 濡傛灉瀛樺偍杩囩▼璋冪敤澶辫触锛屾姏鍑哄紓甯�
+            throw new Exception($"鑾峰彇妫�楠岄」鐩け璐�: {ex.Message}");
+        }
+    }
+
+    /// <summary>
+    /// 淇濆瓨妫�楠岄」鐩�
+    /// </summary>
+    public int saveItem(THJDto thjDto)
+    {
+        return SqlSugarHelper.UseTransactionWithOracle(db =>
+        {
+            var commit = 0;
+
+            // 淇濆瓨涓昏〃
+            thjDto.from.CreateBy = thjDto.userNo;
+            thjDto.from.CreateDate = DateTime.Now;
+
+            var pid = db.Insertable(thjDto.from).ExecuteReturnIdentity();
+            thjDto.from.Id = pid;
+            thjDto.gid = pid;
+
+            // 淇濆瓨妫�楠岄」鐩�
+            if (thjDto.items != null && thjDto.items.Count > 0)
+            {
+                foreach (var item in thjDto.items) item.Pid = pid;
+                commit += db.Insertable(thjDto.items).ExecuteCommand();
+            }
+
+            return commit;
+        });
+    }
+    
+    /// <summary>
+    /// 璁剧疆妫�楠岄」鐩鎯�
+    /// </summary>
+    public int SetQSItemDetail(decimal pid, decimal gid, string fstand, string fcheckResu, string updateBy, int count)
+    {
+        return SqlSugarHelper.UseTransactionWithOracle(db =>
+        {
+            List<QsQaItemThj02> result = new();
+            for (var i = 0; i < count; i++)
+            {
+                var item = new QsQaItemThj02();
+                item.Pid = pid;
+                item.Gid = gid;
+                item.Fstand = fstand;
+                item.FcheckResu = fcheckResu;
+                item.CreateBy = updateBy;
+                item.CreateDate = DateTime.Now;
+                item.Factory = "1000";
+                item.Company = "1000";
+                result.Add(item);
+            }
+
+            var insertResult = db.Insertable(result).ExecuteCommand();
+            
+            // 鎻掑叆妫�楠岀粨鏋滃悗锛岃嚜鍔ㄦ洿鏂版楠岄」鐩殑IsPass鐘舵��
+            autoUpdateInspectionStatus(pid, db);
+            
+            return insertResult;
+        });
+    }
+    
+    /// <summary>
+    /// 鑷姩鏇存柊妫�楠岄」鐩姸鎬�
+    /// </summary>
+    private void autoUpdateInspectionStatus(decimal pid, ISqlSugarClient db)
+    {
+        // 鑾峰彇妫�楠岄」鐩俊鎭�
+        var qsQaItemThj01 = db.Queryable<QsQaItemThj01>()
+            .Where(s => s.Id == pid)
+            .First();
+
+        if (qsQaItemThj01 == null) return;
+ 
+        // 鏌ヨ杩欎釜妫�楠岄」鐩笅鐨勬楠岀粨鏋滄�绘暟
+        var totalCount = db.Queryable<QsQaItemThj02>()
+            .Where(s => s.Pid == pid)
+            .Count();
+
+        // 鏌ヨ鍚堟牸鏁伴噺
+        var passCount = db.Queryable<QsQaItemThj02>() 
+            .Where(s => s.Pid == pid && s.Fstand == "鈭�")
+            .Count();
+
+        // 鑾峰彇搴旇妫�楠岀殑鏁伴噺
+        var levelNum = qsQaItemThj01.LevelNum.HasValue ? (int)qsQaItemThj01.LevelNum.Value : 1;
+        
+        int isPass = 0; // 榛樿涓嶅悎鏍�
+        
+        // 濡傛灉妫�楠屾暟閲忚揪鍒拌姹備笖鍏ㄩ儴鍚堟牸锛屽垯璁剧疆涓哄悎鏍�
+        if (totalCount >= levelNum && passCount == totalCount)
+        {
+            isPass = 1; // 鍚堟牸
+        }
+        // 濡傛灉妫�楠屾暟閲忚揪鍒拌姹備絾鏈変笉鍚堟牸鐨勶紝鍒欒缃负涓嶅悎鏍�
+        else if (totalCount >= levelNum && passCount < totalCount)
+        {
+            isPass = 0; // 涓嶅悎鏍�
+        }
+        // 濡傛灉妫�楠屾暟閲忔湭杈惧埌瑕佹眰锛屼繚鎸佸師鐘舵�侊紙涓嶆洿鏂癐sPass瀛楁锛�
+
+        // 鍙湁褰撴楠屾暟閲忚揪鍒拌姹傛椂鎵嶆洿鏂癐sPass瀛楁
+        if (totalCount >= levelNum)
+        {
+            db.Updateable<QsQaItemThj01>()
+                .SetColumns(s => s.IsPass == isPass)
+                .Where(s => s.Id == pid)
+                .ExecuteCommand();
+        }
+    }
+
+    /// <summary>
+    /// 鏇存柊妫�楠岄」鐩鎯�
+    /// </summary>
+    public int UpdateQSItemDetail(decimal id, decimal pid, decimal gid, string fstand, string fcheckResu, string updateBy)
+    {
+        return SqlSugarHelper.UseTransactionWithOracle(db =>
+        {
+            // 鏇存柊妫�楠岀粨鏋滆褰�
+            var updateResult = db.Updateable<QsQaItemThj02>()
+                .SetColumns(s => s.UpdateBy == updateBy)
+                .SetColumns(s => s.UpdateDate == DateTime.Now)
+                .SetColumnsIF(StringUtil.IsNotNullOrEmpty(fstand),
+                    s => s.Fstand == fstand)
+                .SetColumnsIF(StringUtil.IsNotNullOrEmpty(fcheckResu),
+                    s => s.FcheckResu == fcheckResu)
+                .Where(s => s.Id == id)
+                .ExecuteCommand();
+            
+            // 鏇存柊妫�楠岀粨鏋滃悗锛岄噸鏂拌绠楁楠岄」鐩姸鎬�
+            autoUpdateInspectionStatus(pid, db);
+            
+            return updateResult;
+        });
+    }
+
+    /// <summary>
+    /// 淇濆瓨妫�楠岄」鐩娉�
+    /// </summary>
+    public int saveRemarksPid(decimal pid, string remarks)
+    {
+        return SqlSugarHelper.UseTransactionWithOracle(db =>
+        {
+            return db.Updateable<QsQaItemThj01>()
+                .SetColumns(it => it.Remarks == remarks)
+                .Where(it => it.Id == pid)
+                .ExecuteCommand();
+        });
+    }
+
+    /// <summary>
+    /// 淇濆瓨妫�楠屽崟澶囨敞锛堜笉鍚堟牸鎻忚堪锛�
+    /// </summary>
+    public int saveRemarksGid(decimal gid, string remarks)
+    {
+        return SqlSugarHelper.UseTransactionWithOracle(db =>
+        {
+            return db.Updateable<QsQaItemThj>()
+                .SetColumns(it => it.Bhgyy == remarks)
+                .Where(it => it.Id == gid)
+                .ExecuteCommand();
+        });
+    }
+
+    /// <summary>
+    /// 淇濆瓨妫�楠岀粨鏋�
+    /// </summary>
+    public int saveInspectItem(string gid, string items, string userNo)
+    {
+        return SqlSugarHelper.UseTransactionWithOracle(db =>
+        {
+            var result = 0;
+            var gidDecimal = Convert.ToDecimal(gid);
+
+            // 杩欓噷鍙互鏍规嵁闇�瑕佽В鏋恑tems鍙傛暟骞舵洿鏂版楠岀粨鏋�
+            // 鐢变簬鍓嶇浼犻�掔殑鏄瓧绗︿覆锛岃繖閲岀畝鍖栧鐞�
+            result += db.Updateable<QsQaItemThj>()
+                .SetColumns(s => s.LastupdateBy == userNo)
+                .SetColumns(s => s.LastupdateDate == DateTime.Now)
+                .Where(s => s.Id == gidDecimal)
+                .ExecuteCommand();
+
+            return result;
+        });
+    }
+
+    /// <summary>
+    /// 淇濆瓨閫�璐ф槑缁�
+    /// </summary>
+    public List<dynamic> SaveReturnDetails(string returnDetails)
+    {
+        // 杩欓噷鍙互鏍规嵁闇�瑕佸鐞嗛��璐ф槑缁嗘暟鎹�
+        // 鐢变簬鍓嶇浼犻�掔殑鏄瓧绗︿覆锛岃繖閲岃繑鍥炵┖鍒楄〃
+        return new List<dynamic>();
+    }
+
+    /// <summary>
+    /// 鎻愪氦妫�楠岀粨鏋�
+    /// </summary>
+    public bool SubmitTHJResult(decimal gid, string userNo)
+    {
+        var result = SqlSugarHelper.UseTransactionWithOracle(db =>
+        {
+            // 1. 楠岃瘉妫�楠屽崟鏄惁瀛樺湪
+            var inspectionOrder = db.Queryable<QsQaItemThj>()
+                .Where(s => s.Id == gid)
+                .First();
+            
+            if (inspectionOrder == null)
+            {
+                throw new Exception($"妫�楠屽崟涓嶅瓨鍦紝ID: {gid}");
+            }
+
+            // 2. 妫�鏌ユ槸鍚﹀凡缁忔彁浜よ繃
+            if (inspectionOrder.FcheckResu == "宸插畬鎴�")
+            {
+                throw new Exception("璇ユ楠屽崟宸茬粡鎻愪氦锛屾棤娉曢噸澶嶆彁浜�");
+            }
+
+            // 3. 楠岃瘉鎵�鏈夋楠岄」鐩槸鍚﹂兘宸插畬鎴�
+            var uncompletedItems = db.Queryable<QsQaItemThj01>()
+                .Where(s => s.Pid == gid)
+                .Where(s => s.IsPass == null || s.IsPass == -1) // 鍋囪-1琛ㄧず鏈畬鎴�
+                .Count();
+
+            if (uncompletedItems > 0)
+            {
+                throw new Exception("瀛樺湪鏈畬鎴愮殑妫�楠岄」鐩紝璇峰畬鎴愭墍鏈夋楠屽悗鍐嶆彁浜�");
+            }
+
+            // 4. 鏇存柊妫�楠屽崟鐘舵��
+            var updateResult = db.Updateable<QsQaItemThj>()
+                .SetColumns(s => s.FcheckResu == "宸插畬鎴�")
+                .SetColumns(s => s.FcheckBy == userNo)
+                .SetColumns(s => s.FcheckDate == DateTime.Now)
+                .SetColumns(s => s.LastupdateBy == userNo)
+                .SetColumns(s => s.LastupdateDate == DateTime.Now)
+                .Where(s => s.Id == gid)
+                .ExecuteCommand();
+
+            if (updateResult <= 0)
+            {
+                throw new Exception("鏇存柊妫�楠屽崟鐘舵�佸け璐�");
+            }
+
+            // 5. 璁板綍鎻愪氦鏃ュ織锛堝彲閫夛級
+            // 杩欓噷鍙互娣诲姞鏃ュ織璁板綍鎴栧叾浠栦笟鍔¢�昏緫
+
+            return updateResult;
+        });
+        
+        return result > 0;
+    }
+
+    /// <summary>
+    /// 閫氳繃瀛樺偍杩囩▼鎻愪氦妫�楠岀粨鏋�
+    /// </summary>
+    public (bool success, string message) SubmitTHJResultByProcedure(string releaseNo, string userNo)
+    {
+        try
+        {
+            var db = SqlSugarHelper.GetInstance();
+            
+            // 瀹氫箟杈撳嚭鍙傛暟
+            var outputResult = new SugarParameter("O_RESULT", null, System.Data.DbType.Int32, ParameterDirection.Output, 4000);
+            var outputMessage = new SugarParameter("O_MSG", null, System.Data.DbType.String, ParameterDirection.Output, 4000);
+
+            // 瀹氫箟杈撳叆鍙傛暟
+            var parameters = new List<SugarParameter>
+            {
+                new("P_RELEASE_NO", releaseNo, System.Data.DbType.String, ParameterDirection.Input),
+                new("P_USER", userNo, System.Data.DbType.String, ParameterDirection.Input),
+                outputResult,
+                outputMessage
+            };
+
+            // 璋冪敤瀛樺偍杩囩▼
+            db.Ado.ExecuteCommand(
+                "BEGIN PRC_MES_THJ_QA_SUBMIT82(:P_RELEASE_NO, :P_USER, :O_RESULT, :O_MSG); END;",
+                parameters.ToArray());
+        
+            // 鑾峰彇杈撳嚭鍙傛暟鐨勫��
+            var resultValue = outputResult.Value;
+            var messageValue = outputMessage.Value?.ToString();
+            
+            // 妫�鏌ュ瓨鍌ㄨ繃绋嬫墽琛岀粨鏋�
+            bool isSuccess = false;
+            if (resultValue != null)
+            {
+                if (resultValue is int intVal && intVal == 0)
+                    isSuccess = true;
+                else if (resultValue is decimal decimalVal && decimalVal == 0)
+                    isSuccess = true;
+                else if (resultValue is double doubleVal && doubleVal == 0.0)
+                    isSuccess = true;
+                else if (resultValue.ToString() == "0")
+                    isSuccess = true;
+            }
+            
+            return (isSuccess, messageValue ?? "鏈煡閿欒");
+        }
+        catch (Exception ex)
+        {
+            return (false, $"璋冪敤瀛樺偍杩囩▼澶辫触: {ex.Message}");
+        }
+    }
+}
\ No newline at end of file
diff --git a/MES.Service/service/QC/XJService.cs b/MES.Service/service/QC/XJService.cs
index e2fa544..65a3a08 100644
--- a/MES.Service/service/QC/XJService.cs
+++ b/MES.Service/service/QC/XJService.cs
@@ -3,6 +3,8 @@
 using MES.Service.Modes;
 using MES.Service.util;
 using SqlSugar;
+using System.Data;
+using System.Data.Common;
 
 namespace MES.Service.service.QC;
 
@@ -496,11 +498,75 @@
                     .Where(s => s.Id == detail.Gid)
                     .ExecuteCommand();
             });
+
+            // 鏂板锛氬鏋滃垽瀹氱粨鏋滀负涓嶅悎鏍硷紝璋冪敤瀛樺偍杩囩▼鐢熸垚寮傚父澶勭疆鍗�
+            if (FcheckResu.Equals("涓嶅悎鏍�"))
+            {
+                CallXJUnqualifiedStoredProcedure(detail.Gid, detail.CreateBy);
+            }
         }
 
         return useTransactionWithOracle;
     }
 
+    /// <summary>
+    /// 璋冪敤宸℃涓嶅悎鏍煎鐞嗗瓨鍌ㄨ繃绋嬬敓鎴愬紓甯稿缃崟
+    /// </summary>
+    /// <param name="gid">宸℃涓昏〃ID</param>
+    /// <param name="createBy">鎿嶄綔浜�</param>
+    private void CallXJUnqualifiedStoredProcedure(decimal? gid, string createBy)
+    {
+        try
+        {
+            var db = SqlSugarHelper.GetInstance();
+            
+            // 鑾峰彇宸℃鍗曚俊鎭�
+            var xjInfo = db.Queryable<QsQaItemXj>()
+                .Where(s => s.Id == gid)
+                .First();
+                
+            if (xjInfo == null) return;
+
+            // 瀹氫箟杈撳嚭鍙傛暟
+            var outputResult = new SugarParameter("o_Result", null,
+                System.Data.DbType.Int32, ParameterDirection.Output, 4000);
+
+            var outputMessage = new SugarParameter("o_Msg", null,
+                System.Data.DbType.String, ParameterDirection.Output, 4000);
+
+            // 瀹氫箟杈撳叆鍙傛暟
+            var parameters = new List<SugarParameter>
+            {
+                new("p_Gid", gid, System.Data.DbType.Decimal, ParameterDirection.Input),
+                new("p_Bill_No", xjInfo.BillNo, System.Data.DbType.String, ParameterDirection.Input),
+                new("p_User", createBy, System.Data.DbType.String, ParameterDirection.Input),
+                outputResult,
+                outputMessage
+            };
+
+            // 鎵ц瀛樺偍杩囩▼鐢熸垚寮傚父澶勭疆鍗�
+            db.Ado.ExecuteCommand(
+                "BEGIN PRC_XJ_EXCEPTION_ORDER(:p_Gid, :p_Bill_No, :p_User, :o_Result, :o_Msg); END;",
+                parameters.ToArray());
+
+            // 鑾峰彇杈撳嚭鍙傛暟鐨勫��
+            var resultValue = outputResult.Value?.ToString();
+            var messageValue = outputMessage.Value?.ToString();
+
+            if ("1".Equals(resultValue)) 
+            {
+                throw new Exception($"宸℃寮傚父澶勭疆鍗曠敓鎴愬け璐�: {messageValue}");
+            }
+        }
+        catch (Exception ex)
+        {
+            // 璁板綍鏃ュ織浣嗕笉褰卞搷涓绘祦绋�
+            Console.WriteLine($"宸℃寮傚父澶勭疆鍗曠敓鎴愬瓨鍌ㄨ繃绋嬭皟鐢ㄥけ璐�: {ex.Message}");
+            // 鍙互鏍规嵁闇�瑕佸喅瀹氭槸鍚︽姏鍑哄紓甯�
+            // throw new Exception($"宸℃寮傚父澶勭疆鍗曠敓鎴愬け璐�: {ex.Message}");
+        }
+    }
+
     public int UpdateQSItemDetail(QsQaItemXj02 detail)
     {
         var withOracle = SqlSugarHelper.UseTransactionWithOracle(db =>
diff --git a/MES.Service/service/Warehouse/MesReturnwareManager.cs b/MES.Service/service/Warehouse/MesReturnwareManager.cs
index c83afa9..7bb85c8 100644
--- a/MES.Service/service/Warehouse/MesReturnwareManager.cs
+++ b/MES.Service/service/Warehouse/MesReturnwareManager.cs
@@ -4,6 +4,7 @@
 using MES.Service.DB;
 using MES.Service.Modes;
 using MES.Service.Dto.webApi;
+using System.Data;
 
 namespace MES.Service.service
 {
@@ -92,7 +93,12 @@
             var orUpdate = base.Insert(mesReturnware);
             var baOrUpdate = ReturnwareDetailsManager.InsertRange(mesReturnwareDetails);
 
-            if (orUpdate && baOrUpdate) return true;
+            if (orUpdate && baOrUpdate)
+            {
+                // 淇濆瓨鎴愬姛鍚庯紝璋冪敤瀛樺偍杩囩▼鐢熸垚妫�楠屽崟
+                GenerateInspectionOrder(db, mesReturnware, mesReturnwareDetails);
+                return true;
+            }
             throw new NotImplementedException("鎻掑叆鎴栨洿鏂板け璐�");
 
 
@@ -117,7 +123,12 @@
             var insertOrUpdate = db.Deleteable<MesReturnwareDetails>().Where(it => mesReturnwareDetail.Any(p => p.ReturnwareNo == it.ReturnNo && p.ReturnwareType == it.ReturnType)).ExecuteCommand() > 0;
 
 
-            if (update && insertOrUpdate) return true;
+            if (update && insertOrUpdate)
+            {
+                // 鏇存柊鎴愬姛鍚庯紝璋冪敤瀛樺偍杩囩▼鐢熸垚妫�楠屽崟
+                GenerateInspectionOrder(db, mesReturnware, mesReturnwareDetails);
+                return true;
+            }
             throw new NotImplementedException("鏇存柊澶辫触");
         }
 
@@ -187,27 +198,114 @@
 
         public bool Delete(YFDelete data)
         {
-
-
             return UseTransaction(db =>
             {
-                var update = db.Deleteable<MesReturnware>()
-                       .Where(it => it.ReturnNo == data.FBillNo &&
-                                    it.ReturnType == data.FBillTypeID)
-                       .ExecuteCommand() > 0;
-
-                var insertOrUpdate = db.Deleteable<MesReturnwareDetails>()
+                // 鍏堝垹闄ら��璐ч�氱煡鍗曟槑缁�
+                var detailsDeleted = db.Deleteable<MesReturnwareDetails>()
                       .Where(it => it.ReturnNo == data.FBillNo &&
                                    it.ReturnType == data.FBillTypeID)
                       .ExecuteCommand() > 0;
 
+                // 鍐嶅垹闄ら��璐ч�氱煡鍗曚富琛�
+                var mainDeleted = db.Deleteable<MesReturnware>()
+                       .Where(it => it.ReturnNo == data.FBillNo &&
+                                    it.ReturnType == data.FBillTypeID)
+                       .ExecuteCommand() > 0;
 
-
-                if (update && insertOrUpdate) return 1;
+                if (detailsDeleted && mainDeleted)
+                {
+                    // 鍒犻櫎鎴愬姛鍚庯紝璋冪敤瀛樺偍杩囩▼鍒犻櫎瀵瑰簲鐨勬楠屽崟
+                    DeleteInspectionOrder(db, data.FBillTypeID, data.FBillNo);
+                    return 1;
+                }
+                
                 throw new NotImplementedException("鍒犻櫎澶辫触");
             }) > 0;
+        }
 
+        /// <summary>
+        /// 璋冪敤瀛樺偍杩囩▼鐢熸垚妫�楠屽崟
+        /// </summary>
+        /// <param name="mesReturnware">閫�璐ч�氱煡鍗曚富琛�</param>
+        /// <param name="mesReturnwareDetails">閫�璐ч�氱煡鍗曟槑缁嗚〃</param>
+        private void GenerateInspectionOrder(SqlSugarScope db, MesReturnware mesReturnware, List<MesReturnwareDetails> mesReturnwareDetails)
+        {
+            try
+            {
+                // 瀹氫箟杈撳叆鍙傛暟
+                var inputParam1 = new SugarParameter("P_RETURN_TYPE", mesReturnware.ReturnType ?? "");
+                var inputParam2 = new SugarParameter("P_RETURN_NO", mesReturnware.ReturnNo ?? "");
+                
+                // 瀹氫箟杈撳嚭鍙傛暟
+                var outParam1 = new SugarParameter("P_RESULT", null, true);
+                var outParam2 = new SugarParameter("P_MESSAGE", null, true);
 
+                // 浣跨敤 SqlSugar 鎵ц瀛樺偍杩囩▼
+                db.Ado.ExecuteCommand("BEGIN SP_GEN_RETURN_INSP(:P_RETURN_TYPE,:P_RETURN_NO,:P_RESULT,:P_MESSAGE); END;", 
+                    inputParam1, inputParam2, outParam1, outParam2);
+
+                // 鑾峰彇杈撳嚭鍙傛暟鐨勫��
+                int result = int.Parse((string)outParam1.Value);
+                string message = outParam2.Value == DBNull.Value ? string.Empty : (string)outParam2.Value;
+
+                if (result != 1)
+                {
+                    // 璁板綍璀﹀憡鏃ュ織锛屼絾涓嶅奖鍝嶉��璐ч�氱煡鍗曠殑淇濆瓨
+                    Console.WriteLine($"鐢熸垚妫�楠屽崟璀﹀憡: {message}");
+                }
+                else
+                {
+                    Console.WriteLine($"鐢熸垚妫�楠屽崟鎴愬姛: {message}");
+                }
+            }
+            catch (Exception ex)
+            {
+                // 璁板綍閿欒鏃ュ織锛屼絾涓嶅奖鍝嶉��璐ч�氱煡鍗曠殑淇濆瓨
+                Console.WriteLine($"鐢熸垚妫�楠屽崟鏃跺彂鐢熼敊璇�: {ex.Message}");
+            }
+        }
+
+        /// <summary>
+        /// 璋冪敤瀛樺偍杩囩▼鍒犻櫎妫�楠屽崟
+        /// </summary>
+        /// <param name="db">鏁版嵁搴撹繛鎺�</param>
+        /// <param name="returnType">閫�璐у崟鍒�</param>
+        /// <param name="returnNo">閫�璐у崟鍙�</param>
+        private void DeleteInspectionOrder(SqlSugarScope db, string returnType, string returnNo)
+        {
+            try
+            {
+                // 瀹氫箟杈撳叆鍙傛暟
+                var inputParam1 = new SugarParameter("P_RETURN_TYPE", returnType ?? "");
+                var inputParam2 = new SugarParameter("P_RETURN_NO", returnNo ?? "");
+                
+                // 瀹氫箟杈撳嚭鍙傛暟
+                var outParam1 = new SugarParameter("P_RESULT", null, true);
+                var outParam2 = new SugarParameter("P_MESSAGE", null, true);
+
+                // 浣跨敤 SqlSugar 鎵ц瀛樺偍杩囩▼
+                db.Ado.ExecuteCommand("BEGIN SP_DEL_RETURN_INSP(:P_RETURN_TYPE,:P_RETURN_NO,:P_RESULT,:P_MESSAGE); END;", 
+                    inputParam1, inputParam2, outParam1, outParam2);
+
+                // 鑾峰彇杈撳嚭鍙傛暟鐨勫��
+                int result = int.Parse((string)outParam1.Value);
+                string message = outParam2.Value == DBNull.Value ? string.Empty : (string)outParam2.Value;
+
+                if (result != 1)
+                {
+                    // 璁板綍璀﹀憡鏃ュ織锛屼絾涓嶅奖鍝嶉��璐ч�氱煡鍗曠殑鍒犻櫎
+                    Console.WriteLine($"鍒犻櫎妫�楠屽崟璀﹀憡: {message}");
+                }
+                else
+                {
+                    Console.WriteLine($"鍒犻櫎妫�楠屽崟鎴愬姛: {message}");
+                }
+            }
+            catch (Exception ex)
+            {
+                // 璁板綍閿欒鏃ュ織锛屼絾涓嶅奖鍝嶉��璐ч�氱煡鍗曠殑鍒犻櫎
+                Console.WriteLine($"鍒犻櫎妫�楠屽崟鏃跺彂鐢熼敊璇�: {ex.Message}");
+            }
         }
 
 
diff --git a/MESApplication/Controllers/QC/BaseController.cs b/MESApplication/Controllers/QC/BaseController.cs
index 71ad051..03ae142 100644
--- a/MESApplication/Controllers/QC/BaseController.cs
+++ b/MESApplication/Controllers/QC/BaseController.cs
@@ -107,4 +107,29 @@
         }
     }
 
+    //getByThjFid - 鑾峰彇THJ閫�璐ф楠岀殑鍥剧墖
+    [HttpPost("getByThjFid")]
+    public ResponseResult getByThjFid([FromBody] JObject data)
+    {
+        var id = Convert.ToInt32(data["fid"].ToString());
+        var qsType = data["qsType"].ToString();
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var tbBillList =
+                new BaseService().getByThjFid(id, qsType);
+            resultInfos.tbBillList = tbBillList;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
 }
\ No newline at end of file
diff --git a/MESApplication/Controllers/QC/MesOqcItemsDetect02Controller.cs b/MESApplication/Controllers/QC/MesOqcItemsDetect02Controller.cs
index e4a9ccf..552608c 100644
--- a/MESApplication/Controllers/QC/MesOqcItemsDetect02Controller.cs
+++ b/MESApplication/Controllers/QC/MesOqcItemsDetect02Controller.cs
@@ -58,6 +58,7 @@
         }
     }
 
+<<<<<<< HEAD
     [HttpPost("SetQSItems")]
     public ResponseResult SetQSItems([FromBody] JObject data)
     {
@@ -103,6 +104,8 @@
         }
     }
 
+=======
+>>>>>>> 3b90e8717befe39af4d9384252d27b7a768a773f
     //IqcQaSubmit
     [HttpPost("IqcQaSubmit")]
     public ResponseResult IqcQaSubmit(LLJDto rkjDto)
diff --git a/MESApplication/Controllers/QC/RKJController.cs b/MESApplication/Controllers/QC/RKJController.cs
index 3aea949..f07fc5d 100644
--- a/MESApplication/Controllers/QC/RKJController.cs
+++ b/MESApplication/Controllers/QC/RKJController.cs
@@ -364,4 +364,53 @@
             return ResponseResult.ResponseError(ex);
         }
     }
+
+    /// <summary>
+    /// 鎻愪氦鍏ュ簱妫�缁撴灉
+    /// </summary>
+    /// <param name="data">鍖呭惈gid鍜寀serNo鐨凧SON瀵硅薄</param>
+    /// <returns>鎻愪氦缁撴灉</returns>
+    [HttpPost("submitRKJResult")]
+    public ResponseResult submitRKJResult([FromBody] JObject data)
+    {
+        try
+        {
+            var gid = Convert.ToDecimal(data["gid"]?.ToString());
+            var userNo = data["userNo"]?.ToString();
+
+            if (gid <= 0)
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "鍏ュ簱妫�鍗旾D涓嶈兘涓虹┖",
+                    data = null
+                };
+            }
+
+            if (string.IsNullOrEmpty(userNo))
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "鎿嶄綔浜轰笉鑳戒负绌�",
+                    data = null
+                };
+            }
+
+            dynamic resultInfos = new ExpandoObject();
+            var result = new RKJService().SubmitRKJResult(gid, userNo);
+            resultInfos.tbBillList = result;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "鎻愪氦鎴愬姛",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
 }
\ No newline at end of file
diff --git a/MESApplication/Controllers/QC/THJController.cs b/MESApplication/Controllers/QC/THJController.cs
new file mode 100644
index 0000000..cc46927
--- /dev/null
+++ b/MESApplication/Controllers/QC/THJController.cs
@@ -0,0 +1,604 @@
+using System.Dynamic;
+using MES.Service.Dto.service;
+using MES.Service.Modes;
+using MES.Service.service.QC;
+using MES.Service.util;
+using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json.Linq;
+
+namespace MESApplication.Controllers.QC;
+
+[Route("api/[controller]")]
+[ApiController]
+public class THJController : ControllerBase
+{
+    [HttpPost("getPage")]
+    public ResponseResult GetPage([FromBody] THJPageResult queryObj)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var tbBillList = new THJService().getPage(queryObj);
+            resultInfos.tbBillList = tbBillList;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    [HttpPost("getMaxReleaseNo")]
+    public ResponseResult GetMaxReleaseNo()
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var tbBillList = new THJService().getMaxReleaseNo();
+            resultInfos.tbBillList = tbBillList;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    [HttpPost("getQSItems")]
+    public ResponseResult GetQSItems([FromBody] JObject data)
+    {
+        var pid = data["pid"]?.ToString();
+        var id = data["id"]?.ToString();
+
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var tbBillList = new THJService();
+            var detail021 = tbBillList.getQSItems(Convert.ToDecimal(pid), Convert.ToDecimal(id));
+            resultInfos.tbBillList = detail021;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    [HttpPost("saveItem")]
+    public ResponseResult SaveItem([FromBody] THJDto thjDto)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var tbBillList = new THJService().saveItem(thjDto);
+            resultInfos.tbBillList = tbBillList;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    [HttpPost("submitTHJResult")]
+    public ResponseResult SubmitTHJResult([FromBody] JObject data)
+    {
+        try
+        {
+            var gid = Convert.ToDecimal(data["gid"]?.ToString());
+            var userNo = data["userNo"]?.ToString();
+
+            if (gid <= 0)
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "妫�楠屽崟ID涓嶈兘涓虹┖",
+                    data = null
+                };
+            }
+
+            if (string.IsNullOrEmpty(userNo))
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "鎿嶄綔浜轰笉鑳戒负绌�",
+                    data = null
+                };
+            }
+
+            var result = new THJService().SubmitTHJResult(gid, userNo);
+            
+            if (result)
+            {
+                dynamic resultInfos = new ExpandoObject();
+                resultInfos.tbBillList = new { success = true, message = "鎻愪氦鎴愬姛" };
+                return new ResponseResult
+                {
+                    status = 0,
+                    message = "鎻愪氦鎴愬姛",
+                    data = resultInfos
+                };
+            }
+            else
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "鎻愪氦澶辫触",
+                    data = null
+                };
+            }
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    [HttpPost("getReturnwareInfo")]
+    public ResponseResult GetReturnwareInfo([FromBody] JObject data)
+    {
+        try
+        {
+            var returnType = data["returnType"]?.ToString();
+            var returnNo = data["returnNo"]?.ToString();
+
+            if (string.IsNullOrEmpty(returnType) || string.IsNullOrEmpty(returnNo))
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "閫�璐у崟鍒拰閫�璐у崟鍙蜂笉鑳戒负绌�",
+                    data = null
+                };
+            }
+
+            dynamic resultInfos = new ExpandoObject();
+            var tbBillList = new THJService().getReturnwareInfo(returnType, returnNo);
+            resultInfos.tbBillList = tbBillList;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    [HttpPost("getReturnDetails")]
+    public ResponseResult GetReturnDetails([FromBody] JObject data)
+    {
+        try
+        {
+            var pid = data["pid"]?.ToString();
+
+            if (string.IsNullOrEmpty(pid))
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "妫�楠屽崟ID涓嶈兘涓虹┖",
+                    data = null
+                };
+            }
+
+            dynamic resultInfos = new ExpandoObject();
+            var tbBillList = new THJService().getReturnDetails(pid);
+            resultInfos.tbBillList = tbBillList;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    [HttpPost("setInspectItem")]
+    public ResponseResult SetInspectItem([FromBody] JObject data)
+    {
+        try
+        {
+            var gid = data["gid"]?.ToString();
+            var updateBy = data["updateBy"]?.ToString() ?? "绯荤粺";
+
+            if (string.IsNullOrEmpty(gid))
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "妫�楠屽崟ID涓嶈兘涓虹┖",
+                    data = null
+                };
+            }
+
+            dynamic resultInfos = new ExpandoObject();
+            var tbBillList = new THJService().setInspectItem(gid, updateBy);
+            resultInfos.tbBillList = tbBillList;
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    /// 娴嬭瘯鎺ュ彛 - 楠岃瘉鍩烘湰鍔熻兘
+    /// </summary>
+    [HttpPost("testConnection")]
+    public ResponseResult TestConnection()
+    {
+        try
+        {
+            return new ResponseResult
+            {
+                status = 0,
+                message = "杩炴帴姝e父",
+                data = new { timestamp = DateTime.Now }
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    /// 鏍规嵁ID鑾峰彇妫�楠岄」鐩鎯�
+    /// </summary>
+    [HttpPost("getThjDetail02ById")]
+    public ResponseResult GetThjDetail02ById([FromBody] JObject data)
+    {
+        try
+        {
+            var id = Convert.ToDecimal(data["id"]);
+            var result = new THJService().getThjDetail02ById(id);
+
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = result;
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    /// 璁剧疆妫�楠岄」鐩鎯�
+    /// </summary>
+    [HttpPost("SetQSItemDetail")]
+    public ResponseResult SetQSItemDetail([FromBody] JObject data)
+    {
+        try
+        {
+            var pid = Convert.ToDecimal(data["pid"]);
+            var gid = Convert.ToDecimal(data["gid"]);
+            var fstand = data["fstand"]?.ToString();
+            var fcheckResu = data["fcheckResu"]?.ToString();
+            var updateBy = data["updateBy"]?.ToString();
+            var count = Convert.ToInt32(data["count"]);
+
+            var result = new THJService().SetQSItemDetail(pid, gid, fstand, fcheckResu, updateBy, count);
+
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = result;
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    /// 鏇存柊妫�楠岄」鐩鎯�
+    /// </summary>
+    [HttpPost("UpdateQSItemDetail")]
+    public ResponseResult UpdateQSItemDetail([FromBody] JObject data)
+    {
+        try
+        {
+            // 瀹夊叏鍦拌浆鎹ecimal鍙傛暟锛屽鐞哊ULL鍊�
+            if (!decimal.TryParse(data["id"]?.ToString(), out decimal id))
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "妫�楠岀粨鏋淚D涓嶈兘涓虹┖鎴栨牸寮忎笉姝g‘",
+                    data = null
+                };
+            }
+            
+            if (!decimal.TryParse(data["pid"]?.ToString(), out decimal pid))
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "妫�楠岄」鐩甀D涓嶈兘涓虹┖鎴栨牸寮忎笉姝g‘",
+                    data = null
+                };
+            }
+            
+            if (!decimal.TryParse(data["gid"]?.ToString(), out decimal gid))
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "妫�楠屽崟ID涓嶈兘涓虹┖鎴栨牸寮忎笉姝g‘",
+                    data = null
+                };
+            }
+            
+            var fstand = data["fstand"]?.ToString();
+            var fcheckResu = data["fcheckResu"]?.ToString();
+            var updateBy = data["updateBy"]?.ToString();
+
+            var result = new THJService().UpdateQSItemDetail(id, pid, gid, fstand, fcheckResu, updateBy);
+
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = result;
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    /// 淇濆瓨妫�楠岄」鐩娉�
+    /// </summary>
+    [HttpPost("saveRemarksPid")]
+    public ResponseResult SaveRemarksPid([FromBody] JObject data)
+    {
+        try
+        {
+            var pid = Convert.ToDecimal(data["pid"]);
+            var remarks = data["remarks"]?.ToString();
+
+            var result = new THJService().saveRemarksPid(pid, remarks);
+
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = result;
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    /// 鑾峰彇閫�璐у崟鍒楄〃
+    /// </summary>
+    [HttpPost("getReturnOrders")]
+    public ResponseResult GetReturnOrders()
+    {
+        try
+        {
+            var result = new THJService().getReturnOrders();
+
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = result;
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    /// 淇濆瓨閫�璐ф槑缁�
+    /// </summary>
+    [HttpPost("SaveReturnDetails")]
+    public ResponseResult SaveReturnDetails([FromBody] JObject data)
+    {
+        try
+        {
+            var returnDetails = data["returnDetails"]?.ToString();
+            var result = new THJService().SaveReturnDetails(returnDetails);
+
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = result;
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    /// 淇濆瓨妫�楠岄」鐩�
+    /// </summary>
+    [HttpPost("saveInspectItem")]
+    public ResponseResult SaveInspectItem([FromBody] JObject data)
+    {
+        try
+        {
+            var gid = data["gid"]?.ToString();
+            var items = data["items"]?.ToString();
+            var userNo = data["userNo"]?.ToString();
+
+            var result = new THJService().saveInspectItem(gid, items, userNo);
+
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = result;
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    /// 淇濆瓨妫�楠屽崟澶囨敞锛堜笉鍚堟牸鎻忚堪锛�
+    /// </summary>
+    [HttpPost("saveRemarksGid")]
+    public ResponseResult SaveRemarksGid([FromBody] JObject data)
+    {
+        try
+        {
+            var gid = Convert.ToDecimal(data["gid"]?.ToString());
+            var remarks = data["remarks"]?.ToString();
+
+            var result = new THJService().saveRemarksGid(gid, remarks);
+
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.tbBillList = result;
+
+            return new ResponseResult
+            {
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    /// 閫氳繃瀛樺偍杩囩▼鎻愪氦妫�楠岀粨鏋�
+    /// </summary>
+    [HttpPost("submitTHJResultByProcedure")]
+    public ResponseResult SubmitTHJResultByProcedure([FromBody] JObject data)
+    {
+        try
+        {
+            var releaseNo = data["releaseNo"]?.ToString();
+            var userNo = data["userNo"]?.ToString();
+
+            if (string.IsNullOrEmpty(releaseNo))
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "妫�楠屽崟鍙蜂笉鑳戒负绌�",
+                    data = null
+                };
+            }
+
+            if (string.IsNullOrEmpty(userNo))
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = "鎿嶄綔浜轰笉鑳戒负绌�",
+                    data = null
+                };
+            }
+
+            var result = new THJService().SubmitTHJResultByProcedure(releaseNo, userNo);
+            
+            if (result.success)
+            {
+                dynamic resultInfos = new ExpandoObject();
+                resultInfos.tbBillList = new { success = true, message = result.message };
+                return new ResponseResult
+                {
+                    status = 0,
+                    message = result.message,
+                    data = resultInfos
+                };
+            }
+            else
+            {
+                return new ResponseResult
+                {
+                    status = 1,
+                    message = result.message,
+                    data = null
+                };
+            }
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+}
diff --git a/MESApplication/MESApplication.csproj b/MESApplication/MESApplication.csproj
index b87eece..abcb692 100644
--- a/MESApplication/MESApplication.csproj
+++ b/MESApplication/MESApplication.csproj
@@ -9,7 +9,7 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0"/>
+        <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.0"/>
         <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.1">
             <PrivateAssets>all</PrivateAssets>
             <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
diff --git a/MESApplication/Properties/PublishProfiles/FolderProfile.pubxml.user b/MESApplication/Properties/PublishProfiles/FolderProfile.pubxml.user
index ca32636..92e020f 100644
--- a/MESApplication/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ b/MESApplication/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -5,7 +5,7 @@
 <Project>
   <PropertyGroup>
     <_PublishTargetUrl>E:\Desktop\鎺ュ彛\RD\RD_MES_Api\MESApplication\bin\Release\net8.0\publish\</_PublishTargetUrl>
-    <History>True|2025-08-03T10:48:37.3295098Z||;True|2025-08-01T17:29:02.4576952+08:00||;True|2025-03-27T23:22:42.3501020+08:00||;True|2025-03-10T16:49:08.3476948+08:00||;True|2024-12-24T15:39:58.5366570+08:00||;True|2024-11-26T18:32:03.9568766+08:00||;True|2024-11-21T02:11:35.8050745+08:00||;True|2024-09-21T16:35:22.6651659+08:00||;True|2024-09-21T16:14:11.3450387+08:00||;True|2024-09-19T17:16:11.7338751+08:00||;True|2024-09-19T17:11:21.0116707+08:00||;True|2024-09-19T13:54:25.7455472+08:00||;True|2024-09-15T13:55:51.7095153+08:00||;True|2024-09-12T17:10:20.4734556+08:00||;True|2024-09-10T15:54:07.7463519+08:00||;True|2024-09-06T14:40:56.3762241+08:00||;True|2024-08-20T17:12:00.2924570+08:00||;True|2024-08-17T10:57:05.6670396+08:00||;True|2024-08-17T10:56:46.8068041+08:00||;True|2024-08-16T14:09:17.0526491+08:00||;True|2024-08-15T08:40:32.8134665+08:00||;True|2024-08-14T10:00:27.7017207+08:00||;True|2024-08-14T08:54:44.8284031+08:00||;True|2024-08-07T10:32:10.3689256+08:00||;True|2024-08-05T15:45:03.0864530+08:00||;True|2024-08-03T09:59:13.7916520+08:00||;True|2024-07-31T17:27:28.1965929+08:00||;True|2024-07-31T15:27:34.7943845+08:00||;True|2024-07-30T15:04:50.5849235+08:00||;True|2024-07-30T14:09:06.2877325+08:00||;True|2024-07-29T16:11:30.4493940+08:00||;True|2024-07-23T14:30:34.4591002+08:00||;True|2024-07-22T14:17:39.8186158+08:00||;True|2024-04-10T12:55:31.3963752+08:00||;True|2024-04-08T13:59:25.5487203+08:00||;True|2024-04-06T09:30:09.5350539+08:00||;True|2024-04-06T08:46:05.8814658+08:00||;True|2024-04-05T14:06:52.0448024+08:00||;True|2024-04-05T12:47:46.0561601+08:00||;True|2024-02-26T08:46:22.0988887+08:00||;True|2024-02-24T19:17:13.6770376+08:00||;True|2024-02-24T14:32:37.4450337+08:00||;True|2024-02-23T10:22:06.5150173+08:00||;True|2024-02-22T13:19:56.6997993+08:00||;True|2024-02-22T10:53:17.7929585+08:00||;True|2024-02-21T17:08:06.5553444+08:00||;True|2024-02-19T16:24:37.4912012+08:00||;True|2024-02-02T10:07:23.2726075+08:00||;True|2024-02-02T08:36:49.2904460+08:00||;True|2024-01-29T17:44:43.6800769+08:00||;True|2024-01-23T09:47:26.7811926+08:00||;True|2024-01-18T16:23:30.3373836+08:00||;True|2024-01-17T14:22:04.2552286+08:00||;True|2024-01-16T16:54:42.2316892+08:00||;True|2024-01-16T16:37:23.8028858+08:00||;True|2024-01-16T09:25:24.4007775+08:00||;True|2024-01-15T10:18:57.3362616+08:00||;True|2024-01-15T10:07:14.2044763+08:00||;True|2024-01-10T14:03:36.4451130+08:00||;True|2024-01-09T16:45:32.9601815+08:00||;True|2024-01-06T14:16:34.2732220+08:00||;True|2024-01-06T14:11:45.2134717+08:00||;True|2024-01-06T11:30:58.9198887+08:00||;</History>
+    <History>True|2025-09-07T07:57:42.6492991Z||;True|2025-09-02T14:07:59.4933772+08:00||;True|2025-08-22T10:11:31.0216372+08:00||;True|2025-08-18T08:28:20.1447738+08:00||;True|2025-08-12T09:51:50.2822756+08:00||;True|2025-08-10T16:28:17.3559399+08:00||;True|2025-08-06T09:47:19.1451217+08:00||;True|2025-08-06T09:46:51.2621129+08:00||;True|2025-08-03T18:48:37.3295098+08:00||;True|2025-08-01T17:29:02.4576952+08:00||;True|2025-03-27T23:22:42.3501020+08:00||;True|2025-03-10T16:49:08.3476948+08:00||;True|2024-12-24T15:39:58.5366570+08:00||;True|2024-11-26T18:32:03.9568766+08:00||;True|2024-11-21T02:11:35.8050745+08:00||;True|2024-09-21T16:35:22.6651659+08:00||;True|2024-09-21T16:14:11.3450387+08:00||;True|2024-09-19T17:16:11.7338751+08:00||;True|2024-09-19T17:11:21.0116707+08:00||;True|2024-09-19T13:54:25.7455472+08:00||;True|2024-09-15T13:55:51.7095153+08:00||;True|2024-09-12T17:10:20.4734556+08:00||;True|2024-09-10T15:54:07.7463519+08:00||;True|2024-09-06T14:40:56.3762241+08:00||;True|2024-08-20T17:12:00.2924570+08:00||;True|2024-08-17T10:57:05.6670396+08:00||;True|2024-08-17T10:56:46.8068041+08:00||;True|2024-08-16T14:09:17.0526491+08:00||;True|2024-08-15T08:40:32.8134665+08:00||;True|2024-08-14T10:00:27.7017207+08:00||;True|2024-08-14T08:54:44.8284031+08:00||;True|2024-08-07T10:32:10.3689256+08:00||;True|2024-08-05T15:45:03.0864530+08:00||;True|2024-08-03T09:59:13.7916520+08:00||;True|2024-07-31T17:27:28.1965929+08:00||;True|2024-07-31T15:27:34.7943845+08:00||;True|2024-07-30T15:04:50.5849235+08:00||;True|2024-07-30T14:09:06.2877325+08:00||;True|2024-07-29T16:11:30.4493940+08:00||;True|2024-07-23T14:30:34.4591002+08:00||;True|2024-07-22T14:17:39.8186158+08:00||;True|2024-04-10T12:55:31.3963752+08:00||;True|2024-04-08T13:59:25.5487203+08:00||;True|2024-04-06T09:30:09.5350539+08:00||;True|2024-04-06T08:46:05.8814658+08:00||;True|2024-04-05T14:06:52.0448024+08:00||;True|2024-04-05T12:47:46.0561601+08:00||;True|2024-02-26T08:46:22.0988887+08:00||;True|2024-02-24T19:17:13.6770376+08:00||;True|2024-02-24T14:32:37.4450337+08:00||;True|2024-02-23T10:22:06.5150173+08:00||;True|2024-02-22T13:19:56.6997993+08:00||;True|2024-02-22T10:53:17.7929585+08:00||;True|2024-02-21T17:08:06.5553444+08:00||;True|2024-02-19T16:24:37.4912012+08:00||;True|2024-02-02T10:07:23.2726075+08:00||;True|2024-02-02T08:36:49.2904460+08:00||;True|2024-01-29T17:44:43.6800769+08:00||;True|2024-01-23T09:47:26.7811926+08:00||;True|2024-01-18T16:23:30.3373836+08:00||;True|2024-01-17T14:22:04.2552286+08:00||;True|2024-01-16T16:54:42.2316892+08:00||;True|2024-01-16T16:37:23.8028858+08:00||;True|2024-01-16T09:25:24.4007775+08:00||;True|2024-01-15T10:18:57.3362616+08:00||;True|2024-01-15T10:07:14.2044763+08:00||;True|2024-01-10T14:03:36.4451130+08:00||;True|2024-01-09T16:45:32.9601815+08:00||;True|2024-01-06T14:16:34.2732220+08:00||;True|2024-01-06T14:11:45.2134717+08:00||;True|2024-01-06T11:30:58.9198887+08:00||;</History>
     <LastFailureDetails />
   </PropertyGroup>
 </Project>
\ No newline at end of file
diff --git a/MESApplication/bin/Debug/net8.0/MES.Service.dll b/MESApplication/bin/Debug/net8.0/MES.Service.dll
index c635514..f5f79ef 100644
--- a/MESApplication/bin/Debug/net8.0/MES.Service.dll
+++ b/MESApplication/bin/Debug/net8.0/MES.Service.dll
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MES.Service.pdb b/MESApplication/bin/Debug/net8.0/MES.Service.pdb
index ead8e76..37b5eaf 100644
--- a/MESApplication/bin/Debug/net8.0/MES.Service.pdb
+++ b/MESApplication/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.deps.json b/MESApplication/bin/Debug/net8.0/MESApplication.deps.json
index 523a7cc..50ca4f3 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.deps.json
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.deps.json
@@ -9,7 +9,7 @@
       "MESApplication/1.0.0": {
         "dependencies": {
           "MES.Service": "1.0.0",
-          "Microsoft.AspNetCore.Mvc.NewtonsoftJson": "8.0.0",
+          "Microsoft.AspNetCore.Mvc.NewtonsoftJson": "7.0.0",
           "Microsoft.EntityFrameworkCore.Design": "8.0.1",
           "Microsoft.EntityFrameworkCore.Tools": "8.0.1",
           "Oracle.EntityFrameworkCore": "8.21.121",
@@ -107,28 +107,28 @@
           }
         }
       },
-      "Microsoft.AspNetCore.JsonPatch/8.0.0": {
+      "Microsoft.AspNetCore.JsonPatch/7.0.0": {
         "dependencies": {
           "Microsoft.CSharp": "4.7.0",
           "Newtonsoft.Json": "13.0.3"
         },
         "runtime": {
-          "lib/net8.0/Microsoft.AspNetCore.JsonPatch.dll": {
-            "assemblyVersion": "8.0.0.0",
-            "fileVersion": "8.0.23.53112"
+          "lib/net7.0/Microsoft.AspNetCore.JsonPatch.dll": {
+            "assemblyVersion": "7.0.0.0",
+            "fileVersion": "7.0.22.51819"
           }
         }
       },
-      "Microsoft.AspNetCore.Mvc.NewtonsoftJson/8.0.0": {
+      "Microsoft.AspNetCore.Mvc.NewtonsoftJson/7.0.0": {
         "dependencies": {
-          "Microsoft.AspNetCore.JsonPatch": "8.0.0",
+          "Microsoft.AspNetCore.JsonPatch": "7.0.0",
           "Newtonsoft.Json": "13.0.3",
           "Newtonsoft.Json.Bson": "1.0.2"
         },
         "runtime": {
-          "lib/net8.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll": {
-            "assemblyVersion": "8.0.0.0",
-            "fileVersion": "8.0.23.53112"
+          "lib/net7.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll": {
+            "assemblyVersion": "7.0.0.0",
+            "fileVersion": "7.0.22.51819"
           }
         }
       },
@@ -1475,19 +1475,19 @@
       "path": "masuit.tools.core/2024.3.4",
       "hashPath": "masuit.tools.core.2024.3.4.nupkg.sha512"
     },
-    "Microsoft.AspNetCore.JsonPatch/8.0.0": {
+    "Microsoft.AspNetCore.JsonPatch/7.0.0": {
       "type": "package",
       "serviceable": true,
-      "sha512": "sha512-klQdb/9+j0u8MDjoqHEgDCPz8GRhfsbRVvZIM3glFqjs8uY7S1hS9RvKZuz8o4dS9NsEpFp4Jccd8CQuIYHK0g==",
-      "path": "microsoft.aspnetcore.jsonpatch/8.0.0",
-      "hashPath": "microsoft.aspnetcore.jsonpatch.8.0.0.nupkg.sha512"
+      "sha512": "sha512-svHQiUvLNdI2nac68WNQHNo/ZWyavFpt3Oip09QRnWeFqG9iyakKiNLavXr6KE8y7KxEXZNld96KQYbKz8SJMQ==",
+      "path": "microsoft.aspnetcore.jsonpatch/7.0.0",
+      "hashPath": "microsoft.aspnetcore.jsonpatch.7.0.0.nupkg.sha512"
     },
-    "Microsoft.AspNetCore.Mvc.NewtonsoftJson/8.0.0": {
+    "Microsoft.AspNetCore.Mvc.NewtonsoftJson/7.0.0": {
       "type": "package",
       "serviceable": true,
-      "sha512": "sha512-/e5+eBvY759xiZJO+y1lHi4VzXqbDzTJSyCtKpaj3Ko2JAFQjiCOJ0ZHk2i4g4HpoSdXmzEXQsjr6dUX9U0/JA==",
-      "path": "microsoft.aspnetcore.mvc.newtonsoftjson/8.0.0",
-      "hashPath": "microsoft.aspnetcore.mvc.newtonsoftjson.8.0.0.nupkg.sha512"
+      "sha512": "sha512-IJOsB1cm6FYGXxhlNoWR6zZYFREEBzeFX76NlBGhrZ7+VMK4piLm3fAgUBliasyEUg5MOOqFz5EGv8nmU5rXWQ==",
+      "path": "microsoft.aspnetcore.mvc.newtonsoftjson/7.0.0",
+      "hashPath": "microsoft.aspnetcore.mvc.newtonsoftjson.7.0.0.nupkg.sha512"
     },
     "Microsoft.Bcl.AsyncInterfaces/6.0.0": {
       "type": "package",
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.dll b/MESApplication/bin/Debug/net8.0/MESApplication.dll
index 0bf89ae..129a698 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.dll
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.dll
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.exe b/MESApplication/bin/Debug/net8.0/MESApplication.exe
index 4cad622..25a106e 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.exe
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.exe
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.pdb b/MESApplication/bin/Debug/net8.0/MESApplication.pdb
index 482b469..f87d9c3 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.pdb
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.pdb
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/MESApplication.xml b/MESApplication/bin/Debug/net8.0/MESApplication.xml
index 1d48ccf..446ce0a 100644
--- a/MESApplication/bin/Debug/net8.0/MESApplication.xml
+++ b/MESApplication/bin/Debug/net8.0/MESApplication.xml
@@ -958,6 +958,63 @@
             </summary>
             <returns></returns>
         </member>
+        <member name="M:MESApplication.Controllers.QC.RKJController.submitRKJResult(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            鎻愪氦鍏ュ簱妫�缁撴灉
+            </summary>
+            <param name="data">鍖呭惈gid鍜寀serNo鐨凧SON瀵硅薄</param>
+            <returns>鎻愪氦缁撴灉</returns>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.TestConnection">
+            <summary>
+            娴嬭瘯鎺ュ彛 - 楠岃瘉鍩烘湰鍔熻兘
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.GetThjDetail02ById(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            鏍规嵁ID鑾峰彇妫�楠岄」鐩鎯�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SetQSItemDetail(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            璁剧疆妫�楠岄」鐩鎯�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.UpdateQSItemDetail(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            鏇存柊妫�楠岄」鐩鎯�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SaveRemarksPid(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            淇濆瓨妫�楠岄」鐩娉�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.GetReturnOrders">
+            <summary>
+            鑾峰彇閫�璐у崟鍒楄〃
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SaveReturnDetails(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            淇濆瓨閫�璐ф槑缁�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SaveInspectItem(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            淇濆瓨妫�楠岄」鐩�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SaveRemarksGid(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            淇濆瓨妫�楠屽崟澶囨敞锛堜笉鍚堟牸鎻忚堪锛�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SubmitTHJResultByProcedure(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            閫氳繃瀛樺偍杩囩▼鎻愪氦妫�楠岀粨鏋�
+            </summary>
+        </member>
         <member name="M:MESApplication.Controllers.QC.XJController.getDaa001(Newtonsoft.Json.Linq.JObject)">
             <summary>
                 鑾峰彇宸ュ崟
diff --git a/MESApplication/bin/Debug/net8.0/Microsoft.AspNetCore.JsonPatch.dll b/MESApplication/bin/Debug/net8.0/Microsoft.AspNetCore.JsonPatch.dll
index 5f9168b..9537192 100644
--- a/MESApplication/bin/Debug/net8.0/Microsoft.AspNetCore.JsonPatch.dll
+++ b/MESApplication/bin/Debug/net8.0/Microsoft.AspNetCore.JsonPatch.dll
Binary files differ
diff --git a/MESApplication/bin/Debug/net8.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll b/MESApplication/bin/Debug/net8.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll
index 898bdde..369bda6 100644
--- a/MESApplication/bin/Debug/net8.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll
+++ b/MESApplication/bin/Debug/net8.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll
Binary files differ
diff --git a/MESApplication/bin/Release/net8.0/MES.Service.dll b/MESApplication/bin/Release/net8.0/MES.Service.dll
index e574157..1b5476b 100644
--- a/MESApplication/bin/Release/net8.0/MES.Service.dll
+++ b/MESApplication/bin/Release/net8.0/MES.Service.dll
Binary files differ
diff --git a/MESApplication/bin/Release/net8.0/MES.Service.pdb b/MESApplication/bin/Release/net8.0/MES.Service.pdb
index 02a90ce..2293692 100644
--- a/MESApplication/bin/Release/net8.0/MES.Service.pdb
+++ b/MESApplication/bin/Release/net8.0/MES.Service.pdb
Binary files differ
diff --git a/MESApplication/bin/Release/net8.0/MESApplication.deps.json b/MESApplication/bin/Release/net8.0/MESApplication.deps.json
index 523a7cc..50ca4f3 100644
--- a/MESApplication/bin/Release/net8.0/MESApplication.deps.json
+++ b/MESApplication/bin/Release/net8.0/MESApplication.deps.json
@@ -9,7 +9,7 @@
       "MESApplication/1.0.0": {
         "dependencies": {
           "MES.Service": "1.0.0",
-          "Microsoft.AspNetCore.Mvc.NewtonsoftJson": "8.0.0",
+          "Microsoft.AspNetCore.Mvc.NewtonsoftJson": "7.0.0",
           "Microsoft.EntityFrameworkCore.Design": "8.0.1",
           "Microsoft.EntityFrameworkCore.Tools": "8.0.1",
           "Oracle.EntityFrameworkCore": "8.21.121",
@@ -107,28 +107,28 @@
           }
         }
       },
-      "Microsoft.AspNetCore.JsonPatch/8.0.0": {
+      "Microsoft.AspNetCore.JsonPatch/7.0.0": {
         "dependencies": {
           "Microsoft.CSharp": "4.7.0",
           "Newtonsoft.Json": "13.0.3"
         },
         "runtime": {
-          "lib/net8.0/Microsoft.AspNetCore.JsonPatch.dll": {
-            "assemblyVersion": "8.0.0.0",
-            "fileVersion": "8.0.23.53112"
+          "lib/net7.0/Microsoft.AspNetCore.JsonPatch.dll": {
+            "assemblyVersion": "7.0.0.0",
+            "fileVersion": "7.0.22.51819"
           }
         }
       },
-      "Microsoft.AspNetCore.Mvc.NewtonsoftJson/8.0.0": {
+      "Microsoft.AspNetCore.Mvc.NewtonsoftJson/7.0.0": {
         "dependencies": {
-          "Microsoft.AspNetCore.JsonPatch": "8.0.0",
+          "Microsoft.AspNetCore.JsonPatch": "7.0.0",
           "Newtonsoft.Json": "13.0.3",
           "Newtonsoft.Json.Bson": "1.0.2"
         },
         "runtime": {
-          "lib/net8.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll": {
-            "assemblyVersion": "8.0.0.0",
-            "fileVersion": "8.0.23.53112"
+          "lib/net7.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll": {
+            "assemblyVersion": "7.0.0.0",
+            "fileVersion": "7.0.22.51819"
           }
         }
       },
@@ -1475,19 +1475,19 @@
       "path": "masuit.tools.core/2024.3.4",
       "hashPath": "masuit.tools.core.2024.3.4.nupkg.sha512"
     },
-    "Microsoft.AspNetCore.JsonPatch/8.0.0": {
+    "Microsoft.AspNetCore.JsonPatch/7.0.0": {
       "type": "package",
       "serviceable": true,
-      "sha512": "sha512-klQdb/9+j0u8MDjoqHEgDCPz8GRhfsbRVvZIM3glFqjs8uY7S1hS9RvKZuz8o4dS9NsEpFp4Jccd8CQuIYHK0g==",
-      "path": "microsoft.aspnetcore.jsonpatch/8.0.0",
-      "hashPath": "microsoft.aspnetcore.jsonpatch.8.0.0.nupkg.sha512"
+      "sha512": "sha512-svHQiUvLNdI2nac68WNQHNo/ZWyavFpt3Oip09QRnWeFqG9iyakKiNLavXr6KE8y7KxEXZNld96KQYbKz8SJMQ==",
+      "path": "microsoft.aspnetcore.jsonpatch/7.0.0",
+      "hashPath": "microsoft.aspnetcore.jsonpatch.7.0.0.nupkg.sha512"
     },
-    "Microsoft.AspNetCore.Mvc.NewtonsoftJson/8.0.0": {
+    "Microsoft.AspNetCore.Mvc.NewtonsoftJson/7.0.0": {
       "type": "package",
       "serviceable": true,
-      "sha512": "sha512-/e5+eBvY759xiZJO+y1lHi4VzXqbDzTJSyCtKpaj3Ko2JAFQjiCOJ0ZHk2i4g4HpoSdXmzEXQsjr6dUX9U0/JA==",
-      "path": "microsoft.aspnetcore.mvc.newtonsoftjson/8.0.0",
-      "hashPath": "microsoft.aspnetcore.mvc.newtonsoftjson.8.0.0.nupkg.sha512"
+      "sha512": "sha512-IJOsB1cm6FYGXxhlNoWR6zZYFREEBzeFX76NlBGhrZ7+VMK4piLm3fAgUBliasyEUg5MOOqFz5EGv8nmU5rXWQ==",
+      "path": "microsoft.aspnetcore.mvc.newtonsoftjson/7.0.0",
+      "hashPath": "microsoft.aspnetcore.mvc.newtonsoftjson.7.0.0.nupkg.sha512"
     },
     "Microsoft.Bcl.AsyncInterfaces/6.0.0": {
       "type": "package",
diff --git a/MESApplication/bin/Release/net8.0/MESApplication.dll b/MESApplication/bin/Release/net8.0/MESApplication.dll
index b8bc2e3..39eef1e 100644
--- a/MESApplication/bin/Release/net8.0/MESApplication.dll
+++ b/MESApplication/bin/Release/net8.0/MESApplication.dll
Binary files differ
diff --git a/MESApplication/bin/Release/net8.0/MESApplication.exe b/MESApplication/bin/Release/net8.0/MESApplication.exe
index 4cad622..25a106e 100644
--- a/MESApplication/bin/Release/net8.0/MESApplication.exe
+++ b/MESApplication/bin/Release/net8.0/MESApplication.exe
Binary files differ
diff --git a/MESApplication/bin/Release/net8.0/MESApplication.pdb b/MESApplication/bin/Release/net8.0/MESApplication.pdb
index 998d41b..df53339 100644
--- a/MESApplication/bin/Release/net8.0/MESApplication.pdb
+++ b/MESApplication/bin/Release/net8.0/MESApplication.pdb
Binary files differ
diff --git a/MESApplication/bin/Release/net8.0/MESApplication.xml b/MESApplication/bin/Release/net8.0/MESApplication.xml
index 1d48ccf..446ce0a 100644
--- a/MESApplication/bin/Release/net8.0/MESApplication.xml
+++ b/MESApplication/bin/Release/net8.0/MESApplication.xml
@@ -958,6 +958,63 @@
             </summary>
             <returns></returns>
         </member>
+        <member name="M:MESApplication.Controllers.QC.RKJController.submitRKJResult(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            鎻愪氦鍏ュ簱妫�缁撴灉
+            </summary>
+            <param name="data">鍖呭惈gid鍜寀serNo鐨凧SON瀵硅薄</param>
+            <returns>鎻愪氦缁撴灉</returns>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.TestConnection">
+            <summary>
+            娴嬭瘯鎺ュ彛 - 楠岃瘉鍩烘湰鍔熻兘
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.GetThjDetail02ById(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            鏍规嵁ID鑾峰彇妫�楠岄」鐩鎯�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SetQSItemDetail(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            璁剧疆妫�楠岄」鐩鎯�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.UpdateQSItemDetail(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            鏇存柊妫�楠岄」鐩鎯�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SaveRemarksPid(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            淇濆瓨妫�楠岄」鐩娉�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.GetReturnOrders">
+            <summary>
+            鑾峰彇閫�璐у崟鍒楄〃
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SaveReturnDetails(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            淇濆瓨閫�璐ф槑缁�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SaveInspectItem(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            淇濆瓨妫�楠岄」鐩�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SaveRemarksGid(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            淇濆瓨妫�楠屽崟澶囨敞锛堜笉鍚堟牸鎻忚堪锛�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SubmitTHJResultByProcedure(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            閫氳繃瀛樺偍杩囩▼鎻愪氦妫�楠岀粨鏋�
+            </summary>
+        </member>
         <member name="M:MESApplication.Controllers.QC.XJController.getDaa001(Newtonsoft.Json.Linq.JObject)">
             <summary>
                 鑾峰彇宸ュ崟
diff --git a/MESApplication/bin/Release/net8.0/Microsoft.AspNetCore.JsonPatch.dll b/MESApplication/bin/Release/net8.0/Microsoft.AspNetCore.JsonPatch.dll
index 5f9168b..9537192 100644
--- a/MESApplication/bin/Release/net8.0/Microsoft.AspNetCore.JsonPatch.dll
+++ b/MESApplication/bin/Release/net8.0/Microsoft.AspNetCore.JsonPatch.dll
Binary files differ
diff --git a/MESApplication/bin/Release/net8.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll b/MESApplication/bin/Release/net8.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll
index 898bdde..369bda6 100644
--- a/MESApplication/bin/Release/net8.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll
+++ b/MESApplication/bin/Release/net8.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll
Binary files differ
diff --git a/MESApplication/bin/Release/net8.0/publish/MES.Service.dll b/MESApplication/bin/Release/net8.0/publish/MES.Service.dll
index e574157..1b5476b 100644
--- a/MESApplication/bin/Release/net8.0/publish/MES.Service.dll
+++ b/MESApplication/bin/Release/net8.0/publish/MES.Service.dll
Binary files differ
diff --git a/MESApplication/bin/Release/net8.0/publish/MES.Service.pdb b/MESApplication/bin/Release/net8.0/publish/MES.Service.pdb
index 02a90ce..2293692 100644
--- a/MESApplication/bin/Release/net8.0/publish/MES.Service.pdb
+++ b/MESApplication/bin/Release/net8.0/publish/MES.Service.pdb
Binary files differ
diff --git a/MESApplication/bin/Release/net8.0/publish/MESApplication.deps.json b/MESApplication/bin/Release/net8.0/publish/MESApplication.deps.json
index 43250f4..d7aa6a3 100644
--- a/MESApplication/bin/Release/net8.0/publish/MESApplication.deps.json
+++ b/MESApplication/bin/Release/net8.0/publish/MESApplication.deps.json
@@ -9,7 +9,7 @@
       "MESApplication/1.0.0": {
         "dependencies": {
           "MES.Service": "1.0.0",
-          "Microsoft.AspNetCore.Mvc.NewtonsoftJson": "8.0.0",
+          "Microsoft.AspNetCore.Mvc.NewtonsoftJson": "7.0.0",
           "Microsoft.EntityFrameworkCore.Design": "8.0.1",
           "Microsoft.EntityFrameworkCore.Tools": "8.0.1",
           "Oracle.EntityFrameworkCore": "8.21.121",
@@ -100,28 +100,28 @@
           }
         }
       },
-      "Microsoft.AspNetCore.JsonPatch/8.0.0": {
+      "Microsoft.AspNetCore.JsonPatch/7.0.0": {
         "dependencies": {
           "Microsoft.CSharp": "4.7.0",
           "Newtonsoft.Json": "13.0.3"
         },
         "runtime": {
-          "lib/net8.0/Microsoft.AspNetCore.JsonPatch.dll": {
-            "assemblyVersion": "8.0.0.0",
-            "fileVersion": "8.0.23.53112"
+          "lib/net7.0/Microsoft.AspNetCore.JsonPatch.dll": {
+            "assemblyVersion": "7.0.0.0",
+            "fileVersion": "7.0.22.51819"
           }
         }
       },
-      "Microsoft.AspNetCore.Mvc.NewtonsoftJson/8.0.0": {
+      "Microsoft.AspNetCore.Mvc.NewtonsoftJson/7.0.0": {
         "dependencies": {
-          "Microsoft.AspNetCore.JsonPatch": "8.0.0",
+          "Microsoft.AspNetCore.JsonPatch": "7.0.0",
           "Newtonsoft.Json": "13.0.3",
           "Newtonsoft.Json.Bson": "1.0.2"
         },
         "runtime": {
-          "lib/net8.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll": {
-            "assemblyVersion": "8.0.0.0",
-            "fileVersion": "8.0.23.53112"
+          "lib/net7.0/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll": {
+            "assemblyVersion": "7.0.0.0",
+            "fileVersion": "7.0.22.51819"
           }
         }
       },
@@ -1223,19 +1223,19 @@
       "path": "masuit.tools.core/2024.3.4",
       "hashPath": "masuit.tools.core.2024.3.4.nupkg.sha512"
     },
-    "Microsoft.AspNetCore.JsonPatch/8.0.0": {
+    "Microsoft.AspNetCore.JsonPatch/7.0.0": {
       "type": "package",
       "serviceable": true,
-      "sha512": "sha512-klQdb/9+j0u8MDjoqHEgDCPz8GRhfsbRVvZIM3glFqjs8uY7S1hS9RvKZuz8o4dS9NsEpFp4Jccd8CQuIYHK0g==",
-      "path": "microsoft.aspnetcore.jsonpatch/8.0.0",
-      "hashPath": "microsoft.aspnetcore.jsonpatch.8.0.0.nupkg.sha512"
+      "sha512": "sha512-svHQiUvLNdI2nac68WNQHNo/ZWyavFpt3Oip09QRnWeFqG9iyakKiNLavXr6KE8y7KxEXZNld96KQYbKz8SJMQ==",
+      "path": "microsoft.aspnetcore.jsonpatch/7.0.0",
+      "hashPath": "microsoft.aspnetcore.jsonpatch.7.0.0.nupkg.sha512"
     },
-    "Microsoft.AspNetCore.Mvc.NewtonsoftJson/8.0.0": {
+    "Microsoft.AspNetCore.Mvc.NewtonsoftJson/7.0.0": {
       "type": "package",
       "serviceable": true,
-      "sha512": "sha512-/e5+eBvY759xiZJO+y1lHi4VzXqbDzTJSyCtKpaj3Ko2JAFQjiCOJ0ZHk2i4g4HpoSdXmzEXQsjr6dUX9U0/JA==",
-      "path": "microsoft.aspnetcore.mvc.newtonsoftjson/8.0.0",
-      "hashPath": "microsoft.aspnetcore.mvc.newtonsoftjson.8.0.0.nupkg.sha512"
+      "sha512": "sha512-IJOsB1cm6FYGXxhlNoWR6zZYFREEBzeFX76NlBGhrZ7+VMK4piLm3fAgUBliasyEUg5MOOqFz5EGv8nmU5rXWQ==",
+      "path": "microsoft.aspnetcore.mvc.newtonsoftjson/7.0.0",
+      "hashPath": "microsoft.aspnetcore.mvc.newtonsoftjson.7.0.0.nupkg.sha512"
     },
     "Microsoft.Bcl.AsyncInterfaces/6.0.0": {
       "type": "package",
diff --git a/MESApplication/bin/Release/net8.0/publish/MESApplication.dll b/MESApplication/bin/Release/net8.0/publish/MESApplication.dll
index b8bc2e3..39eef1e 100644
--- a/MESApplication/bin/Release/net8.0/publish/MESApplication.dll
+++ b/MESApplication/bin/Release/net8.0/publish/MESApplication.dll
Binary files differ
diff --git a/MESApplication/bin/Release/net8.0/publish/MESApplication.exe b/MESApplication/bin/Release/net8.0/publish/MESApplication.exe
index 4cad622..25a106e 100644
--- a/MESApplication/bin/Release/net8.0/publish/MESApplication.exe
+++ b/MESApplication/bin/Release/net8.0/publish/MESApplication.exe
Binary files differ
diff --git a/MESApplication/bin/Release/net8.0/publish/MESApplication.pdb b/MESApplication/bin/Release/net8.0/publish/MESApplication.pdb
index 998d41b..df53339 100644
--- a/MESApplication/bin/Release/net8.0/publish/MESApplication.pdb
+++ b/MESApplication/bin/Release/net8.0/publish/MESApplication.pdb
Binary files differ
diff --git a/MESApplication/bin/Release/net8.0/publish/MESApplication.xml b/MESApplication/bin/Release/net8.0/publish/MESApplication.xml
index 1d48ccf..446ce0a 100644
--- a/MESApplication/bin/Release/net8.0/publish/MESApplication.xml
+++ b/MESApplication/bin/Release/net8.0/publish/MESApplication.xml
@@ -958,6 +958,63 @@
             </summary>
             <returns></returns>
         </member>
+        <member name="M:MESApplication.Controllers.QC.RKJController.submitRKJResult(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            鎻愪氦鍏ュ簱妫�缁撴灉
+            </summary>
+            <param name="data">鍖呭惈gid鍜寀serNo鐨凧SON瀵硅薄</param>
+            <returns>鎻愪氦缁撴灉</returns>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.TestConnection">
+            <summary>
+            娴嬭瘯鎺ュ彛 - 楠岃瘉鍩烘湰鍔熻兘
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.GetThjDetail02ById(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            鏍规嵁ID鑾峰彇妫�楠岄」鐩鎯�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SetQSItemDetail(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            璁剧疆妫�楠岄」鐩鎯�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.UpdateQSItemDetail(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            鏇存柊妫�楠岄」鐩鎯�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SaveRemarksPid(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            淇濆瓨妫�楠岄」鐩娉�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.GetReturnOrders">
+            <summary>
+            鑾峰彇閫�璐у崟鍒楄〃
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SaveReturnDetails(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            淇濆瓨閫�璐ф槑缁�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SaveInspectItem(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            淇濆瓨妫�楠岄」鐩�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SaveRemarksGid(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            淇濆瓨妫�楠屽崟澶囨敞锛堜笉鍚堟牸鎻忚堪锛�
+            </summary>
+        </member>
+        <member name="M:MESApplication.Controllers.QC.THJController.SubmitTHJResultByProcedure(Newtonsoft.Json.Linq.JObject)">
+            <summary>
+            閫氳繃瀛樺偍杩囩▼鎻愪氦妫�楠岀粨鏋�
+            </summary>
+        </member>
         <member name="M:MESApplication.Controllers.QC.XJController.getDaa001(Newtonsoft.Json.Linq.JObject)">
             <summary>
                 鑾峰彇宸ュ崟
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..936f7dc
--- /dev/null
+++ b/package.json
@@ -0,0 +1,29 @@
+{
+  "name": "rd-mes-api-frontend",
+  "version": "1.0.0",
+  "description": "RD MES API Frontend Vue Components",
+  "main": "index.js",
+  "scripts": {
+    "dev": "vite",
+    "build": "vite build",
+    "preview": "vite preview"
+  },
+  "dependencies": {
+    "vue": "^3.3.0",
+    "uni-app": "^3.0.0"
+  },
+  "devDependencies": {
+    "@vitejs/plugin-vue": "^4.0.0",
+    "vite": "^4.0.0",
+    "typescript": "^5.0.0",
+    "@vue/tsconfig": "^0.4.0"
+  },
+  "keywords": [
+    "vue",
+    "uni-app",
+    "mes",
+    "frontend"
+  ],
+  "author": "",
+  "license": "MIT"
+}

--
Gitblit v1.9.3