lcl 2 днів тому
батько
коміт
ffdd766c1a
3 змінених файлів з 505 додано та 490 видалено
  1. 6 0
      Model/Vo/Admin/GetPriLogQueryVo.cs
  2. 2 2
      Program.cs
  3. 497 488
      Util/PrizeDo.cs

+ 6 - 0
Model/Vo/Admin/GetPriLogQueryVo.cs

@@ -43,6 +43,12 @@ namespace Vo.Admin
         public string stepList { get; set; }
 
 
+        /// <summary>
+        /// 报错日志
+        /// </summary>
+        public string errLog { get; set; }
+
+
 
     }
 }

+ 2 - 2
Program.cs

@@ -127,11 +127,11 @@ app.Urls.Add("http://*:5802");
 // PrizeDo.sendPrize(4, "{\"PosSn\":\"CS00000000015859\"}");
 // PrizeDo.sendPrize(5, "{\"PosSn\":\"00000302T1NL90664172\"}");
 // PrizeDo.sendPrize(6, "{\"PosSn\":\"1152131239\"}");
-// PrizeDo.sendPrize("KXS_MALL_ORDER_PRIZE", "{\"order_id\":\"319698\"}");
+// PrizeDo.sendPrize("QUEUE_KXS_PRIZE_MALL_CONFIG_DIVISION", "{\"order_id\":319698}");
 // PrizeDo.sendPrize(7, "{\"OrderNo\":\"BM2024090817330511847441249\"}");
 // PrizeDo.sendPrize(7, "{\"OrderNo\":\"BM2024090817360962275551251\"}");
 
-// RabbitMQClient.Instance.Start();
+RabbitMQClient.Instance.Start();
 
 // PrizeDo.sendPrize("{\"prize_tag\":\"1\",\"content\":\"{\\\"PosSn\\\":\\\"00002402045980195457\\\"}\"}");
 

+ 497 - 488
Util/PrizeDo.cs

