duhe
2023-06-29 70e0f3410415b33ccaaf1e6f758a0f2c4affd4c6
WebAPI/Controllers/LMESController.cs
@@ -447,6 +447,73 @@
            return GetObjectJson(ds);
        }
        #endregion
        #region 工艺路线历史列表
        /// <summary>
        /// 返回工艺路线历史列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("LEMS/MES_Gy_RoutingBillList_His")]
        [HttpGet]
        public object MES_Gy_RoutingBillList_His(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;
                }
                //获取系统参数
                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 * from h_v_Gy_RoutingBillList_His where 1 = 1" + sWhere + " order by hmainid desc", "h_v_Gy_RoutingBillList");
                }
                else
                {
                    string sql1 = "select * from h_v_Gy_RoutingBillList_His where 1 = 1 ";
                    //客户自定义
                    if (oSystemParameter.omodel.WMS_CampanyName == "瑞与祺")
                    {
                        sql1 = "select top 1000 * from h_v_Gy_RoutingBillList_His where 1 = 1 ";
                    }
                    string sql = sql1 + sWhere + " order by hmainid desc,cast(工序号 as int)";
                    ds = oCN.RunProcReturn(sql, "h_v_Gy_RoutingBillList_His");
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
            return GetObjectJson(ds);
        }
        #endregion       
        #region 查看工艺路线列表工价权限