ChoosePhotoForm.cpp 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305
  1. // ChoosePhotoForm.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "ChoosePhotoForm.h"
  6. #include "MyMdi.H"
  7. #include "ModifyDinDan.h"
  8. #include "ImportPhoto.h"
  9. #include "ChoosePhotoSkin2.h"
  10. #include "Login2.h"
  11. #include "ShowCut.h"
  12. #include "CompareContent.h"
  13. #include "SelBrunDevice.h"
  14. #include "DelHC.h"
  15. #include "DlgCloudSelection.h"
  16. #include "DlgCloundResult.h"
  17. using namespace helper_coffs;
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23. #pragma comment(lib, "Shlwapi.lib")
  24. /////////////////////////////////////////////////////////////////////////////
  25. IMPLEMENT_DYNCREATE(ChoosePhotoForm, MyFormView)
  26. ChoosePhotoForm::ChoosePhotoForm(): MyFormView(ChoosePhotoForm::IDD)
  27. {
  28. m_filter = _T("");
  29. }
  30. ChoosePhotoForm::~ChoosePhotoForm()
  31. {
  32. }
  33. void ChoosePhotoForm::DoDataExchange(CDataExchange* pDX)
  34. {
  35. MyFormView::DoDataExchange(pDX);
  36. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  37. DDX_Control(pDX, IDC_LIST2, m_List1);
  38. DDX_Control(pDX, IDC_STATIC1, m_static1);
  39. DDX_CBString(pDX, IDC_COMBO1, m_filter);
  40. }
  41. BEGIN_MESSAGE_MAP(ChoosePhotoForm, MyFormView)
  42. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  43. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  44. ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  45. ON_WM_TIMER()
  46. ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
  47. ON_BN_CLICKED(IDC_BUTmoney, OnBUTmoney)
  48. ON_BN_CLICKED(IDC_BUTexportphoto, OnBUTexportphoto)
  49. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  50. ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
  51. ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
  52. ON_BN_CLICKED(IDC_BUTexportphoto2, OnBUTexportphoto2)
  53. ON_BN_CLICKED(IDC_BUTexportphoto3, OnBUTexportphoto3)
  54. ON_BN_CLICKED(BTN_ClounXP, OnBnClickedClounxp)
  55. ON_BN_CLICKED(BTN_ClounXPResult, OnBnClickedClounxpresult)
  56. END_MESSAGE_MAP()
  57. /////////////////////////////////////////////////////////////////////////////
  58. #ifdef _DEBUG
  59. void ChoosePhotoForm::AssertValid() const
  60. {
  61. MyFormView::AssertValid();
  62. }
  63. void ChoosePhotoForm::Dump(CDumpContext& dc) const
  64. {
  65. MyFormView::Dump(dc);
  66. }
  67. #endif //_DEBUG
  68. void ChoosePhotoForm::OnInitialUpdate()
  69. {
  70. MyFormView::OnInitialUpdate();
  71. CMyMdi Mdi;
  72. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  73. CRect rc2;
  74. GetWindowRect(rc2);
  75. ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
  76. EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
  77. int idarray[] = { IDC_BUTshowphoto, IDC_BUTexportphoto2, IDC_BUTexportphoto3, IDC_BUTexportphoto, IDC_BUTmoney, IDC_BUTclose };
  78. int idcount = 6;
  79. int btnwid;
  80. CRect prerc;
  81. for (int a = idcount - 2; a >= 0; a--)
  82. {
  83. GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
  84. ScreenToClient(prerc);
  85. GetDlgItem(idarray[a])->GetWindowRect(rc2);
  86. ScreenToClient(rc2);
  87. btnwid = rc2.Width();
  88. rc2.right = prerc.left;
  89. rc2.left = rc2.right - btnwid;
  90. GetDlgItem(idarray[a])->MoveWindow(rc2);
  91. }
  92. // Jeff.在初修状态后添加精修日期;
  93. m_static1.SetFont(&g_titlefont);
  94. #ifdef CHILD_VERSION // 15列;
  95. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;修片,100;修片日期,100;选片,100;选片日期,100;加挑金额,100;加挑张数,100;接单人,100;选片人,100;摄影师,100;初修师,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  96. #else
  97. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;修片,100;修片日期,100;选片,100;选片日期,100;加挑金额,100;加挑张数,100;接单人,100;选片人,100;摄影师,100;初修师,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  98. #endif
  99. m_List1.LoadColumnInfo(116);
  100. if (g_bShowOK == 0)
  101. {
  102. #ifdef LKAY_VERSION
  103. CString filter="status3='未取' and (dindantype<>'意向客户' or dindantype is null)";
  104. #else
  105. CString filter = "status3='未取'";
  106. #endif
  107. g_sendhead.bsql = 0;
  108. g_sendhead.code[0] = 28;
  109. g_sendhead.tabcount = 1;
  110. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  111. }
  112. else
  113. {
  114. g_sendhead.bsql = 0;
  115. g_sendhead.code[0] = 28;
  116. g_sendhead.tabcount = 1;
  117. #ifdef LKAY_VERSION
  118. CString filter="dindantype<>'意向客户' or dindantype is null";
  119. g_pMainWnd->ProcessChatMessageRequest2(filter);
  120. #else
  121. g_pMainWnd->ProcessChatMessageRequest2(1);
  122. #endif
  123. if (g_bSendOK == 0)return;
  124. }
  125. DataToArray(&m_List1array);
  126. HidePrice();
  127. m_combo1.AddString(g_user.name);
  128. for (int i = 0; i < g_userarray.GetSize(); i++)
  129. m_combo1.AddString(g_userarray.ElementAt(i).ElementAt(1));
  130. FillGrid();
  131. m_combo1.GetWindowRect(rc2);
  132. ScreenToClient(rc2);
  133. rc2.bottom += 200;
  134. m_combo1.MoveWindow(rc2);
  135. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  136. SetComboHei(&m_combo1, rc2.Height());
  137. GetDlgItem(IDC_BUTshowphoto)->EnableWindow(IsHasRights2new(15));
  138. GetDlgItem(IDC_BUTexportphoto2)->EnableWindow(IsHasRights2new(15));
  139. GetDlgItem(IDC_BUTexportphoto3)->EnableWindow(IsHasRights2new(15));
  140. if ( !g_bEnableClound )
  141. {
  142. GetDlgItem(BTN_ClounXP)->ShowWindow(SW_HIDE);
  143. GetDlgItem(BTN_ClounXPResult)->ShowWindow(SW_HIDE);
  144. }
  145. }
  146. void ChoosePhotoForm::FillGrid(BOOL bStatus)
  147. {
  148. if (g_bSearchFilter) // 条件查询;
  149. {
  150. m_List1.DeleteAllItems2();
  151. int ii = 0;
  152. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  153. int count = 0;
  154. {
  155. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  156. {
  157. // 查询条件==选片日期;
  158. if (g_filterdate1 != "")
  159. {
  160. if (m_List1array.ElementAt(ii).ElementAt(6) < g_filterdate1 || m_List1array.ElementAt(ii).ElementAt(6) > g_filterdate2)
  161. continue;
  162. }
  163. // 查询条件==选片人;
  164. if (g_waiter1 != "")
  165. {
  166. if (m_List1array.ElementAt(ii).ElementAt(10) != g_waiter1)
  167. continue;
  168. }
  169. if(g_waiter2 != "")
  170. {
  171. if (m_List1array.ElementAt(ii).ElementAt(11) != g_waiter2)
  172. continue;
  173. }
  174. if(g_waiter3 != "")
  175. {
  176. if (m_List1array.ElementAt(ii).ElementAt(12) != g_waiter3)
  177. continue;
  178. }
  179. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  180. }
  181. }
  182. m_List1.m_arLabels.SetSize(count, 1);
  183. ii = count;
  184. m_List1.m_LabelCount = ii;
  185. m_List1.SetItemCountEx(ii);
  186. CString str;
  187. str.Format("单数:%d", ii);
  188. SetDlgItemText(IDC_STATIC2, str);
  189. }
  190. else
  191. {
  192. m_List1.DeleteAllItems2();
  193. int ii = 0;
  194. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  195. int count = 0;
  196. if (m_filter.IsEmpty())
  197. {
  198. if (bStatus) // 已修未选;
  199. {
  200. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  201. {
  202. // 查询条件==修片OK && 未选片;
  203. if (m_List1array.ElementAt(ii).ElementAt(3) == "OK" && m_List1array.ElementAt(ii).ElementAt(5) != "OK")
  204. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  205. }
  206. }
  207. else
  208. {
  209. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  210. {
  211. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  212. }
  213. }
  214. }
  215. else
  216. {
  217. if (bStatus) // 已修未选;
  218. {
  219. int type = GetType(m_filter);
  220. if (type == 1)//电话
  221. {
  222. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  223. {
  224. // 查询条件==修片OK && 未选片 &&(手机1||手机2);
  225. if (m_List1array.ElementAt(ii).ElementAt(3) == "OK"
  226. && m_List1array.ElementAt(ii).ElementAt(5) != "OK"
  227. //&&(m_List1array.ElementAt (ii).ElementAt (12).Find (m_filter)!=-1 || m_List1array.ElementAt (ii).ElementAt (13).Find (m_filter)!=-1))
  228. && (m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1))
  229. {
  230. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  231. }
  232. }
  233. }
  234. else if (type == 2)//拼音
  235. {
  236. m_filter.MakeUpper();
  237. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  238. {
  239. // 查询条件==修片OK && 未选片 &&(拼音1||拼音2);
  240. if (m_List1array.ElementAt(ii).ElementAt(3) == "OK"
  241. &&m_List1array.ElementAt(ii).ElementAt(5) != "OK"
  242. //&&(m_List1array.ElementAt (ii).ElementAt (14).Find (m_filter)!=-1 || m_List1array.ElementAt (ii).ElementAt (15).Find (m_filter)!=-1))
  243. && (m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1))
  244. {
  245. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  246. }
  247. }
  248. }
  249. else
  250. {
  251. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  252. {
  253. // 查询条件==修片OK && 未选片 &&(……);
  254. if (m_List1array.ElementAt(ii).ElementAt(3) == "OK"
  255. &&m_List1array.ElementAt(ii).ElementAt(5) != "OK"
  256. && (
  257. m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || // 订单号;
  258. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || // 男宾姓名;
  259. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || // 女宾姓名;
  260. m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || // 接单人;
  261. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || // 选片人;
  262. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || // 摄影师;
  263. m_List1array.ElementAt(ii).ElementAt(12).Find(m_filter) != -1 || // 初修师;
  264. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1 || // 套系名称;
  265. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || // 手机1
  266. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1)) // 手机2
  267. {
  268. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  269. }
  270. }
  271. }
  272. }
  273. else
  274. {
  275. int type = GetType(m_filter);
  276. if (type == 1)//电话
  277. {
  278. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  279. {
  280. // 查询条件==手机1 || 手机2;
  281. if (m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 ||
  282. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1)
  283. {
  284. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  285. }
  286. }
  287. }
  288. else if (type == 2)//拼音
  289. {
  290. m_filter.MakeUpper();
  291. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  292. {
  293. // 查询条件==拼音1 || 拼音2;
  294. if (m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 ||
  295. m_List1array.ElementAt(ii).ElementAt(18).Find(m_filter) != -1)
  296. {
  297. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  298. }
  299. }
  300. }
  301. else
  302. {
  303. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  304. {
  305. // 查询条件==修片OK && 未选片 &&(……);
  306. if (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || // 订单号;
  307. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || // 男宾姓名;
  308. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || // 女宾姓名;
  309. m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || // 接单人;
  310. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || // 选片人;
  311. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || // 摄影师;
  312. m_List1array.ElementAt(ii).ElementAt(12).Find(m_filter) != -1 || // 初修师;
  313. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1 || // 套系名称;
  314. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || // 手机1
  315. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1) // 手机2
  316. {
  317. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  318. }
  319. }
  320. }
  321. }
  322. }
  323. m_List1.m_arLabels.SetSize(count, 1);
  324. ii = count;
  325. m_List1.m_LabelCount = ii;
  326. m_List1.SetItemCountEx(ii);
  327. CString str;
  328. str.Format("单数:%d", ii);
  329. SetDlgItemText(IDC_STATIC2, str);
  330. }
  331. if (!g_id.IsEmpty())
  332. {
  333. for (int i = 0; i < m_List1.GetItemCount(); i++)
  334. {
  335. if (g_id == m_List1.GetItemText(i, 0))
  336. {
  337. m_List1.SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
  338. m_List1.EnsureVisible(i, FALSE);
  339. break;
  340. }
  341. }
  342. }
  343. }
  344. void ChoosePhotoForm::OnBUTclose()
  345. {
  346. GetParent()->SendMessage(WM_CLOSE);
  347. }
  348. void ChoosePhotoForm::OnSelchangeCombo1()
  349. {
  350. SetTimer(1, 100, NULL);
  351. }
  352. void ChoosePhotoForm::OnTimer(UINT nIDEvent)
  353. {
  354. KillTimer(nIDEvent);
  355. OnButton1();
  356. }
  357. BOOL ChoosePhotoForm::PreTranslateMessage(MSG* pMsg)
  358. {
  359. try
  360. {
  361. if (pMsg->message == WM_KEYDOWN)
  362. {
  363. switch (pMsg->wParam)
  364. {
  365. case VK_RETURN:
  366. OnButton1();
  367. return 1;
  368. case 0x43: // copy
  369. if ((GetKeyState(VK_CONTROL) & 0x80))
  370. {
  371. GetFocus()->SendMessage(WM_COPY);
  372. return TRUE;
  373. }
  374. break;
  375. case 0x56: //Ctrl + V:
  376. if ((GetKeyState(VK_CONTROL) & 0x80))
  377. {
  378. GetFocus()->SendMessage(WM_PASTE);
  379. return TRUE;
  380. }
  381. break;
  382. case 0x58: // cut
  383. if ((GetKeyState(VK_CONTROL) & 0x80))
  384. {
  385. GetFocus()->SendMessage(WM_CUT);
  386. return TRUE;
  387. }
  388. break;
  389. case 0x5A: //undo
  390. case 0x59: //redo
  391. if ((GetKeyState(VK_CONTROL) & 0x80))
  392. {
  393. GetFocus()->SendMessage(WM_UNDO);
  394. return TRUE;
  395. }
  396. break;
  397. }
  398. }
  399. }
  400. catch (...)
  401. {
  402. }
  403. return MyFormView::PreTranslateMessage(pMsg);
  404. }
  405. // Jeff.门市流程 - 选片 - 开始选片
  406. void ChoosePhotoForm::OnBUTshowphoto() // Jeff.开始选片按钮;
  407. {
  408. if (IsHasRights2new(15) == 0) return;
  409. POSITION pos;
  410. pos = m_List1.GetFirstSelectedItemPosition();
  411. if (pos == NULL)
  412. {
  413. AfxMessageBox("请先选中您要选片的定单!", MB_ICONINFORMATION);
  414. return;
  415. }
  416. int iItem = m_List1.GetNextSelectedItem(pos);
  417. CString id = m_List1.GetItemText(iItem, 0);
  418. CString status = m_List1.GetItemText(iItem, 4); // 选片状态;
  419. ChoosePhotoSkin2 dlg;
  420. dlg.m_strStatusOfChoosePhoto = status;
  421. dlg.SetLiaPath("3.lia");
  422. dlg.m_strOrderNumber = id;
  423. dlg.m_path = g_path2 + "\\";
  424. dlg.m_path += dlg.m_strOrderNumber;
  425. dlg.m_path += "\\";
  426. // printf("Jeff:ChoosePhotoSkin2::m_id=%s\n ChoosePhotoSkin2::m_path=%s\n ChoosePhotoSkin2::m_mode\n\n",dlg.m_id,dlg.m_path,dlg.m_mode);// Jeff Printf;
  427. dlg.DoModal();
  428. g_bInSkin = 0;
  429. if (dlg.m_bSave)
  430. {
  431. #if JEFF_TEST_ON
  432. if (g_bShowOK == 0)
  433. {
  434. #ifdef LKAY_VERSION
  435. CString filter="status3='未取' and (dindantype<>'意向客户' or dindantype is null)";
  436. #else
  437. CString filter = "status3='未取'";
  438. #endif //#ifdef LKAY_VERSION
  439. g_sendhead.bsql = 0;
  440. g_sendhead.code[0] = 28;
  441. g_sendhead.tabcount = 1;
  442. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  443. }
  444. else
  445. {
  446. g_sendhead.bsql = 0;
  447. g_sendhead.code[0] = 28;
  448. g_sendhead.tabcount = 1;
  449. #ifdef LKAY_VERSION
  450. CString filter = "dindantype<>'意向客户' or dindantype is null";
  451. g_pMainWnd->ProcessChatMessageRequest2(filter);
  452. #else
  453. g_pMainWnd->ProcessChatMessageRequest2(1);
  454. #endif //#ifdef LKAY_VERSION
  455. if (g_bSendOK == 0)return;
  456. }
  457. DataToArray(&m_List1array);
  458. HidePrice();
  459. m_combo1.AddString(g_user.name);
  460. for (int i = 0; i < g_userarray.GetSize(); i++)
  461. {
  462. m_combo1.AddString(g_userarray.ElementAt(i).ElementAt(1));
  463. }
  464. FillGrid();
  465. #else
  466. for (int i = 0; i < m_List1array.GetSize(); i++)
  467. {
  468. if (id == m_List1array.ElementAt(i).ElementAt(0))
  469. {
  470. m_List1array.ElementAt(i).SetAt(4+1, "OK");
  471. m_List1array.ElementAt(i).SetAt(5+1, dlg.m_time4);
  472. m_List1array.ElementAt(i).SetAt(6+1, dlg.m_money3);
  473. m_List1array.ElementAt(i).SetAt(7+1, dlg.m_choosezs);
  474. if (status != "OK") // Jeff.若选片状态已经OK,则不刷新选片人2014.08.30
  475. m_List1array.ElementAt(i).SetAt(9+1, dlg.m_waiter3);
  476. FillGrid();
  477. break;
  478. }
  479. }
  480. #endif //#if JEFF_TEST_ON
  481. }
  482. }
  483. void ChoosePhotoForm::OnBUTmoney() // 查看裁剪 按钮;
  484. {
  485. POSITION pos;
  486. pos = m_List1.GetFirstSelectedItemPosition();
  487. if (pos == NULL)
  488. {
  489. AfxMessageBox("请先选中您要查看的客人!", MB_ICONINFORMATION);
  490. return;
  491. }
  492. int iItem = m_List1.GetNextSelectedItem(pos);
  493. CString id = m_List1.GetItemText(iItem, 0);
  494. ShowCut dlg;
  495. dlg.m_mode = 2;
  496. dlg.m_strOrderNum = id;
  497. dlg.DoModal();
  498. }
  499. void ChoosePhotoForm::OnBUTexportphoto() // 选片更改 按钮;
  500. {
  501. UpdateData();
  502. POSITION pos;
  503. pos = m_List1.GetFirstSelectedItemPosition();
  504. if (pos == NULL)
  505. {
  506. AfxMessageBox("请先选中您要对比的定单!", MB_ICONINFORMATION);
  507. return;
  508. }
  509. int iItem = m_List1.GetNextSelectedItem(pos);
  510. if (m_List1.GetItemText(iItem, 5) != "OK")return;
  511. CCompareContent dlg;
  512. dlg.m_id = m_List1.GetItemText(iItem, 0);
  513. dlg.DoModal();
  514. }
  515. void ChoosePhotoForm::GetNo(CString str, CStringArray &array)
  516. {
  517. if (!str.IsEmpty())
  518. {
  519. #ifdef USE_SEP_VEB
  520. int pos = str.Find(SEPS_VEB);
  521. #else
  522. int pos = str.Find(",");
  523. #endif
  524. while (pos != -1)
  525. {
  526. array.Add(str.Left(pos));
  527. str = str.Right(str.GetLength() - pos - 1);
  528. #ifdef USE_SEP_VEB
  529. pos = str.Find(SEPS_VEB);
  530. #else
  531. pos = str.Find(",");
  532. #endif
  533. }
  534. array.Add(str);
  535. }
  536. }
  537. int CALLBACK BrowseProc(HWND hwnd, UINT msg, LPARAM lParam, LPARAM lpData)
  538. {
  539. switch (msg)
  540. {
  541. case BFFM_INITIALIZED:
  542. SendMessage(hwnd, BFFM_SETSELECTION, TRUE, NULL);
  543. break;
  544. case BFFM_SELCHANGED:
  545. {
  546. char szFileName[MAX_PATH];
  547. LPITEMIDLIST pidlCurrent = (LPITEMIDLIST)lParam;
  548. SHGetPathFromIDList(pidlCurrent, szFileName);
  549. SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM)szFileName);
  550. }
  551. break;
  552. }
  553. return 0;
  554. }
  555. void GetSavePath(CString &path)
  556. {
  557. char lpszDisplayName[MAX_PATH], szFileName[MAX_PATH];
  558. LPITEMIDLIST pidlDesktop, pidlCurrent;
  559. if (SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidlDesktop) == NOERROR)
  560. {
  561. BROWSEINFO bi;
  562. bi.hwndOwner = g_pMainWnd->m_hWnd;
  563. bi.pidlRoot = pidlDesktop;
  564. bi.pszDisplayName = lpszDisplayName;
  565. bi.lpszTitle = "\n文档保存的目录:";
  566. bi.ulFlags = BIF_STATUSTEXT&BIF_RETURNONLYFSDIRS;
  567. bi.lpfn = BrowseProc;
  568. bi.lParam = 0;
  569. bi.iImage = 0;
  570. pidlCurrent = SHBrowseForFolder(&bi);
  571. SHGetPathFromIDList(pidlCurrent, szFileName);
  572. path = szFileName;
  573. }
  574. }
  575. int ChoosePhotoForm::FindArray(CStringArray *pArray, CString *pStr)
  576. {
  577. for (int i = 0; i < pArray->GetSize(); i++)
  578. {
  579. if (pArray->ElementAt(i) == *pStr)
  580. return i;
  581. }
  582. return -1;
  583. }
  584. void ChoosePhotoForm::OnButton1() // 查询 按钮;
  585. {
  586. UpdateData();
  587. m_filter.TrimLeft();
  588. m_filter.TrimRight();
  589. FillGrid();
  590. }
  591. void ChoosePhotoForm::OnButton2() // 已修未选 按钮;
  592. {
  593. UpdateData();
  594. m_filter.TrimLeft();
  595. m_filter.TrimRight();
  596. FillGrid(1);
  597. }
  598. void ChoosePhotoForm::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  599. {
  600. POSITION pos;
  601. pos = m_List1.GetFirstSelectedItemPosition();
  602. if (pos == NULL)return;
  603. int iItem = m_List1.GetNextSelectedItem(pos);
  604. g_id = m_List1.GetItemText(iItem, 0);
  605. *pResult = 0;
  606. }
  607. void ChoosePhotoForm::HidePrice()
  608. {
  609. #ifdef LKAY_VERSION
  610. return;
  611. #else
  612. return;
  613. #endif
  614. }
  615. void ChoosePhotoForm::OnBtnsearchfilter() // 条件查询 按钮;
  616. {
  617. SearchFilter dlg;
  618. dlg.m_mode = 4;
  619. if (dlg.DoModal() == IDOK)
  620. FillGrid();
  621. g_bSearchFilter = 0;
  622. }
  623. BOOL ChoosePhotoForm::IsPhoto2Exist(CString m_id)
  624. {
  625. CString path2;
  626. CString path = g_path2 + "\\";
  627. path += m_id;
  628. path += "\\";
  629. using namespace helper_coffs;
  630. ffsco o;
  631. o.dirs(0);
  632. o.find(LPCSTR(path), LPCSTR("*.jpg"));
  633. ffsco::typeT coo;
  634. coo = o.co_file();
  635. return coo.size();
  636. }
  637. void ChoosePhotoForm::OnBUTexportphoto2() // 按钮 缓存本机;
  638. {
  639. POSITION pos;
  640. pos = m_List1.GetFirstSelectedItemPosition();
  641. if (pos == NULL)
  642. {
  643. AfxMessageBox("请先选中您要缓存的定单!", MB_ICONINFORMATION);
  644. return;
  645. }
  646. ClearHC();
  647. int iItem = m_List1.GetNextSelectedItem(pos);
  648. CString m_id = m_List1.GetItemText(iItem, 0);
  649. //////////////////////
  650. CStringArray m_patharray1;
  651. int m_nChoosePhotoType = 0; // 0 = 初修片; 1 = 原片;
  652. if (m_patharray1.GetSize() == 0)
  653. {
  654. #if USE_SHARE_FLORD
  655. CStringArray photoArray;
  656. SelBrunDevice selbrundevicedlg;
  657. selbrundevicedlg.m_mode = 1;
  658. if (selbrundevicedlg.DoModal() == IDOK)
  659. m_nChoosePhotoType = selbrundevicedlg.m_sel;
  660. else
  661. m_nChoosePhotoType = 0;
  662. BOOL bGrowthTx = FALSE;
  663. CString strTxName = _T("");
  664. GetTXName(&m_id, 1, bGrowthTx, strTxName);
  665. GetPhotosDir(m_id, m_nChoosePhotoType, bGrowthTx, strTxName, photoArray);
  666. GetPhotoFiles(&photoArray, m_patharray1);
  667. /*
  668. SelBrunDevice selbrundevicedlg;
  669. selbrundevicedlg.m_mode = 1;
  670. if (selbrundevicedlg.DoModal() == IDOK)
  671. m_nChoosePhotoType = selbrundevicedlg.m_sel;
  672. else
  673. m_nChoosePhotoType = 0;
  674. BOOL bGrowthTx = FALSE;
  675. CString strTxName = _T("");
  676. GetTXName(&m_id, 1, bGrowthTx, strTxName);
  677. CStringArray photoArray;
  678. if(m_nChoosePhotoType == 0)
  679. {// 初修片;
  680. for(int i = 0; i < 2; i++)
  681. {
  682. CStringArray patharr;
  683. GetPhotosDir(m_id, i, bGrowthTx, strTxName, photoArray);
  684. GetPhotoFiles(&photoArray, patharr);
  685. if(m_patharray1.GetSize() == 0)
  686. m_patharray1.Append(patharr);
  687. else
  688. {
  689. // 对比是否有同名的相片;
  690. for(int j=0; j<m_patharray1.GetSize(); j++)
  691. {
  692. for(int k=0; k<patharr.GetSize(); k++)
  693. {
  694. CString str1 = m_patharray1.ElementAt(j);
  695. str1 = str1.Right(str1.GetLength() - str1.ReverseFind('\\') - 1);
  696. CString str2 = patharr.ElementAt(k);
  697. str2 = str2.Right(str2.GetLength() - str2.ReverseFind('\\') - 1);
  698. if(str1 == str2)
  699. patharr.RemoveAt(k);
  700. }
  701. }
  702. if(patharr.GetSize() > 0)
  703. m_patharray1.Append(patharr);
  704. }
  705. }
  706. }
  707. else
  708. {// 原片;
  709. GetPhotosDir(m_id, m_nChoosePhotoType, bGrowthTx, strTxName, photoArray);
  710. GetPhotoFiles(&photoArray, m_patharray1);
  711. }*/
  712. #else
  713. CString m_path, m_seltxname;
  714. m_path = g_path2 + "\\";
  715. m_path += m_id;
  716. m_path += "\\";
  717. if (IsPhoto2Exist(m_id))
  718. {
  719. SelBrunDevice dlg;
  720. dlg.m_mode = 1;
  721. if (dlg.DoModal() == IDOK)
  722. m_nChoosePhotoType = dlg.m_sel;
  723. else
  724. m_nChoosePhotoType = 0;
  725. //m_nChoosePhotoType=0 原片+修片 1:修片 2:原片
  726. }
  727. else
  728. AfxMessageBox("温馨提示:\r\n未找到初修片,将使用原片选片", MB_ICONINFORMATION);
  729. {
  730. CString path, path2;
  731. m_path = g_path1 + "\\";
  732. m_path += m_id;
  733. m_path += "\\";
  734. if (m_seltxname != "" && m_seltxname != "全部")
  735. {
  736. m_path += m_seltxname; m_path += "\\";
  737. }
  738. if (m_nChoosePhotoType == 1)
  739. {
  740. m_path = g_path2 + "\\";
  741. m_path += m_id;
  742. m_path += "\\";
  743. }
  744. CString filename;
  745. ffsco o;
  746. o.dirs(1);
  747. o.find(LPCSTR(m_path), LPCSTR("*.*"));
  748. ffsco::typeT coo;
  749. ffsco::typeT::iterator it;
  750. coo = o.co_file();
  751. for (it = coo.begin(); coo.end() != it; it++)
  752. {
  753. path = (*it).c_str();
  754. if (path.GetAt(path.ReverseFind('\\') + 1) != 's' && path.GetAt(path.ReverseFind('\\') + 1) != 'm')
  755. {
  756. path.MakeLower();
  757. filename = path.Right(path.GetLength() - path.ReverseFind('\\') - 1);
  758. if (filename.Find(".") != -1)
  759. filename = filename.Left(filename.Find("."));
  760. if (!myisdigit(filename))continue;
  761. if (m_nChoosePhotoType == 1)
  762. {
  763. m_patharray1.Add(path);
  764. }
  765. else
  766. {
  767. path2 = path;
  768. if (m_nChoosePhotoType == 0)
  769. path2.Replace("客户原片", "修好的片");
  770. if (1)
  771. {
  772. int pos = path2.Find(m_id);
  773. pos += m_id.GetLength();
  774. int pos2 = path2.ReverseFind('\\');
  775. path2 = path2.Left(pos) + path2.Right(path2.GetLength() - pos2);
  776. }
  777. if (m_nChoosePhotoType == 0 && ::PathFileExists(path2))
  778. {
  779. m_patharray1.Add(path2);
  780. }
  781. else
  782. {
  783. path2.Replace(".raw", ".jpg");
  784. if (::PathFileExists(path2))
  785. {
  786. m_patharray1.Add(path2); continue;
  787. }
  788. path2.Replace(".nef", ".jpg");
  789. if (::PathFileExists(path2))
  790. {
  791. m_patharray1.Add(path2); continue;
  792. }
  793. path2.Replace(".cr2", ".jpg");
  794. if (::PathFileExists(path2))
  795. {
  796. m_patharray1.Add(path2); continue;
  797. }
  798. else
  799. {
  800. if (path.Right(3) != "jpg")continue;
  801. m_patharray1.Add(path);
  802. }
  803. }
  804. }
  805. }
  806. }
  807. }
  808. // if(0)
  809. {//多种修好的效果
  810. CString path, path2;
  811. path2 = g_path2 + "\\";
  812. path2 += m_id;
  813. path2 += "\\";
  814. using namespace helper_coffs;
  815. ffsco o;
  816. o.dirs(0);
  817. o.find(LPCSTR(path2), LPCSTR("*.jpg"));
  818. ffsco::typeT coo;
  819. ffsco::typeT::iterator it;
  820. coo = o.co_file();
  821. for (it = coo.begin();coo.end() != it;it++)
  822. {
  823. path = (*it).c_str();
  824. if (path.GetAt(path.ReverseFind('\\') + 1) != 's' && path.GetAt(path.ReverseFind('\\') + 1) != 'm')
  825. {
  826. path.MakeLower();
  827. path2 = path.Right(path.GetLength() - path.ReverseFind('\\') - 1);
  828. if (path2.Find("-") != -1)
  829. {
  830. m_patharray1.Add(path);
  831. }
  832. }
  833. }
  834. }
  835. #endif //#if USE_SHARE_FLORD
  836. /////////////////////////
  837. char path[MAX_PATH];
  838. ::GetSystemDirectory(path, MAX_PATH);
  839. CString sysdir = path;
  840. sysdir += "\\lyfz";
  841. ::CreateDirectory(sysdir, NULL);
  842. sysdir += "\\";
  843. sysdir += m_id;
  844. ::CreateDirectory(sysdir, NULL);
  845. sysdir += "\\";
  846. //----------------------------------------------------------------------------------------------
  847. // 缓存到本机的相片;
  848. //----------------------------------------------------------------------------------------------
  849. ImportPhoto dlg;
  850. dlg.m_bCopyToLocal = 1;
  851. dlg.m_mode = 1;
  852. dlg.m_pArray = &m_patharray1;
  853. dlg.m_savepath = sysdir;
  854. dlg.DoModal();
  855. AfxMessageBox("缓存成功!");
  856. }
  857. }
  858. CString GetCreateTime(CString path)
  859. {
  860. CFileFind finder;
  861. path.TrimRight("\\");
  862. BOOL bWorking = finder.FindFile(path);
  863. if (bWorking)
  864. {
  865. finder.FindNextFile();
  866. CTime tm;
  867. finder.GetCreationTime(tm);
  868. CTimeSpan dt = CTime::GetCurrentTime() - tm;
  869. int m_dtdays = AfxGetApp()->GetProfileInt(LYFZVERSION, "dtdays2", 5);
  870. if (dt.GetDays() >= m_dtdays)
  871. {
  872. ::DeleteDirectory(path); // 递归删除过期缓存;
  873. }
  874. }
  875. return "";
  876. }
  877. void ChoosePhotoForm::ClearHC()
  878. {
  879. char path[MAX_PATH];
  880. ::GetSystemDirectory(path, MAX_PATH);
  881. CString sysdir = path;
  882. sysdir += "\\lyfz";
  883. ::CreateDirectory(sysdir, NULL);
  884. sysdir += "\\";
  885. CString str;
  886. using namespace helper_coffs;
  887. ffsco o;
  888. o.dirs(0);
  889. o.find(LPCSTR(sysdir), LPCSTR("*.*"));
  890. ffsco::typeT coo;
  891. ffsco::typeT::iterator it;
  892. coo = o.co_dir();
  893. for (it = coo.begin(); coo.end() != it; it++)
  894. {
  895. str = (*it).c_str();
  896. if (str == sysdir)continue;
  897. GetCreateTime(str);
  898. }
  899. }
  900. void ChoosePhotoForm::OnBUTexportphoto3() // 管理缓存按钮;
  901. {
  902. DelHC dlg;
  903. dlg.DoModal();
  904. }
  905. /************************************************************************/
  906. /*
  907. 函数: GetTXName
  908. 描述: 获取套系名称
  909. 参数:
  910. const CString* pStrOrder, //订单号
  911. const int nModle, //
  912. BOOL& bGrowthTx, //返回是否成长套系0否,1是
  913. CString& strTxName //返回套系名
  914. 返回:
  915. */
  916. /************************************************************************/
  917. void ChoosePhotoForm::GetTXName(const CString* pStrOrder, const int nModle, BOOL& bGrowthTx, CString& strTxName)
  918. {
  919. if(pStrOrder == NULL || (*pStrOrder) == _T(""))
  920. return;
  921. IsGrowthTx growthtxdlg;
  922. growthtxdlg.m_mode = nModle;
  923. growthtxdlg.m_strOrderNumber = (*pStrOrder);
  924. growthtxdlg.DoModal();
  925. bGrowthTx = growthtxdlg.m_bGrowthTx;
  926. strTxName = growthtxdlg.m_seltxname;
  927. }
  928. /************************************************************************/
  929. /* 函数:GetPhotosDir[3/27/2016 IT];
  930. /* 描述:获取相片目录;
  931. /* 参数:;
  932. /* [IN] strID: 订单号;
  933. /* [IN] nMode: =1:修片; =2:原片;
  934. /* [IN] bGrowthTx: 是否成长套系;
  935. /* [IN] strTxName: 套系名;
  936. /* [OUT] photoDirArr: 返回路径集合;
  937. /* 返回:void;
  938. /* 注意:;
  939. /* 示例:;
  940. /*
  941. /* 修改:;
  942. /* 日期:;
  943. /* 内容:;
  944. /************************************************************************/
  945. void ChoosePhotoForm::GetPhotosDir(const CString& strID, const int nMode, const BOOL bGrowthTx, const CString& strTxName, CStringArray& photoDirArr)
  946. {
  947. TCHAR szShare[MAX_PATH] = {0};
  948. TCHAR szOrdePath[MAX_PATH] = {0};
  949. int i=0;
  950. int nSize = 0;
  951. switch(nMode)
  952. {
  953. case 0: // 初修;
  954. {
  955. sprintf(szShare, _T("\\\\%s\\%s"), g_serverbak, _T("修好的片(管理软件)$"));
  956. // 若是成长套系,初修片有子目录; 若是婚纱版,初修没了景点了目录;
  957. if ( bGrowthTx && ( !strTxName.IsEmpty() && strTxName != _T("全部")) )
  958. sprintf(szOrdePath, _T("%s\\%s\\%s"), szShare, strID, strTxName);
  959. else
  960. sprintf(szOrdePath, _T("%s\\%s"), szShare, strID);
  961. if ( PathFileExists(szOrdePath) )
  962. photoDirArr.Add(CString(szOrdePath));
  963. nSize = g_aryOfSharePathInfo.GetSize();
  964. for (i = 0; i < nSize; i++)
  965. {
  966. if ( 2 == atoi(g_aryOfSharePathInfo.ElementAt(i).ElementAt(5)) )
  967. {
  968. if ( g_aryOfSharePathInfo.ElementAt(i).ElementAt(1).Compare(g_branchname.IsEmpty() ? g_domain : g_branchname) != 0 )
  969. {
  970. continue;
  971. }
  972. // 逐一加载其他共享目录;
  973. // 如果是成长套系且套系名不为空或全部;
  974. sprintf(szShare,_T("%s"),g_aryOfSharePathInfo.ElementAt(i).ElementAt(2));
  975. // 若是成长套系,初修片有子目录; 若是婚纱版,初修没了景点了目录;
  976. if ( bGrowthTx && ( !strTxName.IsEmpty() && strTxName != _T("全部")) )
  977. sprintf(szOrdePath, _T("%s\\%s\\%s"), szShare, strID, strTxName);
  978. else
  979. sprintf(szOrdePath, _T("%s\\%s"), szShare, strID);
  980. if ( PathFileExists(szOrdePath) )
  981. photoDirArr.Add(CString(szOrdePath));
  982. }
  983. }
  984. }
  985. break;
  986. case 1: // 原片;
  987. {
  988. sprintf(szShare, _T("\\\\%s\\%s"), g_serverbak, _T("客户原片(管理软件)$"));
  989. sprintf(szOrdePath, _T("%s\\%s"), szShare, strID);
  990. if ( PathFileExists(szOrdePath) )
  991. photoDirArr.Add(CString(szOrdePath));
  992. nSize = g_aryOfSharePathInfo.GetSize();
  993. for (i = 0; i < nSize; i++)
  994. {
  995. if ( 1 == atoi(g_aryOfSharePathInfo.ElementAt(i).ElementAt(5)) )
  996. {
  997. if ( g_aryOfSharePathInfo.ElementAt(i).ElementAt(1).Compare(g_branchname.IsEmpty() ? g_domain : g_branchname) != 0 )
  998. {
  999. continue;
  1000. }
  1001. // 逐一加载其他共享目录;
  1002. sprintf(szShare,"%s",g_aryOfSharePathInfo.ElementAt(i).ElementAt(2));
  1003. sprintf(szOrdePath,"%s\\%s",szShare, strID);
  1004. if ( PathFileExists(szOrdePath) )
  1005. photoDirArr.Add(CString(szOrdePath));
  1006. }
  1007. }
  1008. }
  1009. break;
  1010. }
  1011. }
  1012. /************************************************************************/
  1013. /*
  1014. 函数: GetPhotoFiles
  1015. 描述: 获取指定目录下的相片
  1016. 参数:
  1017. CStringArray* photoDirArr, 相片目录
  1018. CStringArray& filesArr 返回相片集
  1019. 返回:
  1020. */
  1021. /************************************************************************/
  1022. void ChoosePhotoForm::GetPhotoFiles(CStringArray* photoDirArr, CStringArray& filesArr)
  1023. {
  1024. if(photoDirArr == NULL)
  1025. return;
  1026. CString path = _T("");
  1027. CString filename = _T("");
  1028. for(int i=0; i<photoDirArr->GetSize(); i++)
  1029. {
  1030. ffsco o;
  1031. o.dirs(1);
  1032. o.find(LPCSTR(photoDirArr->ElementAt(i)), LPCSTR("*.*"));
  1033. ffsco::typeT coo;
  1034. ffsco::typeT::iterator it;
  1035. coo = o.co_file();
  1036. for (it = coo.begin(); coo.end() != it; it++)
  1037. {
  1038. path = (*it).c_str();
  1039. if (path.GetAt(path.ReverseFind('\\') + 1) != 's' && path.GetAt(path.ReverseFind('\\') + 1) != 'm')
  1040. {
  1041. path.MakeLower();
  1042. filename = path.Right(path.GetLength() - path.ReverseFind('\\') - 1);
  1043. if (filename.Find(".") != -1)
  1044. filename = filename.Left(filename.Find("."));
  1045. if (!g_bOriginal && !myisdigit(filename))
  1046. continue;
  1047. filesArr.Add(path);
  1048. }
  1049. }
  1050. }
  1051. }
  1052. void ChoosePhotoForm::OnBnClickedClounxp() // 云选片;
  1053. {
  1054. // TODO: 在此添加控件通知处理程序代码
  1055. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  1056. if ( pos == NULL)
  1057. {
  1058. AfxMessageBox(_T("请选中要使用云选片的订单!"));
  1059. return ;
  1060. }
  1061. INT nItem = m_List1.GetNextSelectedItem(pos);
  1062. CString strOrderNum = _T("");
  1063. CString strScenery = _T("");
  1064. CString strCustomerName = _T("");
  1065. CString strCustomerTel = _T("");
  1066. CString strStudioName = _T("");
  1067. CString strStudioTel = _T("");
  1068. CString strUniqueId = _T("");
  1069. CString strClounSite = _T("");
  1070. CString strTemp;
  1071. strOrderNum = m_List1.GetItemText(nItem, 0);
  1072. strCustomerName.Format(_T("%s,%s"), m_List1.GetItemText(nItem, 1), m_List1.GetItemText(nItem,2));
  1073. #ifdef CHILD_VERSION // 15列;
  1074. strCustomerTel.Format(_T("%s,%s"), m_List1.GetItemText(nItem, 15), m_List1.GetItemText(nItem,16));
  1075. #else
  1076. strCustomerTel.Format(_T("%s,%s"), m_List1.GetItemText(nItem, 15), m_List1.GetItemText(nItem,16));
  1077. #endif
  1078. strStudioName = g_cominfoarray.ElementAt(0).ElementAt(10);
  1079. strStudioTel = g_cominfoarray.ElementAt(0).ElementAt(11);
  1080. strClounSite = m_List1.m_arLabels.ElementAt(nItem).ElementAt(19);
  1081. INT nIndex = 0;
  1082. strTemp = g_branchname.IsEmpty() ? g_domain : g_branchname;
  1083. if ( ( nIndex = strTemp.Find(_T(".ly.com"))) == -1)
  1084. {
  1085. AfxMessageBox(_T("域名无效!"));
  1086. return;
  1087. }
  1088. strTemp = strTemp.Left(nIndex);
  1089. strTemp = strTemp.Right(6);
  1090. strUniqueId.Format(_T("%s_A_%s_0"), strTemp, strOrderNum);
  1091. if ( lyfzLibrary::LoadCloudSelectionLib() )
  1092. {
  1093. CDlgCloudSelection dlg;
  1094. dlg.SetParamters(0, strUniqueId, g_branchname.IsEmpty() ? g_domain : g_branchname, strStudioName, strStudioTel, strOrderNum,strScenery, m_List1.GetItemText(nItem, 1),m_List1.GetItemText(nItem, 2), m_List1.GetItemText(nItem, 15),m_List1.GetItemText(nItem, 16), strClounSite);
  1095. dlg.DoModal();
  1096. lyfzLibrary::FreeCloudSelectionLib();
  1097. }
  1098. else
  1099. {
  1100. AfxMessageBox(_T("加载云选片失败,请检查模块文件是否在客户目录下!"));
  1101. }
  1102. }
  1103. void ChoosePhotoForm::OnBnClickedClounxpresult()
  1104. {
  1105. // TODO: 在此添加控件通知处理程序代码
  1106. #if 0
  1107. CArray<CStringArray,CStringArray> AryCloundOrder;
  1108. AryCloundOrder.SetSize(m_List1.m_arLabels.GetSize(),1);
  1109. int i = 0;
  1110. for ( i = 0; i < m_List1.m_arLabels.GetSize(); i++ )
  1111. {
  1112. // 取出生成云链接的订单;
  1113. AryCloundOrder.ElementAt(i).RemoveAll();
  1114. AryCloundOrder.ElementAt(i).Add(m_List1.m_arLabels.ElementAt(i).ElementAt(0)); // 订单号;
  1115. AryCloundOrder.ElementAt(i).Add(m_List1.m_arLabels.ElementAt(i).ElementAt(19)); // 云地址;
  1116. AryCloundOrder.ElementAt(i).Add(_T("")); // 用于存放选片结果,暂时置空;
  1117. }
  1118. INT nIndex = 0;
  1119. CString strTemp = g_branchname.IsEmpty() ? g_domain : g_branchname;
  1120. if ( ( nIndex = strTemp.Find(_T(".ly.com"))) == -1)
  1121. {
  1122. AfxMessageBox(_T("域名无效!"));
  1123. return;
  1124. }
  1125. strTemp = strTemp.Left(nIndex);
  1126. CString strBranchId = strTemp.Right(6);
  1127. // 获取云选片结果;
  1128. CString strUniqueId = _T("");
  1129. CArray<CStringArray,CStringArray> AryJson;
  1130. if ( lyfzLibrary::LoadCloudSelectionLib() )
  1131. {
  1132. nIndex = 0;
  1133. TCHAR szResultValue[8912] = {0};
  1134. for ( i = 0; i < AryCloundOrder.GetSize(); i++ )
  1135. {
  1136. strUniqueId.Format(_T("%s_A_%s_0"), strBranchId, AryCloundOrder.ElementAt(i).ElementAt(0));
  1137. if ( ( nIndex = AryCloundOrder.ElementAt(i).ElementAt(1).Find(lyfzLibrary::g_strCloundHost)) != -1)
  1138. {
  1139. strTemp = AryCloundOrder.ElementAt(i).ElementAt(1).Mid(lyfzLibrary::g_strCloundHost.GetLength() + nIndex);
  1140. lyfzLibrary::g_getcloundresult(0, strUniqueId, strTemp, szResultValue, 8912);
  1141. AryCloundOrder.ElementAt(i).SetAt(2, szResultValue);
  1142. // 解析Json;
  1143. //lyfzLibrary::getXPJsonresult(szResultValue,AryJson);
  1144. }
  1145. }
  1146. lyfzLibrary::FreeCloudSelectionLib();
  1147. }
  1148. // 获取数据库保存的云数据;
  1149. g_sendhead.bsql = 0;
  1150. g_sendhead.code[0] = 241;
  1151. g_sendhead.tabcount = 1;
  1152. CString strFilter = _T("CloundType = 0");
  1153. CArray<CStringArray, CStringArray> AryCloundInfo;
  1154. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  1155. if ( !g_bSendOK )
  1156. return;
  1157. DataToArray(&AryCloundInfo);
  1158. // 显示并同步结果;
  1159. int j = 0;
  1160. BOOL bExist = FALSE;
  1161. CString strSQL = _T("");
  1162. for ( i = 0; i < AryCloundOrder.GetSize(); i++ )
  1163. {
  1164. if ( AryCloundOrder.ElementAt(i).ElementAt(2).IsEmpty() )
  1165. continue;
  1166. bExist = FALSE;
  1167. for ( j = 0; j < AryCloundInfo.GetSize(); j++ )
  1168. {
  1169. if ( AryCloundOrder.ElementAt(i).ElementAt(0) == AryCloundInfo.ElementAt(j).ElementAt(0) )
  1170. bExist = TRUE;
  1171. }
  1172. if ( bExist )
  1173. {
  1174. if ( AryCloundOrder.ElementAt(i).ElementAt(2) == AryCloundInfo.ElementAt(j-1).ElementAt(4) )
  1175. continue;
  1176. strSQL.Format(_T("update [CloundSelection] set [ResultJson] = '%s' where [order] = '%s'"), AryCloundOrder.ElementAt(i).ElementAt(0), AryCloundOrder.ElementAt(i).ElementAt(2));
  1177. }
  1178. else
  1179. strSQL.Format(_T("insert into [CloundSelection]( [order], [CloundType], [ResultJson]) values('%s', 0, '%s') "), AryCloundOrder.ElementAt(i).ElementAt(0), AryCloundOrder.ElementAt(i).ElementAt(2));
  1180. g_sendhead.bsql = true;
  1181. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  1182. }
  1183. #endif
  1184. CDlgCloundResult dlg;
  1185. dlg.m_pList = &m_List1;
  1186. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  1187. if ( pos != NULL )
  1188. {
  1189. INT nItem = m_List1.GetNextSelectedItem(pos);
  1190. dlg.m_nSelItem = nItem;
  1191. }
  1192. dlg.DoModal();
  1193. }