From 0d19dcc80b6b1864be6813f4caf93996bb505d82 Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期一, 26 一月 2026 09:46:14 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/条码管理/MouldController.cs |  135 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 129 insertions(+), 6 deletions(-)

diff --git "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/MouldController.cs" "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/MouldController.cs"
index 6a5a6b5..1a89cea 100644
--- "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/MouldController.cs"
+++ "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/MouldController.cs"
@@ -26,6 +26,7 @@
         private json objJsonResult = new json();
         SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
         Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+        string ComputerName = SystemInformation.ComputerName;   //璁惧鍚嶇О
 
 
         #region 鍣ㄥ叿鎵爜妯″潡璋冪敤鏂规硶
@@ -225,7 +226,7 @@
         /// <returns></returns>
         [Route("MouldController/set_DelMouldStockBillMain_Temp_Json")]
         [HttpGet]
-        public object set_DelPonderationBillMain_Temp_BarCode_Json(Int64 HInterID, string HBillType, string HBarCode)
+        public object set_DelMouldStockBillMain_Temp_Json(Int64 HInterID, string HBillType, string HBarCode)
         {
             try
             {
@@ -358,19 +359,28 @@
         /// <returns></returns>
         [Route("MouldController/set_DeleteMouldBillList_Json")]
         [HttpGet]
-        public object set_DeleteMouldBillList_Json(long HInterID, string HBillType)
+        public object set_DeleteMouldBillList_Json(long HInterID, string HBillNo, string HBillType, string HMaker, string MvarReportTitle)
         {
             try
             {
+                string WorkList = "鍒犻櫎缂撳瓨鍗曟嵁锛屽崟鎹彿锛�" + HBillNo;
+                string SystemName = "WMS-" + MvarReportTitle + "妯″潡";
+                oCn.BeginTran();
                 oCn.RunProc("Delete from Sc_MouldStockBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo);
+                //鍐欏叆鏃ュ織
+                oCn.RunProc("Insert into  System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
+                    "(getdate(),'" + HMaker + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','','鍒犻櫎')"
+                    );
+                oCn.Commit();
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
-                objJsonResult.Message = "鍒犻櫎鎴愬姛";
+                objJsonResult.Message = "鍗曟嵁鍙凤細" + HBillNo + " 鍒犻櫎鎴愬姛";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
             catch (Exception e)
             {
+                oCn.RollBack();
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "鍒犻櫎鍣ㄥ叿缂撳瓨鍒楄〃鍗曟嵁澶辫触锛�" + e.ToString();
@@ -623,7 +633,7 @@
                 {
                     for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
                     {
-                        Model.ClsSc_MouldStockBillSub oSub = new Model.ClsSc_MouldStockBillSub();
+                        Model.ClsSc_MouldProdOutBillSub oSub = new Model.ClsSc_MouldProdOutBillSub();
                         //鍥哄畾璧嬪��========================================
                         oSub.HEntryID = i + 1;
                         oSub.HRemark = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HRemark"]);
@@ -674,7 +684,8 @@
                 //淇濆瓨
                 bool bResult;
                 bResult = BillNew.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
-
+                //鑷姩鐢熸垚宸ヤ綔鑱旂郴鍗�
+                oCn.RunProc("exec h_p_OA_WorkLinkBill_Create " + BillNew.omodel.HInterID + "," + 3802);
                 if (bResult)
                 {
                     objJsonResult.code = "0";
@@ -782,7 +793,7 @@
                 {
                     for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
                     {
-                        Model.ClsSc_MouldStockBillSub oSub = new Model.ClsSc_MouldStockBillSub();
+                        Model.ClsSc_MouldProdBackBillSub oSub = new Model.ClsSc_MouldProdBackBillSub();
                         //鍥哄畾璧嬪��========================================
                         oSub.HEntryID = i + 1;
                         oSub.HRemark = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HRemark"]);
@@ -1983,6 +1994,118 @@
 
         #endregion
 
+        #region 婧愬崟鏉$爜澶勭悊鏂瑰紡
+        #region 鍣ㄥ叿棰嗙敤鍗�    鎵弿婧愬崟鏉$爜
+
+        /// <summary>
+        /// 鍣ㄥ叿棰嗙敤鍗�    鎵弿婧愬崟鏉$爜
+        /// </summary>
+        /// <returns></returns>
+        [Route("MouldController/Get_SourceBarCode_ProdOut_Json")]
+        [HttpGet]
+        public object get_SourceBarCode_ProdOut_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID)
+        {
+            try
+            {
+                //灏嗘簮鍗曚俊鎭瓨鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛�
+                DataSet ds1 = oCn.RunProcReturn("exec h_p_WMS_AddMouldBarCode_ProdOut " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + 0 + ",'" + HMaker + "'," + 0 + "," + HStockOrgID.ToString(), "h_p_WMS_AddMouldBarCode_ProdOut");
+                if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涘皢婧愬崟淇℃伅瀛樺叆鏉$爜鍑哄叆搴撲复鏃惰〃澶辫触锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    if (DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0][0]) == 0)
+                    {
+                        
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鎴愬姛";
+                        objJsonResult.data = ds1.Tables[0];
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛�" + DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鎵弿婧愬崟鏉$爜澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+        #region 鍣ㄥ叿棰嗙敤鍗�    鎵弿婧愬崟鏉$爜
+
+        /// <summary>
+        /// 鍣ㄥ叿棰嗙敤鍗�    鎵弿婧愬崟鏉$爜
+        /// </summary>
+        /// <returns></returns>
+        [Route("MouldController/Get_SourceBarCode_ScrapRequest_Json")]
+        [HttpGet]
+        public object Get_SourceBarCode_ScrapRequest_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID)
+        {
+            try
+            {
+                //灏嗘簮鍗曚俊鎭瓨鍏ユ潯鐮佸嚭鍏ュ簱涓存椂琛�
+                DataSet ds1 = oCn.RunProcReturn("exec h_p_WMS_AddMouldBarCode_ScrapRequest " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + 0 + ",'" + HMaker + "'," + 0 + "," + HStockOrgID.ToString(), "h_p_WMS_AddMouldBarCode_ScrapRequest");
+                if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛涘皢婧愬崟淇℃伅瀛樺叆鏉$爜鍑哄叆搴撲复鏃惰〃澶辫触锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    if (DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0][0]) == 0)
+                    {
+
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鎴愬姛";
+                        objJsonResult.data = ds1.Tables[0];
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁鍙凤細" + HBillNo + "锛屽崟鎹甀D锛�" + HInterID + "锛�" + DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鎵弿婧愬崟鏉$爜澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+        #endregion
 
 
 

--
Gitblit v1.9.1