| | |
| | | if (kill) { |
| | | break; |
| | | } |
| | | dlg->taskUpdateTimeMap[REQUEST_TASK_L2_SUBSCRIPT] = TimeUtil::getNowTime(); |
| | | |
| | | try { |
| | | SubscriptCodesResult result = NetworkApi::get_huaxin_subscript_codes(); |
| | | if (result.codeInfos.size() > 0) { |
| | |
| | | } |
| | | |
| | | try { |
| | | dlg->taskUpdateTimeMap[REQUEST_TASK_ENV] = TimeUtil::getNowTime(); |
| | | |
| | | string result = NetworkApi::get_env_status(); |
| | | CString st = L""; |
| | |
| | | if (doc.IsObject()) { |
| | | if (doc[L"code"] == 0) { |
| | | auto data = doc[L"data"].GetObjectW(); |
| | | if (data[L"juejin"].GetInt() == 1) { |
| | | if (data.HasMember(L"juejin")&&data[L"juejin"].GetInt() == 1) { |
| | | dlg->labelColors[IDC_STATIC_JUEJIN_STATE] = RGB(0, 0, 0); |
| | | dlg->labelJueJinState.SetWindowTextW(L"正常"); |
| | | } |
| | |
| | | if (kill) { |
| | | break; |
| | | } |
| | | if (dlg->checkAutoPullLogs.GetCheck()) { |
| | | try { |
| | | string result = NetworkApi::list_system_log(dlg->logStartIndex, 20); |
| | | cout << result << endl; |
| | |
| | | catch (...) { |
| | | |
| | | |
| | | } |
| | | } |
| | | // 每1s请求一次 |
| | | Sleep(2000); |
| | |
| | | DDX_Control(pDX, IDC_BUTTON_SEARCH, btnSearch); |
| | | DDX_Control(pDX, IDC_STATIC_TODAY_K_BARS_COUNT, labelTodayKBarsCount); |
| | | DDX_Control(pDX, IDC_STATIC_DATA_SERVER_STATE, labelDataServerState); |
| | | DDX_Control(pDX, IDC_CHECK_READ_LOGS, checkAutoPullLogs); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | void MonitorDlg::OnBnClickedButtonSyncShszCodes() |
| | | { |
| | | CString msg = L""; |
| | | string result = NetworkApi::sync_l1_subscript_codes(); |
| | | auto resultDoc = JsonUtil::parseUTF8(result); |
| | | if (resultDoc.IsObject() && resultDoc["code"].GetInt() == 0) { |
| | | int count = resultDoc["data"]["codes_sh"].GetInt() + resultDoc["data"]["codes_sz"].GetInt(); |
| | | CString msg; |
| | | msg.Append(L"更新成功,代码总数:"); |
| | | msg.Append(L"L1代码更新:成功,代码总数:"); |
| | | msg.Append(std::to_wstring(count).c_str()); |
| | | MessageBox(msg, L"提示"); |
| | | } |
| | | else { |
| | | AfxMessageBox(L"更新失败"); |
| | | msg.Append(L"L1代码更新:失败\n"); |
| | | } |
| | | |
| | | result = NetworkApi::sync_radical_buy_special_codes(); |
| | | auto doc = JsonUtil::parseUTF16(result); |
| | | if (doc.IsObject() && doc[L"code"].GetInt() == 0) { |
| | | msg.Append(L"扫入辨识度代码更新:成功,"); |
| | | msg.Append(doc[L"msg"].GetString()); |
| | | } |
| | | else { |
| | | msg.Append(L"扫入辨识度代码更新:失败\n"); |
| | | } |
| | | MessageBox(msg, L"提示"); |
| | | } |
| | | |
| | | |