DlgCloundResult.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. // DlgCloundResult.cpp : 实现文件
  2. //
  3. #include "stdafx.h"
  4. #include "YLGL.h"
  5. #include "DlgCloundResult.h"
  6. // CDlgCloundResult 对话框
  7. IMPLEMENT_DYNAMIC(CDlgCloundResult, CDialog)
  8. CDlgCloundResult::CDlgCloundResult(CWnd* pParent /*=NULL*/)
  9. : CDialog(CDlgCloundResult::IDD, pParent)
  10. {
  11. m_pList = NULL;
  12. m_nSelItem = -1;
  13. m_nAdd = 0;
  14. m_nCloundType = 0;
  15. }
  16. CDlgCloundResult::~CDlgCloundResult()
  17. {
  18. }
  19. void CDlgCloundResult::DoDataExchange(CDataExchange* pDX)
  20. {
  21. CDialog::DoDataExchange(pDX);
  22. DDX_Control(pDX, IDC_LIST2, m_SortList);
  23. DDX_Control(pDX, IDC_COMBO1, m_ctrlCombox);
  24. }
  25. BEGIN_MESSAGE_MAP(CDlgCloundResult, CDialog)
  26. ON_BN_CLICKED(BTN_DOWNRESULT, OnBnClickedDownresult)
  27. ON_BN_CLICKED(BTN_SYNRESULT, OnBnClickedSynresult)
  28. ON_BN_CLICKED(BTN_EXPORTXLS, OnBnClickedExportxls)
  29. ON_BN_CLICKED(BTN_QUERY, OnBnClickedQuery)
  30. ON_BN_CLICKED(BTN_CLEAN, OnBnClickedClean)
  31. END_MESSAGE_MAP()
  32. // CDlgCloundResult 消息处理程序
  33. BOOL CDlgCloundResult::OnInitDialog()
  34. {
  35. CDialog::OnInitDialog();
  36. // TODO: 在此添加额外的初始化
  37. InitListCtrl();
  38. //GetCloundResult();
  39. return TRUE; // return TRUE unless you set the focus to a control
  40. // 异常: OCX 属性页应返回 FALSE
  41. }
  42. void CDlgCloundResult::InitListCtrl()
  43. {
  44. if ( m_nCloundType == 0 )
  45. m_SortList.SetHeadings("订单号,100;顾客1,100;顾客2,100;商品ID,100;商品名称,100;选片日期,100;相片,100;云选状态,100;" );
  46. else
  47. m_SortList.SetHeadings("订单号,100;顾客1,100;顾客2,100;选样日期,100;要求,100;" );
  48. m_SortList.m_bSortSupport = TRUE;
  49. m_SortList.LoadColumnInfo(1002);
  50. }
  51. void CDlgCloundResult::UpdateDataSortList(vector<lyfzLibrary::STOrdJson>& vtOrdJson)
  52. {
  53. m_SortList.DeleteAllItems2();
  54. int nSize = 0;
  55. // 解析出Json内容;
  56. int i = 0;
  57. vector<lyfzLibrary::STOrdJson>::iterator it = vtOrdJson.begin();
  58. for ( ; it != vtOrdJson.end(); it++ )
  59. {
  60. nSize += it->vtSpJson.size();
  61. }
  62. //CArray<CStringArray,CStringArray> AryCloundResult;
  63. m_AryCloundResult.RemoveAll();
  64. m_AryCloundResult.SetSize(nSize, 1);
  65. m_SortList.m_arLabels.SetSize(nSize,1);
  66. for ( it = vtOrdJson.begin(); it != vtOrdJson.end(); it++ )
  67. {
  68. vector<lyfzLibrary::STSpJson>::iterator iit;
  69. for ( iit = it->vtSpJson.begin(); iit != it->vtSpJson.end(); iit++ )
  70. {
  71. m_AryCloundResult.ElementAt(i).RemoveAll();
  72. m_AryCloundResult.ElementAt(i).Add(it->strorder); // 0.订单号;
  73. m_AryCloundResult.ElementAt(i).Add(it->strCustomer1); // 1.顾客1;
  74. m_AryCloundResult.ElementAt(i).Add(it->strCustomer2); // 2.顾客2;
  75. m_AryCloundResult.ElementAt(i).Add(iit->strSpId); // 3.商品ID;
  76. m_AryCloundResult.ElementAt(i).Add(iit->strSpName); // 4.商品名称;
  77. m_AryCloundResult.ElementAt(i).Add(it->strXPDate); // 5.选片日期;
  78. m_AryCloundResult.ElementAt(i).Add(iit->strImgs); // 6.商品相片串;
  79. m_AryCloundResult.ElementAt(i).Add(it->strXPStatus2); // 7.选片状态;
  80. m_AryCloundResult.ElementAt(i).Add(it->strCust1PY); // 8.顾客1拼音;
  81. m_AryCloundResult.ElementAt(i).Add(it->strCust2PY); // 9.顾客1拼音;
  82. i++;
  83. }
  84. }
  85. //AryCloundResult.SetSize(i,1);
  86. int nIndex = 0;
  87. for ( i = 0; i < nSize; i++)
  88. {
  89. m_SortList.m_arLabels.ElementAt(i).Copy(m_AryCloundResult.ElementAt(i));
  90. }
  91. m_SortList.m_arLabels.SetSize(nSize, 1);
  92. m_SortList.m_LabelCount = nSize;
  93. m_SortList.SetItemCountEx(nSize);
  94. }
  95. void CDlgCloundResult::UpdateDataSortList2(IN vector<lyfzLibrary::STXYJson>& vtXYJson)
  96. {
  97. m_SortList.DeleteAllItems2();
  98. int nSize = vtXYJson.size();
  99. int i = 0;
  100. m_AryCloundResult.RemoveAll();
  101. m_AryCloundResult.SetSize(nSize, 1);
  102. m_SortList.m_arLabels.SetSize(nSize,1);
  103. vector<lyfzLibrary::STXYJson>::iterator it;
  104. for ( it = vtXYJson.begin(); it != vtXYJson.end(); it++ )
  105. {
  106. m_AryCloundResult.ElementAt(i).RemoveAll();
  107. m_AryCloundResult.ElementAt(i).Add(it->strorder); // 0.订单号;
  108. m_AryCloundResult.ElementAt(i).Add(it->strCustomer1); // 1.顾客1;
  109. m_AryCloundResult.ElementAt(i).Add(it->strCustomer2); // 2.顾客2;
  110. m_AryCloundResult.ElementAt(i).Add(it->strXYDate); // 3.选样日期;
  111. m_AryCloundResult.ElementAt(i).Add(it->strJsonResult); // 4.要求;
  112. m_AryCloundResult.ElementAt(i).Add(it->strSJStatus); // 5.设计状态;
  113. m_AryCloundResult.ElementAt(i).Add(it->strCust1PY); // 6.拼音1;
  114. m_AryCloundResult.ElementAt(i).Add(it->strCust2PY); // 7.拼音2;
  115. i++;
  116. }
  117. //AryCloundResult.SetSize(i,1);
  118. int nIndex = 0;
  119. for ( i = 0; i < nSize; i++)
  120. {
  121. m_SortList.m_arLabels.ElementAt(i).Copy(m_AryCloundResult.ElementAt(i));
  122. }
  123. m_SortList.m_arLabels.SetSize(nSize, 1);
  124. m_SortList.m_LabelCount = nSize;
  125. m_SortList.SetItemCountEx(nSize);
  126. }
  127. void CDlgCloundResult::GetCloundResult()
  128. {
  129. if ( m_pList == NULL )
  130. return;
  131. m_AryCloundInfo.SetSize(m_pList->m_arLabels.GetSize(),1);
  132. if ( m_nCloundType == 0 )
  133. {
  134. int i = 0;
  135. for ( i = 0; i < m_pList->m_arLabels.GetSize(); i++ )
  136. {
  137. // 取出生成云链接的订单;
  138. m_AryCloundInfo.ElementAt(i).RemoveAll();
  139. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(0)); // 0.订单号;
  140. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(1)); // 1.顾客1;
  141. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(2)); // 2.顾客2;
  142. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(19)); // 3.云地址;
  143. m_AryCloundInfo.ElementAt(i).Add(_T("")); // 4.用于存放选片结果,暂时置空;
  144. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(17)); // 5.顾客1拼音;
  145. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(18)); // 6.顾客2拼音;
  146. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(5)); // 7.选片状态;
  147. }
  148. INT nIndex = 0;
  149. CString strTemp = g_branchname.IsEmpty() ? g_domain : g_branchname;
  150. if ( ( nIndex = strTemp.Find(_T(".ly.com"))) == -1)
  151. {
  152. AfxMessageBox(_T("域名无效!"));
  153. return;
  154. }
  155. strTemp = strTemp.Left(nIndex);
  156. CString strBranchId = strTemp.Right(6);
  157. // 获取云选片结果;
  158. CString strUniqueId = _T("");
  159. vector<lyfzLibrary::STOrdJson> vtOrdJson;
  160. if ( lyfzLibrary::LoadCloudSelectionLib() )
  161. {
  162. nIndex = 0;
  163. TCHAR szResultValue[8912] = {0};
  164. for ( i = 0; i < m_AryCloundInfo.GetSize(); i++ )
  165. {
  166. strUniqueId.Format(_T("%s_A_%s_0"), strBranchId, m_AryCloundInfo.ElementAt(i).ElementAt(0));
  167. if ( ( nIndex = m_AryCloundInfo.ElementAt(i).ElementAt(3).Find(lyfzLibrary::g_strCloundHost)) != -1)
  168. {
  169. lyfzLibrary::STOrdJson tagOrdJson;
  170. strTemp = m_AryCloundInfo.ElementAt(i).ElementAt(3).Mid(lyfzLibrary::g_strCloundHost.GetLength() + nIndex);
  171. lyfzLibrary::g_getcloundresult(0, strUniqueId, strTemp, szResultValue, 8912);
  172. m_AryCloundInfo.ElementAt(i).SetAt(4, szResultValue);
  173. // 解析Json;
  174. tagOrdJson.strorder = m_AryCloundInfo.ElementAt(i).ElementAt(0);
  175. tagOrdJson.strCustomer1 = m_AryCloundInfo.ElementAt(i).ElementAt(1);
  176. tagOrdJson.strCustomer2 = m_AryCloundInfo.ElementAt(i).ElementAt(2);
  177. tagOrdJson.strCust1PY = m_AryCloundInfo.ElementAt(i).ElementAt(5);
  178. tagOrdJson.strCust1PY = m_AryCloundInfo.ElementAt(i).ElementAt(6);
  179. tagOrdJson.strXPStatus = m_AryCloundInfo.ElementAt(i).ElementAt(7);
  180. // 云选状态;
  181. strTemp = szResultValue;
  182. if ( (nIndex = strTemp.Find("\"order_status\": ")) != -1 )
  183. {
  184. tagOrdJson.strXPStatus2 = strTemp.Mid(nIndex + strlen("\"order_status\": "),1);
  185. if ( tagOrdJson.strXPStatus2 == "1" )
  186. tagOrdJson.strXPStatus2 = "顾客确认完成云选";
  187. else
  188. tagOrdJson.strXPStatus2 = "顾客未完成云选";
  189. }
  190. // 日期;
  191. strTemp = szResultValue;
  192. if ( (nIndex = strTemp.Find(_T(", \"last_modify_time\": "))) != -1 )
  193. {
  194. tagOrdJson.strXPDate = strTemp.Mid(nIndex+strlen(_T(", \"last_modify_time\": ")));
  195. tagOrdJson.strXPDate.TrimRight(_T("\""));
  196. tagOrdJson.strXPDate.TrimLeft(_T("\""));
  197. strTemp = strTemp.Left(nIndex);
  198. if ( ( nIndex = strTemp.Find(_T("\"pick_list\": ["))) != -1 )
  199. {
  200. strTemp = strTemp.Mid(nIndex + strlen(_T("\"pick_list\": [")));
  201. strTemp = strTemp.Mid(0, strTemp.GetLength() - 1);
  202. sprintf(szResultValue, _T("%s"), strTemp);
  203. }
  204. }
  205. lyfzLibrary::getXPJsonresult(szResultValue,tagOrdJson.vtSpJson);
  206. vtOrdJson.push_back(tagOrdJson);
  207. }
  208. }
  209. lyfzLibrary::FreeCloudSelectionLib();
  210. }
  211. #if 0
  212. // 获取数据库保存的云数据;
  213. g_sendhead.bsql = 0;
  214. g_sendhead.code[0] = 241;
  215. g_sendhead.tabcount = 1;
  216. CString strFilter = _T("CloundType = 0");
  217. CArray<CStringArray, CStringArray> AryCloundInfo;
  218. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  219. if ( !g_bSendOK )
  220. return;
  221. DataToArray(&AryCloundInfo);
  222. // 显示并同步结果;
  223. int j = 0;
  224. BOOL bExist = FALSE;
  225. CString strSQL = _T("");
  226. for ( i = 0; i < AryCloundOrder.GetSize(); i++ )
  227. {
  228. if ( AryCloundOrder.ElementAt(i).ElementAt(2).IsEmpty() )
  229. continue;
  230. bExist = FALSE;
  231. for ( j = 0; j < AryCloundInfo.GetSize(); j++ )
  232. {
  233. if ( AryCloundOrder.ElementAt(i).ElementAt(0) == AryCloundInfo.ElementAt(j).ElementAt(0) )
  234. bExist = TRUE;
  235. }
  236. if ( bExist )
  237. {
  238. if ( AryCloundOrder.ElementAt(i).ElementAt(2) == AryCloundInfo.ElementAt(j-1).ElementAt(4) )
  239. continue;
  240. strSQL.Format(_T("update [CloundSelection] set [ResultJson] = '%s' where [order] = '%s'"), AryCloundOrder.ElementAt(i).ElementAt(0), AryCloundOrder.ElementAt(i).ElementAt(2));
  241. }
  242. else
  243. strSQL.Format(_T("insert into [CloundSelection]( [order], [CloundType], [ResultJson]) values('%s', 0, '%s') "), AryCloundOrder.ElementAt(i).ElementAt(0), AryCloundOrder.ElementAt(i).ElementAt(2));
  244. g_sendhead.bsql = true;
  245. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  246. }
  247. #endif
  248. UpdateDataSortList(vtOrdJson);
  249. }
  250. else
  251. {
  252. int i = 0;
  253. for ( i = 0; i < m_pList->m_arLabels.GetSize(); i++ )
  254. {
  255. // 取出生成云链接的订单;
  256. m_AryCloundInfo.ElementAt(i).RemoveAll();
  257. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(0 + m_nAdd)); // 0.订单号;
  258. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(1 + m_nAdd)); // 1.顾客1;
  259. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(2 + m_nAdd)); // 2.顾客2;
  260. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(21 + m_nAdd)); // 3.云地址;
  261. m_AryCloundInfo.ElementAt(i).Add(_T("")); // 4.用于存放选片结果,暂时置空;
  262. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(19 + m_nAdd)); // 5.顾客1拼音;
  263. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(20 + m_nAdd)); // 6.顾客2拼音;
  264. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(5 + m_nAdd)); // 7.设计状态;
  265. }
  266. INT nIndex = 0;
  267. CString strTemp = g_branchname.IsEmpty() ? g_domain : g_branchname;
  268. if ( ( nIndex = strTemp.Find(_T(".ly.com"))) == -1)
  269. {
  270. AfxMessageBox(_T("域名无效!"));
  271. return;
  272. }
  273. strTemp = strTemp.Left(nIndex);
  274. CString strBranchId = strTemp.Right(6);
  275. // 获取云选片结果;
  276. CString strUniqueId = _T("");
  277. vector<lyfzLibrary::STXYJson> vtXYJson;
  278. if ( lyfzLibrary::LoadCloudSelectionLib() )
  279. {
  280. nIndex = 0;
  281. TCHAR szResultValue[8912] = {0};
  282. for ( i = 0; i < m_AryCloundInfo.GetSize(); i++ )
  283. {
  284. strUniqueId.Format(_T("%s_A_%s_1"), strBranchId, m_AryCloundInfo.ElementAt(i).ElementAt(0));
  285. if ( ( nIndex = m_AryCloundInfo.ElementAt(i).ElementAt(3).Find(lyfzLibrary::g_strCloundHost)) != -1)
  286. {
  287. lyfzLibrary::STXYJson tagXYJson;
  288. strTemp = m_AryCloundInfo.ElementAt(i).ElementAt(3).Mid(lyfzLibrary::g_strCloundHost.GetLength() + nIndex);
  289. lyfzLibrary::g_getcloundresult(m_nCloundType, strUniqueId, strTemp, szResultValue, 8912);
  290. m_AryCloundInfo.ElementAt(i).SetAt(4, szResultValue);
  291. // 解析Json;
  292. tagXYJson.strorder = m_AryCloundInfo.ElementAt(i).ElementAt(0);
  293. tagXYJson.strCustomer1 = m_AryCloundInfo.ElementAt(i).ElementAt(1);
  294. tagXYJson.strCustomer2 = m_AryCloundInfo.ElementAt(i).ElementAt(2);
  295. tagXYJson.strCust1PY = m_AryCloundInfo.ElementAt(i).ElementAt(5);
  296. tagXYJson.strCust2PY = m_AryCloundInfo.ElementAt(i).ElementAt(6);
  297. tagXYJson.strSJStatus = m_AryCloundInfo.ElementAt(i).ElementAt(7);
  298. strTemp = szResultValue;
  299. if ( (nIndex = strTemp.Find(_T(", \"last_modify_time\": "))) != -1 )
  300. {
  301. tagXYJson.strXYDate = strTemp.Mid(nIndex+strlen(_T(", \"last_modify_time\": ")));
  302. tagXYJson.strXYDate.TrimRight(_T("\""));
  303. tagXYJson.strXYDate.TrimLeft(_T("\""));
  304. strTemp = strTemp.Left(nIndex);
  305. if ( ( nIndex = strTemp.Find(_T("\"pick_list\": ["))) != -1 )
  306. {
  307. strTemp = strTemp.Mid(nIndex + strlen(_T("\"pick_list\": [")));
  308. strTemp = strTemp.Mid(0, strTemp.GetLength() - 1);
  309. sprintf(szResultValue, _T("%s"), strTemp);
  310. }
  311. }
  312. lyfzLibrary::getXYJsonresult(szResultValue,tagXYJson.strJsonResult);
  313. vtXYJson.push_back(tagXYJson);
  314. }
  315. }
  316. lyfzLibrary::FreeCloudSelectionLib();
  317. }
  318. UpdateDataSortList2(vtXYJson);
  319. }
  320. }
  321. void CDlgCloundResult::OnBnClickedDownresult() // 下载结果;
  322. {
  323. // TODO: 在此添加控件通知处理程序代码
  324. GetCloundResult();
  325. }
  326. void CDlgCloundResult::OnBnClickedSynresult() // 同步结果;
  327. {
  328. // TODO: 在此添加控件通知处理程序代码
  329. POSITION pos = m_SortList.GetFirstSelectedItemPosition();
  330. if ( pos == NULL )
  331. {
  332. AfxMessageBox(_T("请选择要同步的记录"));
  333. return;
  334. }
  335. if ( MessageBox(_T("同步后将覆盖店内选片结果,是否继续?"), _T("温馨提示!"), MB_ICONWARNING|MB_YESNO) != MB_CANCELTRYCONTINUE )
  336. {
  337. return;
  338. }
  339. INT nItem = 0;
  340. CString strSQL = _T("");
  341. CString strOrder = _T("");
  342. if ( m_nCloundType == 0 )
  343. {
  344. CString strSpId = _T("");
  345. CString strNo = _T("");
  346. while ( pos )
  347. {
  348. nItem = m_SortList.GetNextSelectedItem(pos);
  349. strOrder = m_SortList.GetItemText(nItem, 0);
  350. strSpId = m_SortList.GetItemText(nItem,3);
  351. strNo = m_SortList.GetItemText(nItem, 6);
  352. strSQL.Format(_T("update dindansp set no = '%s' where id = '%s' and [spid] = '%s'"), strNo, strOrder, strSpId);
  353. g_sendhead.bsql = true;
  354. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  355. }
  356. }
  357. else
  358. {
  359. CString strbz2 = _T("");
  360. while ( pos )
  361. {
  362. nItem = m_SortList.GetNextSelectedItem(pos);
  363. strOrder = m_SortList.GetItemText(nItem, 0);
  364. strbz2 = m_SortList.GetItemText(nItem,4);
  365. strSQL.Format(_T("update dindan set bz2 = '%s' where id = '%s' "), strbz2, strOrder);
  366. g_sendhead.bsql = true;
  367. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  368. }
  369. }
  370. }
  371. void CDlgCloundResult::OnBnClickedExportxls() // 导出xls;
  372. {
  373. // TODO: 在此添加控件通知处理程序代码
  374. ListToXLS(&m_SortList, _T("C:\\云选片结果.xls"), 0);
  375. }
  376. void CDlgCloundResult::FillUpList(IN CString& strQuery)
  377. {
  378. INT nSize = m_AryCloundResult.GetSize();
  379. m_SortList.DeleteAllItems2();
  380. m_SortList.m_arLabels.SetSize(nSize);
  381. if ( m_nCloundType == 0 )
  382. {
  383. if ( strQuery.IsEmpty() )
  384. {
  385. for ( int i = 0; i < nSize; i++)
  386. {
  387. m_SortList.m_arLabels.ElementAt(i).Copy(m_AryCloundResult.ElementAt(i));
  388. }
  389. m_SortList.m_LabelCount = nSize;
  390. m_SortList.SetItemCountEx(nSize);
  391. }
  392. else
  393. {
  394. int j = 0;
  395. int nType = GetType(strQuery);
  396. if ( nType == 2 ) // 拼音;
  397. {
  398. strQuery.MakeUpper();
  399. for ( int i = 0; i < nSize; i++ )
  400. {
  401. if ( m_AryCloundResult.ElementAt(i).ElementAt(7).Find(strQuery) != -1 || m_AryCloundResult.ElementAt(i).ElementAt(8).Find(strQuery) != -1 )
  402. {
  403. m_SortList.m_arLabels.ElementAt(j++).Copy(m_AryCloundResult.ElementAt(i));
  404. }
  405. }
  406. }
  407. else // 其他;
  408. {
  409. for ( int i = 0; i < nSize; i++ )
  410. {
  411. if ( m_AryCloundResult.ElementAt(i).ElementAt(0).Find(strQuery) != -1 || // 订单号;
  412. m_AryCloundResult.ElementAt(i).ElementAt(1).Find(strQuery) != -1 || // 姓名1;
  413. m_AryCloundResult.ElementAt(i).ElementAt(2).Find(strQuery) != -1 || // 姓名2;
  414. m_AryCloundResult.ElementAt(i).ElementAt(3).Find(strQuery) != -1 || // 商品ID;
  415. m_AryCloundResult.ElementAt(i).ElementAt(4).Find(strQuery) != -1 || // 商品名称;
  416. m_AryCloundResult.ElementAt(i).ElementAt(5).Find(strQuery) != -1 || // 日期;
  417. m_AryCloundResult.ElementAt(i).ElementAt(6).Find(strQuery) != -1 // 相片串;
  418. )
  419. {
  420. m_SortList.m_arLabels.ElementAt(j++).Copy(m_AryCloundResult.ElementAt(i));
  421. }
  422. }
  423. }
  424. m_SortList.m_arLabels.SetSize(j,1);
  425. m_SortList.m_LabelCount = j;
  426. m_SortList.SetItemCountEx(j);
  427. }
  428. }
  429. else
  430. {
  431. if ( strQuery.IsEmpty() )
  432. {
  433. for ( int i = 0; i < nSize; i++)
  434. {
  435. m_SortList.m_arLabels.ElementAt(i).Copy(m_AryCloundResult.ElementAt(i));
  436. }
  437. m_SortList.m_LabelCount = nSize;
  438. m_SortList.SetItemCountEx(nSize);
  439. }
  440. else
  441. {
  442. int j = 0;
  443. int nType = GetType(strQuery);
  444. if ( nType == 2 ) // 拼音;
  445. {
  446. strQuery.MakeUpper();
  447. for ( int i = 0; i < nSize; i++ )
  448. {
  449. if ( m_AryCloundResult.ElementAt(i).ElementAt(5).Find(strQuery) != -1 || m_AryCloundResult.ElementAt(i).ElementAt(6).Find(strQuery) != -1 )
  450. {
  451. m_SortList.m_arLabels.ElementAt(j++).Copy(m_AryCloundResult.ElementAt(i));
  452. }
  453. }
  454. }
  455. else // 其他;
  456. {
  457. for ( int i = 0; i < nSize; i++ )
  458. {
  459. if ( m_AryCloundResult.ElementAt(i).ElementAt(0).Find(strQuery) != -1 || // 订单号;
  460. m_AryCloundResult.ElementAt(i).ElementAt(1).Find(strQuery) != -1 || // 姓名1;
  461. m_AryCloundResult.ElementAt(i).ElementAt(2).Find(strQuery) != -1 || // 姓名2;
  462. m_AryCloundResult.ElementAt(i).ElementAt(3).Find(strQuery) != -1 || // 日期;
  463. m_AryCloundResult.ElementAt(i).ElementAt(4).Find(strQuery) != -1 // 要求;
  464. )
  465. {
  466. m_SortList.m_arLabels.ElementAt(j++).Copy(m_AryCloundResult.ElementAt(i));
  467. }
  468. }
  469. }
  470. m_SortList.m_arLabels.SetSize(j,1);
  471. m_SortList.m_LabelCount = j;
  472. m_SortList.SetItemCountEx(j);
  473. }
  474. }
  475. }
  476. void CDlgCloundResult::OnBnClickedQuery()
  477. {
  478. // TODO: 在此添加控件通知处理程序代码
  479. UpdateData();
  480. CString strQuery = _T("");
  481. GetDlgItemText(IDC_COMBO1, strQuery);
  482. FillUpList(strQuery);
  483. }
  484. void CDlgCloundResult::OnBnClickedClean()
  485. {
  486. // TODO: 在此添加控件通知处理程序代码
  487. }
  488. void CDlgCloundResult::OnOK()
  489. {
  490. // TODO: 在此添加专用代码和/或调用基类
  491. OnBnClickedQuery();
  492. //CDialog::OnOK();
  493. }
  494. void CDlgCloundResult::OnCancel()
  495. {
  496. // TODO: 在此添加专用代码和/或调用基类
  497. CDialog::OnCancel();
  498. }