Prechádzať zdrojové kódy

完善奖励算法,打通递归逻辑

lcl 6 mesiacov pred
rodič
commit
2a6cb5c7e4

+ 2 - 1
Extensions/AppServiceExtensions.cs

@@ -50,7 +50,8 @@ namespace Infrastructure
             services.AddTransient<IPriQueryTableService, PriQueryTableService>(); 
             services.AddTransient<IPriQueryFieldService, PriQueryFieldService>(); 
             services.AddTransient<IPriReturnFieldService, PriReturnFieldService>(); 
-            services.AddTransient<IPriListService, PriListService>(); 
+            services.AddTransient<IPriListService, PriListService>();
+            services.AddTransient<IPriListAmountSetService, PriListAmountSetService>();
             services.AddTransient<IPriConditionService, PriConditionService>(); 
             services.AddTransient<IPriLoopSetService, PriLoopSetService>(); 
             services.AddTransient<IPriRecordService, PriRecordService>(); 

+ 2 - 2
Model/Base/PagerInfo.cs

@@ -25,10 +25,10 @@
         public PagerInfo()
         {
             pageNum = 1;
-            pageSize = 20;
+            pageSize = 30;
         }
 
-        public PagerInfo(int page = 1, int pageSize = 20)
+        public PagerInfo(int page = 1, int pageSize = 30)
         {
             pageNum = page;
             pageSize = pageSize;

+ 14 - 0
Model/Database/PriLoopSet.cs

@@ -101,6 +101,20 @@ namespace Model
         public bool levelDiffFlag { get; set; }
 
 
+        /// <summary>
+        /// 发奖后是否继续
+        /// </summary>
+        [SugarColumn(ColumnDescription = "发奖后是否继续", ColumnName = "after_prize_flag")]
+        public bool afterPrizeFlag { get; set; }
+
+
+        /// <summary>
+        /// 条件模式
+        /// </summary>
+        [SugarColumn(ColumnDescription = "条件模式", Length = 20, ColumnName = "condition_mode")]
+        public string? conditionMode { get; set; }
+
+
 
     }
 }

+ 7 - 0
Model/Database/PriRecursionStartTable.cs

@@ -66,6 +66,13 @@ namespace Model
         public int projectId { get; set; }
 
 
+        /// <summary>
+        /// 配置ID
+        /// </summary>
+        [SugarColumn(ColumnDescription = "配置ID", ColumnName = "list_id")]
+        public int listId { get; set; }
+
+
 
     }
 }

+ 12 - 0
Model/Vo/Admin/GetPriLoopSetListVo.cs

@@ -37,6 +37,18 @@ namespace Vo.Admin
         public string sonField { get; set; }
 
 
+        /// <summary>
+        /// 发奖后是否继续
+        /// </summary>
+        public bool afterPrizeFlag { get; set; }
+
+
+        /// <summary>
+        /// 条件模式
+        /// </summary>
+        public string? conditionMode { get; set; }
+
+
 
     }
 }

+ 12 - 0
Model/Vo/Admin/GetPriLoopSetQueryVo.cs

@@ -49,6 +49,18 @@ namespace Vo.Admin
         public bool levelDiffFlag { get; set; }
 
 
+        /// <summary>
+        /// 发奖后是否继续
+        /// </summary>
+        public bool afterPrizeFlag { get; set; }
+
+
+        /// <summary>
+        /// 条件模式
+        /// </summary>
+        public string? conditionMode { get; set; }
+
+
 
     }
 }

+ 1 - 1
Model/Vo/Admin/GetPriRecursionStartTableQueryVo.cs

@@ -22,7 +22,7 @@ namespace Vo.Admin
         /// <summary>
         /// 项目
         /// </summary>
-        public int projectId { get; set; }
+        public int listId { get; set; }
 
 
 

+ 2 - 0
Program.cs