@@ -986,348 +986,352 @@ namespace Util
                     loopLog.Add("查询" + objId + "匹配数据", condiDic);
                     if(condiDic.Count > 0)
                     {
-                        bool prizeFlag = true;                            
-                        var conditions = recursionStartConditionService.GetList(m => m.loopSetId == loopSet.id);
-                        if(conditions.Count > 0)
+                        bool prizeFlag = false;
+                        List<Dictionary<string, object>> logStepDics = new();
+                        var groupNos = recursionStartConditionService.GetList(m => m.loopSetId == loopSet.id).ToList().Select(m => m.groupNo).Distinct().ToList();
+                        foreach(var groupNo in groupNos)
                         {
-                            int allCount = conditions.Count; //所有奖励条件数
-                            int passCount = 0; //通过条件数
-                            List<Dictionary<string, object>> logStepDics = new();
-                            foreach(var condition in conditions)
+                            var conditions = recursionStartConditionService.GetList(m => m.loopSetId == loopSet.id && m.groupNo == groupNo);
+                            if(conditions.Count > 0)
                             {
-                                if(condition.startIndex <= index)
+                                int allCount = conditions.Count; //所有奖励条件数
+                                int passCount = 0; //通过条件数
+                                foreach(var condition in conditions)
                                 {
-                                    Dictionary<string, object> logStepDic = new();
-                                    
-                                    var returnFieldId = condition.returnFieldId; //条件返回字段
-                                    var fieldQueryKind = condition.fieldQueryKind; //匹配条件
-                                    var fieldQueryModel = condition.fieldQueryModel; //匹配方式
-                                    var fieldQueryValue = condition.fieldQueryValue; //匹配值
-                                    var fieldQueryValueType = condition.fieldQueryValueType; //匹配值类型
-
-                                    string checkObj = "";
-                                    string checkTitle = "";
-                                    if(returnFieldId.Contains(","))
+                                    if(condition.startIndex <= index)
                                     {
-                                        string[] returnFieldIdList = returnFieldId.Split(',');
-                                        foreach(string subField in returnFieldIdList)
-                                        {
-                                            string val = GetQueryTableData(condiDic, subField);
-                                            checkObj += val + ",";
-                                            string title = GetQueryTableTitle(condiDic, subField);
-                                            checkTitle += title + ",";
-                                        }
-                                        checkObj = checkObj.TrimEnd(',');
-                                        checkTitle = checkTitle.TrimEnd(',');
-                                    }
-                                    else if (returnFieldId.Contains("+") || returnFieldId.Contains("-") || returnFieldId.Contains("*") || returnFieldId.Contains("/") || returnFieldId.Contains("(") || returnFieldId.Contains(")"))
-                                    {
-                                        string expresssion = returnFieldId;
-                                        checkTitle = returnFieldId;
-                                        string[] returnFields = returnFieldId.Split(new char[] { '+', '-', '*', '/', '(', ')' });
-                                        foreach(string returnField in returnFields)
-                                        {
-                                            string val = GetQueryTableData(condiDic, returnField);
-                                            expresssion = expresssion.Replace(returnField, val);
+                                        Dictionary<string, object> logStepDic = new();
+                                        
+                                        var returnFieldId = condition.returnFieldId; //条件返回字段
+                                        var fieldQueryKind = condition.fieldQueryKind; //匹配条件
+                                        var fieldQueryModel = condition.fieldQueryModel; //匹配方式
+                                        var fieldQueryValue = condition.fieldQueryValue; //匹配值
+                                        var fieldQueryValueType = condition.fieldQueryValueType; //匹配值类型
 
-                                            string title = GetQueryTableTitle(condiDic, returnField);
-                                            checkTitle = checkTitle.Replace(returnField, title);
-                                        }
-                                        DataTable dt = new();
-                                        checkObj = dt.Compute(expresssion, "false").ToString();
-                                    }
-                                    else
-                                    {
-                                        checkObj = GetQueryTableData(condiDic, returnFieldId);
-                                        checkTitle = GetQueryTableTitle(condiDic, returnFieldId);
-                                    }
-                                    
-                                    logStepDic.Add("标题", checkTitle);
-                                    logStepDic.Add("匹配条件", getQueryKind(fieldQueryKind));
-                                    logStepDic.Add("匹配方式", getQueryModel(fieldQueryModel));
-                                    logStepDic.Add("匹配值", fieldQueryValue);
-                                    logStepDic.Add("实际值", checkObj);
-
-                                    var checkVal = fieldQueryValue;
-                                    bool passFlag = false;
-
-                                    if(fieldQueryKind == "1") //模糊匹配
-                                    {
-                                        if(fieldQueryValueType == "text")
+                                        string checkObj = "";
+                                        string checkTitle = "";
+                                        if(returnFieldId.Contains(","))
                                         {
-                                            if(checkObj.ToString().Contains(GetExpressionVal(checkVal))) 
+                                            string[] returnFieldIdList = returnFieldId.Split(',');
+                                            foreach(string subField in returnFieldIdList)
                                             {
-                                                passCount += 1; passFlag = true;
-                                            }
-                                        }
-                                    }
-                                    else if(fieldQueryKind == "2") //精确匹配
-                                    {
-                                        if(fieldQueryValueType == "int")
-                                        {
-                                            if(int.Parse(Function.CheckInt(checkObj.ToString())) == int.Parse(Function.CheckNum(checkVal))) 
-                                            {
-                                                passCount += 1; passFlag = true;
+                                                string val = GetQueryTableData(condiDic, subField);
+                                                checkObj += val + ",";
+                                                string title = GetQueryTableTitle(condiDic, subField);
+                                                checkTitle += title + ",";
                                             }
+                                            checkObj = checkObj.TrimEnd(',');
+                                            checkTitle = checkTitle.TrimEnd(',');
                                         }
-                                        else if(fieldQueryValueType == "number")
+                                        else if (returnFieldId.Contains("+") || returnFieldId.Contains("-") || returnFieldId.Contains("*") || returnFieldId.Contains("/") || returnFieldId.Contains("(") || returnFieldId.Contains(")"))
                                         {
-                                            if(decimal.Parse(Function.CheckNum(checkObj.ToString())) == decimal.Parse(Function.CheckNum(checkVal))) 
+                                            string expresssion = returnFieldId;
+                                            checkTitle = returnFieldId;
+                                            string[] returnFields = returnFieldId.Split(new char[] { '+', '-', '*', '/', '(', ')' });
+                                            foreach(string returnField in returnFields)
                                             {
-                                                passCount += 1; passFlag = true;
+                                                string val = GetQueryTableData(condiDic, returnField);
+                                                expresssion = expresssion.Replace(returnField, val);
+
+                                                string title = GetQueryTableTitle(condiDic, returnField);
+                                                checkTitle = checkTitle.Replace(returnField, title);
                                             }
+                                            DataTable dt = new();
+                                            checkObj = dt.Compute(expresssion, "false").ToString();
                                         }
                                         else
                                         {
-                                            if(checkObj.ToString() == GetExpressionVal(checkVal)) 
-                                            {
-                                                passCount += 1; passFlag = true;
-                                            }
+                                            checkObj = GetQueryTableData(condiDic, returnFieldId);
+                                            checkTitle = GetQueryTableTitle(condiDic, returnFieldId);
                                         }
-                                    }
-                                    else if(fieldQueryKind == "3") //范围匹配
-                                    {
-                                        string[] val = checkVal.Split(':');
-                                        string valLeft = val[0];
-                                        string valRight = val[1];
-                                        if(fieldQueryModel == "request_param")
+                                        
+                                        logStepDic.Add("标题", checkTitle);
+                                        logStepDic.Add("匹配条件", getQueryKind(fieldQueryKind));
+                                        logStepDic.Add("匹配方式", getQueryModel(fieldQueryModel));
+                                        logStepDic.Add("匹配值", fieldQueryValue);
+                                        logStepDic.Add("实际值", checkObj);
+
+                                        var checkVal = fieldQueryValue;
+                                        bool passFlag = false;
+
+                                        if(fieldQueryKind == "1") //模糊匹配
                                         {
-                                            Dictionary<string, string> req = getRequestParams(projectId, content);
-                                            if(fieldQueryValueType == "number")
+                                            if(fieldQueryValueType == "text")
                                             {
-                                                if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(req[valLeft])) && decimal.Parse(checkObj) <= decimal.Parse(Function.CheckNum(req[valRight]))) 
-                                                {
-                                                    passCount += 1; passFlag = true;
-                                                }
-                                                else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(req[valLeft]))) 
-                                                {
-                                                    passCount += 1; passFlag = true;
-                                                }
-                                                else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) <= decimal.Parse(Function.CheckNum(req[valRight]))) 
+                                                if(checkObj.ToString().Contains(GetExpressionVal(checkVal))) 
                                                 {
                                                     passCount += 1; passFlag = true;
                                                 }
                                             }
-                                            else if(fieldQueryValueType == "int")
+                                        }
+                                        else if(fieldQueryKind == "2") //精确匹配
+                                        {
+                                            if(fieldQueryValueType == "int")
                                             {
-                                                if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(req[valLeft])) && int.Parse(checkObj) <= int.Parse(Function.CheckInt(req[valRight]))) 
-                                                {
-                                                    passCount += 1; passFlag = true;
-                                                }
-                                                else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(req[valLeft]))) 
-                                                {
-                                                    passCount += 1; passFlag = true;
-                                                }
-                                                else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) <= int.Parse(Function.CheckInt(req[valRight]))) 
+                                                if(int.Parse(Function.CheckInt(checkObj.ToString())) == int.Parse(Function.CheckNum(checkVal))) 
                                                 {
                                                     passCount += 1; passFlag = true;
                                                 }
                                             }
-                                            else if(fieldQueryValueType.StartsWith("date"))
+                                            else if(fieldQueryValueType == "number")
                                             {
-                                                if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) >= DateTime.Parse(req[valLeft]) && DateTime.Parse(checkObj) <= DateTime.Parse(req[valRight])) 
+                                                if(decimal.Parse(Function.CheckNum(checkObj.ToString())) == decimal.Parse(Function.CheckNum(checkVal))) 
                                                 {
                                                     passCount += 1; passFlag = true;
                                                 }
