Ver código fonte

修改逻辑

lcl 3 meses atrás
pai
commit
4a094ba6c5
2 arquivos alterados com 8 adições e 7 exclusões
  1. 1 1
      Program.cs
  2. 7 6
      Util/PrizeDo.cs

+ 1 - 1
Program.cs

@@ -127,7 +127,7 @@ app.Urls.Add("http://*:5802");
 // PrizeDo.sendPrize(4, "{\"PosSn\":\"CS00000000015859\"}");
 // PrizeDo.sendPrize(5, "{\"PosSn\":\"00000302T1NL90664172\"}");
 // PrizeDo.sendPrize(6, "{\"PosSn\":\"1152131239\"}");
-// PrizeDo.sendPrize("QUEUE_KXS_PRIZE_MALL_CONFIG_DIVISION", "{\"order_id\":319698}");
+// PrizeDo.sendPrize("QUEUE_KXS_PRIZE_MALL_CONFIG_DIVISION", "{\"order_id\":32,\"user_id\":212819}");
 // PrizeDo.sendPrize(7, "{\"OrderNo\":\"BM2024090817330511847441249\"}");
 // PrizeDo.sendPrize(7, "{\"OrderNo\":\"BM2024090817360962275551251\"}");
 

+ 7 - 6
Util/PrizeDo.cs

@@ -427,7 +427,7 @@ namespace Util
                             string field = column.ColumnName;
                             if(!dic.Any(m => m.FieldEnName == field)) dic.Add(new QueryCondition()
                             {
-                                FieldName = fieldDic[field],
+                                FieldName = field,
                                 FieldEnName = field,
                                 Value = items.Rows[0][field].ToString()
                             });
@@ -1868,7 +1868,7 @@ namespace Util
                         Dictionary<string, object> prizeItem = new Dictionary<string, object>();
                         prizeItem.Add("prize_date", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                         prizeItem.Add("prize_name", sub.prizeName);
-                        prizeItem.Add("prize_code", sub.prizeCode);
+                        prizeItem.Add("prize_code", prizeCode);
                         prizeItem.Add("batch_no", batchNo);
                         prizeItem.Add("request_param_field", content);
                         List<Dictionary<string, object>> prizeItemList = new List<Dictionary<string, object>>();
@@ -2541,10 +2541,11 @@ namespace Util
             foreach(Match m in mc)
             {
                 string matchValue = m.Value.Replace("${", "").Replace("}", "");
-                matchValue = getRequestParams(projectId, content, matchValue);
-                matchValue = GetQueryTableData(dic, matchValue);
-                matchValue = GetStartData(startData, matchValue);
-                str = str.Replace(m.Value, matchValue);
+                string val = "";
+                if(string.IsNullOrEmpty(val) || val == "0") val = getRequestParams(projectId, content, matchValue);
+                if(string.IsNullOrEmpty(val) || val == "0") val = GetQueryTableData(dic, matchValue);
+                if(string.IsNullOrEmpty(val) || val == "0") val = GetStartData(startData, matchValue);
+                str = str.Replace(m.Value, val);
             }
             return str;
         }