From 6592e8f84bf7958dd256a33b66e1fa3203296312 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期四, 25 五月 2023 16:40:52 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/LMESController.cs |  252 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 241 insertions(+), 11 deletions(-)

diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index bdd3b1a..2d9fed1 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -16,6 +16,7 @@
 
         private json objJsonResult = new json();
         SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
         /// <summary>
         /// 杩斿洖杩涚珯鎵弿鍒楄〃|宸ュ簭杩涚珯鎺ユ敹鍗曞垪琛� 
         ///鍙傛暟锛歴tring sql銆�
@@ -70,6 +71,20 @@
                 //    objJsonResult.data = null;
                 //    return objJsonResult;
                 //}
+
+                //鑾峰彇绯荤粺鍙傛暟
+                string Ret = "";
+                if (oSystemParameter.ShowBill(ref Ret))
+                {
+                    //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰�
+                    if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤")
+                    {
+                        //鑾峰彇闇�瑕佹嫾鎺ョ殑瀛楃涓�
+                        string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "宸ュ簭娲惧伐鍗曞垪琛�");
+
+                        sWhere += sql_splice;                       
+                    }
+                }
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillQuery");
@@ -151,6 +166,21 @@
                 //    objJsonResult.data = null;
                 //    return objJsonResult;
                 //}
+
+                //鑾峰彇绯荤粺鍙傛暟
+                string Ret = "";
+                if (oSystemParameter.ShowBill(ref Ret))
+                {
+                    //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰�
+                    if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤")
+                    {
+                        //鑾峰彇闇�瑕佹嫾鎺ョ殑瀛楃涓�
+                        string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "宸ュ簭娲惧伐鍗曟槑缁嗗垪琛�");
+
+                        sWhere += sql_splice;                        
+                    }
+                }
+
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeIssueBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeIssueBillQuery");
                 objJsonResult.code = "1";
@@ -363,23 +393,37 @@
             try
             {
                 //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
-                //if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
-                //{
-                //    objJsonResult.code = "0";
-                //    objJsonResult.count = 0;
-                //    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
-                //    objJsonResult.data = null;
-                //    return objJsonResult;
-                //}
+                if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                //鑾峰彇绯荤粺鍙傛暟
+                string Ret = "";
+                if (oSystemParameter.ShowBill(ref Ret))
+                {
+                    //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰�
+                    if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤")
+                    {
+                        //鑾峰彇闇�瑕佹嫾鎺ョ殑瀛楃涓�
+                        string sql_splice = DBUtility.ClsPub.SpliceSQL(user,"宸ヨ壓璺嚎鍒楄〃");
+
+                        sWhere += sql_splice;                        
+                    }
+                }               
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sWhere == null || sWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select top 1000 * from h_v_Gy_RoutingBillList order by hmainid desc", "h_v_Gy_RoutingBillList");
+                    ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList where 1 = 1" + sWhere + " order by hmainid desc", "h_v_Gy_RoutingBillList");
                 }
                 else
                 {
-                    string sql1 = "select  top 1000 * from h_v_Gy_RoutingBillList where 1 = 1 ";
+                    string sql1 = "select * from h_v_Gy_RoutingBillList where 1 = 1 ";
                     string sql = sql1 + sWhere + " order by hmainid desc,cast(宸ュ簭鍙� as int)";
                     ds = oCN.RunProcReturn(sql, "h_v_Gy_RoutingBillList");
                 }
@@ -395,6 +439,100 @@
             return GetObjectJson(ds);
         }
 