-                                                else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) >= DateTime.Parse(req[valLeft])) 
-                                                {
-                                                    passCount += 1; passFlag = true;
-                                                }
-                                                else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) <= DateTime.Parse(req[valRight])) 
+                                            }
+                                            else
+                                            {
+                                                if(checkObj.ToString() == GetExpressionVal(checkVal)) 
                                                 {
                                                     passCount += 1; passFlag = true;
                                                 }
                                             }
                                         }
-                                        else if(fieldQueryModel == "fixed_value")
+                                        else if(fieldQueryKind == "3") //范围匹配
                                         {
-                                            string checkValLeft = valLeft.Replace("#{", "").Replace("}#", "");
-                                            string checkValRight = valRight.Replace("#{", "").Replace("}#", "");
-                                            if(checkValLeft.Contains(",")) checkValLeft = checkValLeft.Split(',')[0];
-                                            if(checkValRight.Contains(",")) checkValRight = checkValRight.Split(',')[0];
-                                            valLeft = GetExpressionVal(valLeft);
-                                            valRight = GetExpressionVal(valRight);
-                                            if(fieldQueryValueType == "number")
+                                            string[] val = checkVal.Split(':');
+                                            string valLeft = val[0];
+                                            string valRight = val[1];
+                                            if(fieldQueryModel == "request_param")
                                             {
-                                                if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(valLeft)) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
+                                                Dictionary<string, string> req = getRequestParams(projectId, content);
+                                                if(fieldQueryValueType == "number")
                                                 {
-                                                    passCount += 1; passFlag = true;
+                                                    if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(req[valLeft])) && decimal.Parse(checkObj) <= decimal.Parse(Function.CheckNum(req[valRight]))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
+                                                    else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(req[valLeft]))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
+                                                    else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) <= decimal.Parse(Function.CheckNum(req[valRight]))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
                                                 }
-                                                else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft))) 
+                                                else if(fieldQueryValueType == "int")
                                                 {
-                                                    passCount += 1; passFlag = true;
+                                                    if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(req[valLeft])) && int.Parse(checkObj) <= int.Parse(Function.CheckInt(req[valRight]))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
+                                                    else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(req[valLeft]))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
+                                                    else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) <= int.Parse(Function.CheckInt(req[valRight]))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
                                                 }
-                                                else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
+                                                else if(fieldQueryValueType.StartsWith("date"))
                                                 {
-                                                    passCount += 1; passFlag = true;
+                                                    if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) >= DateTime.Parse(req[valLeft]) && DateTime.Parse(checkObj) <= DateTime.Parse(req[valRight])) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
+                                                    else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) >= DateTime.Parse(req[valLeft])) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
+                                                    else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) <= DateTime.Parse(req[valRight])) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
                                                 }
                                             }
-                                            else if(fieldQueryValueType == "int")
+                                            else if(fieldQueryModel == "fixed_value")
                                             {
-                                                if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(valLeft)) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                                                string checkValLeft = valLeft.Replace("#{", "").Replace("}#", "");
+                                                string checkValRight = valRight.Replace("#{", "").Replace("}#", "");
+                                                if(checkValLeft.Contains(",")) checkValLeft = checkValLeft.Split(',')[0];
+                                                if(checkValRight.Contains(",")) checkValRight = checkValRight.Split(',')[0];
+                                                valLeft = GetExpressionVal(valLeft);
+                                                valRight = GetExpressionVal(valRight);
+                                                if(fieldQueryValueType == "number")
                                                 {
-                                                    passCount += 1; passFlag = true;
+                                                    if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(valLeft)) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
+                                                    else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
+                                                    else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
                                                 }
-                                                else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft))) 
+                                                else if(fieldQueryValueType == "int")
                                                 {
-                                                    passCount += 1; passFlag = true;
+                                                    if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(valLeft)) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
+                                                    else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
+                                                    else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
                                                 }
-                                                else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                                                else if(fieldQueryValueType.StartsWith("date"))
                                                 {
-                                                    passCount += 1; passFlag = true;
+                                                    if(valLeft == "0") valLeft = "";
+                                                    if(valRight == "0") valRight = "";
+                                                    if(checkObj != "0" && checkObj != "")
+                                                    {
+                                                        if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft)) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight))) 
+                                                        {
+                                                            passCount += 1; passFlag = true;
+                                                        }
+                                                        else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft))) 
+                                                        {
+                                                            passCount += 1; passFlag = true;
+                                                        }
+                                                        else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight))) 
+                                                        {
+                                                            passCount += 1; passFlag = true;
+                                                        }
+                                                    }
                                                 }
                                             }
-                                            else if(fieldQueryValueType.StartsWith("date"))
-                                            {
-                                                if(valLeft == "0") valLeft = "";
-                                                if(valRight == "0") valRight = "";
-                                                if(checkObj != "0" && checkObj != "")
+                                            else if(fieldQueryModel == "query_field")
+                                            {                                                
+                                                valLeft = GetComputeVal(queryCondiDic, valLeft);
+                                                valRight = GetComputeVal(queryCondiDic, valRight);
+                                                if(fieldQueryValueType == "number")
                                                 {
-                                                    if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft)) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight))) 
+                                                    if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(valLeft)) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
                                                     {
                                                         passCount += 1; passFlag = true;
                                                     }
-                                                    else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft))) 
+                                                    else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft))) 
                                                     {
                                                         passCount += 1; passFlag = true;
                                                     }
-                                                    else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight))) 
+                                                    else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
                                                     {
                                                         passCount += 1; passFlag = true;
                                                     }
                                                 }
-                                            }
-                                        }
-                                        else if(fieldQueryModel == "query_field")
-                                        {                                                
-                                            valLeft = GetComputeVal(queryCondiDic, valLeft);
-                                            valRight = GetComputeVal(queryCondiDic, valRight);
-                                            if(fieldQueryValueType == "number")
-                                            {
-                                                if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(valLeft)) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
+                                                else if(fieldQueryValueType == "int")
                                                 {
-                                                    passCount += 1; passFlag = true;
+                                                    if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(valLeft)) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
+                                                    else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
+                                                    else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                                                    {
+                                                        passCount += 1; passFlag = true;
+                                                    }
                                                 }
