فهرست منبع

先屏蔽奖励入库程序

lcl 7 ماه پیش
والد
کامیت
6b3bfe9e21
5فایلهای تغییر یافته به همراه16 افزوده شده و 7 حذف شده
  1. 2 1
      .gitignore
  2. 3 4
      Common/RabbitMQClient.cs
  3. 9 0
      Model/Customer/QueryCondition.cs
  4. 1 1
      Program.cs
  5. 1 1
      Util/PrizeDo.cs

+ 2 - 1
.gitignore

@@ -1,4 +1,5 @@
 /bin
 /publish
 /obj
-/appsettings.json
+/appsettings.json
+.DS_Store

+ 3 - 4
Common/RabbitMQClient.cs

@@ -63,19 +63,18 @@ namespace MySystem
             EventingBasicConsumer consumer = new EventingBasicConsumer(channel);
             consumer.Received += (a, e) =>
             {
+                string MsgContent = Encoding.Default.GetString(e.Body.ToArray());
                 try
                 {
-                    string MsgContent = Encoding.Default.GetString(e.Body.ToArray());
                     Function.WriteLog(DateTime.Now.ToString() + "-" + MsgContent, "接收mq数据队列");
                     PrizeDo.sendPrize(MsgContent);
                     Function.WriteLog(DateTime.Now.ToString() + "-end", "接收mq数据队列");
-                    channel.BasicAck(e.DeliveryTag, false); //收到回复后,RabbitMQ会直接在队列中删除这条消息
-                    Function.WriteLog(DateTime.Now.ToString() + "-BasicAck\n\n", "接收mq数据队列");
                 }
                 catch(Exception ex)
                 {
-                    Function.WriteLog(DateTime.Now + "\n" + ex.ToString(), "发奖异常");
+                    Function.WriteLog(DateTime.Now + "\n" + ex.ToString() + "\n" + MsgContent, "发奖异常");
                 }
+                channel.BasicAck(e.DeliveryTag, false); //收到回复后,RabbitMQ会直接在队列中删除这条消息
             };
             channel.BasicConsume(QueueName, false, consumer);
         }

+ 9 - 0
Model/Customer/QueryCondition.cs

@@ -0,0 +1,9 @@
+namespace Model.Customer
+{
+    public class QueryCondition
+    {
+        public string FieldName { get; set; }
+        public string FieldEnName { get; set; }
+        public object Value { get; set; }
+    }
+}

+ 1 - 1
Program.cs

@@ -129,7 +129,7 @@ app.MapControllers();
 // PrizeDo.sendPrize(7, "{\"OrderNo\":\"BM2024090817330511847441249\"}");
 // PrizeDo.sendPrize(7, "{\"OrderNo\":\"BM2024090817360962275551251\"}");
 
-RabbitMQClient.Instance.StartReceive("PRIZE_SEND_QUEUE", "PRIZE_SEND_QUEUE", "/");
+// RabbitMQClient.Instance.StartReceive("PRIZE_SEND_QUEUE", "PRIZE_SEND_QUEUE", "/");
 
 // PrizeDo.sendPrize("{\"prize_tag\":\"1\",\"content\":\"{\\\"PosSn\\\":\\\"00002402045980195457\\\"}\"}");
 

+ 1 - 1
Util/PrizeDo.cs

@@ -1007,7 +1007,7 @@ namespace Util
                             batchNo = batchNo,
                         });
                         loopAmount = getPrizeAmount;
-                        prizeToDatabase(projectId, sub.id, content); //入库
+                        // prizeToDatabase(projectId, sub.id, content); //入库
                     }
                 }
             }