lcl преди 2 месеца
родител
ревизия
d62de27103
променени са 4 файла, в които са добавени 25 реда и са изтрити 4 реда
  1. BIN
      .DS_Store
  2. 7 0
      Model/Database/PriProjectParam.cs
  3. 2 2
      Program.cs
  4. 16 2
      Util/PrizeDo.cs

BIN
.DS_Store


+ 7 - 0
Model/Database/PriProjectParam.cs

@@ -73,6 +73,13 @@ namespace Model
         public int projectId { get; set; }
 
 
+        /// <summary>
+        /// 查询索引字段
+        /// </summary>
+        [SugarColumn(ColumnDescription = "查询索引字段", Length = 100, ColumnName = "query_index")]
+        public string? queryIndex { get; set; }
+
+
 
     }
 }

+ 2 - 2
Program.cs

@@ -127,13 +127,13 @@ app.Urls.Add("http://*:5802");
 // PrizeDo.sendPrize(4, "{\"PosSn\":\"CS00000000015859\"}");
 // PrizeDo.sendPrize("QUEUE_KXS_HAODA_PRIZE_CONFIG_DIVISION", "{\"brand_id\":19,\"pos_sn\":\"00000102249QCQF02551\",\"user_id\":192332}");
 // PrizeDo.sendPrize(6, "{\"PosSn\":\"1152131239\"}");
-// PrizeDo.sendPrize("QUEUE_KXS_PRIZE_MALL_CONFIG_DIVISION", "{\"order_id\":602675,\"user_id\":264331}");
+// PrizeDo.sendPrize("QUEUE_KXS_PRIZE_MALL_CONFIG_DIVISION", "{\"order_id\":602763,\"user_id\":264331}");
 // PrizeDo.sendPrize(7, "{\"OrderNo\":\"BM2024090817330511847441249\"}");
 // PrizeDo.sendPrize(7, "{\"OrderNo\":\"BM2024090817360962275551251\"}");
 
 // PrizeDo.sendPrize("KXS_LEADER_STA_PRIZE", "{\"month\":\"202411\"}");
 
-// RabbitMQClient.Instance.Start();
+RabbitMQClient.Instance.Start();
 
 // CopyProject.Copy(5, 7);
 

+ 16 - 2
Util/PrizeDo.cs

@@ -102,6 +102,18 @@ namespace Util
             }
             return key;
         }
+        public static string getRequestParamsIndex(int projectId, string content)
+        {
+            string result = ",";
+            JsonData jsonData = JsonMapper.ToObject(content);
+            var paramService = App.GetService<IPriProjectParamService>();
+            var paramList = paramService.GetList(m => m.projectId == projectId && m.queryIndex == "1");
+            foreach(var param in paramList)
+            {
+                if(content.Contains("\"" + param.fieldEnName + "\"")) result += jsonData[param.fieldEnName].ToString() + ",";
+            }
+            return result;
+        }
 
         //数据库链接
         public static SqlSugarClient initDb(int id)
@@ -1095,7 +1107,7 @@ namespace Util
             var recursionStartTableService = App.GetService<IPriRecursionStartTableService>();
             var recursionStartConditionService = App.GetService<IPriRecursionStartConditionService>();
             Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-s1", "接收mq数据日志");
-            addLog(projectId, sub.id, prizeInId, content, queueName); //初始化日志
+            addLog(projectId, sub.id, prizeInId, content, queueName, content); //初始化日志
             Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-s2", "接收mq数据日志");
             string prizeObjectId = prizeObject(sub.id, sub.prizeObj, content);
             Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-s3", "接收mq数据日志");
@@ -2871,9 +2883,10 @@ namespace Util
         }
 
         //记录日志
-        public static void addLog(int projectId, int listId, int prizeIn, string requestParam, string prizeInUrl)
+        public static void addLog(int projectId, int listId, int prizeIn, string requestParam, string prizeInUrl, string content = "")
         {
             if(!logFlag) return;
+            
             var logService = App.GetService<IPriLogService>();
             logService.Add(new PriLog()
             {
@@ -2884,6 +2897,7 @@ namespace Util
                 prizeIn = prizeIn,
                 requestParam = requestParam,
                 prizeInUrl = prizeInUrl,
+                stepListIndex = getRequestParamsIndex(projectId, content), //获取参数索引字段值
             });
         }
         public static void setLogPrizeAmount(int listId, decimal prizeAmount)