-                                                else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft))) 
+                                                else if(fieldQueryValueType.StartsWith("date"))
                                                 {
-                                                    passCount += 1; passFlag = true;
+                                                    if(valLeft == "0") valLeft = "";
+                                                    if(valRight == "0") valRight = "";
+                                                    if(checkObj != "0" && checkObj != "")
+                                                    {
+                                                        if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft)) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight))) 
+                                                        {
+                                                            passCount += 1; passFlag = true;
+                                                        }
+                                                        else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft))) 
+                                                        {
+                                                            passCount += 1; passFlag = true;
+                                                        }
+                                                        else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight))) 
+                                                        {
+                                                            passCount += 1; passFlag = true;
+                                                        }
+                                                    }
                                                 }
-                                                else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
+                                            }
+                                        }
+                                        else if(fieldQueryKind == "4") //取反匹配
+                                        {
+                                            if(fieldQueryValueType == "int")
+                                            {
+                                                if(int.Parse(checkObj) != int.Parse(Function.CheckInt(checkVal))) 
                                                 {
                                                     passCount += 1; passFlag = true;
                                                 }
                                             }
-                                            else if(fieldQueryValueType == "int")
+                                            else if(fieldQueryValueType == "number")
                                             {
-                                                if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(valLeft)) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                                                if(decimal.Parse(checkObj) != decimal.Parse(Function.CheckNum(checkVal))) 
                                                 {
                                                     passCount += 1; passFlag = true;
                                                 }
-                                                else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft))) 
+                                            }
+                                            else if(fieldQueryValueType == "text")
+                                            {
+                                                if(checkObj.ToString() != GetExpressionVal(checkVal)) 
                                                 {
                                                     passCount += 1; passFlag = true;
                                                 }
-                                                else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                                            }
+                                        }
+                                        else if(fieldQueryKind == "5" || fieldQueryKind == "6") //数组匹配/排除
+                                        {
+                                            string val = ",";
+                                            string[] valList = checkVal.Split(',');
+                                            if(fieldQueryModel == "request_param")
+                                            {
+                                                Dictionary<string, string> req = getRequestParams(projectId, content);
+                                                foreach(string subVal in valList)
                                                 {
-                                                    passCount += 1; passFlag = true;
+                                                    val += req[subVal] + ",";
                                                 }
                                             }
-                                            else if(fieldQueryValueType.StartsWith("date"))
+                                            else if(fieldQueryModel == "fixed_value")
                                             {
-                                                if(valLeft == "0") valLeft = "";
-                                                if(valRight == "0") valRight = "";
-                                                if(checkObj != "0" && checkObj != "")
+                                                foreach(string subVal in valList)
                                                 {
-                                                    if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft)) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight))) 
-                                                    {
-                                                        passCount += 1; passFlag = true;
-                                                    }
-                                                    else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft))) 
-                                                    {
-                                                        passCount += 1; passFlag = true;
-                                                    }
-                                                    else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight))) 
-                                                    {
-                                                        passCount += 1; passFlag = true;
-                                                    }
+                                                    val += GetExpressionVal(subVal) + ",";
                                                 }
                                             }
-                                        }
-                                    }
-                                    else if(fieldQueryKind == "4") //取反匹配
-                                    {
-                                        if(fieldQueryValueType == "int")
-                                        {
-                                            if(int.Parse(checkObj) != int.Parse(Function.CheckInt(checkVal))) 
+                                            else if(fieldQueryModel == "db_field")
                                             {
-                                                passCount += 1; passFlag = true;
+                                                foreach(string subVal in valList)
+                                                {
+                                                    val += GetDbExpressionVal(subVal) + ",";
+                                                }
                                             }
-                                        }
-                                        else if(fieldQueryValueType == "number")
-                                        {
-                                            if(decimal.Parse(checkObj) != decimal.Parse(Function.CheckNum(checkVal))) 
+                                            if(fieldQueryKind == "5" && val.Contains("," + checkObj.ToString() + ",")) 
                                             {
                                                 passCount += 1; passFlag = true;
                                             }
-                                        }
-                                        else if(fieldQueryValueType == "text")
-                                        {
-                                            if(checkObj.ToString() != GetExpressionVal(checkVal)) 
+                                            if(fieldQueryKind == "6" && !val.Contains("," + checkObj.ToString() + ",")) 
                                             {
                                                 passCount += 1; passFlag = true;
                                             }
                                         }
+                                        logStepDic.Add("状态", passFlag ? "通过" : "未通过");
+                                        logStepDics.Add(logStepDic);
                                     }
-                                    else if(fieldQueryKind == "5" || fieldQueryKind == "6") //数组匹配/排除
-                                    {
-                                        string val = ",";
-                                        string[] valList = checkVal.Split(',');
-                                        if(fieldQueryModel == "request_param")
-                                        {
-                                            Dictionary<string, string> req = getRequestParams(projectId, content);
-                                            foreach(string subVal in valList)
-                                            {
-                                                val += req[subVal] + ",";
-                                            }
-                                        }
-                                        else if(fieldQueryModel == "fixed_value")
-                                        {
-                                            foreach(string subVal in valList)
-                                            {
-                                                val += GetExpressionVal(subVal) + ",";
-                                            }
-                                        }
-                                        else if(fieldQueryModel == "db_field")
-                                        {
-                                            foreach(string subVal in valList)
-                                            {
-                                                val += GetDbExpressionVal(subVal) + ",";
-                                            }
-                                        }
-                                        if(fieldQueryKind == "5" && val.Contains("," + checkObj.ToString() + ",")) 
-                                        {
-                                            passCount += 1; passFlag = true;
-                                        }
-                                        if(fieldQueryKind == "6" && !val.Contains("," + checkObj.ToString() + ",")) 
-                                        {
-                                            passCount += 1; passFlag = true;
-                                        }
-                                    }
-                                    logStepDic.Add("状态", passFlag ? "通过" : "未通过");
-                                    logStepDics.Add(logStepDic);
                                 }
