From a20222cae5a8862547d121204396caeb4cf5b1ca Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期二, 10 二月 2026 17:53:40 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/CJGL/Cj_CheckBarcodeController.cs |  141 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 138 insertions(+), 3 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_CheckBarcodeController.cs b/WebAPI/Controllers/CJGL/Cj_CheckBarcodeController.cs
index 37b8e55..e220215 100644
--- a/WebAPI/Controllers/CJGL/Cj_CheckBarcodeController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_CheckBarcodeController.cs
@@ -22,7 +22,7 @@
         #region 涓夌爜鍚堜竴锛屽垽鏂壂鎻忕墿鏂欐潯鐮佺粦瀹氫俊鎭槸鍚︿竴鑷�
         [Route("CheckBarcodeController/Get_BarCode_BarcodeCheck")]
         [HttpGet]
-        public object CheckBarcode(string HBarCode_Pallet, string HBarCode_Destination, string HBarCode_MiddleBox, string HBarCode_SN, int HBarCodeType,int HInterID, string HBillNo,string HMaker,string HBillType)
+        public object CheckBarcode(string HBarCode_Pallet, string HBarCode_Destination, string HBarCode_MiddleBox, string HBarCode_SN, int HBarCodeType, int HInterID, string HBillNo, string HMaker, string HBillType)
         {
             try
             {
@@ -68,7 +68,7 @@
 
         [Route("CheckBarcodeController/Save_BarCode_BarcodeCheck")]
         [HttpGet]
-        public object Save_BarCode_BarcodeCheck(Int64 HInterID, string HBillNo,string HBillType)
+        public object Save_BarCode_BarcodeCheck(Int64 HInterID, string HBillNo, string HBillType)
         {
             try
             {
@@ -76,7 +76,7 @@
                 DataSet ds = oCn.RunProcReturn("exec h_p_WMS_BarCodeBingCheckBill_Insert " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "'", "h_p_WMS_BarCodeBingCheckBill_Insert");
 
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
-                {                   
+                {
                     oCn.RollBack();
 
                     objJsonResult.code = "0";
@@ -122,5 +122,140 @@
         }
 
         #endregion
+
+        #region 鎷嗙灏忓崼
+        [Route("CheckBarcodeController/UnpackMiddleBox")]
+        [HttpGet]
+        public object UnpackMiddleBox(string HBarCode_Middle, int signal, string HMaker, string HDate)
+        {
+            try
+            {
+                if (signal == 1)//鎵爜
+                {
+                    DataSet ds = oCn.RunProcReturn("select a.HCaseCode 涓鐮�,a.HBarCode 瀵瑰簲鐨凷N鐮�,b.HNumber 鐗╂枡浠g爜,b.HName 鐗╂枡鍚嶇О from Gy_CaseCodeRelation a left join Gy_Material b on a.HMaterID=b.HItemID where HCaseCode='" + HBarCode_Middle + "'", "Gy_CaseCodeRelation");
+                    if (ds.Tables[0].Rows[0]["涓鐮�"].ToString() == "" || ds == null)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鏉$爜涓嶅瓨鍦紒璇锋鏌ユ槸鍚﹁绠�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+
+                }
+
+                else
+                {
+                    oCn.BeginTran();
+                    oCn.RunProc("delete from Gy_CaseCodeRelation where HCaseCode='" + HBarCode_Middle + "'");
+                    DataSet dss = oCn.RunProcReturn("select * from Gy_BarCodeBill where HBarCode=' " + HBarCode_Middle + "'", "Gy_BarCodeBill");
+                    if (dss != null && dss.Tables.Count > 0)
+                    {
+                        oCn.RunProc("delete from Gy_BarCodeBill where HBarCode='" + HBarCode_Middle + "'");
+                    }
+                    oCn.RunProc("insert into System_log VALUES('" + HDate + "','" + HMaker + "',''," + "'灏忓崼鎷嗙鏉$爜" + HBarCode_Middle + "'," + "'APP-涓鐮佹媶绠�'" + ",''," + "'鍒犻櫎鏉$爜')");
+                    oCn.Commit();
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+
+            }
+            catch (Exception)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "閿欒璇疯仈绯荤鐞嗗憳";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region sn瑁呯灏忓崼
+        [Route("CheckBarcodeController/PackedBoxSn")]
+        [HttpGet]
+        public object PackedBoxSn(string HBarCode, string HMaker, string HDate)
+        {
+            try
+            {
+                DataSet ds = oCn.RunProcReturn("select a.HBarCode sn鐮�,a.HItemID,b.Hname 鐗╂枡鍚嶇О,b.hnumber 鐗╂枡浠g爜 from Gy_BarCodeBill a LEFT JOIN Gy_Material b on a.hmaterid=b.hitemid where HBarCode='" + HBarCode + "'", "Gy_BarCodeBill");
+                if(ds.Tables[0].Rows.Count==0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "璇n鐮佷笉瀛樺湪锛岃妫�鏌ワ紒锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                DataSet dss = oCn.RunProcReturn("select * from Gy_CaseCodeRelation where HBarCode='" + HBarCode + "'", "Gy_CaseCodeRelation");
+                int counts=dss.Tables[0].Rows.Count;
+                if (counts > 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "璇n鐮佸凡缁忚绠憋紝璇锋鏌ワ紒锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鎴愬姛";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
+        #region sn瑁呯灏忓崼鎻愪氦
+        [Route("CheckBarcodeController/submitPackedBoxSn")]
+        [HttpGet]
+        public object submitPackedBoxSn(string HItemIDs, string HMaker, string HDate)
+        {
+            try
+            {
+                DataSet ds = oCn.RunProcReturn("exec h_p_Gy_CaseCodeBySN  '"+ HItemIDs+ "'", "h_p_Gy_CaseCodeBySN");                
+                if (ds.Tables[0].Rows[0]["HBack"] == "2")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "涓鐮佸凡瀛樺湪璇烽噸鏂扮敓鎴�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鎴愬姛";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1