From 954ead41d9391bca28a3cc4f9592f73f25b3bbc8 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 02 一月 2023 17:55:06 +0800
Subject: [PATCH] '完善批量设置代码'

---
 app/JsonUtil.h |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/app/JsonUtil.h b/app/JsonUtil.h
index 9c409dd..ef9010a 100644
--- a/app/JsonUtil.h
+++ b/app/JsonUtil.h
@@ -72,18 +72,19 @@
 	}
 
 
-	static  std::string loadTradeQueueData(int clientID, int channel, string code, std::list<int> numList) {
+	static  std::string loadTradeQueueData(int clientID, int channel, string code, L2TradeQueue tradeQueue) {
 		Json::Value data;
 		data["channel"] = channel;
 		data["code"] = code;
 
 		Json::Value _data;
-
-		std::list<int>::iterator ele;
-		int index = 0;
-		for (ele = numList.begin();ele != numList.end();ele++) {
-			_data[index++] = *ele;
-		}
+		_data["buyOnePrice"] = tradeQueue.buyOnePrice;
+		_data["buyOneVolumn"] = tradeQueue.buyOneVolumn;
+		_data["buyTime"] = tradeQueue.buyTime;
+		_data["sellOnePrice"] = tradeQueue.sellOnePrice;
+		_data["sellOneVolumn"] = tradeQueue.sellOneVolumn;
+		_data["sellTime"] = tradeQueue.sellTime;
+		
 		data["data"] = _data;
 		Json::Value root;
 		root["type"] = 10;
@@ -160,6 +161,7 @@
 			Json::Value  item;
 			item["code"] = (*ele).code;
 			item["time"] = (*ele).time;
+			item["apply_time"] = (*ele).apply_time;
 			item["num"] = (*ele).num;
 			item["type"] = (*ele).type;
 			item["price"] = (*ele).price;
@@ -223,7 +225,7 @@
 	}
 
 
-	static  std::string loadGPCodeData(std::list<IndustryData> codeList) {
+	static  std::string loadGPCodeData(std::list<IndustryData> codeList,bool add) {
 		Json::Value root;
 		root["type"] = 1;
 		Json::Value data;
@@ -238,6 +240,7 @@
 			data[index++] = item;
 		}
 		root["data"] = data;
+		root["add"] = add;
 		return toJsonStr(root);
 	}
 
@@ -292,6 +295,17 @@
 		return toJsonStr(root);
 	}
 
+
+	// 自动启动L2成功
+	static  std::string loadAutoStartL2(int client) {
+		Json::Value root;
+		root["type"] = 60;
+		Json::Value data;
+		data["client"] = client;
+		root["data"] = data;
+		return toJsonStr(root);
+	}
+
 	static std::string toJson(ClientEnvState state) {
 		Json::Value root;
 		root["ths_l2_win"] = state.ths_l2_win;

--
Gitblit v1.8.0