-                            }
-                            loopLog.Add(objId + "匹配情况", logStepDics);
-                            if(loopSet.conditionMode == "all" && passCount == allCount) prizeFlag = true;
-                            else if(loopSet.conditionMode == "one" && passCount >= 1) prizeFlag = true;
-                            else if(loopSet.conditionMode == "two" && passCount >= 2) prizeFlag = true;
-                            else if(loopSet.conditionMode == "three" && passCount >= 3) prizeFlag = true;
-                            else prizeFlag = false;
-                        }
-                        else
-                        {
-                            prizeFlag = false;
-                        }
+                                if(loopSet.conditionMode == "all" && passCount == allCount) prizeFlag = true;
+                                else if(loopSet.conditionMode == "one" && passCount >= 1) prizeFlag = true;
+                                else if(loopSet.conditionMode == "two" && passCount >= 2) prizeFlag = true;
+                                else if(loopSet.conditionMode == "three" && passCount >= 3) prizeFlag = true;
+                                // else prizeFlag = false;
+                            }
+                            // else
+                            // {
+                            //     prizeFlag = false;
+                            // }
+                        }
+                        loopLog.Add(objId + "匹配情况", logStepDics);
                         loopLog.Add("匹配结果", prizeFlag);
                         if(prizeFlag)
                         {
@@ -1378,346 +1382,351 @@ namespace Util
             var conditionMode = sub.conditionMode; //条件模式
             var recursionFlag = sub.recursionFlag; //是否递归
             
-            var conditions = conditionService.GetList(m => m.listId == sub.id);
-            setLogStep(sub.id, "发放奖励匹配条件", condiDic);
-            int allCount = conditions.Count; //所有奖励条件数
-            int passCount = 0; //通过条件数
-            List<Dictionary<string, object>> logStepDics = new();
-            foreach(var condition in conditions)
+            bool op = false;
+            var groupNos = conditionService.GetList(m => m.listId == sub.id).ToList().Select(m => m.groupNo).Distinct().ToList();
+            foreach(var groupNo in groupNos)
             {
-                Dictionary<string, object> logStepDic = new();
-                var returnFieldId = condition.returnFieldId; //条件返回字段
-                var fieldQueryKind = condition.fieldQueryKind; //匹配条件
-                var fieldQueryModel = condition.fieldQueryModel; //匹配方式
-                var fieldQueryValue = condition.fieldQueryValue; //匹配值
-                var fieldQueryValueType = condition.fieldQueryValueType; //匹配值类型
-
-                string checkObj = "";
-                string checkTitle = "";
-                if(returnFieldId.Contains(","))
-                {
-                    string[] returnFieldIdList = returnFieldId.Split(',');
-                    foreach(string subField in returnFieldIdList)
-                    {
-                        string val = GetQueryTableData(condiDic, subField);
-                        checkObj += val + ",";
-                        string title = GetQueryTableTitle(condiDic, subField);
-                        checkTitle += title + ",";
-                    }
-                    checkObj = checkObj.TrimEnd(',');
-                    checkTitle = checkTitle.TrimEnd(',');
-                }
-                else if (returnFieldId.Contains("+") || returnFieldId.Contains("-") || returnFieldId.Contains("*") || returnFieldId.Contains("/") || returnFieldId.Contains("(") || returnFieldId.Contains(")"))
-                {
-                    string expresssion = returnFieldId;
-                    checkTitle = returnFieldId;
-                    string[] returnFields = returnFieldId.Split(new char[] { '+', '-', '*', '/', '(', ')' });
-                    foreach(string returnField in returnFields)
-                    {
-                        string val = GetQueryTableData(condiDic, returnField);
-                        expresssion = expresssion.Replace(returnField, val);
-
-                        string title = GetQueryTableTitle(condiDic, returnField);
-                        checkTitle = checkTitle.Replace(returnField, title);
-                    }
-                    DataTable dt = new();
-                    checkObj = dt.Compute(expresssion, "false").ToString();
-                }
-                else
+                var conditions = conditionService.GetList(m => m.listId == sub.id && m.groupNo == groupNo);
+                setLogStep(sub.id, "发放奖励匹配条件", condiDic);
+                int allCount = conditions.Count; //所有奖励条件数
+                int passCount = 0; //通过条件数
+                List<Dictionary<string, object>> logStepDics = new();
+                foreach(var condition in conditions)
                 {
-                    checkObj = GetQueryTableData(condiDic, returnFieldId);
-                    checkTitle = GetQueryTableTitle(condiDic, returnFieldId);
-                }
-                // if(!sub.recursionFlag)
-                // {
-                    logStepDic.Add("标题", checkTitle);
-                    logStepDic.Add("匹配条件", getQueryKind(fieldQueryKind));
-                    logStepDic.Add("匹配方式", getQueryModel(fieldQueryModel));
-                    logStepDic.Add("匹配值", fieldQueryValue);
-                    logStepDic.Add("实际值", checkObj);
-                // }
+                    Dictionary<string, object> logStepDic = new();
+                    var returnFieldId = condition.returnFieldId; //条件返回字段
+                    var fieldQueryKind = condition.fieldQueryKind; //匹配条件
+                    var fieldQueryModel = condition.fieldQueryModel; //匹配方式
+                    var fieldQueryValue = condition.fieldQueryValue; //匹配值
+                    var fieldQueryValueType = condition.fieldQueryValueType; //匹配值类型
 
-                string checkVal = fieldQueryValue;
-                bool passFlag = false;
-
-                if(fieldQueryKind == "1") //模糊匹配
-                {
-                    if(fieldQueryValueType == "text")
-                    {
-                        if(checkObj.ToString().Contains(GetExpressionVal(checkVal))) 
-                        {
-                            passCount += 1; passFlag = true;
-                        }
-                    }
-                }
-                else if(fieldQueryKind == "2") //精确匹配
-                {
-                    if(fieldQueryValueType == "int")
+                    string checkObj = "";
+                    string checkTitle = "";
+                    if(returnFieldId.Contains(","))
                     {
-                        if(int.Parse(Function.CheckInt(checkObj.ToString())) == int.Parse(Function.CheckNum(checkVal))) 
+                        string[] returnFieldIdList = returnFieldId.Split(',');
+                        foreach(string subField in returnFieldIdList)
                         {
-                            passCount += 1; passFlag = true;
+                            string val = GetQueryTableData(condiDic, subField);
+                            checkObj += val + ",";
+                            string title = GetQueryTableTitle(condiDic, subField);
+                            checkTitle += title + ",";
                         }
+                        checkObj = checkObj.TrimEnd(',');
+                        checkTitle = checkTitle.TrimEnd(',');
                     }
-                    else if(fieldQueryValueType == "number")
+                    else if (returnFieldId.Contains("+") || returnFieldId.Contains("-") || returnFieldId.Contains("*") || returnFieldId.Contains("/") || returnFieldId.Contains("(") || returnFieldId.Contains(")"))
                     {
-                        if(decimal.Parse(Function.CheckNum(checkObj.ToString())) == decimal.Parse(Function.CheckNum(checkVal))) 
+                        string expresssion = returnFieldId;
+                        checkTitle = returnFieldId;
+                        string[] returnFields = returnFieldId.Split(new char[] { '+', '-', '*', '/', '(', ')' });
+                        foreach(string returnField in returnFields)
                         {
-                            passCount += 1; passFlag = true;
+                            string val = GetQueryTableData(condiDic, returnField);
+                            expresssion = expresssion.Replace(returnField, val);
+
+                            string title = GetQueryTableTitle(condiDic, returnField);
+                            checkTitle = checkTitle.Replace(returnField, title);
                         }
+                        DataTable dt = new();
+                        checkObj = dt.Compute(expresssion, "false").ToString();
                     }
                     else
                     {
-                        if(checkObj.ToString() == GetExpressionVal(checkVal)) 
-                        {
-                            passCount += 1; passFlag = true;
-                        }
-                    }
-                }
-                else if(fieldQueryKind == "3") //范围匹配
-                {
-                    string[] val = checkVal.Split(':');
-                    string valLeft = val[0];
-                    string valRight = val[1];
-                    if(fieldQueryModel == "request_param")
+                        checkObj = GetQueryTableData(condiDic, returnFieldId);
+                        checkTitle = GetQueryTableTitle(condiDic, returnFieldId);
+                    }
+                    // if(!sub.recursionFlag)
+                    // {
+                        logStepDic.Add("标题", checkTitle);
+                        logStepDic.Add("匹配条件", getQueryKind(fieldQueryKind));
+                        logStepDic.Add("匹配方式", getQueryModel(fieldQueryModel));
+                        logStepDic.Add("匹配值", fieldQueryValue);
+                        logStepDic.Add("实际值", checkObj);
+                    // }
+
+                    string checkVal = fieldQueryValue;
+                    bool passFlag = false;
+
+                    if(fieldQueryKind == "1") //模糊匹配
                     {
-                        Dictionary<string, string> req = getRequestParams(projectId, content);
-                        if(fieldQueryValueType == "number")
+                        if(fieldQueryValueType == "text")
                         {
-                            if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(req[valLeft])) && decimal.Parse(checkObj) <= decimal.Parse(Function.CheckNum(req[valRight]))) 
-                            {
-                                passCount += 1; passFlag = true;
-                            }
-                            else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(req[valLeft]))) 
-                            {
-                                passCount += 1; passFlag = true;
-                            }
-                            else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) <= decimal.Parse(Function.CheckNum(req[valRight]))) 
+                            if(checkObj.ToString().Contains(GetExpressionVal(checkVal))) 
                             {
                                 passCount += 1; passFlag = true;
                             }
                         }
