BeautifySkinFrom2.cpp 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726
  1. // BeautifySkinFrom2.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "BeautifySkinFrom2.h"
  6. #include "MyMdi.H"
  7. #include "ModifyDinDan.h"
  8. #include "ShowPic.h"
  9. #include "SelectPhotoDlg.h"
  10. #include "./helper/ffsco.h"
  11. #include "ShowCut.h"
  12. #include "CompressOption.h"
  13. #include "NetShareInfo.h"
  14. #include "DlgChuXiuInfo.h"
  15. #ifdef _DEBUG
  16. #define new DEBUG_NEW
  17. #undef THIS_FILE
  18. static char THIS_FILE[] = __FILE__;
  19. #endif
  20. IMPLEMENT_DYNCREATE(BeautifySkinFrom2, MyFormView)
  21. BeautifySkinFrom2::BeautifySkinFrom2(): MyFormView(BeautifySkinFrom2::IDD)
  22. {
  23. m_filter = _T("");
  24. m_nAdd = 0;
  25. if (g_bAllBranch)
  26. {
  27. m_nAdd = 1;
  28. }
  29. }
  30. BeautifySkinFrom2::~BeautifySkinFrom2()
  31. {
  32. }
  33. void BeautifySkinFrom2::DoDataExchange(CDataExchange* pDX)
  34. {
  35. MyFormView::DoDataExchange(pDX);
  36. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  37. DDX_Control(pDX, IDC_LIST2, m_FurtherList);
  38. DDX_Control(pDX, IDC_STATIC1, m_static1);
  39. DDX_CBString(pDX, IDC_COMBO1, m_filter);
  40. }
  41. BEGIN_MESSAGE_MAP(BeautifySkinFrom2, 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_BUTimportphoto, OnBUTimportphoto)
  47. ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
  48. ON_BN_CLICKED(IDC_BUTexportphoto, OnBUTexportphoto)
  49. ON_BN_CLICKED(IDC_BUTexportphoto2, OnBUTexportphoto2)
  50. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  51. ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
  52. ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
  53. ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
  54. ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3)
  55. END_MESSAGE_MAP()
  56. #ifdef _DEBUG
  57. void BeautifySkinFrom2::AssertValid() const
  58. {
  59. MyFormView::AssertValid();
  60. }
  61. void BeautifySkinFrom2::Dump(CDumpContext& dc) const
  62. {
  63. MyFormView::Dump(dc);
  64. }
  65. #endif
  66. void BeautifySkinFrom2::OnInitialUpdate()
  67. {
  68. MyFormView::OnInitialUpdate();
  69. CMyMdi Mdi;
  70. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  71. CRect rc2;
  72. GetWindowRect(rc2);
  73. ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
  74. EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
  75. int idarray[] = { IDC_BUTprint3, IDC_BUTexportphoto, IDC_BUTimportphoto, IDC_BUTshowphoto, IDC_BUTexportphoto2, IDC_BUTclose };
  76. int idcount = 6;
  77. int btnwid;
  78. CRect prerc;
  79. for (int a = idcount - 2; a >= 0; a--)
  80. {
  81. GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
  82. ScreenToClient(prerc);
  83. GetDlgItem(idarray[a])->GetWindowRect(rc2);
  84. ScreenToClient(rc2);
  85. btnwid = rc2.Width();
  86. rc2.right = prerc.left;
  87. rc2.left = rc2.right - btnwid;
  88. GetDlgItem(idarray[a])->MoveWindow(rc2);
  89. }
  90. m_static1.SetFont(&g_titlefont);
  91. if (g_bAllBranch == 0)
  92. {
  93. #ifdef CHILD_VERSION
  94. m_FurtherList.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;修片,100;选片,100;选片日期,100;精修,100;精修日期,100;设计,100;看设计日期,100;加急,100;取件日期,100;修片人,100;精修人,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100");
  95. #else
  96. m_FurtherList.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;修片,100;选片,100;选片日期,100;精修,100;精修日期,100;设计,100;看设计日期,100;加急,100;取件日期,100;修片人,100;精修人,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  97. #endif
  98. m_FurtherList.LoadColumnInfo(122);
  99. }
  100. else
  101. {
  102. #ifdef CHILD_VERSION
  103. m_FurtherList.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;修片,100;选片,100;选片日期,100;精修,100;精修日期,100;设计,100;看设计日期,100;加急,100;取件日期,100;修片人,100;精修人,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100");
  104. #else
  105. m_FurtherList.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;修片,100;选片,100;选片日期,100;精修,100;精修日期,100;设计,100;看设计日期,100;加急,100;取件日期,100;修片人,100;精修人,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  106. #endif
  107. m_FurtherList.LoadColumnInfo(198);
  108. GetDlgItem(IDC_BUTprint3)->ShowWindow(1);
  109. }
  110. GetData();
  111. m_combo1.AddString(g_user.name);
  112. m_combo1.GetWindowRect(rc2);
  113. ScreenToClient(rc2);
  114. rc2.bottom += 200;
  115. m_combo1.MoveWindow(rc2);
  116. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  117. SetComboHei(&m_combo1, rc2.Height());
  118. GetDlgItem(IDC_BUTexportphoto)->EnableWindow(IsHasRights2new(10));
  119. GetDlgItem(IDC_BUTexportphoto2)->EnableWindow(IsHasRights2new(11));
  120. }
  121. void BeautifySkinFrom2::FillGrid(BOOL bStatus)
  122. {
  123. if (g_bSearchFilter)
  124. {
  125. m_FurtherList.DeleteAllItems2();
  126. int ii = 0;
  127. m_FurtherList.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  128. int count = 0;
  129. {
  130. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  131. {
  132. // 条件查询==精修日期
  133. if (g_filterdate1 != "")
  134. {
  135. if (m_List1array.ElementAt(ii).ElementAt(7 + m_nAdd) < g_filterdate1 || m_List1array.ElementAt(ii).ElementAt(7 + m_nAdd) > g_filterdate2)
  136. continue;
  137. }
  138. if (g_waiter1 != "")
  139. {
  140. // 条件查询==精修人;
  141. if (m_List1array.ElementAt(ii).ElementAt(13 + m_nAdd) != g_waiter1)
  142. continue;
  143. }
  144. if (g_bAllBranch && g_filterbranch != "")
  145. {
  146. if (m_List1array.ElementAt(ii).ElementAt(0) != g_filterbranch)
  147. continue;
  148. }
  149. if (1)
  150. {
  151. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  152. }
  153. }
  154. }
  155. m_FurtherList.m_arLabels.SetSize(count, 1);
  156. ii = count;
  157. m_FurtherList.m_LabelCount = ii;
  158. m_FurtherList.SetItemCountEx(ii);
  159. CString str;
  160. str.Format("单数:%d", ii);
  161. SetDlgItemText(IDC_STATIC2, str);
  162. }
  163. else
  164. {
  165. m_FurtherList.DeleteAllItems2();
  166. int ii = 0;
  167. m_FurtherList.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  168. int count = 0;
  169. if (m_filter.IsEmpty())
  170. {
  171. if (bStatus)
  172. {
  173. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  174. {
  175. // 条件查询==选片状态&&精修状态;
  176. if (m_List1array.ElementAt(ii).ElementAt(4 + m_nAdd) == "OK" && m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) != "OK")
  177. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  178. }
  179. }
  180. else
  181. {
  182. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  183. {
  184. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  185. }
  186. }
  187. }
  188. else
  189. {
  190. if (bStatus)
  191. {
  192. int type = GetType(m_filter);
  193. if (type == 1)//电话
  194. {
  195. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  196. {
  197. // 查询条件==选片状态&&精修状态&&(手机1||手机2)
  198. if (m_List1array.ElementAt(ii).ElementAt(4 + m_nAdd) == "OK" &&
  199. m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) != "OK" &&
  200. (m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1 || m_List1array.ElementAt(ii).ElementAt(18 + m_nAdd).Find(m_filter) != -1))
  201. {
  202. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  203. }
  204. }
  205. }
  206. else if (type == 2)//拼音
  207. {
  208. m_filter.MakeUpper();
  209. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  210. {
  211. // 查询条件==选片状态&&精修状态&&(拼音1||拼音2)
  212. if (m_List1array.ElementAt(ii).ElementAt(4 + m_nAdd) == "OK" &&
  213. m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) != "OK" &&
  214. (m_List1array.ElementAt(ii).ElementAt(19 + m_nAdd).Find(m_filter) != -1 ||m_List1array.ElementAt(ii).ElementAt(20 + m_nAdd).Find(m_filter) != -1))
  215. {
  216. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  217. }
  218. }
  219. }
  220. else
  221. {
  222. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  223. {
  224. // 查询条件==选片状态&&精修状态&&(……)
  225. if (m_List1array.ElementAt(ii).ElementAt(4 + m_nAdd) == "OK" &&
  226. m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) != "OK" &&
  227. (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  228. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  229. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  230. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  231. m_List1array.ElementAt(ii).ElementAt(12).Find(m_filter) != -1 || \
  232. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1 || \
  233. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  234. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  235. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  236. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  237. m_List1array.ElementAt(ii).ElementAt(18).Find(m_filter) != -1 || \
  238. m_List1array.ElementAt(ii).ElementAt(19).Find(m_filter) != -1))
  239. {
  240. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  241. }
  242. }
  243. }
  244. }
  245. else
  246. {
  247. int type = GetType(m_filter);
  248. if (type == 1)//电话
  249. {
  250. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  251. {
  252. // 查询条件==手机1||手机2
  253. if (m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1 ||
  254. m_List1array.ElementAt(ii).ElementAt(18 + m_nAdd).Find(m_filter) != -1)
  255. {
  256. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  257. }
  258. }
  259. }
  260. else if (type == 2)//拼音
  261. {
  262. m_filter.MakeUpper();
  263. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  264. {
  265. // 查询条件==拼音1||拼音2
  266. if (m_List1array.ElementAt(ii).ElementAt(19 + m_nAdd).Find(m_filter) != -1 ||
  267. m_List1array.ElementAt(ii).ElementAt(20 + m_nAdd).Find(m_filter) != -1)
  268. {
  269. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  270. }
  271. }
  272. }
  273. else
  274. {
  275. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  276. {
  277. if (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  278. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  279. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  280. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  281. m_List1array.ElementAt(ii).ElementAt(12).Find(m_filter) != -1 || \
  282. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1 || \
  283. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  284. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  285. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  286. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  287. m_List1array.ElementAt(ii).ElementAt(18).Find(m_filter) != -1 || \
  288. m_List1array.ElementAt(ii).ElementAt(20).Find(m_filter) != -1)
  289. {
  290. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  291. }
  292. }
  293. }
  294. }
  295. }
  296. m_FurtherList.m_arLabels.SetSize(count, 1);
  297. ii = count;
  298. m_FurtherList.m_LabelCount = ii;
  299. m_FurtherList.SetItemCountEx(ii);
  300. CString str;
  301. str.Format("单数:%d", ii);
  302. SetDlgItemText(IDC_STATIC2, str);
  303. }
  304. if (!g_id.IsEmpty())
  305. {
  306. for (int i = 0; i < m_FurtherList.GetItemCount(); i++)
  307. {
  308. if (g_id == m_FurtherList.GetItemText(i, 0 + m_nAdd))
  309. {
  310. m_FurtherList.SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
  311. m_FurtherList.EnsureVisible(i, FALSE);
  312. break;
  313. }
  314. }
  315. }
  316. }
  317. void BeautifySkinFrom2::OnBUTclose()
  318. {
  319. GetParent()->SendMessage(WM_CLOSE);
  320. }
  321. void BeautifySkinFrom2::OnSelchangeCombo1()
  322. {
  323. SetTimer(1, 100, NULL);
  324. }
  325. void BeautifySkinFrom2::OnTimer(UINT nIDEvent)
  326. {
  327. KillTimer(nIDEvent);
  328. OnButton1();
  329. }
  330. BOOL BeautifySkinFrom2::PreTranslateMessage(MSG* pMsg)
  331. {
  332. try
  333. {
  334. if (pMsg->message == WM_KEYDOWN)
  335. {
  336. switch (pMsg->wParam)
  337. {
  338. case VK_RETURN:
  339. OnButton1();
  340. return 1;
  341. case 0x43: // copy
  342. if ((GetKeyState(VK_CONTROL) & 0x80))
  343. {
  344. GetFocus()->SendMessage(WM_COPY);
  345. return TRUE;
  346. }
  347. break;
  348. case 0x56: //Ctrl + V:
  349. if ((GetKeyState(VK_CONTROL) & 0x80))
  350. {
  351. GetFocus()->SendMessage(WM_PASTE);
  352. return TRUE;
  353. }
  354. break;
  355. case 0x58: // cut
  356. if ((GetKeyState(VK_CONTROL) & 0x80))
  357. {
  358. GetFocus()->SendMessage(WM_CUT);
  359. return TRUE;
  360. }
  361. break;
  362. case 0x5A: //undo
  363. case 0x59: //redo
  364. if ((GetKeyState(VK_CONTROL) & 0x80))
  365. {
  366. GetFocus()->SendMessage(WM_UNDO);
  367. return TRUE;
  368. }
  369. break;
  370. }
  371. }
  372. return MyFormView::PreTranslateMessage(pMsg);
  373. }
  374. catch (...)
  375. {
  376. }
  377. return true;
  378. }
  379. void BeautifySkinFrom2::OnBUTimportphoto() // 导入精修片 按钮;
  380. {
  381. POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
  382. if ( pos == NULL )
  383. {
  384. AfxMessageBox(_T("请选中您要导入精修片的订单!"),MB_ICONINFORMATION);
  385. return;
  386. }
  387. INT nItemCount = m_FurtherList.GetItemCount();
  388. INT nSelectedItem = m_FurtherList.GetNextSelectedItem(pos);
  389. // 获取列表信息:域名、订单号、顾客信息、景点名(成长套系名)、精修人、精修状态、精修日期;
  390. CString strBranchName = _T("");
  391. CString strBranchId = _T("");
  392. CString strOrderNum = _T("");
  393. CString strScenery = _T("");
  394. CString strCustomerInfo = _T("");
  395. CString strJingxiuRen = _T("");
  396. CString strJingxiuState = _T("");
  397. CString strJingxiuDate = _T("");
  398. // 获取域名;
  399. if ( g_bAllBranch )
  400. {// 多店汇总时;
  401. strBranchName = m_FurtherList.GetItemText(nSelectedItem, 0);
  402. strBranchId = GetDomainFromBranch( strBranchName );
  403. }
  404. else
  405. {
  406. if ( g_branchname.IsEmpty() )
  407. {// 连接本店时;
  408. strBranchId = g_domain;
  409. }
  410. else
  411. {// 连接分店时;
  412. strBranchName = g_branchname;
  413. strBranchId = GetDomainFromBranch( g_branchname );
  414. }
  415. }
  416. // 获取订单号;
  417. strOrderNum = m_FurtherList.GetItemText(nSelectedItem, 0 + m_nAdd);
  418. // 获取精修师;
  419. strJingxiuRen = m_FurtherList.GetItemText(nSelectedItem, 13 + m_nAdd); // 11
  420. // 获取精修状态;
  421. strJingxiuState = m_FurtherList.GetItemText(nSelectedItem, 6 + m_nAdd);
  422. // 获取精修日期;
  423. strJingxiuDate = m_FurtherList.GetItemText(nSelectedItem, 7 + m_nAdd);
  424. // 获取顾客信息;
  425. strCustomerInfo = m_FurtherList.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_FurtherList.GetItemText(nSelectedItem, 2 + m_nAdd);
  426. CDlgChuXiuInfo xpdlg;
  427. xpdlg.m_strOrderNumber = strOrderNum;
  428. xpdlg.m_strXiupianRen = strJingxiuRen;
  429. if ( strJingxiuState == _T("OK") )
  430. xpdlg.m_nXiupianStatus = 0;
  431. else if ( strJingxiuState == _T("修片中"))
  432. xpdlg.m_nXiupianStatus = 1;
  433. else if ( strJingxiuState == _T("未修"))
  434. xpdlg.m_nXiupianStatus = 2;
  435. CString strSQL = _T("");
  436. if ( xpdlg.DoModal() == IDOK )
  437. {
  438. if ( xpdlg.m_bGrowthTx )
  439. strScenery = xpdlg.m_strScenery;
  440. if ( xpdlg.m_nXiupianStatus == 0 )
  441. strJingxiuState = _T("OK");
  442. else if ( xpdlg.m_nXiupianStatus == 1)
  443. strJingxiuState = _T("修片中");
  444. else if ( xpdlg.m_nXiupianStatus == 2 )
  445. strJingxiuState = _T("未修");
  446. strJingxiuRen = xpdlg.m_strXiupianRen;
  447. if (strJingxiuDate.IsEmpty())
  448. strSQL.Format(_T("update dindan set waiter7 = '%s', status6 = '%s', time9 = '%s' where id = '%s' "), strJingxiuRen, strJingxiuState, g_date, strOrderNum);
  449. else
  450. strSQL.Format(_T("update dindan set waiter7 = '%s', status6 = '%s' where id = '%s'"), strJingxiuRen, strJingxiuState, strOrderNum);
  451. // 构建更新包,发送到服务端更新数据;
  452. g_sendhead.bsql = TRUE;
  453. if ( g_bAllBranch )
  454. { // 多店汇总时;
  455. g_branchip = GetBranchIPbyId(strBranchId);
  456. g_pMainWnd->OnDisconnect();
  457. g_branchname = strBranchName;
  458. g_bBranchModify = TRUE;
  459. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  460. g_pMainWnd->OnDisconnect();
  461. g_bBranchModify = FALSE;
  462. g_branchip = g_branchname = "";
  463. }
  464. else
  465. {// 连接本店或分店时;
  466. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  467. }
  468. /////////////////////////////////////////////////////////////////////////////////////////////////
  469. // 接收服务器返回的数据,并刷新界面;
  470. if (g_bSendOK == 0)
  471. {
  472. OutputDebugString(_T("接收服务信息失败\n"));
  473. return;
  474. }
  475. if ( g_bAllBranch == 0)
  476. {// 连接本店或分店时;
  477. GetData();
  478. }
  479. else
  480. {// 多店汇总时;
  481. for (int i = 0; i < m_List1array.GetSize(); i++)
  482. {
  483. if ( strOrderNum == m_List1array.ElementAt(i).ElementAt(1) && strBranchName == m_List1array.ElementAt(i).ElementAt(0))
  484. {
  485. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, strJingxiuState);
  486. if ( strJingxiuDate.IsEmpty() )
  487. m_List1array.ElementAt(i).SetAt(7 + m_nAdd, g_date);
  488. m_List1array.ElementAt(i).SetAt(13 + m_nAdd, strJingxiuRen);
  489. FillGrid();
  490. break;
  491. }
  492. }
  493. }
  494. }
  495. else
  496. {
  497. // 开始导入初修片;
  498. if ( MessageBox(_T("是否现在开始导入精修片!"), _T("导片提示:导入精修片"), MB_TOPMOST|MB_YESNO|MB_ICONWARNING ) != IDYES )
  499. {// 是否马上导入相片;
  500. return;
  501. }
  502. if ( xpdlg.m_bGrowthTx )
  503. strScenery = xpdlg.m_strScenery;
  504. if ( xpdlg.m_bGrowthTx && strScenery.IsEmpty() )
  505. {
  506. AfxMessageBox(_T("儿童成长套系导片必须选择套系名!"));
  507. return;
  508. }
  509. }
  510. /////////////////////////////////////////////////////////////////////////////////////////////////
  511. if ( g_pIMGProcess == NULL )
  512. {
  513. return;
  514. }
  515. ImgImportInterface *pImport = NULL;
  516. g_pIMGProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
  517. if ( pImport )
  518. {
  519. pImport->ImportFurtherImg(
  520. FALSE, // 文件夹形式打开源或多选文件形式;
  521. strBranchId, // 分店域名;
  522. strOrderNum, // 订单号;
  523. strCustomerInfo, // 顾客信息,可任意组合;
  524. !strScenery.IsEmpty(), // 导入时,是否生成景点名文件夹;
  525. strScenery, // 导入时,景点名;
  526. _T("*.jpg|*.jpeg"), // 导入时,主扩展名相片;
  527. INVALID_COPY_PIX, // 导入时,主扩展名相片的压缩像素;
  528. _T("*.nef|*.cr2"), // 导入时,附加的扩展名相片;
  529. TRUE, // 导入时,是否生成缩略图;
  530. SET_PIX(100,100), // 导入时,生成的缩略图像素大小;
  531. FALSE // 导入时,文件存在时是否覆盖;
  532. );
  533. g_pIMGProcess->Release();
  534. WriteOptLog(_T("导入精修,订单号:%s"),strOrderNum);
  535. }
  536. // 结束;
  537. }
  538. void BeautifySkinFrom2::OnBUTshowphoto() // 查看精修片;
  539. {
  540. POSITION pos;
  541. pos = m_FurtherList.GetFirstSelectedItemPosition();
  542. if (pos == NULL)
  543. {
  544. AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
  545. return;
  546. }
  547. int iItem = m_FurtherList.GetNextSelectedItem(pos);
  548. CString branch;
  549. CString id = m_FurtherList.GetItemText(iItem, 0 + m_nAdd);
  550. if (g_bAllBranch)
  551. branch = m_FurtherList.GetItemText(iItem, 0);
  552. CString name = m_FurtherList.GetItemText(iItem, 1 + m_nAdd) + "," + m_FurtherList.GetItemText(iItem, 2 + m_nAdd);
  553. name.TrimLeft(",");
  554. name.TrimRight(",");
  555. name = "客人:" + name;
  556. ShowPic dlg;
  557. dlg.m_id = id;
  558. dlg.m_name = name;
  559. dlg.m_mode = 3;
  560. if(g_branchname == _T(""))
  561. dlg.m_path = g_path1 + "\\";
  562. else
  563. {
  564. dlg.m_branch = GetDomainFromBranch(g_branchname);
  565. CString branchpath = GetBranchPhotoPath(g_branchname);
  566. dlg.m_path = g_path1 + branchpath + "\\";
  567. }
  568. #ifndef USE_KERNEL_DLL
  569. #if USE_SHARE_FLORD
  570. // 根据域名,相片类型,订单号查找相片;
  571. dlg.m_aryOfShareDirectory.RemoveAll();
  572. CNetShareInfo::GetInstance()->LoadOrderImages(dlg.m_mode, dlg.m_id, g_domain, dlg.m_patharray1, &dlg.m_aryOfShareDirectory);
  573. #endif
  574. #endif
  575. dlg.m_path += id;
  576. dlg.m_path += "\\";
  577. dlg.DoModal();
  578. }
  579. //-----------------------------------------------------------------
  580. // remark by Jeff 2014-12-12
  581. // 函数:GetNo
  582. // 描述:从str中解析出每个相片名,然后存入空的CStringArray中;
  583. // 参数:
  584. // str:选好的相片名串,如:"001,002,003" 后分隔符改为"|",结果应是"001|002|003"
  585. // array:空的数组,用来存放解析后的相片名;
  586. // 返回:
  587. // 注意:更换分隔符造成的问题,在该函数已解决;
  588. //-----------------------------------------------------------------
  589. void BeautifySkinFrom2::GetNo(CString str, CStringArray &array)
  590. {
  591. if (!str.IsEmpty())
  592. {
  593. #ifdef USE_SEP_VEB
  594. int pos = str.Find(SEPS_VEB);
  595. #else
  596. int pos = str.Find(",");
  597. #endif
  598. while (pos != -1)
  599. {
  600. if (FindArray(&array, str.Left(pos)) == -1)
  601. array.Add(str.Left(pos));
  602. str = str.Right(str.GetLength() - pos - 1);
  603. #ifdef USE_SEP_VEB
  604. pos = str.Find(SEPS_VEB);
  605. #else
  606. pos = str.Find(",");
  607. #endif
  608. }
  609. if (FindArray(&array, str) == -1)
  610. array.Add(str);
  611. }
  612. }
  613. //-----------------------------------------------------------------
  614. // remark by Jeff 2014-12-12
  615. // 函数:GetSelName
  616. // 描述:
  617. // 参数:
  618. // name:由GetNo解析出来后的单个相片名,如:"001"
  619. // spnamearray:订单下的商品数组,case 50所得;
  620. // 返回:
  621. // 注意:更换分隔符造成的问题,在该函数已解决;
  622. //-----------------------------------------------------------------
  623. CString BeautifySkinFrom2::GetSelName(CString name, CArray<CStringArray, CStringArray>&spnamearray)
  624. {
  625. CString ret;
  626. #ifdef USE_SEP_VEB
  627. name = SEPS_VEB + name + SEPS_VEB;
  628. #else
  629. name = "," + name + ",";
  630. #endif
  631. CString str;
  632. for (int i = 0; i < spnamearray.GetSize(); i++)
  633. {
  634. #ifdef USE_SEP_VEB
  635. str = SEPS_VEB + spnamearray.ElementAt(i).ElementAt(6) + SEPS_VEB;
  636. #else
  637. str = "," + spnamearray.ElementAt(i).ElementAt(6) + ",";
  638. #endif
  639. if (str.Find(name) != -1)
  640. {
  641. ret += spnamearray.ElementAt(i).ElementAt(5);
  642. ret += ";";
  643. }
  644. }
  645. ret.TrimRight(";");
  646. ret.Replace("*", "x");
  647. return ret;
  648. }
  649. CString GetPathFromNo2(CString dir, CString no)
  650. {
  651. CString sRet;
  652. dir.TrimRight('\\');
  653. dir += "\\";
  654. CStringArray dirarray;
  655. CString temp;
  656. using namespace helper_coffs;
  657. ffsco o;
  658. o.dirs(1);
  659. o.find(LPCSTR(dir), LPCSTR("*.*"));
  660. ffsco::typeT coo;
  661. ffsco::typeT::iterator it;
  662. coo = o.co_dir();
  663. for (it = coo.begin();coo.end() != it;it++)
  664. {
  665. temp = (*it).c_str();
  666. if (::FindArray(&dirarray, temp) == -1 && temp != dir)
  667. {
  668. dirarray.Add(temp);
  669. }
  670. }
  671. for (int i = 0; i < dirarray.GetSize(); i++)
  672. {
  673. temp = dirarray.ElementAt(i);
  674. sRet.Format("%s%s.jpg", temp, no);
  675. if (::PathFileExists(sRet))return sRet;
  676. sRet.Replace(".jpg", ".raw");
  677. if (::PathFileExists(sRet))return sRet;
  678. sRet.Replace(".raw", ".nef");
  679. if (::PathFileExists(sRet))return sRet;
  680. sRet.Replace(".nef", ".cr2");
  681. if (::PathFileExists(sRet))return sRet;
  682. sRet.Replace(".cr2", ".jpg");
  683. if (::PathFileExists(sRet))return sRet;
  684. }
  685. return dir + no + ".jpg";
  686. }
  687. CString GetPathFromNo3(CString dir, CString no)
  688. {
  689. CString sRet;
  690. dir.TrimRight('\\');
  691. dir += "\\";
  692. CStringArray dirarray;
  693. CString temp;
  694. using namespace helper_coffs;
  695. ffsco o;
  696. o.dirs(1);
  697. o.find(LPCSTR(dir), LPCSTR("*.*"));
  698. ffsco::typeT coo;
  699. ffsco::typeT::iterator it;
  700. coo = o.co_dir();
  701. for (it = coo.begin();coo.end() != it;it++)
  702. {
  703. temp = (*it).c_str();
  704. if (::FindArray(&dirarray, temp) == -1 && temp != dir)
  705. {
  706. dirarray.Add(temp);
  707. }
  708. }
  709. for (int i = 0; i < dirarray.GetSize(); i++)
  710. {
  711. temp = dirarray.ElementAt(i);
  712. sRet.Format("%s%s.jpg", temp, no);
  713. if (::PathFileExists(sRet))return sRet;
  714. }
  715. return dir + no + ".jpg";
  716. }
  717. // 导出裁剪后的效果图;
  718. void BeautifySkinFrom2::OnBUTexportphoto() // 导出选好的片 按钮;
  719. {
  720. // 判断用户是否有权限导出选好的片;
  721. if ( !IsHasRights2new(10) )
  722. {
  723. AfxMessageBox(_T("您没有权限导出选好的片!"));
  724. return;
  725. }
  726. // 获取列表信息;
  727. POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
  728. if ( pos == NULL )
  729. {
  730. AfxMessageBox(__T("请选中您要导片的订单!"));
  731. return;
  732. }
  733. INT nItemCount = m_FurtherList.GetItemCount();
  734. INT nSelectedItem = m_FurtherList.GetNextSelectedItem(pos);
  735. // 获取域名、订单号、景点名、顾客信息、选片人、选片状态、选片日期;
  736. CString strBranchName = _T("");
  737. CString strBranchId = _T("");
  738. CString strOrderNum = _T("");
  739. CString strScenery = _T("");
  740. CString strCustomerInfo = _T("");
  741. CString strXuanpianRen = _T("");
  742. CString strXuanpianState = _T("");
  743. CString strXuanpianDate = _T("");
  744. // 获取订单号;
  745. strOrderNum = m_FurtherList.GetItemText(nSelectedItem, 0 + m_nAdd);
  746. // 获取顾客信息;
  747. strCustomerInfo = m_FurtherList.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_FurtherList.GetItemText(nSelectedItem, 2 + m_nAdd);
  748. // 获取选片状态;
  749. strXuanpianState = m_FurtherList.GetItemText(nSelectedItem, 4 + m_nAdd);
  750. // 获取选片日期;
  751. strXuanpianRen = m_FurtherList.GetItemText(nSelectedItem, 5 + m_nAdd);
  752. if ( strXuanpianState == _T("未选") )
  753. {
  754. MessageBox(_T("此单未选片!"), _T("影楼管理"), MB_OK | MB_TOPMOST | MB_ICONINFORMATION );
  755. return;
  756. }
  757. // 获取域名;
  758. if ( g_bAllBranch )
  759. {// 多店汇总;
  760. strBranchName = m_FurtherList.GetItemText(nSelectedItem, 0);
  761. strBranchId = GetDomainFromBranch(strBranchName);
  762. }
  763. else
  764. {
  765. if ( g_branchname.IsEmpty() )
  766. {// 连接本店时;
  767. strBranchId = g_domain;
  768. }
  769. else
  770. {//连接分店时;
  771. strBranchName = g_branchname;
  772. strBranchId = GetDomainFromBranch( g_branchname );
  773. }
  774. }
  775. // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  776. IsGrowthTx IsGrowthtxdlg;
  777. IsGrowthtxdlg.m_mode = 1;
  778. IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
  779. IsGrowthtxdlg.DoModal();
  780. if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
  781. {
  782. return;
  783. }
  784. if ( IsGrowthtxdlg.m_bGrowthTx )
  785. {
  786. // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  787. strScenery = IsGrowthtxdlg.m_seltxname;
  788. if ( strScenery == _T("全部") )
  789. {
  790. strScenery.Empty();
  791. }
  792. }
  793. /////////////////////////////////////////////////////////////////////////////////////////////////
  794. // 与服务器通信获取指定条件的订单商品信息;
  795. CString strSQL = _T("");
  796. #ifdef CHILD_VERSION
  797. if ( IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
  798. strSQL.Format(_T("id='%s' and growthtxname = '%s'; id='%s'; id='%s' and name <> '入册' and name <> '入底'"), strOrderNum, strScenery, strOrderNum, strOrderNum);
  799. else
  800. strSQL.Format(_T("id='%s'; id='%s'; id='%s' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
  801. #else
  802. strSQL.Format(_T("id='%s'; id='%s'; id='%s' and kind <> '2' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
  803. #endif//CHILD_VERSION
  804. g_sendhead.bsql = FALSE;
  805. g_sendhead.code[0] = 50; // dindansp;
  806. g_sendhead.code[1] = 11; // dindan;
  807. g_sendhead.code[2] = 56; // dindansp;
  808. g_sendhead.tabcount = 3;
  809. if( g_bAllBranch )
  810. {//多店汇总时;
  811. g_branchip = GetBranchIPbyId(strBranchId);
  812. g_pMainWnd->OnDisconnect();
  813. g_branchname = strBranchName;
  814. g_bBranchModify = TRUE;
  815. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  816. g_pMainWnd->OnDisconnect();
  817. g_bBranchModify = FALSE;
  818. g_branchip = g_branchname = _T("");
  819. }
  820. else
  821. {// 连接本店或分店时;
  822. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  823. }
  824. if( !g_bSendOK )
  825. return ;
  826. CArray<CStringArray, CStringArray> Arydindan;
  827. CArray<CStringArray, CStringArray> Arydindansp;
  828. CArray<CStringArray, CStringArray> Arydindansp2;
  829. DataToArray( &Arydindansp, &Arydindan, &Arydindansp2 );
  830. CString strTemp = _T("");
  831. CStringArray AryImgNums;
  832. CStringArray AryPerImgGoods;
  833. // 获取所有dindansp记录no字段中的相片编号;
  834. int i = 0;
  835. int nSize = Arydindansp.GetSize();
  836. for ( i = 0; i < nSize; i++)
  837. {
  838. strTemp = Arydindansp.ElementAt(i).ElementAt(6); // dindansp表中的no字段;
  839. GetNo(strTemp, AryImgNums);
  840. }
  841. // 获取每张相片编号对应的商品,每个商品间用分号隔开;
  842. nSize = AryImgNums.GetSize();
  843. AryPerImgGoods.SetSize(nSize);
  844. for ( i = 0; i < nSize; i++ )
  845. {
  846. strTemp = AryImgNums.ElementAt(i);
  847. AryPerImgGoods.SetAt(i, GetSelName(strTemp, Arydindansp));
  848. }
  849. // 由于VC6.0传CStringArray给VC9.0DLL 时,会产生无法避免的兼容性问题,故使用CString传;
  850. CString strImgNums = _T("");
  851. for ( i = 0; i < AryImgNums.GetSize(); i++ )
  852. {
  853. strImgNums += AryImgNums.ElementAt(i);
  854. strImgNums += _T("?|?");
  855. }
  856. CString strPerImgGoods = _T("");
  857. for ( i = 0; i < AryPerImgGoods.GetSize(); i++ )
  858. {// 商品名称,应该禁止包含非法字符;
  859. strPerImgGoods += AryPerImgGoods.ElementAt(i);
  860. strPerImgGoods += _T("?|?");
  861. }
  862. // 再选择导出的是初修片、原片、初修+原片,并且是否按产品生成文件夹分类相片或者相片名后带产品名;
  863. SelectPhotoDlg selectdlg;
  864. selectdlg.DoModal();
  865. BOOL bExportWithName = selectdlg.m_check1;
  866. INT bExportMode = selectdlg.m_mode; // 0 原片+初修, 1 原片, 2 初修;
  867. // 保存导出相片的路径;
  868. CString strSaveDirectory = _T("");
  869. if ( g_pIMGProcess == NULL )
  870. {
  871. return ;
  872. }
  873. ImgExportInterface *pExport = NULL;
  874. g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
  875. if ( pExport )
  876. {// 导出选好的片;
  877. HGLOBAL hMemery = pExport->ExportSelectedBeautifyImg(
  878. strBranchId,
  879. strOrderNum,
  880. strCustomerInfo,
  881. !strScenery.IsEmpty(),
  882. strScenery,
  883. _T("*.jpg|*.jpeg"),
  884. INVALID_COPY_PIX,
  885. _T("*.nef|*.cr2|*.raw|"),
  886. FALSE,
  887. bExportWithName,
  888. IsGrowthtxdlg.m_bGrowthTx,
  889. bExportMode,
  890. strImgNums,
  891. strPerImgGoods,
  892. Arydindan.ElementAt(0).ElementAt(60)
  893. );
  894. WriteOptLog(_T("导出选好的片,订单号:%s"),strOrderNum);
  895. if ( hMemery )
  896. {
  897. CString strDir = _T("");
  898. TCHAR* pszSaveDirectory = (TCHAR*)GlobalLock(hMemery);
  899. GlobalUnlock(hMemery);
  900. // 输出输出要求内容;
  901. strDir.Format(_T("%s\\客户要求.txt"), pszSaveDirectory);
  902. if ( Arydindan.GetSize() )
  903. {
  904. CStdioFile fp;
  905. fp.Open(strDir, CFile::modeCreate | CFile::modeWrite);
  906. fp.WriteString(_T("选片要求:\n"));
  907. fp.WriteString(Arydindan.ElementAt(0).ElementAt(39) + _T(" ") + Arydindan.ElementAt(0).ElementAt(75));
  908. fp.WriteString(_T("\n"));
  909. fp.WriteString(_T("\n"));
  910. fp.WriteString(_T("订单要求:\n"));
  911. fp.WriteString(Arydindan.ElementAt(0).ElementAt(38));
  912. fp.WriteString(_T("\n"));
  913. fp.WriteString(_T("\n"));
  914. fp.WriteString(_T("客人产品:\n"));
  915. CString str;
  916. str = _T("产品名称");
  917. FillLength(str, 30);
  918. str += _T("数量");
  919. FillLength(str, 40);
  920. #ifdef LKAY_VERSION
  921. str += _T("P数");
  922. FillLength(str, 50);
  923. str += _T("加急");
  924. FillLength(str, 60);
  925. str += _T("取件日期");
  926. FillLength(str, 70);
  927. #else
  928. str += _T("加急");
  929. FillLength(str, 50);
  930. str += _T("取件日期");
  931. FillLength(str, 60);
  932. #endif
  933. fp.WriteString(str);
  934. fp.WriteString(_T("\n"));
  935. for (int i = 0; i < Arydindansp2.GetSize(); i++)
  936. {
  937. str.Empty();
  938. str = Arydindansp2.ElementAt(i).ElementAt(0);
  939. FillLength(str, 30);
  940. str += Arydindansp2.ElementAt(i).ElementAt(1);
  941. FillLength(str, 40);
  942. #ifdef LKAY_VERSION
  943. str += Arydindansp2.ElementAt(i).ElementAt(29); //p数
  944. FillLength(str, 50);
  945. str += Arydindansp2.ElementAt(i).ElementAt(18);
  946. FillLength(str, 60);
  947. str += Arydindansp2.ElementAt(i).ElementAt(19);
  948. FillLength(str, 70);
  949. #else
  950. str += Arydindansp2.ElementAt(i).ElementAt(18);
  951. FillLength(str, 50);
  952. str += Arydindansp2.ElementAt(i).ElementAt(19);
  953. FillLength(str, 60);
  954. #endif
  955. fp.WriteString(str);
  956. fp.WriteString(_T("\n"));
  957. }
  958. fp.Close();
  959. }
  960. // 导出条形码位图;
  961. if ( g_bExportBarCode )
  962. {
  963. for ( int j = Arydindansp.GetSize() - 1; j >= 0; j-- )
  964. {
  965. if ( Arydindansp.ElementAt(j).ElementAt(6).IsEmpty() )
  966. Arydindansp.RemoveAt(j);
  967. }
  968. if ( !bExportWithName )
  969. {
  970. for ( int i = 0; i < Arydindansp.GetSize(); i++ )
  971. {
  972. strDir.Format(_T("%s\\%s"), pszSaveDirectory, Arydindansp.ElementAt(i).ElementAt(5));
  973. if ( PathFileExists(strDir) )
  974. {
  975. // 商品目录存在才导出;
  976. pExport->ExportBarCodeImg(0, g_screenwid, g_screenhei, 1, 40, Arydindansp.ElementAt(i).ElementAt(7), Arydindansp.ElementAt(i).ElementAt(0), Arydindansp.ElementAt(i).ElementAt(5), strDir);
  977. }
  978. }
  979. }
  980. pExport->ExportOrderBarCodeImg(0, g_screenwid, g_screenhei*3, 1, 40, Arydindansp, pszSaveDirectory);
  981. }
  982. }
  983. OutputDebugString(_T("导出选好的片!\n"));
  984. }
  985. pExport->Release();
  986. // 结束;
  987. }
  988. void BeautifySkinFrom2::OnBUTexportphoto2() // 导出精修的片 按钮;
  989. {
  990. // 判断登陆用户是否有导出原片的权限;
  991. if ( !IsHasRights2new(11) )
  992. {
  993. AfxMessageBox(_T("您无权限导出原片!"),MB_ICONINFORMATION);
  994. return;
  995. }
  996. // 获取列表信息:域名、订单号、景点名、顾客信息;
  997. POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
  998. if ( pos == NULL )
  999. {
  1000. AfxMessageBox(_T("请选中您要导出原片的订单!"), MB_ICONINFORMATION);
  1001. return;
  1002. }
  1003. INT nItemCount = m_FurtherList.GetItemCount();
  1004. INT nSelectedItem = m_FurtherList.GetNextSelectedItem(pos);
  1005. CString strBranchId = _T("");
  1006. CString strOrderNum = _T("");
  1007. // 初修列表不支持景点名,需要从其他地方获取;
  1008. CString strScenery = _T("");
  1009. CString strCustomerInfo = _T("");
  1010. // 获取域名;
  1011. if ( g_bAllBranch )
  1012. {// 多店汇总时;
  1013. strBranchId = GetDomainFromBranch( m_FurtherList.GetItemText(nSelectedItem, 0) );
  1014. }
  1015. else
  1016. {
  1017. if ( g_branchname.IsEmpty() )
  1018. {// 连接本店时;
  1019. strBranchId = g_domain;
  1020. }
  1021. else
  1022. {// 连接分店时;
  1023. strBranchId = GetDomainFromBranch( g_branchname );
  1024. }
  1025. }
  1026. // 获取订单号;
  1027. strOrderNum = m_FurtherList.GetItemText(nSelectedItem, 0 + m_nAdd);
  1028. // 获取顾客信息;
  1029. strCustomerInfo = m_FurtherList.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_FurtherList.GetItemText(nSelectedItem, 2 + m_nAdd);
  1030. // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  1031. IsGrowthTx IsGrowthtxdlg;
  1032. IsGrowthtxdlg.m_mode = 1;
  1033. IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
  1034. IsGrowthtxdlg.DoModal();
  1035. if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
  1036. {
  1037. return;
  1038. }
  1039. if ( IsGrowthtxdlg.m_bGrowthTx )
  1040. {
  1041. // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  1042. strScenery = IsGrowthtxdlg.m_seltxname;
  1043. if ( strScenery == _T("全部") )
  1044. {
  1045. strScenery.Empty();
  1046. }
  1047. }
  1048. // 导出原片时,是否压缩导出;
  1049. DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素;
  1050. /////////////////////////////////////////////////////////////////////////////////////////////////
  1051. if ( g_pIMGProcess == NULL )
  1052. {
  1053. return ;
  1054. }
  1055. // 获取完信息,开始导出原片;
  1056. ImgExportInterface *pExport = NULL;
  1057. g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
  1058. if ( pExport )
  1059. {
  1060. pExport->ExportFurtherImg(
  1061. TRUE,
  1062. strBranchId,
  1063. strOrderNum,
  1064. strCustomerInfo,
  1065. !strScenery.IsEmpty(),
  1066. strScenery,
  1067. _T("*.jpg|*.jpeg"),
  1068. dwExportPix,
  1069. _T("*.nef|*.cr2|*.raw|*.ra2"),
  1070. FALSE,
  1071. FALSE
  1072. );
  1073. }
  1074. g_pIMGProcess->Release();
  1075. WriteOptLog(_T("导出精修,订单号:%s"),strOrderNum);
  1076. // 结束;
  1077. }
  1078. void BeautifySkinFrom2::OnButton1()
  1079. {
  1080. UpdateData();
  1081. m_filter.TrimLeft();
  1082. m_filter.TrimRight();
  1083. FillGrid();
  1084. }
  1085. void BeautifySkinFrom2::OnButton2() // 已选未修 按钮;
  1086. {
  1087. UpdateData();
  1088. m_filter.TrimLeft();
  1089. m_filter.TrimRight();
  1090. FillGrid(1);
  1091. }
  1092. void BeautifySkinFrom2::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
  1093. {
  1094. NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
  1095. POSITION pos;
  1096. pos = m_FurtherList.GetFirstSelectedItemPosition();
  1097. if (pos == NULL)
  1098. {
  1099. return;
  1100. }
  1101. int iItem = m_FurtherList.GetNextSelectedItem(pos);
  1102. if (IsHasRights2new(6) || IsHasRights2new(49))
  1103. {
  1104. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1105. }
  1106. else
  1107. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
  1108. /* if(waiter7.IsEmpty () && IsHasRights2new(6) || IsHasRights2new(49))
  1109. {
  1110. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1111. }
  1112. else if(waiter7==g_user.name && IsHasRights2new(6) )
  1113. {
  1114. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1115. }
  1116. else
  1117. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);*/
  1118. *pResult = 0;
  1119. }
  1120. void BeautifySkinFrom2::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  1121. {
  1122. POSITION pos;
  1123. pos = m_FurtherList.GetFirstSelectedItemPosition();
  1124. if (pos == NULL)return;
  1125. int iItem = m_FurtherList.GetNextSelectedItem(pos);
  1126. g_id = m_FurtherList.GetItemText(iItem, 0 + m_nAdd);
  1127. *pResult = 0;
  1128. }
  1129. void BeautifySkinFrom2::HidePrice()
  1130. {
  1131. #ifdef LKAY_VERSION
  1132. return;
  1133. #else
  1134. return;
  1135. #endif
  1136. }
  1137. void BeautifySkinFrom2::OnBtnsearchfilter()
  1138. {
  1139. SearchFilter dlg;
  1140. dlg.m_mode = 3;
  1141. if (dlg.DoModal() == IDOK)FillGrid();
  1142. g_bSearchFilter = 0;
  1143. }
  1144. void BeautifySkinFrom2::GetData()
  1145. {
  1146. if (g_bAllBranch == 0)
  1147. {
  1148. if (g_bShowOK == 0)
  1149. {
  1150. #ifdef LKAY_VERSION
  1151. CString filter = "status3='未取' and (dindantype<>'意向客户' or dindantype is null)";
  1152. #else
  1153. CString filter = "status3='未取'";
  1154. #endif
  1155. g_sendhead.bsql = 0;
  1156. g_sendhead.code[0] = 35;
  1157. g_sendhead.tabcount = 1;
  1158. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1159. if (g_bSendOK == 0)return;
  1160. }
  1161. else
  1162. {
  1163. g_sendhead.bsql = 0;
  1164. g_sendhead.code[0] = 35;
  1165. g_sendhead.tabcount = 1;
  1166. #ifdef LKAY_VERSION
  1167. CString filter = "dindantype<>'意向客户' or dindantype is null";
  1168. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1169. #else
  1170. g_pMainWnd->ProcessChatMessageRequest2(1);
  1171. #endif
  1172. if (g_bSendOK == 0)return;
  1173. }
  1174. DataToArray(&m_List1array);
  1175. }
  1176. else
  1177. {
  1178. //////////////数据汇总
  1179. m_List1array.RemoveAll();
  1180. CString branch;
  1181. for (int i = -1; i < g_brancharray.GetSize() - 1; i++)
  1182. {
  1183. if (i != -1)
  1184. {
  1185. branch = g_brancharray.ElementAt(i).ElementAt(0);
  1186. g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
  1187. g_pMainWnd->OnDisconnect();
  1188. g_branchname = branch;
  1189. g_bBranchModify = 1;
  1190. }
  1191. else
  1192. branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0);
  1193. if (g_bShowOK == 0)
  1194. {
  1195. CString filter = "status3='未取'";
  1196. g_sendhead.bsql = 0;
  1197. g_sendhead.code[0] = 35;
  1198. g_sendhead.tabcount = 1;
  1199. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1200. if (g_bSendOK == 0)continue;
  1201. }
  1202. else
  1203. {
  1204. g_sendhead.bsql = 0;
  1205. g_sendhead.code[0] = 35;
  1206. g_sendhead.tabcount = 1;
  1207. g_pMainWnd->ProcessChatMessageRequest2(1);
  1208. if (g_bSendOK == 0)continue;
  1209. }
  1210. CArray<CStringArray, CStringArray>List1array;
  1211. DataToArray(&List1array);
  1212. int size = m_List1array.GetSize();
  1213. for (int j = 0; j < List1array.GetSize(); j++)
  1214. {
  1215. size++;
  1216. m_List1array.SetSize(size, 1);
  1217. size--;
  1218. m_List1array.ElementAt(size).Copy(List1array.ElementAt(j));
  1219. m_List1array.ElementAt(size).InsertAt(0, branch);
  1220. size++;
  1221. }
  1222. }
  1223. g_pMainWnd->OnDisconnect();
  1224. g_bBranchModify = 0; g_branchip = g_branchname = "";
  1225. }
  1226. HidePrice();
  1227. FillGrid();
  1228. }
  1229. void BeautifySkinFrom2::OnBUTprint3()
  1230. {
  1231. GetData();
  1232. }
  1233. #if USE_SHARE_FLORD
  1234. /************************************************************************/
  1235. /*
  1236. 函数:GetCurSelRecord
  1237. 描述:获取当前List列表选中的项记录;
  1238. 参数:
  1239. OUT:strName1 选中项的顾客1姓名;
  1240. OUT:strName2 选中项的顾客2姓名;
  1241. OUT:strOrderNum 选中项的订单号;
  1242. OUT:strDomain 选中项的所在分店域名,本店为空;
  1243. 返回:
  1244. 调用约定:
  1245. 注意:
  1246. */
  1247. /************************************************************************/
  1248. void BeautifySkinFrom2::GetCurSelRecord(
  1249. OUT CString &strName1,
  1250. OUT CString &strName2,
  1251. OUT CString &strOrderNum,
  1252. OUT CString &strBranch,
  1253. OUT CString &strDomain)
  1254. {
  1255. UpdateData();
  1256. // 获取所中行;
  1257. POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
  1258. if ( pos == NULL)
  1259. {
  1260. AfxMessageBox(_T("请先选中您要导片的定单!"), MB_ICONINFORMATION);
  1261. return;
  1262. }
  1263. int nItem = m_FurtherList.GetNextSelectedItem(pos);
  1264. // 获取选片状态, m_nAdd作用?;
  1265. CString strStatus = m_FurtherList.GetItemText(nItem,4 + m_nAdd);
  1266. if ( strStatus != _T("OK") )
  1267. {
  1268. AfxMessageBox(_T("此单未选片!"), MB_ICONINFORMATION);
  1269. return;
  1270. }
  1271. strOrderNum = m_FurtherList.GetItemText(nItem, 0 + m_nAdd);
  1272. strName1 = m_FurtherList.GetItemText(nItem, 1 + m_nAdd);
  1273. strName2 = m_FurtherList.GetItemText(nItem, 2 + m_nAdd);
  1274. if ( g_bAllBranch )
  1275. {
  1276. // 多店汇总时;
  1277. strBranch = m_FurtherList.GetItemText(nItem, 0);
  1278. strDomain = GetDomainFromBranch(strBranch);
  1279. }
  1280. else
  1281. {
  1282. if(g_branchname != _T(""))
  1283. {
  1284. strBranch = g_branchname;
  1285. strDomain = GetDomainFromBranch(g_branchname);
  1286. }
  1287. }
  1288. }
  1289. /************************************************************************/
  1290. /*
  1291. 函数:GetImageWithGoods
  1292. 描述:获取每张相片对应的商品串;
  1293. 参数:
  1294. IN: strBranch 分店名(多店汇总时)
  1295. IN: strDomain 分店域名(多店汇总或分店连接时);
  1296. IN: strOrderNum 订单号;
  1297. OUT: bGrowth 是否是儿童套系;
  1298. OUT: strSelGrowth 若bGrowth为TRUE,则这里为选中的成长套系名称;
  1299. OUT: bExportWithName 导出选好的片是否带商品名;
  1300. OUT: strAryOfImagePath 选中的相片路径;
  1301. OUT: strEachImageOfGoods与strAryOfImagePath元素位置对应,每一个元素都是strAryOfImagePath元素的商品表(用分号隔开);
  1302. 返回:返回导出的相片类型,== -1 无相片, 1 == 原片,0 == 初修片, 3 == 无初修,使用原片, //== 4 选择的是原片,但原片空....
  1303. 调用约定:
  1304. 注意:
  1305. */
  1306. /************************************************************************/
  1307. int BeautifySkinFrom2::GetImageWithGoods(
  1308. IN CString &strBranch,
  1309. IN CString &strDomain,
  1310. IN CString &strOrderNum,
  1311. OUT BOOL &bGrowth,
  1312. OUT CString &strSelGrowth,
  1313. OUT BOOL &bExportWithName,
  1314. OUT CStringArray &strAryOfImagePath,
  1315. OUT CStringArray &strAryOfEachImageOfGoods,
  1316. OUT CArray<CStringArray, CStringArray> &sparray2)
  1317. {
  1318. // 若是儿童成长套系,则弹出选项框;
  1319. CStringArray strAryOfScenery;
  1320. IsGrowthTx growthtxdlg;
  1321. growthtxdlg.m_mode = 1;
  1322. growthtxdlg.m_pAryOfScenery = &strAryOfScenery;
  1323. growthtxdlg.m_strOrderNumber = strOrderNum;
  1324. growthtxdlg.DoModal();
  1325. bGrowth = growthtxdlg.m_bGrowthTx;
  1326. strSelGrowth = growthtxdlg.m_seltxname;
  1327. // 与服务器通信获取指定条件的订单商品信息;
  1328. CString strFilter = _T("");
  1329. #ifdef CHILD_VERSION
  1330. if ( !strSelGrowth.IsEmpty() && strSelGrowth != _T("全部") )
  1331. {
  1332. strFilter.Format(_T("id='%s' and growthtxname = '%s'; id='%s'; id='%s' and name <> '入册' and name <> '入底'"), strOrderNum, strSelGrowth, strOrderNum, strOrderNum);
  1333. }
  1334. else
  1335. {
  1336. strFilter.Format(_T("id='%s'; id='%s'; id='%s' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
  1337. }
  1338. #else
  1339. strFilter.Format(_T("id='%s'; id='%s'; id='%s' and kind <> '2' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
  1340. #endif
  1341. g_sendhead.bsql = 0;
  1342. g_sendhead.code[0] = 50;
  1343. g_sendhead.code[1] = 11;
  1344. g_sendhead.code[2] = 56;
  1345. g_sendhead.tabcount = 3;
  1346. if( !g_bAllBranch )
  1347. {
  1348. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  1349. }
  1350. else
  1351. {
  1352. g_branchip = GetIP(strBranch);
  1353. g_pMainWnd->OnDisconnect();
  1354. g_branchname = strBranch;
  1355. g_bBranchModify = 1;
  1356. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  1357. g_pMainWnd->OnDisconnect();
  1358. g_bBranchModify = 0;
  1359. g_branchip = g_branchname = _T("");
  1360. }
  1361. if( !g_bSendOK )
  1362. return -1;
  1363. CArray<CStringArray, CStringArray> sparray;
  1364. //CArray<CStringArray, CStringArray> sparray2;
  1365. DataToArray( &sparray, &g_List1array, &sparray2 );
  1366. CString strTemp;
  1367. CStringArray strAryOfImageNum; // 所有相片的数字编号;
  1368. // 获取所有dindansp记录no字段中的相片编号;
  1369. int i = 0;
  1370. int nSize = sparray.GetSize();
  1371. for ( i = 0; i < nSize; i++)
  1372. {
  1373. strTemp = sparray.ElementAt(i).ElementAt(6); // dindansp表中的no字段;
  1374. // WriteTextLog(_T("no:") + strTemp);
  1375. GetNo(strTemp, strAryOfImageNum);
  1376. }
  1377. if ( strAryOfImageNum.GetSize() == 0 )
  1378. {
  1379. AfxMessageBox(_T("此单未选片!"),MB_ICONINFORMATION);
  1380. return -1;
  1381. }
  1382. // 获取每个相片编号关联的商品集合,用分号隔开;
  1383. strAryOfEachImageOfGoods.SetSize(strAryOfImageNum.GetSize());
  1384. nSize = strAryOfImageNum.GetSize();
  1385. for( int n = 0; n < nSize; n++)
  1386. {
  1387. strTemp = strAryOfImageNum.ElementAt(n);
  1388. // WriteTextLog(_T("关联的号码:") + strTemp);
  1389. CString strspnames = GetSelName(strTemp, sparray);
  1390. // WriteTextLog(_T("关联的商品:") + strspnames);
  1391. strAryOfEachImageOfGoods.SetAt(n, strspnames);
  1392. }
  1393. CStringArray strTempImageGoods;
  1394. strTempImageGoods.Copy(strAryOfEachImageOfGoods);
  1395. SelectPhotoDlg selectdlg;
  1396. selectdlg.DoModal();
  1397. bExportWithName = selectdlg.m_check1;
  1398. int nPhotoType = selectdlg.m_mode; //mode模式:2.初修 1.原片 0.初修+原片 //相片类型1=原片 2=初修 3=精修 4=设计
  1399. // 遍历所有共享目录,查找相片路径;
  1400. CStringArray imagePathArr;
  1401. CStringArray imageNumArr;
  1402. imageNumArr.Copy(strAryOfImageNum);
  1403. if(nPhotoType == 0)
  1404. {
  1405. // printf(_T("原片+初修\n"));
  1406. for(i=2; i>0; --i)
  1407. {
  1408. imagePathArr.RemoveAll();
  1409. LoadExistsImagesEx(i, strDomain, strOrderNum, bGrowth, strSelGrowth, strAryOfScenery, imageNumArr, imagePathArr, strAryOfEachImageOfGoods);
  1410. if(strAryOfImagePath.GetSize() == 0)
  1411. strAryOfImagePath.Append(imagePathArr);
  1412. else
  1413. {
  1414. int nSize = strAryOfImagePath.GetSize();
  1415. for(int j=0; j<nSize; j++)
  1416. {
  1417. //去掉相同的相片
  1418. CString strName1 = strAryOfImagePath.ElementAt(j);
  1419. strName1 = strName1.Right(strName1.GetLength() - strName1.ReverseFind('\\') - 1);
  1420. for(int k=0; k<imagePathArr.GetSize(); k++)
  1421. {
  1422. CString strName2 = imagePathArr.ElementAt(k);
  1423. strName2 = strName2.Right(strName2.GetLength() - strName2.ReverseFind('\\') - 1);
  1424. if(strName1 == strName2)
  1425. {
  1426. imagePathArr.RemoveAt(k);
  1427. break;
  1428. }
  1429. }
  1430. }
  1431. if(imagePathArr.GetSize() > 0)
  1432. strAryOfImagePath.Append(imagePathArr);
  1433. }
  1434. }
  1435. }
  1436. else
  1437. {
  1438. LoadExistsImagesEx(nPhotoType, strDomain, strOrderNum, bGrowth, strSelGrowth, strAryOfScenery, imageNumArr, imagePathArr, strAryOfEachImageOfGoods);
  1439. if(imagePathArr.GetSize() > 0)
  1440. strAryOfImagePath.Copy(imagePathArr);
  1441. }
  1442. if ( strAryOfImagePath.GetSize() == 0 && nPhotoType == 2)
  1443. {
  1444. AfxMessageBox(_T("注意:此单未修片, 导出的是原片!"), MB_ICONINFORMATION);
  1445. nPhotoType = 1;
  1446. strAryOfImagePath.RemoveAll();
  1447. strAryOfEachImageOfGoods.RemoveAll();
  1448. strAryOfEachImageOfGoods.Copy(strTempImageGoods);
  1449. LoadExistsImagesEx(nPhotoType,strDomain,strOrderNum,bGrowth,strSelGrowth,strAryOfScenery,imageNumArr,imagePathArr,strAryOfEachImageOfGoods);
  1450. if(imagePathArr.GetSize() > 0)
  1451. strAryOfImagePath.Append(imagePathArr);
  1452. return strAryOfImagePath.GetSize() ? 3 : -1;
  1453. }
  1454. //按编号排序
  1455. CStringArray tempPathArr;
  1456. tempPathArr.Copy(strAryOfImagePath);
  1457. strAryOfImagePath.RemoveAll();
  1458. for(int j=0; j<imageNumArr.GetSize(); j++)
  1459. {
  1460. BOOL bExists = FALSE;
  1461. CString strNum = imageNumArr.ElementAt(j);
  1462. for(i=0; i<tempPathArr.GetSize(); i++)
  1463. {
  1464. CString strFile = tempPathArr.ElementAt(i);
  1465. strFile = strFile.Mid(strFile.ReverseFind('\\')+1);
  1466. int nPos = strFile.Find(_T("."));
  1467. if(nPos == -1)
  1468. continue;
  1469. strFile = strFile.Left(nPos);
  1470. if(strNum.CompareNoCase(strFile) == 0)
  1471. {
  1472. strAryOfImagePath.Add(tempPathArr.ElementAt(i));
  1473. bExists = TRUE;
  1474. break;
  1475. }
  1476. }
  1477. if(!bExists)
  1478. strAryOfImagePath.Add(_T(""));
  1479. }
  1480. return strAryOfImagePath.GetSize() ? selectdlg.m_mode : -1;
  1481. }
  1482. /************************************************************************/
  1483. /*
  1484. 函数:LoadExistsImagesEx
  1485. 描述:加载存在的相片编号文件;
  1486. 参数:
  1487. IN:nPhotoType 导出的相片类型;
  1488. IN:lpDomain 域名;
  1489. IN:lpOrderNum 订单号;
  1490. IN:bGrowTh 是否儿童成长套系;
  1491. IN:lpSelectName 选中的成长套系名;
  1492. IN:strAryOfScenery 订单下的景点名或儿童成长套系名数组;
  1493. IN:strAryOfImageNum 订单选好商品的相片编号数组;
  1494. OUT:strAryOfImagePath 存在于共享目录的相片编号文件路径数组;
  1495. OUT:strAryOfImageGoods 存在于共享目录的相片关联的商品数组;
  1496. 返回:
  1497. 调用约定:
  1498. 注意:
  1499. */
  1500. /************************************************************************/
  1501. void BeautifySkinFrom2::LoadExistsImagesEx(IN const int &nPhotoType,
  1502. IN LPCTSTR lpDomain,
  1503. IN LPCTSTR lpOrderNum,
  1504. IN BOOL bGrowTh,
  1505. IN LPCTSTR lpSelectName,
  1506. IN CStringArray &strAryOfScenery,
  1507. IN CStringArray &strAryOfImageNum,
  1508. OUT CStringArray &strAryOfImagePath,
  1509. OUT CStringArray &strAryOfImageGoods)
  1510. {
  1511. CStringArray strTempNum; //临时相片编号如:001,002
  1512. strTempNum.Copy(strAryOfImageNum);
  1513. CStringArray strTempImagePath; //临时相片路径集
  1514. //根据选好的相片编号查找
  1515. CNetShareInfo::GetInstance()->LoadOrderBySelectedImages(nPhotoType, lpOrderNum, lpDomain, strTempNum, strTempImagePath);
  1516. CString strScenery(lpSelectName);
  1517. /*
  1518. printf("-----bGrowTh = %d---------------strScenery = %s--------------------\n", bGrowTh, lpSelectName);
  1519. */
  1520. if ( bGrowTh && ( !strScenery.IsEmpty() && strScenery != _T("全部")) )
  1521. {
  1522. // 保留套系名下的相片;
  1523. CString str;
  1524. if ( nPhotoType == 1 )
  1525. {
  1526. // 原片;
  1527. for ( int i = 0; i < strTempImagePath.GetSize(); i++)
  1528. {
  1529. str = strTempImagePath.ElementAt(i);
  1530. str = str.Mid(str.Find(lpOrderNum) + strlen(lpOrderNum) + 1);
  1531. str = str.Left(str.Find('\\'));
  1532. if ( str.CompareNoCase(strScenery) == 0 )
  1533. {
  1534. strAryOfImagePath.Add(strTempImagePath.ElementAt(i));
  1535. }
  1536. }
  1537. }
  1538. else
  1539. {
  1540. // 初修;
  1541. for ( int i = 0; i < strTempImagePath.GetSize(); i++)
  1542. {
  1543. str = strTempImagePath.ElementAt(i);
  1544. int nIndex = str.Find(lpOrderNum);
  1545. str.Insert(nIndex + strlen(lpOrderNum) + 1, strScenery + _T("\\"));
  1546. if ( PathFileExists(str) )
  1547. strAryOfImagePath.Add(strTempImagePath.ElementAt(i));
  1548. }
  1549. }
  1550. }
  1551. else
  1552. {
  1553. /*
  1554. for(int i=0; i<strTempImagePath.GetSize(); )
  1555. {
  1556. CString strPath = strTempImagePath.ElementAt(i);
  1557. strPath = strPath.Right(strPath.GetLength() - strPath.ReverseFind('\\') - 1);
  1558. strPath = strPath.Left(strPath.Find('.'));
  1559. printf("strPath = %s\n", strPath);
  1560. if(FindArray(&strTempNum, strPath) == -1)
  1561. {
  1562. printf("remove = %s\n", strTempImagePath.ElementAt(i));
  1563. strTempImagePath.RemoveAt(i);
  1564. }
  1565. else
  1566. i++;
  1567. }
  1568. */
  1569. strAryOfImagePath.Copy(strTempImagePath);
  1570. }
  1571. /*test
  1572. for(int i=0; i<strAryOfImagePath.GetSize(); i++)
  1573. printf("path10 = %s\n", strAryOfImagePath.ElementAt(i));
  1574. */
  1575. }
  1576. #endif