@@ -119,4 +119,6 @@ app.MapControllerRoute(
 
 app.MapControllers();
 
+PrizeDo.sendPrize("{\"PosSn\":\"CS00000000004720\"}");
+
 app.Run();

+ 110 - 76
Util/PrizeDo.cs

@@ -15,7 +15,7 @@ namespace Util
         public static void sendPrize(string content)
         {
             batchNo = DateTime.Now.ToString("yyyyMMddHHmmssfff") + Function.get_Random(3);
-            int projectId = 1;
+            int projectId = 5;
             string priObjString = prizeObject(projectId, content);
             if(!string.IsNullOrEmpty(priObjString))
             {
@@ -28,12 +28,12 @@ namespace Util
 
 
         //接收入参
-        public static Dictionary<string, string> getRequestParams(string content)
+        public static Dictionary<string, string> getRequestParams(int projectId, string content)
         {
             Dictionary<string, string> dic = new Dictionary<string, string>();
             JsonData jsonData = JsonMapper.ToObject(content);
             var paramService = App.GetService<IPriProjectParamService>();
-            var paramList = paramService.GetList(m => m.projectId == 1);
+            var paramList = paramService.GetList(m => m.projectId == projectId);
             foreach(var param in paramList)
             {
                 dic.Add(param.fieldEnName, jsonData[param.fieldEnName].ToString());
@@ -45,7 +45,7 @@ namespace Util
         public static SqlSugarClient initDb(int projectId)
         {
             var databaseSetService = App.GetService<IPriDatabaseSetService>();
-            var connectionString = databaseSetService.GetFirst(m => m.projectId == 1);
+            var connectionString = databaseSetService.GetFirst(m => m.projectId == projectId);
             string server = connectionString.ipAddress;
             int port = connectionString.port;
             string user = connectionString.userId;
@@ -76,7 +76,7 @@ namespace Util
                 var returnFields = returnFieldService.GetList(m => m.queryTableId == queryTable.id);
                 foreach(var returnField in returnFields)
                 {
-                    fields += returnField.fieldEnName + ",";
+                    fields += returnField.fieldEnName + " " + queryTable.tableEnName + "_" + returnField.fieldEnName + ",";
                 }
                 fields = fields.TrimEnd(',');
 
@@ -95,7 +95,7 @@ namespace Util
                         condi += " and " + fieldEnName + " like ";
                         if(fieldQueryModel == "request_param")
                         {
-                            Dictionary<string, string> req = getRequestParams(content);
+                            Dictionary<string, string> req = getRequestParams(projectId, content);
                             condi += "'%" + req[fieldQueryValue] + "%'";
                         }
                         else if(fieldQueryModel == "fixed_value")
@@ -105,29 +105,33 @@ namespace Util
                     }
                     else if(fieldQueryKind == "2") //精确匹配
                     {
-                        condi += " and " + fieldEnName + "=";
-                        string val = "";
-                        if(fieldQueryModel == "request_param")
-                        {
-                            Dictionary<string, string> req = getRequestParams(content);
-                            val = req[fieldQueryValue];
-                        }
-                        else if(fieldQueryModel == "fixed_value")
-                        {
-                            val = GetExpressionVal(fieldQueryValue);
-                        }
-                        if(fieldQueryValueType == "text")
+                        if(fieldQueryValue == "null" && fieldQueryValueType == "text") condi += " and " + fieldEnName + " is null";
+                        else
                         {
-                            val = "'" + val + "'";
+                            condi += " and " + fieldEnName + "=";
+                            string val = "";
+                            if(fieldQueryModel == "request_param")
+                            {
+                                Dictionary<string, string> req = getRequestParams(projectId, content);
+                                val = req[fieldQueryValue];
+                            }
+                            else if(fieldQueryModel == "fixed_value")
+                            {
+                                val = GetExpressionVal(fieldQueryValue);
+                            }
+                            if(fieldQueryValueType == "text")
+                            {
+                                val = "'" + val + "'";
+                            }
+                            condi += val;
                         }
-                        condi += val;
                     }
                     else if(fieldQueryKind == "3") //范围匹配
                     {
                         string[] val = fieldQueryValue.Split(':');
                         if(fieldQueryModel == "request_param")
                         {
-                            Dictionary<string, string> req = getRequestParams(content);
+                            Dictionary<string, string> req = getRequestParams(projectId, content);
                             if(fieldQueryValueType == "number")
                             {
                                 if(!string.IsNullOrEmpty(req[val[0]])) condi += " and " + fieldEnName + ">=" + req[val[0]];
@@ -155,28 +159,39 @@ namespace Util
                     }
                     else if(fieldQueryKind == "4") //取反匹配
                     {
-                        condi += " and " + fieldEnName + "!=";
-                        string val = "";
-                        if(fieldQueryModel == "request_param")
-                        {
-                            Dictionary<string, string> req = getRequestParams(content);
-                            val = req[fieldQueryValue];
-                        }
-                        else if(fieldQueryModel == "fixed_value")
-                        {
-                            val = GetExpressionVal(fieldQueryValue);
-                        }
-                        if(fieldQueryValueType == "text")
+                        if(fieldQueryValue == "null" && fieldQueryValueType == "text") condi += " and " + fieldEnName + " is not null";
+                        else
                         {
-                            val = "'" + val + "'";
+                            condi += " and " + fieldEnName + "!=";
+                            string val = "";
+                            if(fieldQueryModel == "request_param")
+                            {
+                                Dictionary<string, string> req = getRequestParams(projectId, content);
+                                val = req[fieldQueryValue];
+                            }
+                            else if(fieldQueryModel == "fixed_value")
+                            {
+                                val = GetExpressionVal(fieldQueryValue);
+                            }
+                            if(fieldQueryValueType == "text")
+                            {
+                                val = "'" + val + "'";
+                            }
+                            condi += val;
                         }
-                        condi += val;
                     }
                 }
 
                 var db = initDb(projectId);
-                var item = db.SqlQueryable<Dictionary<string, object>>("select " + fields + " " + queryTable.tableEnName + "-" + fields + " from " + queryTable.tableEnName + " where 1=1" + condi).First();
-                dic.AddRange(item);
+                string sql = "select " + fields + " from " + queryTable.tableEnName + " where 1=1" + condi;
+                var items = db.Ado.GetDataTable(sql);
+                if(items.Rows.Count > 0)
+                {
+                    foreach(System.Data.DataColumn item in items.Columns)
+                    {
+                        dic.Add(item.ColumnName, items.Rows[0][item.ColumnName].ToString());
+                    }
+                }
             }
             return dic;
         }
@@ -207,7 +222,7 @@ namespace Util
                     condi += " and " + fieldEnName + " like ";
                     if(fieldQueryModel == "request_param")
                     {
-                        Dictionary<string, string> req = getRequestParams(content);
+                        Dictionary<string, string> req = getRequestParams(projectId, content);
                         condi += "'%" + req[fieldQueryValue] + "%'";
                     }
                     else if(fieldQueryModel == "fixed_value")
@@ -221,7 +236,7 @@ namespace Util
                     string val = "";
                     if(fieldQueryModel == "request_param")
                     {
-                        Dictionary<string, string> req = getRequestParams(content);
+                        Dictionary<string, string> req = getRequestParams(projectId, content);
                         val = req[fieldQueryValue];
                     }
                     else if(fieldQueryModel == "fixed_value")
@@ -239,7 +254,7 @@ namespace Util
                     string[] val = fieldQueryValue.Split(':');
                     if(fieldQueryModel == "request_param")
                     {
-                        Dictionary<string, string> req = getRequestParams(content);
+                        Dictionary<string, string> req = getRequestParams(projectId, content);
                         if(fieldQueryValueType == "number")
                         {
                             if(!string.IsNullOrEmpty(req[val[0]])) condi += " and " + fieldEnName + ">=" + req[val[0]];
@@ -271,7 +286,7 @@ namespace Util
                     string val = "";
                     if(fieldQueryModel == "request_param")
                     {
-                        Dictionary<string, string> req = getRequestParams(content);
+                        Dictionary<string, string> req = getRequestParams(projectId, content);
                         val = req[fieldQueryValue];
                     }
                     else if(fieldQueryModel == "fixed_value")
@@ -287,10 +302,10 @@ namespace Util
             }
 
             var db = initDb(projectId);
-            var item = db.SqlQueryable<Dictionary<string, object>>("select " + field + " from " + prizeObjectTable.tableEnName + " where 1=1" + condi).First();
+            var item = db.Ado.GetScalar("select " + field + " from " + prizeObjectTable.tableEnName + " where 1=1" + condi);
             if(item != null)
             {
-                return item[field].ToString() + "|" + prizeObjectTable.prizeListIds;
+                return item.ToString() + "|" + prizeObjectTable.prizeListIds;
             }
             return "";
         }
@@ -319,18 +334,21 @@ namespace Util
                     var tableEnName = loopSet.tableEnName; //递归查询表
                     var parentField = loopSet.parentField; //父字段
                     var sonField = loopSet.sonField; //子字段
+                    var afterPrizeFlag = loopSet.afterPrizeFlag; //发奖后是否继续
                     var db = initDb(projectId);
                     string objId = prizeObjectId;
-                    while(!string.IsNullOrEmpty(objId) && objId != "0")
+                    bool op = true;
+                    while(!string.IsNullOrEmpty(objId) && objId != "0" && op)
                     {
-                        if(loopCondition(projectId, objId, content))
+                        if(loopCondition(projectId, sub, objId, content))
                         {
                             prizeSendDo(projectId, sub, objId, content);
+                            op = afterPrizeFlag;
                         }
-                        var parent = db.SqlQueryable<Dictionary<string, object>>("select " + parentField + " from " + tableEnName + " where " + sonField + "=" + objId).First();
+                        var parent = db.Ado.GetScalar("select " + parentField + " from " + tableEnName + " where " + sonField + "=" + objId);
                         if(parent != null)
                         {
-                            objId = parent[parentField].ToString();
+                            objId = parent.ToString();
                         }
                     }
                 }
@@ -370,7 +388,7 @@ namespace Util
 
                 var returnField = returnFieldService.GetFirst(m => m.id == returnFieldId);
                 var queryTable = queryTableService.GetFirst(m => m.id == returnField.queryTableId);
-                var checkObj = condiDic[queryTable.tableEnName + "-" + returnField.fieldEnName];
+                var checkObj = condiDic.ContainsKey(queryTable.tableEnName + "_" + returnField.fieldEnName) ? condiDic[queryTable.tableEnName + "_" + returnField.fieldEnName] : "0";
                 var checkVal = fieldQueryValue;
 
                 if(fieldQueryKind == "1") //模糊匹配
@@ -384,11 +402,11 @@ namespace Util
                 {
                     if(fieldQueryValueType == "int")
                     {
-                        if((int)checkObj == int.Parse(Function.CheckInt(checkVal))) passCount += 1;
+                        if(int.Parse(Function.CheckInt(checkObj.ToString())) == int.Parse(Function.CheckNum(checkVal))) passCount += 1;
                     }
                     else if(fieldQueryValueType == "number")
                     {
-                        if((decimal)checkObj == decimal.Parse(Function.CheckNum(checkVal))) passCount += 1;
+                        if(decimal.Parse(Function.CheckNum(checkObj.ToString())) == decimal.Parse(Function.CheckNum(checkVal))) passCount += 1;
                     }
                     else
                     {
@@ -400,7 +418,7 @@ namespace Util
                     string[] val = checkVal.Split(':');
                     if(fieldQueryModel == "request_param")
                     {
-                        Dictionary<string, string> req = getRequestParams(content);
+                        Dictionary<string, string> req = getRequestParams(projectId, content);
                         if(fieldQueryValueType == "number")
                         {
                             if(!string.IsNullOrEmpty(req[val[0]]) && !string.IsNullOrEmpty(req[val[1]]) && (decimal)checkObj >= decimal.Parse(Function.CheckNum(req[val[0]])) && (decimal)checkObj <= decimal.Parse(Function.CheckNum(req[val[1]]))) passCount += 1;
@@ -424,15 +442,15 @@ namespace Util
                     {
                         if(fieldQueryValueType == "number")
                         {
-                            if(!string.IsNullOrEmpty(val[0]) && !string.IsNullOrEmpty(val[1]) && (decimal)checkObj >= decimal.Parse(Function.CheckNum(val[0])) && (decimal)checkObj <= decimal.Parse(Function.CheckNum(val[1]))) passCount += 1;
-                            else if(!string.IsNullOrEmpty(val[0]) && string.IsNullOrEmpty(val[1]) && (decimal)checkObj >= decimal.Parse(Function.CheckNum(val[0]))) passCount += 1;
-                            else if(string.IsNullOrEmpty(val[0]) && !string.IsNullOrEmpty(val[1]) && (decimal)checkObj <= decimal.Parse(Function.CheckNum(val[1]))) passCount += 1;
+                            if(!string.IsNullOrEmpty(val[0]) && !string.IsNullOrEmpty(val[1]) && (decimal)checkObj >= decimal.Parse(Function.CheckNum(val[0])) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(val[1]))) passCount += 1;
+                            else if(!string.IsNullOrEmpty(val[0]) && string.IsNullOrEmpty(val[1]) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(val[0]))) passCount += 1;
+                            else if(string.IsNullOrEmpty(val[0]) && !string.IsNullOrEmpty(val[1]) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(val[1]))) passCount += 1;
                         }
                         else if(fieldQueryValueType == "int")
                         {
-                            if(!string.IsNullOrEmpty(val[0]) && !string.IsNullOrEmpty(val[1]) && (int)checkObj >= int.Parse(Function.CheckInt(val[0])) && (int)checkObj <= int.Parse(Function.CheckInt(val[1]))) passCount += 1;
-                            else if(!string.IsNullOrEmpty(val[0]) && string.IsNullOrEmpty(val[1]) && (int)checkObj >= int.Parse(Function.CheckInt(val[0]))) passCount += 1;
-                            else if(string.IsNullOrEmpty(val[0]) && !string.IsNullOrEmpty(val[1]) && (int)checkObj <= int.Parse(Function.CheckInt(val[1]))) passCount += 1;
+                            if(!string.IsNullOrEmpty(val[0]) && !string.IsNullOrEmpty(val[1]) && (int)checkObj >= int.Parse(Function.CheckInt(val[0])) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(val[1]))) passCount += 1;
+                            else if(!string.IsNullOrEmpty(val[0]) && string.IsNullOrEmpty(val[1]) && int.Parse(Function.CheckInt(checkObj.ToString())) >= int.Parse(Function.CheckInt(val[0]))) passCount += 1;
+                            else if(string.IsNullOrEmpty(val[0]) && !string.IsNullOrEmpty(val[1]) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(val[1]))) passCount += 1;
                         }
                         else if(fieldQueryValueType.StartsWith("date"))
                         {
@@ -463,7 +481,18 @@ namespace Util
             else if(conditionMode == "one" && passCount == 1) op = true;
             if(op) //满足条件
             {
-                string prizeSourceData = condiDic[prizeSourceField].ToString();
+                decimal number = 0;
+                if(prizeSourceField.Contains("/"))
+                {
+                    number = decimal.Parse(prizeSourceField.Split('/')[1]);
+                    prizeSourceField = prizeSourceField.Split('/')[0];
+                }
+                string prizeSourceData = condiDic.ContainsKey(prizeSourceField) ? condiDic[prizeSourceField].ToString() : "0";
+                if(prizeSourceField.Contains("/") && number > 0)
+                {
+                    decimal prizeSourceDataNum = decimal.Parse(prizeSourceData) / number;
+                    prizeSourceData = prizeSourceDataNum.ToString("f2");
+                }
                 decimal prizeAmt = 0;
                 var amountSet = amountSetService.GetFirst(m => m.listId == sub.id && m.prizeSourceField == prizeSourceData);
                 if(amountSet != null)
@@ -475,7 +504,7 @@ namespace Util
                 if(prizeAmount > 0) prizeAmt += prizeAmount;
                 if(prizeAmt > 0)
                 {
-                    var req = getRequestParams(content);
+                    var req = getRequestParams(projectId, content);
                     var requestParamField = req[sub.requestParamField];
                     var sendFlag = recordService.Any(m => m.prizeObjId == prizeObjectId && m.listId == sub.id && m.requestParamField == requestParamField);
                     if(!sendFlag)
@@ -485,7 +514,7 @@ namespace Util
                             createDate = DateTime.Now,
                             projectId = projectId,
                             listId = sub.id,
-                            prizeAmount = sub.prizeAmount,
+                            prizeAmount = prizeAmt,
                             prizeObjId = prizeObjectId,
                             requestParamField = requestParamField,
                             batchNo = batchNo,
@@ -497,13 +526,15 @@ namespace Util
         }
 
         //递归条件判断
-        public static bool loopCondition(int projectId, string objId, string content)
+        public static bool loopCondition(int projectId, PriList sub, string objId, string content)
         {
             Dictionary<string, object> dic = new Dictionary<string, object>();
             var queryTableService = App.GetService<IPriRecursionStartTableService>();
             var queryFieldService = App.GetService<IPriRecursionStartFieldService>();
+            int passCount = 0;
             //查询表
-            var queryTables = queryTableService.GetList(m => m.projectId == projectId);
+            var queryTables = queryTableService.GetList(m => m.listId == sub.id);
+            int allCount = queryTables.Count;
             foreach(var queryTable in queryTables)
             {
                 //查询返回字段
@@ -518,14 +549,14 @@ namespace Util
                     string fieldQueryKind = queryField.fieldQueryKind;
                     string fieldQueryModel = queryField.fieldQueryModel;
                     string fieldQueryValue = queryField.fieldQueryValue;
-                    fieldQueryValue = fieldQueryValue.Replace("#{loop_obj}#", objId);
+                    if(fieldQueryModel == "loop_field") fieldQueryValue = objId;
                     string fieldQueryValueType = queryField.fieldQueryValueType;
                     if(fieldQueryKind == "1") //模糊匹配
                     {
                         condi += " and " + fieldEnName + " like ";
                         if(fieldQueryModel == "request_param")
                         {
-                            Dictionary<string, string> req = getRequestParams(content);
+                            Dictionary<string, string> req = getRequestParams(projectId, content);
                             condi += "'%" + req[fieldQueryValue] + "%'";
                         }
                         else if(fieldQueryModel == "fixed_value")
@@ -536,10 +567,10 @@ namespace Util
                     else if(fieldQueryKind == "2") //精确匹配
                     {
                         condi += " and " + fieldEnName + "=";
-                        string val = "";
+                        string val = fieldQueryValue;
                         if(fieldQueryModel == "request_param")
                         {
-                            Dictionary<string, string> req = getRequestParams(content);
+                            Dictionary<string, string> req = getRequestParams(projectId, content);
                             val = req[fieldQueryValue];
                         }
                         else if(fieldQueryModel == "fixed_value")
@@ -557,7 +588,7 @@ namespace Util
                         string[] val = fieldQueryValue.Split(':');
                         if(fieldQueryModel == "request_param")
                         {
-                            Dictionary<string, string> req = getRequestParams(content);
+                            Dictionary<string, string> req = getRequestParams(projectId, content);
                             if(fieldQueryValueType == "number")
                             {
                                 if(!string.IsNullOrEmpty(req[val[0]])) condi += " and " + fieldEnName + ">=" + req[val[0]];
@@ -589,7 +620,7 @@ namespace Util
                         string val = "";
                         if(fieldQueryModel == "request_param")
                         {
-                            Dictionary<string, string> req = getRequestParams(content);
+                            Dictionary<string, string> req = getRequestParams(projectId, content);
                             val = req[fieldQueryValue];
                         }
                         else if(fieldQueryModel == "fixed_value")
@@ -605,10 +636,13 @@ namespace Util
                 }
 
                 var db = initDb(projectId);
-                var item = db.SqlQueryable<Dictionary<string, object>>("select " + fields + " " + queryTable.tableEnName + "-" + fields + " from " + queryTable.tableEnName + " where 1=1" + condi).First();
-                if(item == null) return false;
+                var item = db.Ado.GetScalar("select " + fields + " from " + queryTable.tableEnName + " where 1=1" + condi);
+                if(item != null) passCount += 1;
             }
-            return true;
+            bool op = false;
+            if(sub.conditionMode == "all" && passCount == allCount) op = true;
+            else if(sub.conditionMode == "one" && passCount == 1) op = true;
+            return op;
         }
 
         //奖励入库
@@ -634,7 +668,7 @@ namespace Util
                     string fieldQueryValueType = prizeInField.fieldQueryValueType;
                     if(fieldQueryModel == "request_param")
                     {
-                        Dictionary<string, string> req = getRequestParams(content);
+                        Dictionary<string, string> req = getRequestParams(projectId, content);
                         fieldQueryValue = req[fieldQueryValue];
                     }
                     else if(fieldQueryModel == "fixed_value")
@@ -663,7 +697,7 @@ namespace Util
                         condi += " and " + fieldEnName + " like ";
                         if(fieldQueryModel == "request_param")
                         {
-                            Dictionary<string, string> req = getRequestParams(content);
+                            Dictionary<string, string> req = getRequestParams(projectId, content);
                             condi += "'%" + req[fieldQueryValue] + "%'";
                         }
                         else if(fieldQueryModel == "fixed_value")
@@ -677,7 +711,7 @@ namespace Util
                         string val = "";
                         if(fieldQueryModel == "request_param")
                         {
-                            Dictionary<string, string> req = getRequestParams(content);
+                            Dictionary<string, string> req = getRequestParams(projectId, content);
                             val = req[fieldQueryValue];
                         }
                         else if(fieldQueryModel == "fixed_value")
@@ -695,7 +729,7 @@ namespace Util
                         string[] val = fieldQueryValue.Split(':');
                         if(fieldQueryModel == "request_param")
                         {
-                            Dictionary<string, string> req = getRequestParams(content);
+                            Dictionary<string, string> req = getRequestParams(projectId, content);
                             if(fieldQueryValueType == "number")
                             {
                                 if(!string.IsNullOrEmpty(req[val[0]])) condi += " and " + fieldEnName + ">=" + req[val[0]];
@@ -727,7 +761,7 @@ namespace Util
                         string val = "";
                         if(fieldQueryModel == "request_param")
                         {
-                            Dictionary<string, string> req = getRequestParams(content);
+                            Dictionary<string, string> req = getRequestParams(projectId, content);
                             val = req[fieldQueryValue];
                         }
                         else if(fieldQueryModel == "fixed_value")