-                        else if(fieldQueryValueType == "int")
+                    }
+                    else if(fieldQueryKind == "2") //精确匹配
+                    {
+                        if(fieldQueryValueType == "int")
                         {
-                            if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(req[valLeft])) && int.Parse(checkObj) <= int.Parse(Function.CheckInt(req[valRight]))) 
-                            {
-                                passCount += 1; passFlag = true;
-                            }
-                            else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(req[valLeft]))) 
-                            {
-                                passCount += 1; passFlag = true;
-                            }
-                            else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) <= int.Parse(Function.CheckInt(req[valRight]))) 
+                            if(int.Parse(Function.CheckInt(checkObj.ToString())) == int.Parse(Function.CheckNum(checkVal))) 
                             {
                                 passCount += 1; passFlag = true;
                             }
                         }
-                        else if(fieldQueryValueType.StartsWith("date"))
+                        else if(fieldQueryValueType == "number")
                         {
-                            if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) >= DateTime.Parse(req[valLeft]) && DateTime.Parse(checkObj) <= DateTime.Parse(req[valRight])) 
-                            {
-                                passCount += 1; passFlag = true;
-                            }
-                            else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) >= DateTime.Parse(req[valLeft])) 
+                            if(decimal.Parse(Function.CheckNum(checkObj.ToString())) == decimal.Parse(Function.CheckNum(checkVal))) 
                             {
                                 passCount += 1; passFlag = true;
                             }
-                            else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) <= DateTime.Parse(req[valRight])) 
+                        }
+                        else
+                        {
+                            if(checkObj.ToString() == GetExpressionVal(checkVal)) 
                             {
                                 passCount += 1; passFlag = true;
                             }
                         }
                     }
-                    else if(fieldQueryModel == "fixed_value")
+                    else if(fieldQueryKind == "3") //范围匹配
                     {
-                        valLeft = GetExpressionVal(valLeft);
-                        valRight = GetExpressionVal(valRight);
-                        if(fieldQueryValueType == "number")
+                        string[] val = checkVal.Split(':');
+                        string valLeft = val[0];
+                        string valRight = val[1];
+                        if(fieldQueryModel == "request_param")
                         {
-                            if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft)) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
+                            Dictionary<string, string> req = getRequestParams(projectId, content);
+                            if(fieldQueryValueType == "number")
                             {
-                                passCount += 1; passFlag = true;
+                                if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(req[valLeft])) && decimal.Parse(checkObj) <= decimal.Parse(Function.CheckNum(req[valRight]))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
+                                else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(req[valLeft]))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
+                                else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) <= decimal.Parse(Function.CheckNum(req[valRight]))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
                             }
-                            else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft))) 
+                            else if(fieldQueryValueType == "int")
                             {
-                                passCount += 1; passFlag = true;
+                                if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(req[valLeft])) && int.Parse(checkObj) <= int.Parse(Function.CheckInt(req[valRight]))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
+                                else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(req[valLeft]))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
+                                else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) <= int.Parse(Function.CheckInt(req[valRight]))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
                             }
