From a9f282b625e6cebb93c02946eb9a1d5bd699544b Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期日, 28 四月 2024 16:44:28 +0800
Subject: [PATCH] 新增采购退料模块、生产退料模块扫描源单调用方法,上传生成单据调用方法

---
 WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs |   96 +++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 83 insertions(+), 13 deletions(-)

diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
index 99fa4a8..1910c73 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
@@ -15,7 +15,8 @@
         public DBUtility.ClsPub.Enum_BillStatus BillStatus;//鍗曟嵁鐘舵�侊紙鏂板锛屼慨鏀癸紝娴忚锛屾洿鏂板崟浠凤紝鍙樻洿锛�
         SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
         public DAL.ClsSb_EquipDotCheckBill BillNew = new DAL.ClsSb_EquipDotCheckBill();   //瀵瑰簲鍗曟嵁绫�
-        public DAL.ClsSb_EquipDotCheckBill BillOld = new DAL.ClsSb_EquipDotCheckBill();   //瀵瑰簲鍗曟嵁绫�
+        public DAL.ClsSb_EquipDotCheckBill BillOld = new DAL.ClsSb_EquipDotCheckBill();   //瀵瑰簲鍗曟嵁绫�                                            
+        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();   //鑾峰彇绯荤粺鍙傛暟
 
         #region 璁惧鐐规璁板綍琛�
 
@@ -38,15 +39,34 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                if (sWhere == null || sWhere.Equals(""))
+
+                string sReturn = "";
+                string HViewName = "h_v_Sb_EquipDotCheckBillList";//瑙嗗浘鍛藉悕
+                if (oSystemParameter.ShowBill(ref sReturn) == true)
                 {
-                    ds = oCN.RunProcReturn("select * from h_v_Sb_EquipDotCheckBillList " + sWhere + " order by hmainid desc", "h_v_Sb_EquipDotCheckBillList");
+                    if (oSystemParameter.omodel.WMS_CampanyName == "涔濊彵")
+                    {
+                        HViewName = "h_v_Sb_EquipDotCheckBillMainList";
+                    }
                 }
                 else
                 {
-                    string sql1 = "select * from h_v_Sb_EquipDotCheckBillList where 1 = 1";
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁璇诲彇澶辫触锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from " + HViewName + " " + sWhere + " order by hmainid desc", HViewName);
+                }
+                else
+                {
+                    string sql1 = "select * from " + HViewName + " " + " where 1 = 1";
                     string sql = sql1 + sWhere + " order by hmainid desc";
-                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckBillList");
+                    ds = oCN.RunProcReturn(sql, HViewName);
                 }
                 //娣诲姞鍒楀悕
                 foreach (DataColumn col in ds.Tables[0].Columns)
@@ -391,13 +411,8 @@
         #endregion
 
 
-
-
-
         #endregion
 
-
-        #region 璁惧鐐规璁板綍鍗昉DA
 
         #region 鏍规嵁璁惧鏉$爜鏌ユ壘璁惧妗f淇℃伅PDA
         [Route("Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown")]
@@ -528,8 +543,8 @@
                     oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                     oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
                     //oItemSub.HRemark = "";         //澶囨敞
-                    oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
-                    oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
+                    //oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
+                    //oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
                     //oItemSub.HSourceBillNo = "";  //婧愬崟鍗曞彿
                     //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
                     //oItemSub.HRelationQty = 0;     //鍏宠仈鏁伴噺
@@ -732,7 +747,62 @@
         }
         #endregion
 
-        #endregion
+        #region 璁惧鐐规閫炬湡棰勮鎶ヨ〃
 
+        [Route("Sb_EquipDotCheckWarning/Report")]
+        [HttpGet]
+        public object Report(string HYear,string HMonth,string HEquipTypeID, string user)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //if (!DBUtility.ClsPub.Security_Log("Gy_EquipFileList", 1, false, user))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "娌℃湁鏌ョ湅鏉冮檺";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                if (HYear == null || HYear.Equals("") || HMonth == null || HMonth.Equals(""))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "璇烽�夋嫨鏈夋晥骞翠唤锛屾湀浠�";
+                    objJsonResult.data = "";
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+                else
+                {
+                    string sql = "exec h_p_Sb_EquipDotCheckWarningReport " + HYear + "," + HMonth + "," + HEquipTypeID;
+                    ds = oCN.RunProcReturn(sql, "h_p_Sb_EquipDotCheckWarningReport");
+                }
+
+                //娣诲姞鍒楀悕
+                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
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1