DlgCloundResult.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  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;" );
  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(iit->strImgs); // 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(_T(", \"last_modify_time\": "))) != -1 )
  183. {
  184. tagOrdJson.strXPDate = strTemp.Mid(nIndex+strlen(_T(", \"last_modify_time\": ")));
  185. tagOrdJson.strXPDate.TrimRight(_T("\""));
  186. tagOrdJson.strXPDate.TrimLeft(_T("\""));
  187. strTemp = strTemp.Left(nIndex);
  188. if ( ( nIndex = strTemp.Find(_T("\"pick_list\": ["))) != -1 )
  189. {
  190. strTemp = strTemp.Mid(nIndex + strlen(_T("\"pick_list\": [")));
  191. strTemp = strTemp.Mid(0, strTemp.GetLength() - 1);
  192. sprintf(szResultValue, _T("%s"), strTemp);
  193. }
  194. }
  195. lyfzLibrary::getXPJsonresult(szResultValue,tagOrdJson.vtSpJson);
  196. vtOrdJson.push_back(tagOrdJson);
  197. }
  198. }
  199. lyfzLibrary::FreeCloudSelectionLib();
  200. }
  201. #if 0
  202. // 获取数据库保存的云数据;
  203. g_sendhead.bsql = 0;
  204. g_sendhead.code[0] = 241;
  205. g_sendhead.tabcount = 1;
  206. CString strFilter = _T("CloundType = 0");
  207. CArray<CStringArray, CStringArray> AryCloundInfo;
  208. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  209. if ( !g_bSendOK )
  210. return;
  211. DataToArray(&AryCloundInfo);
  212. // 显示并同步结果;
  213. int j = 0;
  214. BOOL bExist = FALSE;
  215. CString strSQL = _T("");
  216. for ( i = 0; i < AryCloundOrder.GetSize(); i++ )
  217. {
  218. if ( AryCloundOrder.ElementAt(i).ElementAt(2).IsEmpty() )
  219. continue;
  220. bExist = FALSE;
  221. for ( j = 0; j < AryCloundInfo.GetSize(); j++ )
  222. {
  223. if ( AryCloundOrder.ElementAt(i).ElementAt(0) == AryCloundInfo.ElementAt(j).ElementAt(0) )
  224. bExist = TRUE;
  225. }
  226. if ( bExist )
  227. {
  228. if ( AryCloundOrder.ElementAt(i).ElementAt(2) == AryCloundInfo.ElementAt(j-1).ElementAt(4) )
  229. continue;
  230. strSQL.Format(_T("update [CloundSelection] set [ResultJson] = '%s' where [order] = '%s'"), AryCloundOrder.ElementAt(i).ElementAt(0), AryCloundOrder.ElementAt(i).ElementAt(2));
  231. }
  232. else
  233. strSQL.Format(_T("insert into [CloundSelection]( [order], [CloundType], [ResultJson]) values('%s', 0, '%s') "), AryCloundOrder.ElementAt(i).ElementAt(0), AryCloundOrder.ElementAt(i).ElementAt(2));
  234. g_sendhead.bsql = true;
  235. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  236. }
  237. #endif
  238. UpdateDataSortList(vtOrdJson);
  239. }
  240. else
  241. {
  242. int i = 0;
  243. for ( i = 0; i < m_pList->m_arLabels.GetSize(); i++ )
  244. {
  245. // 取出生成云链接的订单;
  246. m_AryCloundInfo.ElementAt(i).RemoveAll();
  247. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(0 + m_nAdd)); // 0.订单号;
  248. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(1 + m_nAdd)); // 1.顾客1;
  249. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(2 + m_nAdd)); // 2.顾客2;
  250. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(21 + m_nAdd)); // 3.云地址;
  251. m_AryCloundInfo.ElementAt(i).Add(_T("")); // 4.用于存放选片结果,暂时置空;
  252. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(19 + m_nAdd)); // 5.顾客1拼音;
  253. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(20 + m_nAdd)); // 6.顾客2拼音;
  254. m_AryCloundInfo.ElementAt(i).Add(m_pList->m_arLabels.ElementAt(i).ElementAt(5 + m_nAdd)); // 7.设计状态;
  255. }
  256. INT nIndex = 0;
  257. CString strTemp = g_branchname.IsEmpty() ? g_domain : g_branchname;
  258. if ( ( nIndex = strTemp.Find(_T(".ly.com"))) == -1)
  259. {
  260. AfxMessageBox(_T("域名无效!"));
  261. return;
  262. }
  263. strTemp = strTemp.Left(nIndex);
  264. CString strBranchId = strTemp.Right(6);
  265. // 获取云选片结果;
  266. CString strUniqueId = _T("");
  267. vector<lyfzLibrary::STXYJson> vtXYJson;
  268. if ( lyfzLibrary::LoadCloudSelectionLib() )
  269. {
  270. nIndex = 0;
  271. TCHAR szResultValue[8912] = {0};
  272. for ( i = 0; i < m_AryCloundInfo.GetSize(); i++ )
  273. {
  274. strUniqueId.Format(_T("%s_A_%s_1"), strBranchId, m_AryCloundInfo.ElementAt(i).ElementAt(0));
  275. if ( ( nIndex = m_AryCloundInfo.ElementAt(i).ElementAt(3).Find(lyfzLibrary::g_strCloundHost)) != -1)
  276. {
  277. lyfzLibrary::STXYJson tagXYJson;
  278. strTemp = m_AryCloundInfo.ElementAt(i).ElementAt(3).Mid(lyfzLibrary::g_strCloundHost.GetLength() + nIndex);
  279. lyfzLibrary::g_getcloundresult(m_nCloundType, strUniqueId, strTemp, szResultValue, 8912);
  280. m_AryCloundInfo.ElementAt(i).SetAt(4, szResultValue);
  281. // 解析Json;
  282. tagXYJson.strorder = m_AryCloundInfo.ElementAt(i).ElementAt(0);
  283. tagXYJson.strCustomer1 = m_AryCloundInfo.ElementAt(i).ElementAt(1);
  284. tagXYJson.strCustomer2 = m_AryCloundInfo.ElementAt(i).ElementAt(2);
  285. tagXYJson.strCust1PY = m_AryCloundInfo.ElementAt(i).ElementAt(5);
  286. tagXYJson.strCust2PY = m_AryCloundInfo.ElementAt(i).ElementAt(6);
  287. tagXYJson.strSJStatus = m_AryCloundInfo.ElementAt(i).ElementAt(7);
  288. strTemp = szResultValue;
  289. if ( (nIndex = strTemp.Find(_T(", \"last_modify_time\": "))) != -1 )
  290. {
  291. tagXYJson.strXYDate = strTemp.Mid(nIndex+strlen(_T(", \"last_modify_time\": ")));
  292. tagXYJson.strXYDate.TrimRight(_T("\""));
  293. tagXYJson.strXYDate.TrimLeft(_T("\""));
  294. strTemp = strTemp.Left(nIndex);
  295. if ( ( nIndex = strTemp.Find(_T("\"pick_list\": ["))) != -1 )
  296. {
  297. strTemp = strTemp.Mid(nIndex + strlen(_T("\"pick_list\": [")));
  298. strTemp = strTemp.Mid(0, strTemp.GetLength() - 1);
  299. sprintf(szResultValue, _T("%s"), strTemp);
  300. }
  301. }
  302. lyfzLibrary::getXYJsonresult(szResultValue,tagXYJson.strJsonResult);
  303. vtXYJson.push_back(tagXYJson);
  304. }
  305. }
  306. lyfzLibrary::FreeCloudSelectionLib();
  307. }
  308. UpdateDataSortList2(vtXYJson);
  309. }
  310. }
  311. void CDlgCloundResult::OnBnClickedDownresult() // 下载结果;
  312. {
  313. // TODO: 在此添加控件通知处理程序代码
  314. GetCloundResult();
  315. }
  316. void CDlgCloundResult::OnBnClickedSynresult() // 同步结果;
  317. {
  318. // TODO: 在此添加控件通知处理程序代码
  319. POSITION pos = m_SortList.GetFirstSelectedItemPosition();
  320. if ( pos == NULL )
  321. {
  322. AfxMessageBox(_T("请选择要同步的记录"));
  323. return;
  324. }
  325. if ( MessageBox(_T("同步后将覆盖店内选片结果,是否继续?"), _T("温馨提示!"), MB_ICONWARNING|MB_YESNO) != MB_CANCELTRYCONTINUE )
  326. {
  327. return;
  328. }
  329. INT nItem = 0;
  330. CString strSQL = _T("");
  331. CString strOrder = _T("");
  332. if ( m_nCloundType == 0 )
  333. {
  334. CString strSpId = _T("");
  335. CString strNo = _T("");
  336. while ( pos )
  337. {
  338. nItem = m_SortList.GetNextSelectedItem(pos);
  339. strOrder = m_SortList.GetItemText(nItem, 0);
  340. strSpId = m_SortList.GetItemText(nItem,3);
  341. strNo = m_SortList.GetItemText(nItem, 6);
  342. strSQL.Format(_T("update dindansp set no = '%s' where id = '%s' and [spid] = '%s'"), strNo, strOrder, strSpId);
  343. g_sendhead.bsql = true;
  344. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  345. }
  346. }
  347. else
  348. {
  349. CString strbz2 = _T("");
  350. while ( pos )
  351. {
  352. nItem = m_SortList.GetNextSelectedItem(pos);
  353. strOrder = m_SortList.GetItemText(nItem, 0);
  354. strbz2 = m_SortList.GetItemText(nItem,4);
  355. strSQL.Format(_T("update dindan set bz2 = '%s' where id = '%s' "), strbz2, strOrder);
  356. g_sendhead.bsql = true;
  357. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  358. }
  359. }
  360. }
  361. void CDlgCloundResult::OnBnClickedExportxls() // 导出xls;
  362. {
  363. // TODO: 在此添加控件通知处理程序代码
  364. ListToXLS(&m_SortList, _T("C:\\云选片结果.xls"), 0);
  365. }
  366. void CDlgCloundResult::FillUpList(IN CString& strQuery)
  367. {
  368. INT nSize = m_AryCloundResult.GetSize();
  369. m_SortList.DeleteAllItems2();
  370. m_SortList.m_arLabels.SetSize(nSize);
  371. if ( m_nCloundType == 0 )
  372. {
  373. if ( strQuery.IsEmpty() )
  374. {
  375. for ( int i = 0; i < nSize; i++)
  376. {
  377. m_SortList.m_arLabels.ElementAt(i).Copy(m_AryCloundResult.ElementAt(i));
  378. }
  379. m_SortList.m_LabelCount = nSize;
  380. m_SortList.SetItemCountEx(nSize);
  381. }
  382. else
  383. {
  384. int j = 0;
  385. int nType = GetType(strQuery);
  386. if ( nType == 2 ) // 拼音;
  387. {
  388. strQuery.MakeUpper();
  389. for ( int i = 0; i < nSize; i++ )
  390. {
  391. if ( m_AryCloundResult.ElementAt(i).ElementAt(7).Find(strQuery) != -1 || m_AryCloundResult.ElementAt(i).ElementAt(8).Find(strQuery) != -1 )
  392. {
  393. m_SortList.m_arLabels.ElementAt(j++).Copy(m_AryCloundResult.ElementAt(i));
  394. }
  395. }
  396. }
  397. else // 其他;
  398. {
  399. for ( int i = 0; i < nSize; i++ )
  400. {
  401. if ( m_AryCloundResult.ElementAt(i).ElementAt(0).Find(strQuery) != -1 || // 订单号;
  402. m_AryCloundResult.ElementAt(i).ElementAt(1).Find(strQuery) != -1 || // 姓名1;
  403. m_AryCloundResult.ElementAt(i).ElementAt(2).Find(strQuery) != -1 || // 姓名2;
  404. m_AryCloundResult.ElementAt(i).ElementAt(3).Find(strQuery) != -1 || // 商品ID;
  405. m_AryCloundResult.ElementAt(i).ElementAt(4).Find(strQuery) != -1 || // 商品名称;
  406. m_AryCloundResult.ElementAt(i).ElementAt(5).Find(strQuery) != -1 || // 日期;
  407. m_AryCloundResult.ElementAt(i).ElementAt(6).Find(strQuery) != -1 // 相片串;
  408. )
  409. {
  410. m_SortList.m_arLabels.ElementAt(j++).Copy(m_AryCloundResult.ElementAt(i));
  411. }
  412. }
  413. }
  414. m_SortList.m_arLabels.SetSize(j,1);
  415. m_SortList.m_LabelCount = j;
  416. m_SortList.SetItemCountEx(j);
  417. }
  418. }
  419. else
  420. {
  421. if ( strQuery.IsEmpty() )
  422. {
  423. for ( int i = 0; i < nSize; i++)
  424. {
  425. m_SortList.m_arLabels.ElementAt(i).Copy(m_AryCloundResult.ElementAt(i));
  426. }
  427. m_SortList.m_LabelCount = nSize;
  428. m_SortList.SetItemCountEx(nSize);
  429. }
  430. else
  431. {
  432. int j = 0;
  433. int nType = GetType(strQuery);
  434. if ( nType == 2 ) // 拼音;
  435. {
  436. strQuery.MakeUpper();
  437. for ( int i = 0; i < nSize; i++ )
  438. {
  439. if ( m_AryCloundResult.ElementAt(i).ElementAt(5).Find(strQuery) != -1 || m_AryCloundResult.ElementAt(i).ElementAt(6).Find(strQuery) != -1 )
  440. {
  441. m_SortList.m_arLabels.ElementAt(j++).Copy(m_AryCloundResult.ElementAt(i));
  442. }
  443. }
  444. }
  445. else // 其他;
  446. {
  447. for ( int i = 0; i < nSize; i++ )
  448. {
  449. if ( m_AryCloundResult.ElementAt(i).ElementAt(0).Find(strQuery) != -1 || // 订单号;
  450. m_AryCloundResult.ElementAt(i).ElementAt(1).Find(strQuery) != -1 || // 姓名1;
  451. m_AryCloundResult.ElementAt(i).ElementAt(2).Find(strQuery) != -1 || // 姓名2;
  452. m_AryCloundResult.ElementAt(i).ElementAt(3).Find(strQuery) != -1 || // 日期;
  453. m_AryCloundResult.ElementAt(i).ElementAt(4).Find(strQuery) != -1 // 要求;
  454. )
  455. {
  456. m_SortList.m_arLabels.ElementAt(j++).Copy(m_AryCloundResult.ElementAt(i));
  457. }
  458. }
  459. }
  460. m_SortList.m_arLabels.SetSize(j,1);
  461. m_SortList.m_LabelCount = j;
  462. m_SortList.SetItemCountEx(j);
  463. }
  464. }
  465. }
  466. void CDlgCloundResult::OnBnClickedQuery()
  467. {
  468. // TODO: 在此添加控件通知处理程序代码
  469. UpdateData();
  470. CString strQuery = _T("");
  471. GetDlgItemText(IDC_COMBO1, strQuery);
  472. FillUpList(strQuery);
  473. }
  474. void CDlgCloundResult::OnBnClickedClean()
  475. {
  476. // TODO: 在此添加控件通知处理程序代码
  477. }
  478. void CDlgCloundResult::OnOK()
  479. {
  480. // TODO: 在此添加专用代码和/或调用基类
  481. OnBnClickedQuery();
  482. //CDialog::OnOK();
  483. }
  484. void CDlgCloundResult::OnCancel()
  485. {
  486. // TODO: 在此添加专用代码和/或调用基类
  487. CDialog::OnCancel();
  488. }