-                            else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
+                            else if(fieldQueryValueType.StartsWith("date"))
                             {
-                                passCount += 1; passFlag = true;
+                                if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) >= DateTime.Parse(req[valLeft]) && DateTime.Parse(checkObj) <= DateTime.Parse(req[valRight])) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
+                                else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) >= DateTime.Parse(req[valLeft])) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
+                                else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) <= DateTime.Parse(req[valRight])) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
                             }
                         }
-                        else if(fieldQueryValueType == "int")
+                        else if(fieldQueryModel == "fixed_value")
                         {
-                            if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckNum(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft)) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                            valLeft = GetExpressionVal(valLeft);
+                            valRight = GetExpressionVal(valRight);
+                            if(fieldQueryValueType == "number")
                             {
-                                passCount += 1; passFlag = true;
+                                if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft)) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
+                                else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
+                                else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
                             }
-                            else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft))) 
+                            else if(fieldQueryValueType == "int")
                             {
-                                passCount += 1; passFlag = true;
+                                if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckNum(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft)) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
+                                else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
+                                else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
                             }
-                            else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                            else if(fieldQueryValueType.StartsWith("date"))
                             {
-                                passCount += 1; passFlag = true;
+                                if(valLeft == "0") valLeft = "";
+                                if(valRight == "0") valRight = "";
+                                if(checkObj != "0" && checkObj != "")
+                                {
+                                    if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj.ToString()) >= DateTime.Parse(GetExpressionVal(valLeft)) && DateTime.Parse(checkObj.ToString()) <= DateTime.Parse(GetExpressionVal(valRight))) 
+                                    {
+                                        passCount += 1; passFlag = true;
+                                    }
+                                    else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj.ToString()) >= DateTime.Parse(GetExpressionVal(valLeft))) 
+                                    {
+                                        passCount += 1; passFlag = true;
+                                    }
+                                    else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj.ToString()) <= DateTime.Parse(GetExpressionVal(valRight))) 
+                                    {
+                                        passCount += 1; passFlag = true;
+                                    }
+                                }
                             }
                         }
-                        else if(fieldQueryValueType.StartsWith("date"))
+                        else if(fieldQueryModel == "query_field")
                         {
-                            if(valLeft == "0") valLeft = "";
-                            if(valRight == "0") valRight = "";
-                            if(checkObj != "0" && checkObj != "")
+                            string checkValLeft = valLeft.Replace("#{", "").Replace("}#", "");
+                            string checkValRight = valRight.Replace("#{", "").Replace("}#", "");
+                            if(checkValLeft.Contains(",")) checkValLeft = checkValLeft.Split(',')[0];
+                            if(checkValRight.Contains(",")) checkValRight = checkValRight.Split(',')[0];
+                            if(!string.IsNullOrEmpty(valLeft)) valLeft = valLeft.Replace(checkValLeft, GetQueryTableData(condiDic, checkValLeft));
+                            if(!string.IsNullOrEmpty(valRight)) valRight = valRight.Replace(checkValRight, GetQueryTableData(condiDic, checkValRight));
+                            valLeft = GetExpressionVal(valLeft);
+                            valRight = GetExpressionVal(valRight);
+                            if(fieldQueryValueType == "number")
                             {
-                                if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj.ToString()) >= DateTime.Parse(GetExpressionVal(valLeft)) && DateTime.Parse(checkObj.ToString()) <= DateTime.Parse(GetExpressionVal(valRight))) 
+                                if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft)) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
                                 {
                                     passCount += 1; passFlag = true;
                                 }
-                                else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj.ToString()) >= DateTime.Parse(GetExpressionVal(valLeft))) 
+                                else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft))) 
                                 {
                                     passCount += 1; passFlag = true;
                                 }
-                                else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj.ToString()) <= DateTime.Parse(GetExpressionVal(valRight))) 
+                                else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
                                 {
                                     passCount += 1; passFlag = true;
                                 }
                             }
+                            else if(fieldQueryValueType == "int")
+                            {
+                                if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckNum(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft)) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
+                                else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
+                                else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                                {
+                                    passCount += 1; passFlag = true;
+                                }
+                            }
+                            else if(fieldQueryValueType.StartsWith("date"))
+                            {
+                                if(valLeft == "0") valLeft = "";
+                                if(valRight == "0") valRight = "";
+                                if(checkObj != "0" && checkObj != "")
+                                {
+                                    if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj.ToString()) >= DateTime.Parse(GetExpressionVal(valLeft)) && DateTime.Parse(checkObj.ToString()) <= DateTime.Parse(GetExpressionVal(valRight))) 
+                                    {
+                                        passCount += 1; passFlag = true;
+                                    }
+                                    else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj.ToString()) >= DateTime.Parse(GetExpressionVal(valLeft))) 
+                                    {
+                                        passCount += 1; passFlag = true;
+                                    }
+                                    else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj.ToString()) <= DateTime.Parse(GetExpressionVal(valRight))) 
+                                    {
+                                        passCount += 1; passFlag = true;
+                                    }
+                                }
+                            }
                         }
                     }
-                    else if(fieldQueryModel == "query_field")
+                    else if(fieldQueryKind == "4") //取反匹配
                     {
-                        string checkValLeft = valLeft.Replace("#{", "").Replace("}#", "");
-                        string checkValRight = valRight.Replace("#{", "").Replace("}#", "");
-                        if(checkValLeft.Contains(",")) checkValLeft = checkValLeft.Split(',')[0];
-                        if(checkValRight.Contains(",")) checkValRight = checkValRight.Split(',')[0];
-                        if(!string.IsNullOrEmpty(valLeft)) valLeft = valLeft.Replace(checkValLeft, GetQueryTableData(condiDic, checkValLeft));
-                        if(!string.IsNullOrEmpty(valRight)) valRight = valRight.Replace(checkValRight, GetQueryTableData(condiDic, checkValRight));
-                        valLeft = GetExpressionVal(valLeft);
-                        valRight = GetExpressionVal(valRight);
-                        if(fieldQueryValueType == "number")
+                        if(fieldQueryValueType == "int")
                         {
-                            if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft)) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
-                            {
-                                passCount += 1; passFlag = true;
-                            }
-                            else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft))) 
+                            if(int.Parse(Function.CheckNum(checkObj.ToString())) != int.Parse(Function.CheckInt(checkVal))) 
                             {
                                 passCount += 1; passFlag = true;
                             }
