From 5184117835a0656429af34c646f05c401223a203 Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期五, 20 三月 2026 13:17:24 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs |  166 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 160 insertions(+), 6 deletions(-)

diff --git a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
index 1eba259..2f80092 100644
--- a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
@@ -907,6 +907,7 @@
                     oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                     oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
                     oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+                    oItem.HBarCode = DBUtility.ClsPub.isStrNull(oItem.HBarCode);
                     if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
                     {
                         objJsonResult.code = "0";
@@ -7409,7 +7410,6 @@
                 }
                 if (bResult)
                 {
-
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
@@ -7436,9 +7436,128 @@
         }
         #endregion
 
-        #region 宸ヤ綔鑱旂郴鍗曞垪琛�
+        #region 宸ヤ綔鑱旂郴鍗曞垪琛� 浣跨敤涓嬫媺鍔犺浇 璋冪敤瀛樺偍杩囩▼
+        [Route("Sc_MESTransFerWorkBill/GetOA_WorkLinkBillListProcess")]
+        [HttpGet]
+        public object GetOA_WorkLinkBillList2(string beginDate, string endDate, string user, string type, int page = -1, int size = -1)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("OA_WorkLinkBillList", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                string sql = $"exec h_p_OA_WorkLinkBillAllList '{user}', '{type}', '{page}', '{size}', '{beginDate}', '{endDate}'";
+
+                ds = oCN.RunProcReturn(sql, "h_p_OA_WorkLinkBillAllList");
+                
+
+                //娣诲姞鍒楀悕
+                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
+
+
+
+        #region 宸ヤ綔鑱旂郴鍗曞垪琛� 浣跨敤涓嬫媺鍔犺浇        
         [Route("Sc_MESTransFerWorkBill/GetOA_WorkLinkBillList")]
         [HttpGet]
+        public object GetOA_WorkLinkBillList2(string sWhere, string user, int page = -1, int size = -1)
+        {
+            if(page == -1 || size == -1)
+            {
+                return GetOA_WorkLinkBillList(sWhere, user);
+            }else
+            {
+                try
+                {
+                    List<object> columnNameList = new List<object>();
+
+                    //鏌ョ湅鏉冮檺
+                    if (!DBUtility.ClsPub.Security_Log("OA_WorkLinkBillList", 1, false, user))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    if (sWhere == null || sWhere.Equals(""))
+                    {
+                        string sql = "select * from h_v_OA_WorkLinkBillAllList order by 鍗曟嵁鍙� desc";
+                        sql += $@" OFFSET {(page-1)*size} ROWS
+                                FETCH NEXT {size} ROWS ONLY; ";
+                        ds = oCN.RunProcReturn(sql, "h_v_OA_WorkLinkBillAllList");
+                    }
+                    else
+                    {
+                        string sql1 = "select * from h_v_OA_WorkLinkBillAllList where 1 = 1 ";
+                        string sql = sql1 + sWhere + " order by 鍗曟嵁鍙� desc";
+                        sql += $@" OFFSET {(page - 1) * size} ROWS
+                                FETCH NEXT {size} ROWS ONLY; ";
+
+                        ds = oCN.RunProcReturn(sql, "h_v_OA_WorkLinkBillAllList");
+                    }
+
+                    //娣诲姞鍒楀悕
+                    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
+
+
+        #region 宸ヤ綔鑱旂郴鍗曞垪琛�
         public object GetOA_WorkLinkBillList(string sWhere, string user)
         {
             try
@@ -7464,6 +7583,7 @@
                 {
                     string sql1 = "select * from h_v_OA_WorkLinkBillAllList where 1 = 1 ";
                     string sql = sql1 + sWhere + " order by 鍗曟嵁鍙� desc";
+
                     ds = oCN.RunProcReturn(sql, "h_v_OA_WorkLinkBillAllList");
                 }
 
@@ -8592,7 +8712,18 @@
 
                 List<object> columnNameList = new List<object>();
 
-                ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackSelfQuery  '" + HStatus + "','" + HBeginDate + "','" + HEndDate + "','" + HSourceID + "','" + user + "'"  , "h_p_OA_ErrMsgBackSelfQuery");
+                string sReturn = "";
+                if (oSystemParameter.ShowBill(ref sReturn) == true)
+                {
+                    if (oSystemParameter.omodel.OA_ErrMsgBackBill_Role == "Y") //绯荤粺鍙傛暟  鏍规嵁瑙掕壊鏌ョ湅瀵瑰簲鐨勫崟鎹繘琛屼笅鎺�
+                    {
+                        ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackSelfQuery_Role  '" + HStatus + "','" + HBeginDate + "','" + HEndDate + "','" + HSourceID + "','" + user + "'", "h_p_OA_ErrMsgBackSelfQuery_Role");
+                    }
+                    else
+                    {
+                        ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackSelfQuery  '" + HStatus + "','" + HBeginDate + "','" + HEndDate + "','" + HSourceID + "','" + user + "'", "h_p_OA_ErrMsgBackSelfQuery");
+                    }
+                }                
 
                 if (ds.Tables[0].Rows.Count != 0 || ds != null)
                 {
@@ -8646,8 +8777,18 @@
                 string HEndDate = dic["HEndDate"].ToString();//缁撴潫鏃ユ湡
 
                 List<object> columnNameList = new List<object>();
-
-                ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackSelfQuery_APP '" + HBeginDate + "','" + HEndDate + "','" + user + "'", "h_p_OA_ErrMsgBackSelfQuery_APP");
+                string sReturn = "";
+                if (oSystemParameter.ShowBill(ref sReturn) == true)
+                {
+                    if (oSystemParameter.omodel.OA_ErrMsgBackBill_Role == "Y") //绯荤粺鍙傛暟  鏍规嵁瑙掕壊鏌ョ湅瀵瑰簲鐨勫崟鎹繘琛屼笅鎺�
+                    {
+                        ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackSelfQuery_APP_Role '" + HBeginDate + "','" + HEndDate + "','" + user + "'", "h_p_OA_ErrMsgBackSelfQuery_APP_Role");
+                    }
+                    else
+                    {
+                        ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackSelfQuery_APP '" + HBeginDate + "','" + HEndDate + "','" + user + "'", "h_p_OA_ErrMsgBackSelfQuery_APP");
+                    }
+                }
 
                 if (ds.Tables[0].Rows.Count != 0 || ds != null)
                 {
@@ -8694,10 +8835,23 @@
         {
             try
             {
+                string sql = "";
                 List<object> columnNameList = new List<object>();
 
-                string sql = "select a.HSourceBillNo 娴佽浆鍗″彿,a.HSourceBillType 娴佽浆鍗$被鍨�,a.HSourceInterID 娴佽浆鍗′富鍐呯爜,a.HSourceEntryID 娴佽浆鍗″瓙鍐呯爜,b.HNumber 鐗╂枡浠g爜,b.HName 鐗╂枡鍚嶇О,b.HModel 瑙勬牸鍨嬪彿,a.HDatePlanQty 璁″垝鏁伴噺,a.HSourceID,c.HName 鐢熶骇璧勬簮 from Sc_ICMOBillStatus_Tmp a " +
+                if (!string.IsNullOrEmpty(HSourceBill) && HSourceBill.Substring(0, 6) == "GXCZHB")
+                {
+                    HSourceBill = HSourceBill.Split('-')[0];
+                    //鍗庤垷鍋氭湯浠跺彂璧峰畨鐏殑鏃跺�� 浼犺繃鏉ョ殑鏄嚭绔欏崟鐨勫崟鎹彿
+                    sql = @"select a.HProcExchInterID 娴佽浆鍗′富鍐呯爜,a.HProcExchEntryID 娴佽浆鍗″瓙鍐呯爜,a.HProcExchBillNo 娴佽浆鍗″彿,a.HSourceID,b.HName 鐢熶骇璧勬簮, c.HNumber 鐗╂枡浠g爜, c.HName 鐗╂枡鍚嶇О, c.HModel 瑙勬牸鍨嬪彿, a.HPlanQty 璁″垝鏁伴噺
+                            from Sc_StationOutBillMain a  left  join Gy_Source b on a.HSourceID = b.HItemID  left  join Gy_Material c on a.HMaterID = c.HItemID  where a.HBillNo = '" + HSourceBill + "'";
+                }
+                else
+                {
+                    //鎶ュ伐鍙颁紶杩囨潵鐨勬槸娴佽浆鍗$殑
+                    sql = "select a.HSourceBillNo 娴佽浆鍗″彿,a.HSourceBillType 娴佽浆鍗$被鍨�,a.HSourceInterID 娴佽浆鍗′富鍐呯爜,a.HSourceEntryID 娴佽浆鍗″瓙鍐呯爜,b.HNumber 鐗╂枡浠g爜,b.HName 鐗╂枡鍚嶇О,b.HModel 瑙勬牸鍨嬪彿,a.HDatePlanQty 璁″垝鏁伴噺,a.HSourceID,c.HName 鐢熶骇璧勬簮 from Sc_ICMOBillStatus_Tmp a " +
                     "left join Gy_Material b on a.HMaterID=b.HItemID  left join Gy_Source c on a.HSourceID=c.HItemID where HSourceBillNo='" + HSourceBill + "' and a.HICMOStatus=1";
+                }
+                 
                 ds = oCN.RunProcReturn(sql, "Sc_ICMOBillStatus_Tmp");
                 if (ds.Tables[0].Rows.Count == 0)
                 {

--
Gitblit v1.9.1