From d9d67e2c013a9f27df3e971508f96550eb2c210e Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期三, 12 十一月 2025 18:59:39 +0800
Subject: [PATCH] 小卫三码合一、过站解绑、

---
 WebAPI/Controllers/CJGL/Cj_SingleStationController.cs |  146 +++++++++++++++++++++++++++++
 WebAPI/WebAPI.csproj                                  |    1 
 WebAPI/Controllers/CJGL/Cj_CheckBarcodeController.cs  |  126 +++++++++++++++++++++++++
 3 files changed, 273 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_CheckBarcodeController.cs b/WebAPI/Controllers/CJGL/Cj_CheckBarcodeController.cs
new file mode 100644
index 0000000..1bf08df
--- /dev/null
+++ b/WebAPI/Controllers/CJGL/Cj_CheckBarcodeController.cs
@@ -0,0 +1,126 @@
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using Pub_Class;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Web.Http;
+using WebAPI.Models;
+
+namespace WebAPI.Controllers.CJGL
+{
+    public class Cj_CheckBarcodeController : ApiController
+    {
+        private json objJsonResult = new json();
+        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+        DataSet ds;
+
+
+        #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)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_Cj_CheckBarcodeBing '" + HBarCode_Pallet + "','" + HBarCode_Destination + "','" + HBarCode_MiddleBox + "','" + HBarCode_SN + "','" + HBarCodeType + "'," + HInterID + ",'" + HBillNo + "','" + HMaker + "'", "h_p_Cj_CheckBarcodeBing");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎵弿鏉$爜鍒ゆ柇閿欒锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    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 涓夌爜鍚堜竴鏍稿鎵弿璁板綍  涓婁紶鐢熷崟
+
+        [Route("CheckBarcodeController/Save_BarCode_BarcodeCheck")]
+        [HttpGet]
+        public object Save_BarCode_BarcodeCheck(Int64 HInterID, string HBillNo)
+        {
+            try
+            {
+                oCn.BeginTran();
+                DataSet ds = oCn.RunProcReturn("exec h_p_WMS_BarCodeBingCheckBill_Insert " + HInterID.ToString() + ",'" + HBillNo + "'", "h_p_WMS_BarCodeBingCheckBill_Insert");
+
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {                   
+                    oCn.RollBack();
+
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //澶辫触锛�
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 1)
+                    {
+                        oCn.RollBack();
+
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //澶辫触锛�
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        oCn.Commit();
+
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍗曟嵁鍙凤細" + HBillNo + " 淇濆瓨鎴愬姛锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+            }
+            catch (Exception e)
+            {
+                oCn.RollBack();
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鐢熸垚鍗曟嵁澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
index 9233cfd..202c7a7 100644
--- a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -3301,6 +3301,152 @@
             }
         }
         #endregion
+
+        #region 杩囩珯瑙g粦鍒楄〃 鏌ヨ
+        [Route("Cj_SingleStation/UnbindBarList")]
+        [HttpGet]
+        public object BarList(string sWhere, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Cj_SingleStation_UnbindBarList", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Sc_UnbindStation_BarList order by 鏉$爜鏃ユ湡 desc", "h_v_Sc_UnbindStation_BarList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Sc_UnbindStation_BarList where 1 = 1 ";
+                    string sql = sql1 + sWhere + " order by 鏉$爜鏃ユ湡 desc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Sc_UnbindStation_BarList");
+                }
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 閲嶅伐鏉$爜淇℃伅 鏌ヨ
+        [Route("Cj_SingleStation/UnbindBarInfo")]
+        [HttpGet]
+        public object UnbindBarInfo(string HBarCodeIDs, string user)
+        {
+            try
+            {
+                if (HBarCodeIDs == null || HBarCodeIDs.Equals(""))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "閲嶅伐鏉$爜淇℃伅鏈�掑叆锛岃閫�鍑洪噸璇�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    string sql = "exec h_p_Sc_UnbindBarInfo '" + HBarCodeIDs + "'";
+                    ds = oCN.RunProcReturn(sql, "h_p_Sc_UnbindBarInfo");
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 瑙i櫎鍖呰鍏崇郴銆佹媶闄ょ墿鏂�(1:瑙i櫎鍖呰鍏崇郴锛�2.鎷嗛櫎鐗╂枡)
+        [Route("Cj_SingleStation/DelRelation")]
+        [HttpGet]
+        public object DelRelation(string HBarCodeIDs, Int64 HICMOInterID, Int64 HICMOEntryID, Int64 HProcID, Int64 HType, string user)
+        {
+            try
+            {
+                if (HBarCodeIDs == null || HBarCodeIDs.Equals(""))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎷嗛櫎鏉$爜淇℃伅鏈�掑叆锛岃閫�鍑洪噸璇�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    string sql = "exec h_p_Sc_DelbindBarRelation '" + HBarCodeIDs + "'," + HICMOInterID + "," + HICMOEntryID + "," + HProcID + "," + HType;
+                    ds = oCN.RunProcReturn(sql, "h_p_Sc_DelbindBarRelation");
+                }
+
+                if (ds.Tables[0].Rows[0]["HBack"].ToString() == "0")
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = ds.Tables[0].Rows[0]["HBackRemark"].ToString();
+                    objJsonResult.data = "";
+                    return objJsonResult;
+                }
+
+               
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
         #endregion
 
     }
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index e88839f..b3e44f9 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -441,6 +441,7 @@
     <Compile Include="Controllers\CJGL\Cj_ComplementGoodsBillController.cs" />
     <Compile Include="Controllers\CJGL\Cj_NoPassProcController.cs" />
     <Compile Include="Controllers\CJGL\Cj_SendGoodsBillController.cs" />
+    <Compile Include="Controllers\CJGL\Cj_CheckBarcodeController.cs" />
     <Compile Include="Controllers\CJGL\Mes_OrderProcFlowAllReportController.cs" />
     <Compile Include="Controllers\CJGL\Gy_MaterPreventErrMouldBillController.cs" />
     <Compile Include="Controllers\CJGL\ReportController.cs" />

--
Gitblit v1.9.1