-                            else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight))) 
+                        }
+                        else if(fieldQueryValueType == "number")
+                        {
+                            if(decimal.Parse(Function.CheckNum(checkObj.ToString())) != decimal.Parse(Function.CheckNum(checkVal))) 
                             {
                                 passCount += 1; passFlag = true;
                             }
                         }
-                        else if(fieldQueryValueType == "int")
+                        else if(fieldQueryValueType == "text")
                         {
-                            if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckNum(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft)) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
+                            if(checkObj.ToString() != GetExpressionVal(checkVal)) 
                             {
                                 passCount += 1; passFlag = true;
                             }
-                            else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft))) 
+                        }
+                    }
+                    else if(fieldQueryKind == "5" || fieldQueryKind == "6") //数组匹配/排除
+                    {
+                        string val = ",";
+                        string[] valList = checkVal.Split(',');
+                        if(fieldQueryModel == "request_param")
+                        {
+                            Dictionary<string, string> req = getRequestParams(projectId, content);
+                            foreach(string subVal in valList)
                             {
-                                passCount += 1; passFlag = true;
-                            }
-                            else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight))) 
-                            {
-                                passCount += 1; passFlag = true;
+                                val += req[subVal] + ",";
                             }
                         }
-                        else if(fieldQueryValueType.StartsWith("date"))
+                        else if(fieldQueryModel == "fixed_value")
                         {
-                            if(valLeft == "0") valLeft = "";
-                            if(valRight == "0") valRight = "";
-                            if(checkObj != "0" && checkObj != "")
+                            foreach(string subVal in valList)
                             {
-                                if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj.ToString()) >= DateTime.Parse(GetExpressionVal(valLeft)) && DateTime.Parse(checkObj.ToString()) <= DateTime.Parse(GetExpressionVal(valRight))) 
-                                {
-                                    passCount += 1; passFlag = true;
-                                }
-                                else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj.ToString()) >= DateTime.Parse(GetExpressionVal(valLeft))) 
-                                {
-                                    passCount += 1; passFlag = true;
-                                }
-                                else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj.ToString()) <= DateTime.Parse(GetExpressionVal(valRight))) 
-                                {
-                                    passCount += 1; passFlag = true;
-                                }
+                                val += GetExpressionVal(subVal) + ",";
                             }
                         }
-                    }
-                }
-                else if(fieldQueryKind == "4") //取反匹配
-                {
-                    if(fieldQueryValueType == "int")
-                    {
-                        if(int.Parse(Function.CheckNum(checkObj.ToString())) != int.Parse(Function.CheckInt(checkVal))) 
+                        else if(fieldQueryModel == "db_field")
                         {
-                            passCount += 1; passFlag = true;
+                            foreach(string subVal in valList)
+                            {
+                                val += GetDbExpressionVal(subVal) + ",";
+                            }
                         }
-                    }
-                    else if(fieldQueryValueType == "number")
-                    {
-                        if(decimal.Parse(Function.CheckNum(checkObj.ToString())) != decimal.Parse(Function.CheckNum(checkVal))) 
+                        if (fieldQueryKind == "5" && val.Contains("," + checkObj.ToString() + ",")) 
                         {
                             passCount += 1; passFlag = true;
                         }
-                    }
-                    else if(fieldQueryValueType == "text")
-                    {
-                        if(checkObj.ToString() != GetExpressionVal(checkVal)) 
+                        if(fieldQueryKind == "6" && !val.Contains("," + checkObj.ToString() + ",")) 
                         {
                             passCount += 1; passFlag = true;
                         }
                     }
+
+                    // if(!sub.recursionFlag)
+                    // {
+                        logStepDic.Add("状态", passFlag ? "通过" : "未通过");
+                        logStepDics.Add(logStepDic);
+                    // }
                 }
-                else if(fieldQueryKind == "5" || fieldQueryKind == "6") //数组匹配/排除
-                {
-                    string val = ",";
-                    string[] valList = checkVal.Split(',');
-                    if(fieldQueryModel == "request_param")
-                    {
-                        Dictionary<string, string> req = getRequestParams(projectId, content);
-                        foreach(string subVal in valList)
-                        {
-                            val += req[subVal] + ",";
-                        }
-                    }
-                    else if(fieldQueryModel == "fixed_value")
-                    {
-                        foreach(string subVal in valList)
-                        {
-                            val += GetExpressionVal(subVal) + ",";
-                        }
-                    }
-                    else if(fieldQueryModel == "db_field")
-                    {
-                        foreach(string subVal in valList)
-                        {
-                            val += GetDbExpressionVal(subVal) + ",";
-                        }
-                    }
-                    if (fieldQueryKind == "5" && val.Contains("," + checkObj.ToString() + ",")) 
-                    {
-                        passCount += 1; passFlag = true;
-                    }
-                    if(fieldQueryKind == "6" && !val.Contains("," + checkObj.ToString() + ",")) 
-                    {
-                        passCount += 1; passFlag = true;
-                    }
-                }
+                setLogStep(sub.id, "匹配结果", logStepDics);
 
-                // if(!sub.recursionFlag)
-                // {
-                    logStepDic.Add("状态", passFlag ? "通过" : "未通过");
-                    logStepDics.Add(logStepDic);
-                // }
+                if(conditionMode == "all" && passCount == allCount && passCount > 0) op = true;
+                else if(conditionMode == "one" && passCount >= 1) op = true;
+                else if(conditionMode == "two" && passCount >= 2) op = true;
+                else if(conditionMode == "three" && passCount >= 3) op = true;
             }
-            setLogStep(sub.id, "匹配结果", logStepDics);
-            bool op = false;
             decimal prizeAmt = 0;
-            if(conditionMode == "all" && passCount == allCount && passCount > 0) op = true;
-            else if(conditionMode == "one" && passCount >= 1) op = true;
-            else if(conditionMode == "two" && passCount >= 2) op = true;
-            else if(conditionMode == "three" && passCount >= 3) op = true;
             setLogStep(sub.id, "是否通过", op ? "是" : "否");
             if(op) //满足条件
             {