| | |
| | | // Excel上传股票代码 |
| | | void CappDlg::OnBnClickedButtonUploadExcelCode() |
| | | { |
| | | CString cpath = GUITool::selectImage(); |
| | | std:string path = Tool::cstring2String(cpath); |
| | | CString cpath = GUITool::selectExcel(); |
| | | std:string path = Tool::cstring2String(cpath); |
| | | if (path.length() > 0) |
| | | { |
| | | ExcelUtil::read(path); |
| | | std::list<IndustryData> fresult; |
| | | list<ExcelGPCodeInfo> codesList = ExcelUtil::readGPCodes(path); |
| | | list<ExcelGPCodeInfo>::iterator ele; |
| | | for (ele = codesList.begin();ele != codesList.end();++ele) { |
| | | ExcelGPCodeInfo info= *ele; |
| | | IndustryData finfo; |
| | | if (info.code.length()>0) |
| | | { |
| | | |
| | | finfo.code = info.code.replace(0, 2, ""); |
| | | if (info.zyltgb.find("亿",0) > 0) { |
| | | finfo.zyltMoneyUnit = MONEY_UNIT_Y; |
| | | string zyltgb = info.zyltgb; |
| | | finfo.zyltMoney = zyltgb.substr(0, zyltgb.length()-2); |
| | | } |
| | | else if (info.zyltgb.find("万",0) > 0) { |
| | | finfo.zyltMoneyUnit = MONEY_UNIT_W; |
| | | string zyltgb = info.zyltgb; |
| | | finfo.zyltMoney = zyltgb.substr(0, zyltgb.length() - 2); |
| | | } |
| | | else { |
| | | finfo.zyltMoneyUnit = MONEY_UNIT_NO; |
| | | finfo.zyltMoney = info.zyltgb; |
| | | } |
| | | fresult.push_back(finfo); |
| | | } |
| | | } |
| | | codesDataDlog::codeData = fresult; |
| | | codesDataDlog::upload = TRUE; |
| | | codesDataDlog dlg; |
| | | dlg.DoModal(); |
| | | } |
| | | |
| | | |