+        #endregion       
+
+        #region 鏌ョ湅宸ヨ壓璺嚎鍒楄〃宸ヤ环鏉冮檺
+        /// <summary>
+        /// 鍒ゆ柇鏈夋棤鏌ョ湅宸ヤ环鏉冮檺
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Web/CheckProcPrice")]
+        [HttpGet]
+        public object CheckProcPrice(string UserName)
+        {
+            try
+            {
+                //鑾峰彇绯荤粺鍙傛暟
+                string Ret = "";
+                if (oSystemParameter.ShowBill(ref Ret))
+                {
+                    //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰�
+                    if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤")
+                    {
+                        //鍒ゆ柇鏄惁鏈夋煡璇㈠伐浠锋潈闄�
+                        if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_CheckProcPrice", 1, false, UserName))
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鏃犳煡鐪嬪伐浠锋潈闄�!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鏌ョ湅鎴愬姛锛�";
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "寮傚父锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult; ;
+            }
+        }
+        #endregion
+
+        #region 淇敼宸ヨ壓璺嚎宸ヤ环鏉冮檺
+        /// <summary>
+        /// 鍒ゆ柇鏈夋棤淇敼宸ヤ环鏉冮檺
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Web/EditProcPrice")]
+        [HttpGet]
+        public object EditProcPrice(string UserName)
+        {
+            try
+            {
+                //鑾峰彇绯荤粺鍙傛暟
+                string Ret = "";
+                if (oSystemParameter.ShowBill(ref Ret))
+                {
+                    //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰�
+                    if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤")
+                    {
+                        //鍒ゆ柇鏄惁鏈夋煡璇㈠伐浠锋潈闄�
+                        if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_EditProcPrice", 1, false, UserName))
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鏃犱慨鏀瑰伐浠锋潈闄�!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "淇敼鎴愬姛锛�";
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "寮傚父锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult; ;
+            }
+        }
         #endregion
 
         #region 宸ヨ壓璺嚎  鍒犻櫎
@@ -521,6 +659,84 @@
 
         #endregion
 
+        #region 宸ヨ壓璺嚎(缁存姢宸ヤ环)
+        /// <summary>
+        /// 杩斿洖宸ヨ壓璺嚎鍒楄〃
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("LEMS/MES_Gy_RoutingBillMainRates_Json")]
+        [HttpGet]
+        public object MES_Gy_RoutingBillMainRates_Json(string sWhere, string user)
+        {
+            DataSet ds;
+            try
+            {
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList_MainRate order by hmainid desc", "h_v_Gy_RoutingBillList_MainRate");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Gy_RoutingBillList_MainRate where 1 = 1 ";
+                    string sql = sql1 + sWhere + " order by hmainid desc,cast(宸ュ簭鍙� as int)";
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_RoutingBillList_MainRate");
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            return GetObjectJson(ds);
+        }
+
+        #endregion
+
+        #region 鍒ゆ柇鐗╂枡鏄惁宸茬粡瀛樺湪宸ヨ壓璺嚎
+        /// <summary>
+        /// 杩斿洖宸ヨ壓璺嚎鍒楄〃
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("LEMS/IsExistRoutingByMaterial")]
+        [HttpGet]
+        public object IsExistRoutingByMaterial(int HMaterID, string user)
+        {
+            DataSet ds;
+            try
+            {               
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+                ds = oCN.RunProcReturn("select * from Gy_RoutingBillMain where HMaterID = '" + HMaterID + "'", "Gy_RoutingBillMain");               
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            return GetObjectJson(ds);
+        }
+
+        #endregion
+
         #endregion
 
         /// <summary>
@@ -545,7 +761,21 @@
                     return objJsonResult;
                 }
 
-                ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where 1 = 1 " + sWhere + " order by 鍗曟嵁鍙� desc", "h_v_IF_ICMOBillList");
+                //鑾峰彇绯荤粺鍙傛暟
+                string Ret = "";
+                if (oSystemParameter.ShowBill(ref Ret))
+                {
+                    //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰�
+                    if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤")
+                    {
+                        //鑾峰彇闇�瑕佹嫾鎺ョ殑瀛楃涓�
+                        string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "鐢熶骇璁㈠崟鍒楄〃");
+
+                        sWhere += sql_splice;
+                    }
+                }
+
+                ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where 1 = 1 " + sWhere + " order by 鍒跺崟鏃ユ湡 desc,鍗曟嵁鍙� desc", "h_v_IF_ICMOBillList");
             }
             catch (Exception e)
             {

--
Gitblit v1.9.1