From 51aa625a0301d6be922d7e878aa5def8fd0ebb8f Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 28 四月 2025 13:46:21 +0800
Subject: [PATCH] 添加报工平台新接口,工艺路线启用默认设置新存储过程

---
 WebAPI/Controllers/Sc_ProcessMangementController.cs |  144 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 142 insertions(+), 2 deletions(-)

diff --git a/WebAPI/Controllers/Sc_ProcessMangementController.cs b/WebAPI/Controllers/Sc_ProcessMangementController.cs
index 647c045..5c7bdef 100644
--- a/WebAPI/Controllers/Sc_ProcessMangementController.cs
+++ b/WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -12,6 +12,7 @@
 using WebAPI.Models;
 using WebAPI.Service;
 using Kingdee.BOS.WebApi.Client;
+using SyntacticSugar.constant;
 
 namespace WebAPI.Controllers
 {
@@ -6121,6 +6122,61 @@
         }
         #endregion
 
+        #region 涓嶈壇鍝佽瘎瀹″鐞嗗崟 鍒嗛〉鍒楄〃
+        [Route("Sc_ProcessMangement/get锘縂et_QC_NoPassProdDisposeBillListPage")]
+        [HttpGet]
+        public json Get_QC_NoPassProdDisposeBillListPage(string sWhere, string user, int page, int size)
+        {
+            DataSet ds;
+            json res = new json();
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鍒ゆ柇鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("QC_NoPassProdDisposeBillMain_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                sWhere = sWhere.Replace("'", "''");
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("exec h_p_QC_NoPassProdDisposeBillList " + page + "," + size + ",''", "h_p_QC_NoPassProdDisposeBillList");
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn("exec h_p_QC_NoPassProdDisposeBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_QC_NoPassProdDisposeBillList");
+                }
+
+                //娣诲姞鍒楀悕
+                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鍒楀璞$殑鍒楀悕
+                }
+
+                res.code = CodeConstant.SUCCEED;
+                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+                res.Message = "Sucess锛�";
+                res.list = columnNameList;
+                res.data = ds.Tables[0];
+                return res;
+            }
+            catch (Exception e)
+            {
+                res.code = CodeConstant.FAIL;
+                res.count = CountConstant.FAIL;
+                res.Message = "Exception锛�" + e.ToString();
+                res.data = null;
+                return res;
+            }
+        }
+        #endregion
+
         #region 涓嶈壇鍝佽瘎瀹″鐞嗗崟 鍒犻櫎
 
         [Route("Sc_ProcessMangement/DeleteQC_NoPassProdDisposeBill")]
@@ -6539,8 +6595,30 @@
                 //杩涜闇�瑕佽繘琛岀殑鍏抽棴/鍙嶅叧闂搷浣�
                 if (IsAudit == 0) //鍏抽棴鎻愪氦
                 {
+                    //鍏抽棴鍓嶆帶鍒�=========================================      
+                    string sql1 = "exec h_p_Sc_WorkBeginDotCheckBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
+                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_WorkBeginDotCheckBill_BeforeCloseCtrl");
+                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:鍏抽棴鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //==================================================================================      
+
                     //鍏抽棴鎻愪氦
-                    if (oBill.CloseBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_WorkBeginDotCheckBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                     {
                         objJsonResult.code = "1";
                         objJsonResult.count = 1;
@@ -6559,8 +6637,31 @@
                 }
                 if (IsAudit == 1) //鍙嶅叧闂彁浜�
                 {
+                    //鍙嶅叧闂墠鎺у埗=========================================      
+                    string sql1 = "exec h_p_Sc_WorkBeginDotCheckBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
+                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_WorkBeginDotCheckBill_BeforeUnCloseCtrl    ");
+                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:鍙嶅叧闂墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //==================================================================================      
+
+
                     //鍙嶅叧闂彁浜�
-                    if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_WorkBeginDotCheckBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                     {
                         objJsonResult.code = "1";
                         objJsonResult.count = 1;
@@ -6727,6 +6828,45 @@
         }
         #endregion
 
+        #region 涓嶈壇鍝佽瘎瀹″鐞嗗崟 鍑虹珯鍗曚笅鎺ㄦ煡璇�
+
+        [Route("Sc_ProcessMangement/Get_Sc_StationOutBill")]
+        [HttpGet]
+        public object Get_Sc_StationOutBill(string HID)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                string sql = "select * from h_v_MES_StationOutBillList where hmainid='" + HID + "'";
+                ds = oCN.RunProcReturn(sql, "h_v_MES_StationOutBillList");
+
+                //娣诲姞鍒楀悕
+                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 ex)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + ex.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #endregion
 
         #region 涓嶈壇鍝佽瘎瀹″鐞嗛獙鏀跺崟

--
Gitblit v1.9.1