BeautifySkinFrom2.cpp 71 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699
  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 "ImportPhoto.h"
  9. #include "ShowPic.h"
  10. #include "SelectPhotoDlg.h"
  11. #include "./helper/ffsco.h"
  12. #include "ShowCut.h"
  13. #include "CompressOption.h"
  14. #include "NetShareInfo.h"
  15. #include "DlgChuXiuInfo.h"
  16. #ifdef _DEBUG
  17. #define new DEBUG_NEW
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21. IMPLEMENT_DYNCREATE(BeautifySkinFrom2, MyFormView)
  22. BeautifySkinFrom2::BeautifySkinFrom2(): MyFormView(BeautifySkinFrom2::IDD)
  23. {
  24. m_filter = _T("");
  25. m_nAdd = 0;
  26. if (g_bAllBranch)
  27. {
  28. m_nAdd = 1;
  29. }
  30. }
  31. BeautifySkinFrom2::~BeautifySkinFrom2()
  32. {
  33. }
  34. void BeautifySkinFrom2::DoDataExchange(CDataExchange* pDX)
  35. {
  36. MyFormView::DoDataExchange(pDX);
  37. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  38. DDX_Control(pDX, IDC_LIST2, m_FurtherList);
  39. DDX_Control(pDX, IDC_STATIC1, m_static1);
  40. DDX_CBString(pDX, IDC_COMBO1, m_filter);
  41. }
  42. BEGIN_MESSAGE_MAP(BeautifySkinFrom2, MyFormView)
  43. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  44. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  45. ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  46. ON_WM_TIMER()
  47. ON_BN_CLICKED(IDC_BUTimportphoto, OnBUTimportphoto)
  48. ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
  49. ON_BN_CLICKED(IDC_BUTexportphoto, OnBUTexportphoto)
  50. ON_BN_CLICKED(IDC_BUTexportphoto2, OnBUTexportphoto2)
  51. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  52. ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
  53. ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
  54. ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
  55. ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3)
  56. END_MESSAGE_MAP()
  57. #ifdef _DEBUG
  58. void BeautifySkinFrom2::AssertValid() const
  59. {
  60. MyFormView::AssertValid();
  61. }
  62. void BeautifySkinFrom2::Dump(CDumpContext& dc) const
  63. {
  64. MyFormView::Dump(dc);
  65. }
  66. #endif
  67. void BeautifySkinFrom2::OnInitialUpdate()
  68. {
  69. MyFormView::OnInitialUpdate();
  70. CMyMdi Mdi;
  71. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  72. CRect rc2;
  73. GetWindowRect(rc2);
  74. ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
  75. EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
  76. int idarray[] = { IDC_BUTprint3, IDC_BUTexportphoto, IDC_BUTimportphoto, IDC_BUTshowphoto, IDC_BUTexportphoto2, IDC_BUTclose };
  77. int idcount = 6;
  78. int btnwid;
  79. CRect prerc;
  80. for (int a = idcount - 2; a >= 0; a--)
  81. {
  82. GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
  83. ScreenToClient(prerc);
  84. GetDlgItem(idarray[a])->GetWindowRect(rc2);
  85. ScreenToClient(rc2);
  86. btnwid = rc2.Width();
  87. rc2.right = prerc.left;
  88. rc2.left = rc2.right - btnwid;
  89. GetDlgItem(idarray[a])->MoveWindow(rc2);
  90. }
  91. m_static1.SetFont(&g_titlefont);
  92. if (g_bAllBranch == 0)
  93. {
  94. #ifdef CHILD_VERSION
  95. m_FurtherList.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;修片,100;选片,100;选片日期,100;精修,100;精修日期,100;加急,100;取件日期,100;修片人,100;精修人,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100");
  96. #else
  97. m_FurtherList.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;修片,100;选片,100;选片日期,100;精修,100;精修日期,100;加急,100;取件日期,100;修片人,100;精修人,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  98. #endif
  99. m_FurtherList.LoadColumnInfo(122);
  100. }
  101. else
  102. {
  103. #ifdef CHILD_VERSION
  104. m_FurtherList.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;修片,100;选片,100;选片日期,100;精修,100;精修日期,100;加急,100;取件日期,100;修片人,100;精修人,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100");
  105. #else
  106. m_FurtherList.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;修片,100;选片,100;选片日期,100;精修,100;精修日期,100;加急,100;取件日期,100;修片人,100;精修人,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  107. #endif
  108. m_FurtherList.LoadColumnInfo(198);
  109. GetDlgItem(IDC_BUTprint3)->ShowWindow(1);
  110. }
  111. GetData();
  112. m_combo1.AddString(g_user.name);
  113. m_combo1.GetWindowRect(rc2);
  114. ScreenToClient(rc2);
  115. rc2.bottom += 200;
  116. m_combo1.MoveWindow(rc2);
  117. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  118. SetComboHei(&m_combo1, rc2.Height());
  119. GetDlgItem(IDC_BUTexportphoto)->EnableWindow(IsHasRights2new(10));
  120. GetDlgItem(IDC_BUTexportphoto2)->EnableWindow(IsHasRights2new(11));
  121. }
  122. void BeautifySkinFrom2::FillGrid(BOOL bStatus)
  123. {
  124. if (g_bSearchFilter)
  125. {
  126. m_FurtherList.DeleteAllItems2();
  127. int ii = 0;
  128. m_FurtherList.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  129. int count = 0;
  130. {
  131. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  132. {
  133. // 条件查询==精修日期
  134. if (g_filterdate1 != "")
  135. {
  136. if (m_List1array.ElementAt(ii).ElementAt(7 + m_nAdd) < g_filterdate1 || m_List1array.ElementAt(ii).ElementAt(7 + m_nAdd) > g_filterdate2)
  137. continue;
  138. }
  139. if (g_waiter1 != "")
  140. {
  141. // 条件查询==精修人;
  142. if (m_List1array.ElementAt(ii).ElementAt(11 + m_nAdd) != g_waiter1)
  143. continue;
  144. }
  145. if (g_bAllBranch && g_filterbranch != "")
  146. {
  147. if (m_List1array.ElementAt(ii).ElementAt(0) != g_filterbranch)
  148. continue;
  149. }
  150. if (1)
  151. {
  152. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  153. }
  154. }
  155. }
  156. m_FurtherList.m_arLabels.SetSize(count, 1);
  157. ii = count;
  158. m_FurtherList.m_LabelCount = ii;
  159. m_FurtherList.SetItemCountEx(ii);
  160. CString str;
  161. str.Format("单数:%d", ii);
  162. SetDlgItemText(IDC_STATIC2, str);
  163. }
  164. else
  165. {
  166. m_FurtherList.DeleteAllItems2();
  167. int ii = 0;
  168. m_FurtherList.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  169. int count = 0;
  170. if (m_filter.IsEmpty())
  171. {
  172. if (bStatus)
  173. {
  174. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  175. {
  176. // 条件查询==选片状态&&精修状态;
  177. if (m_List1array.ElementAt(ii).ElementAt(4 + m_nAdd) == "OK" && m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) != "OK")
  178. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  179. }
  180. }
  181. else
  182. {
  183. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  184. {
  185. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  186. }
  187. }
  188. }
  189. else
  190. {
  191. if (bStatus)
  192. {
  193. int type = GetType(m_filter);
  194. if (type == 1)//电话
  195. {
  196. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  197. {
  198. // 查询条件==选片状态&&精修状态&&(手机1||手机2)
  199. if (m_List1array.ElementAt(ii).ElementAt(4 + m_nAdd) == "OK" &&
  200. m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) != "OK" &&
  201. (m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1 || m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1))
  202. {
  203. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  204. }
  205. }
  206. }
  207. else if (type == 2)//拼音
  208. {
  209. m_filter.MakeUpper();
  210. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  211. {
  212. // 查询条件==选片状态&&精修状态&&(拼音1||拼音2)
  213. if (m_List1array.ElementAt(ii).ElementAt(4 + m_nAdd) == "OK" &&
  214. m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) != "OK" &&
  215. (m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1 ||m_List1array.ElementAt(ii).ElementAt(18 + m_nAdd).Find(m_filter) != -1))
  216. {
  217. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  218. }
  219. }
  220. }
  221. else
  222. {
  223. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  224. {
  225. // 查询条件==选片状态&&精修状态&&(……)
  226. if (m_List1array.ElementAt(ii).ElementAt(4 + m_nAdd) == "OK" &&
  227. m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) != "OK" &&
  228. (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  229. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  230. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  231. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  232. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
  233. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
  234. m_List1array.ElementAt(ii).ElementAt(12).Find(m_filter) != -1 || \
  235. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1 || \
  236. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  237. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  238. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  239. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1))
  240. {
  241. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  242. }
  243. }
  244. }
  245. }
  246. else
  247. {
  248. int type = GetType(m_filter);
  249. if (type == 1)//电话
  250. {
  251. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  252. {
  253. // 查询条件==手机1||手机2
  254. if (m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1 ||
  255. m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1)
  256. {
  257. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  258. }
  259. }
  260. }
  261. else if (type == 2)//拼音
  262. {
  263. m_filter.MakeUpper();
  264. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  265. {
  266. // 查询条件==拼音1||拼音2
  267. if (m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1 ||
  268. m_List1array.ElementAt(ii).ElementAt(18 + m_nAdd).Find(m_filter) != -1)
  269. {
  270. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  271. }
  272. }
  273. }
  274. else
  275. {
  276. for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
  277. {
  278. if (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  279. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  280. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  281. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  282. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
  283. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
  284. m_List1array.ElementAt(ii).ElementAt(12).Find(m_filter) != -1 || \
  285. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1 || \
  286. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  287. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  288. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  289. m_List1array.ElementAt(ii).ElementAt(18).Find(m_filter) != -1)
  290. {
  291. m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  292. }
  293. }
  294. }
  295. }
  296. }
  297. m_FurtherList.m_arLabels.SetSize(count, 1);
  298. ii = count;
  299. m_FurtherList.m_LabelCount = ii;
  300. m_FurtherList.SetItemCountEx(ii);
  301. CString str;
  302. str.Format("单数:%d", ii);
  303. SetDlgItemText(IDC_STATIC2, str);
  304. }
  305. if (!g_id.IsEmpty())
  306. {
  307. for (int i = 0; i < m_FurtherList.GetItemCount(); i++)
  308. {
  309. if (g_id == m_FurtherList.GetItemText(i, 0 + m_nAdd))
  310. {
  311. m_FurtherList.SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
  312. m_FurtherList.EnsureVisible(i, FALSE);
  313. break;
  314. }
  315. }
  316. }
  317. }
  318. void BeautifySkinFrom2::OnBUTclose()
  319. {
  320. GetParent()->SendMessage(WM_CLOSE);
  321. }
  322. void BeautifySkinFrom2::OnSelchangeCombo1()
  323. {
  324. SetTimer(1, 100, NULL);
  325. }
  326. void BeautifySkinFrom2::OnTimer(UINT nIDEvent)
  327. {
  328. KillTimer(nIDEvent);
  329. OnButton1();
  330. }
  331. BOOL BeautifySkinFrom2::PreTranslateMessage(MSG* pMsg)
  332. {
  333. try
  334. {
  335. if (pMsg->message == WM_KEYDOWN)
  336. {
  337. switch (pMsg->wParam)
  338. {
  339. case VK_RETURN:
  340. OnButton1();
  341. return 1;
  342. case 0x43: // copy
  343. if ((GetKeyState(VK_CONTROL) & 0x80))
  344. {
  345. GetFocus()->SendMessage(WM_COPY);
  346. return TRUE;
  347. }
  348. break;
  349. case 0x56: //Ctrl + V:
  350. if ((GetKeyState(VK_CONTROL) & 0x80))
  351. {
  352. GetFocus()->SendMessage(WM_PASTE);
  353. return TRUE;
  354. }
  355. break;
  356. case 0x58: // cut
  357. if ((GetKeyState(VK_CONTROL) & 0x80))
  358. {
  359. GetFocus()->SendMessage(WM_CUT);
  360. return TRUE;
  361. }
  362. break;
  363. case 0x5A: //undo
  364. case 0x59: //redo
  365. if ((GetKeyState(VK_CONTROL) & 0x80))
  366. {
  367. GetFocus()->SendMessage(WM_UNDO);
  368. return TRUE;
  369. }
  370. break;
  371. }
  372. }
  373. return MyFormView::PreTranslateMessage(pMsg);
  374. }
  375. catch (...)
  376. {
  377. }
  378. return true;
  379. }
  380. void BeautifySkinFrom2::OnBUTimportphoto() // 导入精修片 按钮;
  381. {
  382. #ifdef USE_KERNEL_DLL
  383. POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
  384. if ( pos == NULL )
  385. {
  386. AfxMessageBox(_T("请选中您要导入精修片的订单!"),MB_ICONINFORMATION);
  387. return;
  388. }
  389. INT nItemCount = m_FurtherList.GetItemCount();
  390. INT nSelectedItem = m_FurtherList.GetNextSelectedItem(pos);
  391. // 获取列表信息:域名、订单号、顾客信息、景点名(成长套系名)、精修人、精修状态、精修日期;
  392. CString strBranchName = _T("");
  393. CString strBranchId = _T("");
  394. CString strOrderNum = _T("");
  395. CString strScenery = _T("");
  396. CString strCustomerInfo = _T("");
  397. CString strJingxiuRen = _T("");
  398. CString strJingxiuState = _T("");
  399. CString strJingxiuDate = _T("");
  400. // 获取域名;
  401. if ( g_bAllBranch )
  402. {// 多店汇总时;
  403. strBranchName = m_FurtherList.GetItemText(nSelectedItem, 0);
  404. strBranchId = GetDomainFromBranch( strBranchName );
  405. }
  406. else
  407. {
  408. if ( g_branchname.IsEmpty() )
  409. {// 连接本店时;
  410. strBranchId = g_domain;
  411. }
  412. else
  413. {// 连接分店时;
  414. strBranchName = g_branchname;
  415. strBranchId = GetDomainFromBranch( g_branchname );
  416. }
  417. }
  418. // 获取订单号;
  419. strOrderNum = m_FurtherList.GetItemText(nSelectedItem, 0 + m_nAdd);
  420. // 获取精修师;
  421. strJingxiuRen = m_FurtherList.GetItemText(nSelectedItem, 11 + m_nAdd);
  422. // 获取精修状态;
  423. strJingxiuState = m_FurtherList.GetItemText(nSelectedItem, 6 + m_nAdd);
  424. // 获取精修日期;
  425. strJingxiuDate = m_FurtherList.GetItemText(nSelectedItem, 7 + m_nAdd);
  426. // 获取顾客信息;
  427. strCustomerInfo = m_FurtherList.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_FurtherList.GetItemText(nSelectedItem, 2 + m_nAdd);
  428. CDlgChuXiuInfo xpdlg;
  429. xpdlg.m_strOrderNumber = strOrderNum;
  430. xpdlg.m_strXiupianRen = strJingxiuRen;
  431. if ( strJingxiuState == _T("OK") )
  432. xpdlg.m_nXiupianStatus = 0;
  433. else if ( strJingxiuState == _T("修片中"))
  434. xpdlg.m_nXiupianStatus = 1;
  435. else if ( strJingxiuState == _T("未修"))
  436. xpdlg.m_nXiupianStatus = 2;
  437. CString strSQL = _T("");
  438. if ( xpdlg.DoModal() == IDOK )
  439. {
  440. if ( xpdlg.m_bGrowthTx )
  441. strScenery = xpdlg.m_strScenery;
  442. if ( xpdlg.m_nXiupianStatus == 0 )
  443. strJingxiuState = _T("OK");
  444. else if ( xpdlg.m_nXiupianStatus == 1)
  445. strJingxiuState = _T("修片中");
  446. else if ( xpdlg.m_nXiupianStatus == 2 )
  447. strJingxiuState = _T("未修");
  448. strJingxiuRen = xpdlg.m_strXiupianRen;
  449. if (strJingxiuDate.IsEmpty())
  450. strSQL.Format(_T("update dindan set waiter7 = '%s', status6 = '%s', time9 = '%s' where id = '%s' "), strJingxiuRen, strJingxiuState, g_date, strOrderNum);
  451. else
  452. strSQL.Format(_T("update dindan set waiter7 = '%s', status6 = '%s' where id = '%s'"), strJingxiuRen, strJingxiuState, strOrderNum);
  453. // 构建更新包,发送到服务端更新数据;
  454. g_sendhead.bsql = TRUE;
  455. if ( g_bAllBranch )
  456. { // 多店汇总时;
  457. g_branchip = GetBranchIPbyId(strBranchId);
  458. g_pMainWnd->OnDisconnect();
  459. g_branchname = strBranchName;
  460. g_bBranchModify = TRUE;
  461. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  462. g_pMainWnd->OnDisconnect();
  463. g_bBranchModify = FALSE;
  464. g_branchip = g_branchname = "";
  465. }
  466. else
  467. {// 连接本店或分店时;
  468. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  469. }
  470. /////////////////////////////////////////////////////////////////////////////////////////////////
  471. // 接收服务器返回的数据,并刷新界面;
  472. if (g_bSendOK == 0)
  473. {
  474. OutputDebugString(_T("接收服务信息失败\n"));
  475. return;
  476. }
  477. if ( g_bAllBranch == 0)
  478. {// 连接本店或分店时;
  479. GetData();
  480. }
  481. else
  482. {// 多店汇总时;
  483. for (int i = 0; i < m_List1array.GetSize(); i++)
  484. {
  485. if ( strOrderNum == m_List1array.ElementAt(i).ElementAt(1) && strBranchName == m_List1array.ElementAt(i).ElementAt(0))
  486. {
  487. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, strJingxiuState);
  488. if ( strJingxiuDate.IsEmpty() )
  489. m_List1array.ElementAt(i).SetAt(7 + m_nAdd, g_date);
  490. m_List1array.ElementAt(i).SetAt(11 + m_nAdd, strJingxiuRen);
  491. FillGrid();
  492. break;
  493. }
  494. }
  495. }
  496. }
  497. else
  498. {
  499. // 开始导入初修片;
  500. if ( MessageBox(_T("是否现在开始导入精修片!"), _T("导片提示:导入精修片"), MB_TOPMOST|MB_YESNO|MB_ICONWARNING ) != IDYES )
  501. {// 是否马上导入相片;
  502. return;
  503. }
  504. if ( xpdlg.m_bGrowthTx )
  505. strScenery = xpdlg.m_strScenery;
  506. if ( xpdlg.m_bGrowthTx && strScenery.IsEmpty() )
  507. {
  508. AfxMessageBox(_T("儿童成长套系导片必须选择套系名!"));
  509. return;
  510. }
  511. }
  512. /////////////////////////////////////////////////////////////////////////////////////////////////
  513. if ( g_pIMGProcess == NULL )
  514. {
  515. return;
  516. }
  517. ImgImportInterface *pImport = NULL;
  518. g_pIMGProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
  519. if ( pImport )
  520. {
  521. pImport->ImportFurtherImg(
  522. FALSE, // 文件夹形式打开源或多选文件形式;
  523. strBranchId, // 分店域名;
  524. strOrderNum, // 订单号;
  525. strCustomerInfo, // 顾客信息,可任意组合;
  526. !strScenery.IsEmpty(), // 导入时,是否生成景点名文件夹;
  527. strScenery, // 导入时,景点名;
  528. _T("*.jpg|*.jpeg"), // 导入时,主扩展名相片;
  529. INVALID_COPY_PIX, // 导入时,主扩展名相片的压缩像素;
  530. _T("*.nef|*.cr2"), // 导入时,附加的扩展名相片;
  531. TRUE, // 导入时,是否生成缩略图;
  532. SET_PIX(100,100), // 导入时,生成的缩略图像素大小;
  533. FALSE // 导入时,文件存在时是否覆盖;
  534. );
  535. g_pIMGProcess->Release();
  536. }
  537. // 结束;
  538. #else
  539. POSITION pos;
  540. pos = m_FurtherList.GetFirstSelectedItemPosition();
  541. if (pos == NULL)
  542. {
  543. AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
  544. return;
  545. }
  546. int iItem = m_FurtherList.GetNextSelectedItem(pos);
  547. CString branch;
  548. CString id = m_FurtherList.GetItemText(iItem, 0 + m_nAdd);
  549. if (g_bAllBranch)
  550. branch = m_FurtherList.GetItemText(iItem, 0);
  551. CString oldstatus = m_FurtherList.GetItemText(iItem, 6 + m_nAdd);
  552. CString time9 = m_FurtherList.GetItemText(iItem, 7 + m_nAdd);
  553. CString name = m_FurtherList.GetItemText(iItem, 1 + m_nAdd) + "," + m_FurtherList.GetItemText(iItem, 2 + m_nAdd);
  554. name.TrimLeft(",");
  555. name.TrimRight(",");
  556. name = "客人:" + name;
  557. CString phone = m_FurtherList.GetItemText(iItem, 15 + m_nAdd) + "," + m_FurtherList.GetItemText(iItem, 16 + m_nAdd);
  558. phone.TrimLeft(",");
  559. phone.TrimRight(",");
  560. phone = "电话:" + phone;
  561. CString strDomain = _T("");
  562. CString savepath = _T("");
  563. if (g_bAllBranch)
  564. strDomain = GetDomainFromBranch(branch);
  565. else
  566. {
  567. if(g_branchname != _T(""))
  568. strDomain = GetDomainFromBranch(g_branchname);
  569. }
  570. //////////////////////////////////////////////////////////////////////////
  571. // 获取可用的共享目录;
  572. #if USE_SHARE_FLORD // 2015.04.13
  573. TCHAR szSharePath[MAX_PATH];
  574. //if( GetEnableShareDirectory(3,id,branch,szSharePath) )
  575. if (CNetShareInfo::GetInstance()->GetEnableShareDirectory(3, id, strDomain, szSharePath))
  576. {
  577. savepath.Format("%s\\",szSharePath);
  578. }
  579. else
  580. {
  581. AfxMessageBox(_T("没有可用的共享目录!"));
  582. return;
  583. }
  584. #else
  585. savepath += id + "\\";
  586. #endif
  587. //////////////////////////////////////////////////////////////////////////
  588. if (::CheckFolderFileExist(savepath) == 0)
  589. {
  590. if ( !CreateDirectory(savepath, NULL) )
  591. {
  592. DWORD dwError = GetLastError();
  593. AfxMessageBox(_T("创建精修订单目录失败"));
  594. return;
  595. }
  596. }
  597. CString srcdir; CString str;
  598. GetSavePath(srcdir);
  599. if (srcdir.IsEmpty())
  600. {
  601. CString status6;
  602. if (AfxMessageBox("客照是否全部精修完毕?", MB_YESNO | MB_ICONINFORMATION) == IDYES)
  603. status6 = "OK";
  604. else
  605. status6 = "修片中";
  606. CString sql;
  607. if (time9.IsEmpty())
  608. sql = "update dindan set status6='" + status6 + "',time9='" + g_date + "' where id='" + id + "'";
  609. else
  610. sql = "update dindan set status6='" + status6 + "' where id='" + id + "'";
  611. g_sendhead.bsql = 1;
  612. if (g_bAllBranch)
  613. {
  614. g_branchip = GetIP(branch);
  615. g_pMainWnd->OnDisconnect();
  616. g_branchname = branch;
  617. g_bBranchModify = 1;
  618. g_pMainWnd->ProcessChatMessageRequest2(sql);
  619. g_pMainWnd->OnDisconnect();
  620. g_bBranchModify = 0;
  621. g_branchip = g_branchname = "";
  622. }
  623. else
  624. g_pMainWnd->ProcessChatMessageRequest2(sql);
  625. if (g_bSendOK == 0)return;
  626. if (g_bAllBranch == 0)
  627. {
  628. GetData();
  629. }
  630. else
  631. {
  632. for (int i = 0; i < m_List1array.GetSize(); i++)
  633. {
  634. if (id == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
  635. {
  636. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, status6);
  637. if (time9.IsEmpty())
  638. m_List1array.ElementAt(i).SetAt(7 + m_nAdd, g_date);
  639. FillGrid();
  640. break;
  641. }
  642. }
  643. }
  644. return;
  645. }
  646. if (srcdir.GetLength() < 4)
  647. {
  648. AfxMessageBox("请选择正确的您文件所在的目录!", MB_ICONSTOP);
  649. return;
  650. }
  651. if (oldstatus != "未修")
  652. {
  653. str.Format("%s\r\n%s\r\n此单已导入过修片,确认您选中的照片没有导入过吗? 否则会覆盖原来的照片, 是否继续?", name, phone);
  654. if (AfxMessageBox(str, MB_YESNO | MB_ICONSTOP) != IDYES)
  655. return;
  656. }
  657. else
  658. {
  659. str.Format("%s\r\n%s\r\n确认您选中的照片与客户资料相符吗? 是否继续?", name, phone);
  660. if (AfxMessageBox(str, MB_YESNO | MB_ICONINFORMATION) != IDYES)
  661. return;
  662. }
  663. CStringArray array;
  664. CStringArray desarray;
  665. CStringArray dirarray;
  666. if (1)
  667. {
  668. // 1.获取源目录下的所有文件,包含子目录;
  669. using namespace helper_coffs;
  670. ffsco o;
  671. o.dirs(1);
  672. o.find(LPCSTR(srcdir), LPCSTR("*.*"));
  673. ffsco::typeT coo;
  674. ffsco::typeT::iterator it;
  675. coo = o.co_dir();
  676. for (it = coo.begin(); coo.end() != it; it++)
  677. {
  678. str = (*it).c_str();
  679. if (FindArray(&dirarray, str) == -1)
  680. {
  681. dirarray.Add(str);
  682. if (str != dirarray.ElementAt(0))
  683. {
  684. str = savepath + str.Right(str.GetLength() - dirarray.ElementAt(0).GetLength());
  685. if (::CheckFolderFileExist(str) == 0)
  686. ::CreateDirectory(str, NULL);
  687. }
  688. }
  689. }
  690. }
  691. if (1)
  692. {
  693. // 2.从每个子目录下查找所有的相片;
  694. for (int i = 0; i < dirarray.GetSize(); i++)
  695. {
  696. using namespace helper_coffs;
  697. ffsco o;
  698. o.dirs(0);
  699. o.find(LPCSTR(dirarray.ElementAt(i)), LPCSTR("*.jpg"));
  700. ffsco::typeT coo;
  701. ffsco::typeT::iterator it;
  702. coo = o.co_file();
  703. for (it = coo.begin();coo.end() != it;it++)
  704. {
  705. str = (*it).c_str();
  706. array.Add(str);
  707. desarray.Add(savepath + dirarray.ElementAt(i).Right(dirarray.ElementAt(i).GetLength() - dirarray.ElementAt(0).GetLength()) + str.Right(str.GetLength() - str.ReverseFind('\\') - 1));
  708. }
  709. }
  710. }
  711. if (array.GetSize() == 0)return;
  712. ImportPhoto dlg;
  713. #if USE_SHARE_FLORD
  714. dlg.m_id = id; // add by 2015-07-06 Jeff;
  715. #endif
  716. dlg.m_branch = branch;
  717. dlg.m_nphototype = 2;
  718. dlg.m_bOverWrite = 1;
  719. dlg.m_pArray = &array;
  720. dlg.m_pDesArray = &desarray;
  721. dlg.m_savepath = savepath;
  722. #ifdef ENTERPRISE_VERSION
  723. // if(!g_branchname.IsEmpty ())
  724. {
  725. dlg.m_bSaveUploadTask = g_bSaveUploadTask3;
  726. dlg.m_sel = g_cominfoarraylocal.ElementAt(0).ElementAt(80);
  727. dlg.m_uploadtaskarray.Add(id + ";" + name);
  728. dlg.m_uploadtaskarray.Add("");
  729. dlg.m_uploadtaskarray.Add("");
  730. dlg.m_uploadtaskarray.Add("");
  731. dlg.m_uploadtaskarray.Add("");
  732. dlg.m_uploadtaskarray.Add("");
  733. dlg.m_uploadtaskarray.Add("");
  734. dlg.m_uploadtaskarray.Add("");
  735. dlg.m_uploadtaskarray.Add("");
  736. dlg.m_uploadtaskarray.Add("");
  737. }
  738. #endif
  739. dlg.DoModal();
  740. CString status6;
  741. if (AfxMessageBox("客照是否全部精修完毕?", MB_YESNO | MB_ICONINFORMATION) == IDYES)
  742. status6 = "OK";
  743. else
  744. status6 = "修片中";
  745. CString sql;
  746. if (time9.IsEmpty())
  747. sql = "update dindan set status6='" + status6 + "',waiter7='" + g_user.name + "',time9='" + g_date + "' where id='" + id + "'";
  748. else
  749. sql = "update dindan set status6='" + status6 + "',waiter7='" + g_user.name + "' where id='" + id + "'";
  750. g_sendhead.bsql = 1;
  751. if (g_bAllBranch)
  752. {
  753. g_branchip = GetIP(branch);
  754. g_pMainWnd->OnDisconnect();
  755. g_branchname = branch;
  756. g_bBranchModify = 1;
  757. g_pMainWnd->ProcessChatMessageRequest2(sql);
  758. g_pMainWnd->OnDisconnect();
  759. g_bBranchModify = 0;
  760. g_branchip = g_branchname = "";
  761. }
  762. else
  763. g_pMainWnd->ProcessChatMessageRequest2(sql);
  764. if (g_bSendOK == 0)return;
  765. savepath += "ok";
  766. ::DeleteFile(savepath); // 删除ok文件;
  767. AfxMessageBox("导入客照成功!", MB_ICONINFORMATION);
  768. if (g_bAllBranch == 0)
  769. {
  770. GetData();
  771. }
  772. else
  773. {
  774. for (int i = 0; i < m_List1array.GetSize(); i++)
  775. {
  776. if (id == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
  777. {
  778. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, status6);
  779. if (time9.IsEmpty())
  780. m_List1array.ElementAt(i).SetAt(7 + m_nAdd, g_date);
  781. m_List1array.ElementAt(i).SetAt(11 + m_nAdd, g_user.name);
  782. FillGrid();
  783. break;
  784. }
  785. }
  786. }
  787. #endif
  788. }
  789. void BeautifySkinFrom2::OnBUTshowphoto()
  790. {
  791. POSITION pos;
  792. pos = m_FurtherList.GetFirstSelectedItemPosition();
  793. if (pos == NULL)
  794. {
  795. AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
  796. return;
  797. }
  798. int iItem = m_FurtherList.GetNextSelectedItem(pos);
  799. CString branch;
  800. CString id = m_FurtherList.GetItemText(iItem, 0 + m_nAdd);
  801. if (g_bAllBranch)
  802. branch = m_FurtherList.GetItemText(iItem, 0);
  803. CString name = m_FurtherList.GetItemText(iItem, 1 + m_nAdd) + "," + m_FurtherList.GetItemText(iItem, 2 + m_nAdd);
  804. name.TrimLeft(",");
  805. name.TrimRight(",");
  806. name = "客人:" + name;
  807. ShowPic dlg;
  808. dlg.m_id = id;
  809. dlg.m_name = name;
  810. dlg.m_mode = 3;
  811. if(g_branchname == _T(""))
  812. dlg.m_path = g_path1 + "\\";
  813. else
  814. {
  815. dlg.m_branch = GetDomainFromBranch(g_branchname);
  816. CString branchpath = GetBranchPhotoPath(g_branchname);
  817. dlg.m_path = g_path1 + branchpath + "\\";
  818. }
  819. #ifndef USE_KERNEL_DLL
  820. #if USE_SHARE_FLORD
  821. // 根据域名,相片类型,订单号查找相片;
  822. dlg.m_aryOfShareDirectory.RemoveAll();
  823. CNetShareInfo::GetInstance()->LoadOrderImages(dlg.m_mode, dlg.m_id, g_domain, dlg.m_patharray1, &dlg.m_aryOfShareDirectory);
  824. #endif
  825. #endif
  826. dlg.m_path += id;
  827. dlg.m_path += "\\";
  828. dlg.DoModal();
  829. }
  830. //-----------------------------------------------------------------
  831. // remark by Jeff 2014-12-12
  832. // 函数:GetNo
  833. // 描述:从str中解析出每个相片名,然后存入空的CStringArray中;
  834. // 参数:
  835. // str:选好的相片名串,如:"001,002,003" 后分隔符改为"|",结果应是"001|002|003"
  836. // array:空的数组,用来存放解析后的相片名;
  837. // 返回:
  838. // 注意:更换分隔符造成的问题,在该函数已解决;
  839. //-----------------------------------------------------------------
  840. void BeautifySkinFrom2::GetNo(CString str, CStringArray &array)
  841. {
  842. if (!str.IsEmpty())
  843. {
  844. #ifdef USE_SEP_VEB
  845. int pos = str.Find(SEPS_VEB);
  846. #else
  847. int pos = str.Find(",");
  848. #endif
  849. while (pos != -1)
  850. {
  851. if (FindArray(&array, str.Left(pos)) == -1)
  852. array.Add(str.Left(pos));
  853. str = str.Right(str.GetLength() - pos - 1);
  854. #ifdef USE_SEP_VEB
  855. pos = str.Find(SEPS_VEB);
  856. #else
  857. pos = str.Find(",");
  858. #endif
  859. }
  860. if (FindArray(&array, str) == -1)
  861. array.Add(str);
  862. }
  863. }
  864. //-----------------------------------------------------------------
  865. // remark by Jeff 2014-12-12
  866. // 函数:GetSelName
  867. // 描述:
  868. // 参数:
  869. // name:由GetNo解析出来后的单个相片名,如:"001"
  870. // spnamearray:订单下的商品数组,case 50所得;
  871. // 返回:
  872. // 注意:更换分隔符造成的问题,在该函数已解决;
  873. //-----------------------------------------------------------------
  874. CString BeautifySkinFrom2::GetSelName(CString name, CArray<CStringArray, CStringArray>&spnamearray)
  875. {
  876. CString ret;
  877. #ifdef USE_SEP_VEB
  878. name = SEPS_VEB + name + SEPS_VEB;
  879. #else
  880. name = "," + name + ",";
  881. #endif
  882. CString str;
  883. for (int i = 0; i < spnamearray.GetSize(); i++)
  884. {
  885. #ifdef USE_SEP_VEB
  886. str = SEPS_VEB + spnamearray.ElementAt(i).ElementAt(6) + SEPS_VEB;
  887. #else
  888. str = "," + spnamearray.ElementAt(i).ElementAt(6) + ",";
  889. #endif
  890. if (str.Find(name) != -1)
  891. {
  892. ret += spnamearray.ElementAt(i).ElementAt(5);
  893. ret += ";";
  894. }
  895. }
  896. ret.TrimRight(";");
  897. ret.Replace("*", "x");
  898. return ret;
  899. }
  900. CString GetPathFromNo2(CString dir, CString no)
  901. {
  902. CString sRet;
  903. dir.TrimRight('\\');
  904. dir += "\\";
  905. CStringArray dirarray;
  906. CString temp;
  907. using namespace helper_coffs;
  908. ffsco o;
  909. o.dirs(1);
  910. o.find(LPCSTR(dir), LPCSTR("*.*"));
  911. ffsco::typeT coo;
  912. ffsco::typeT::iterator it;
  913. coo = o.co_dir();
  914. for (it = coo.begin();coo.end() != it;it++)
  915. {
  916. temp = (*it).c_str();
  917. if (::FindArray(&dirarray, temp) == -1 && temp != dir)
  918. {
  919. dirarray.Add(temp);
  920. }
  921. }
  922. for (int i = 0; i < dirarray.GetSize(); i++)
  923. {
  924. temp = dirarray.ElementAt(i);
  925. sRet.Format("%s%s.jpg", temp, no);
  926. if (::PathFileExists(sRet))return sRet;
  927. sRet.Replace(".jpg", ".raw");
  928. if (::PathFileExists(sRet))return sRet;
  929. sRet.Replace(".raw", ".nef");
  930. if (::PathFileExists(sRet))return sRet;
  931. sRet.Replace(".nef", ".cr2");
  932. if (::PathFileExists(sRet))return sRet;
  933. sRet.Replace(".cr2", ".jpg");
  934. if (::PathFileExists(sRet))return sRet;
  935. }
  936. return dir + no + ".jpg";
  937. }
  938. CString GetPathFromNo3(CString dir, CString no)
  939. {
  940. CString sRet;
  941. dir.TrimRight('\\');
  942. dir += "\\";
  943. CStringArray dirarray;
  944. CString temp;
  945. using namespace helper_coffs;
  946. ffsco o;
  947. o.dirs(1);
  948. o.find(LPCSTR(dir), LPCSTR("*.*"));
  949. ffsco::typeT coo;
  950. ffsco::typeT::iterator it;
  951. coo = o.co_dir();
  952. for (it = coo.begin();coo.end() != it;it++)
  953. {
  954. temp = (*it).c_str();
  955. if (::FindArray(&dirarray, temp) == -1 && temp != dir)
  956. {
  957. dirarray.Add(temp);
  958. }
  959. }
  960. for (int i = 0; i < dirarray.GetSize(); i++)
  961. {
  962. temp = dirarray.ElementAt(i);
  963. sRet.Format("%s%s.jpg", temp, no);
  964. if (::PathFileExists(sRet))return sRet;
  965. }
  966. return dir + no + ".jpg";
  967. }
  968. // 导出裁剪后的效果图;
  969. void BeautifySkinFrom2::OnBUTexportphoto() // 导出选好的片 按钮;
  970. {
  971. #ifdef USE_KERNEL_DLL
  972. // 判断用户是否有权限导出选好的片;
  973. if ( !IsHasRights2new(10) )
  974. {
  975. AfxMessageBox(_T("您没有权限导出选好的片!"));
  976. return;
  977. }
  978. // 获取列表信息;
  979. POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
  980. if ( pos == NULL )
  981. {
  982. AfxMessageBox(__T("请选中您要导片的订单!"));
  983. return;
  984. }
  985. INT nItemCount = m_FurtherList.GetItemCount();
  986. INT nSelectedItem = m_FurtherList.GetNextSelectedItem(pos);
  987. // 获取域名、订单号、景点名、顾客信息、选片人、选片状态、选片日期;
  988. CString strBranchName = _T("");
  989. CString strBranchId = _T("");
  990. CString strOrderNum = _T("");
  991. CString strScenery = _T("");
  992. CString strCustomerInfo = _T("");
  993. CString strXuanpianRen = _T("");
  994. CString strXuanpianState = _T("");
  995. CString strXuanpianDate = _T("");
  996. // 获取订单号;
  997. strOrderNum = m_FurtherList.GetItemText(nSelectedItem, 0 + m_nAdd);
  998. // 获取顾客信息;
  999. strCustomerInfo = m_FurtherList.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_FurtherList.GetItemText(nSelectedItem, 2 + m_nAdd);
  1000. // 获取选片状态;
  1001. strXuanpianState = m_FurtherList.GetItemText(nSelectedItem, 4 + m_nAdd);
  1002. // 获取选片日期;
  1003. strXuanpianRen = m_FurtherList.GetItemText(nSelectedItem, 5 + m_nAdd);
  1004. if ( strXuanpianState == _T("未选") )
  1005. {
  1006. MessageBox(_T("此单未选片!"), _T("影楼管理"), MB_OK | MB_TOPMOST | MB_ICONINFORMATION );
  1007. return;
  1008. }
  1009. // 获取域名;
  1010. if ( g_bAllBranch )
  1011. {// 多店汇总;
  1012. strBranchName = m_FurtherList.GetItemText(nSelectedItem, 0);
  1013. strBranchId = GetDomainFromBranch(strBranchName);
  1014. }
  1015. else
  1016. {
  1017. if ( g_branchname.IsEmpty() )
  1018. {// 连接本店时;
  1019. strBranchId = g_domain;
  1020. }
  1021. else
  1022. {//连接分店时;
  1023. strBranchName = g_branchname;
  1024. strBranchId = GetDomainFromBranch( g_branchname );
  1025. }
  1026. }
  1027. // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  1028. IsGrowthTx IsGrowthtxdlg;
  1029. IsGrowthtxdlg.m_mode = 1;
  1030. IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
  1031. IsGrowthtxdlg.DoModal();
  1032. if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
  1033. {
  1034. return;
  1035. }
  1036. if ( IsGrowthtxdlg.m_bGrowthTx )
  1037. {
  1038. // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  1039. strScenery = IsGrowthtxdlg.m_seltxname;
  1040. if ( strScenery == _T("全部") )
  1041. {
  1042. strScenery.Empty();
  1043. }
  1044. }
  1045. /////////////////////////////////////////////////////////////////////////////////////////////////
  1046. // 与服务器通信获取指定条件的订单商品信息;
  1047. CString strSQL = _T("");
  1048. #ifdef CHILD_VERSION
  1049. if ( IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
  1050. strSQL.Format(_T("id='%s' and growthtxname = '%s'; id='%s'; id='%s' and name <> '入册' and name <> '入底'"), strOrderNum, strScenery, strOrderNum, strOrderNum);
  1051. else
  1052. strSQL.Format(_T("id='%s'; id='%s'; id='%s' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
  1053. #else
  1054. strSQL.Format(_T("id='%s'; id='%s'; id='%s' and kind <> '2' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
  1055. #endif//CHILD_VERSION
  1056. g_sendhead.bsql = FALSE;
  1057. g_sendhead.code[0] = 50; // dindansp;
  1058. g_sendhead.code[1] = 11; // dindan;
  1059. g_sendhead.code[2] = 56; // dindansp;
  1060. g_sendhead.tabcount = 3;
  1061. if( g_bAllBranch )
  1062. {//多店汇总时;
  1063. g_branchip = GetBranchIPbyId(strBranchId);
  1064. g_pMainWnd->OnDisconnect();
  1065. g_branchname = strBranchName;
  1066. g_bBranchModify = TRUE;
  1067. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  1068. g_pMainWnd->OnDisconnect();
  1069. g_bBranchModify = FALSE;
  1070. g_branchip = g_branchname = _T("");
  1071. }
  1072. else
  1073. {// 连接本店或分店时;
  1074. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  1075. }
  1076. if( !g_bSendOK )
  1077. return ;
  1078. CArray<CStringArray, CStringArray> Arydindan;
  1079. CArray<CStringArray, CStringArray> Arydindansp;
  1080. CArray<CStringArray, CStringArray> Arydindansp2;
  1081. DataToArray( &Arydindansp, &Arydindan, &Arydindansp2 );
  1082. CString strTemp = _T("");
  1083. CStringArray AryImgNums;
  1084. CStringArray AryPerImgGoods;
  1085. // 获取所有dindansp记录no字段中的相片编号;
  1086. int i = 0;
  1087. int nSize = Arydindansp.GetSize();
  1088. for ( i = 0; i < nSize; i++)
  1089. {
  1090. strTemp = Arydindansp.ElementAt(i).ElementAt(6); // dindansp表中的no字段;
  1091. GetNo(strTemp, AryImgNums);
  1092. }
  1093. // 获取每张相片编号对应的商品,每个商品间用分号隔开;
  1094. nSize = AryImgNums.GetSize();
  1095. AryPerImgGoods.SetSize(nSize);
  1096. for ( i = 0; i < nSize; i++ )
  1097. {
  1098. strTemp = AryImgNums.ElementAt(i);
  1099. AryPerImgGoods.SetAt(i, GetSelName(strTemp, Arydindansp));
  1100. }
  1101. // 由于VC6.0传CStringArray给VC9.0DLL 时,会产生无法避免的兼容性问题,故使用CString传;
  1102. CString strImgNums = _T("");
  1103. for ( i = 0; i < AryImgNums.GetSize(); i++ )
  1104. {
  1105. strImgNums += AryImgNums.ElementAt(i);
  1106. strImgNums += _T("?|?");
  1107. }
  1108. CString strPerImgGoods = _T("");
  1109. for ( i = 0; i < AryPerImgGoods.GetSize(); i++ )
  1110. {// 商品名称,应该禁止包含非法字符;
  1111. strPerImgGoods += AryPerImgGoods.ElementAt(i);
  1112. strPerImgGoods += _T("?|?");
  1113. }
  1114. // 再选择导出的是初修片、原片、初修+原片,并且是否按产品生成文件夹分类相片或者相片名后带产品名;
  1115. SelectPhotoDlg selectdlg;
  1116. selectdlg.DoModal();
  1117. BOOL bExportWithName = selectdlg.m_check1;
  1118. INT bExportMode = selectdlg.m_mode; // 0 原片+初修, 1 原片, 2 初修;
  1119. // 保存导出相片的路径;
  1120. CString strSaveDirectory = _T("");
  1121. if ( g_pIMGProcess == NULL )
  1122. {
  1123. return ;
  1124. }
  1125. ImgExportInterface *pExport = NULL;
  1126. g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
  1127. if ( pExport )
  1128. {// 导出选好的片;
  1129. HGLOBAL hMemery = pExport->ExportSelectedBeautifyImg(
  1130. strBranchId,
  1131. strOrderNum,
  1132. strCustomerInfo,
  1133. !strScenery.IsEmpty(),
  1134. strScenery,
  1135. _T("*.jpg|*.jpeg"),
  1136. INVALID_COPY_PIX,
  1137. _T("*.nef|*.cr2|*.raw|"),
  1138. FALSE,
  1139. bExportWithName,
  1140. IsGrowthtxdlg.m_bGrowthTx,
  1141. bExportMode,
  1142. strImgNums,
  1143. strPerImgGoods,
  1144. Arydindan.ElementAt(0).ElementAt(60)
  1145. );
  1146. pExport->Release();
  1147. if ( hMemery )
  1148. {
  1149. TCHAR* pszSaveDirectory = (TCHAR*)GlobalLock(hMemery);
  1150. GlobalUnlock(hMemery);
  1151. // 输出输出要求内容;
  1152. CString strDir = _T("");
  1153. strDir.Format(_T("%s\\客户要求.txt"), pszSaveDirectory);
  1154. if ( Arydindan.GetSize() )
  1155. {
  1156. CStdioFile fp;
  1157. fp.Open(strDir, CFile::modeCreate | CFile::modeWrite);
  1158. fp.WriteString(_T("选片要求:\n"));
  1159. fp.WriteString(Arydindan.ElementAt(0).ElementAt(39) + _T(" ") + Arydindan.ElementAt(0).ElementAt(75));
  1160. fp.WriteString(_T("\n"));
  1161. fp.WriteString(_T("\n"));
  1162. fp.WriteString(_T("订单要求:\n"));
  1163. fp.WriteString(Arydindan.ElementAt(0).ElementAt(38));
  1164. fp.WriteString(_T("\n"));
  1165. fp.WriteString(_T("\n"));
  1166. fp.WriteString(_T("客人产品:\n"));
  1167. CString str;
  1168. str = _T("产品名称");
  1169. FillLength(str, 30);
  1170. str += _T("数量");
  1171. FillLength(str, 40);
  1172. #ifdef LKAY_VERSION
  1173. str += _T("P数");
  1174. FillLength(str, 50);
  1175. str += _T("加急");
  1176. FillLength(str, 60);
  1177. str += _T("取件日期");
  1178. FillLength(str, 70);
  1179. #else
  1180. str += _T("加急");
  1181. FillLength(str, 50);
  1182. str += _T("取件日期");
  1183. FillLength(str, 60);
  1184. #endif
  1185. fp.WriteString(str);
  1186. fp.WriteString(_T("\n"));
  1187. for (int i = 0; i < Arydindansp2.GetSize(); i++)
  1188. {
  1189. str.Empty();
  1190. str = Arydindansp2.ElementAt(i).ElementAt(0);
  1191. FillLength(str, 30);
  1192. str += Arydindansp2.ElementAt(i).ElementAt(1);
  1193. FillLength(str, 40);
  1194. #ifdef LKAY_VERSION
  1195. str += Arydindansp2.ElementAt(i).ElementAt(29); //p数
  1196. FillLength(str, 50);
  1197. str += Arydindansp2.ElementAt(i).ElementAt(18);
  1198. FillLength(str, 60);
  1199. str += Arydindansp2.ElementAt(i).ElementAt(19);
  1200. FillLength(str, 70);
  1201. #else
  1202. str += Arydindansp2.ElementAt(i).ElementAt(18);
  1203. FillLength(str, 50);
  1204. str += Arydindansp2.ElementAt(i).ElementAt(19);
  1205. FillLength(str, 60);
  1206. #endif
  1207. fp.WriteString(str);
  1208. fp.WriteString(_T("\n"));
  1209. }
  1210. fp.Close();
  1211. }
  1212. }
  1213. OutputDebugString(_T("导出选好的片!\n"));
  1214. }
  1215. // 结束;
  1216. #else
  1217. // 1.判断权限;
  1218. if (IsHasRights2new(10) == 0)return;
  1219. #if USE_SHARE_FLORD
  1220. BOOL bOfmat = FALSE;
  1221. BOOL bGrowth = FALSE;
  1222. BOOL bExportWithName = FALSE;
  1223. CString name1,name2,branch,strdomain,strOrderNumber,strGrowhTx = _T("");
  1224. CStringArray array,spnamearray2;
  1225. OUT CArray<CStringArray, CStringArray> sparray2;
  1226. GetCurSelRecord(name1,name2,strOrderNumber,branch,strdomain);
  1227. int nResult = GetImageWithGoods(branch,strdomain,strOrderNumber,bGrowth,strGrowhTx,bExportWithName,array,spnamearray2,sparray2);
  1228. if ( nResult == -1 )
  1229. {
  1230. // 没有任务相片存在于共享目录中;
  1231. return;
  1232. }
  1233. CString strSaveDiretory;
  1234. GetSavePath(strSaveDiretory);
  1235. if(strSaveDiretory.IsEmpty())return;
  1236. strSaveDiretory.TrimRight ('\\');
  1237. strSaveDiretory+="\\";
  1238. strSaveDiretory+=strOrderNumber;
  1239. strSaveDiretory+=g_branchname;
  1240. if(g_bAllBranch)
  1241. {
  1242. if(GetBranchPhotoPath(branch)!="")
  1243. strSaveDiretory+=branch;
  1244. }
  1245. strSaveDiretory+=name1;
  1246. strSaveDiretory+=name2;
  1247. strSaveDiretory+="选片";
  1248. strSaveDiretory+="\\";
  1249. if ( nResult == 3 )
  1250. {
  1251. // 选择导出的是初修,但初修无片,导出原片;
  1252. strSaveDiretory.Delete(strSaveDiretory.GetLength()-1, 1);
  1253. strSaveDiretory += _T("(未修)\\");
  1254. bOfmat = TRUE;
  1255. }
  1256. ::CreateDirectory (strSaveDiretory, NULL);
  1257. #else
  1258. // 2.获取选中列的信息,如订单号;
  1259. UpdateData();
  1260. POSITION pos;
  1261. pos = m_FurtherList.GetFirstSelectedItemPosition();
  1262. if (pos == NULL)
  1263. {
  1264. AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
  1265. return;
  1266. }
  1267. // 2.1.获取订单的选片状态;
  1268. int iItem = m_FurtherList.GetNextSelectedItem(pos);
  1269. CString status2 = m_FurtherList.GetItemText(iItem, 4 + m_nAdd);
  1270. if (status2 != "OK")
  1271. {
  1272. AfxMessageBox("此单未选片!", MB_ICONINFORMATION);
  1273. return;
  1274. }
  1275. // 2.2.获取订单号;
  1276. BOOL bOfmat = 0;
  1277. CString strOrderNumber = m_FurtherList.GetItemText(iItem, 0 + m_nAdd); // 订单号;
  1278. CString branch;
  1279. if (g_bAllBranch)
  1280. branch = m_FurtherList.GetItemText(iItem, 0);
  1281. CString name1 = m_FurtherList.GetItemText(iItem, 1 + m_nAdd);
  1282. CString name2 = m_FurtherList.GetItemText(iItem, 2 + m_nAdd);
  1283. // 3.1.选片成长套系对话框;
  1284. IsGrowthTx growthtxdlg;
  1285. growthtxdlg.m_mode = 1;
  1286. growthtxdlg.m_strOrderNumber = strOrderNumber;
  1287. growthtxdlg.DoModal(); // 非成长套系的,直接退出;
  1288. BOOL m_bGrowthTX = growthtxdlg.m_bGrowthTx;
  1289. CString m_seltxname = growthtxdlg.m_seltxname;
  1290. #ifdef CHILD_VERSION
  1291. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底'";
  1292. if (m_seltxname != "" && m_seltxname != "全部")
  1293. {
  1294. filter = "id='" + strOrderNumber + "' and growthtxname='" + m_seltxname + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底'";
  1295. }
  1296. #else
  1297. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"' and kind<>'2' and name<>'入册' and name<>'入底'";
  1298. #endif //#ifdef CHILD_VERSION
  1299. g_sendhead.bsql = 0;
  1300. g_sendhead.code[0] = 50; // dindansp
  1301. g_sendhead.code[1] = 11; // dindan
  1302. g_sendhead.code[2] = 56; // dindansp
  1303. g_sendhead.tabcount = 3;
  1304. if (g_bAllBranch)
  1305. {
  1306. g_branchip = GetIP(branch);
  1307. g_pMainWnd->OnDisconnect();
  1308. g_branchname = branch;
  1309. g_bBranchModify = 1;
  1310. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1311. g_pMainWnd->OnDisconnect();
  1312. g_bBranchModify = 0;
  1313. g_branchip = g_branchname = "";
  1314. }
  1315. else
  1316. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1317. if (g_bSendOK == 0)return;
  1318. CArray<CStringArray, CStringArray>sparray;
  1319. CArray<CStringArray, CStringArray>sparray2;
  1320. DataToArray(&sparray, &g_List1array, &sparray2);
  1321. CString strSrcDiretory; // 相片源目录;
  1322. if (g_bAllBranch)
  1323. {
  1324. CString branchpath = GetBranchPhotoPath(branch);
  1325. strSrcDiretory = g_path2 + branchpath + "\\";
  1326. }
  1327. else
  1328. strSrcDiretory = g_path2 + "\\";
  1329. // 4.照片类型选择对话框;(客户原片、初修片)
  1330. SelectPhotoDlg selectdlg;
  1331. selectdlg.DoModal();
  1332. strSrcDiretory += strOrderNumber;
  1333. strSrcDiretory += "\\";
  1334. if (m_seltxname != "" && m_seltxname != "全部")
  1335. {
  1336. strSrcDiretory += m_seltxname;
  1337. strSrcDiretory += "\\";
  1338. }
  1339. ////////////////////////////////////////
  1340. CString str, spname;
  1341. CStringArray noarray;
  1342. CStringArray spnamearray;
  1343. for (int i = 0; i < sparray.GetSize(); i++)
  1344. {
  1345. str = sparray.ElementAt(i).ElementAt(6); // 选好的片的相片名串;
  1346. spname = sparray.ElementAt(i).ElementAt(5); // 选好的片对应的商品名;
  1347. GetNo(str, noarray);
  1348. }
  1349. /*
  1350. for(int k=0; k<noarray; k++)
  1351. printf("no str=%s\n", noarray.ElementAt(k));
  1352. */
  1353. if (noarray.GetSize() == 0)
  1354. {
  1355. AfxMessageBox("此单未选片!", MB_ICONINFORMATION);
  1356. return;
  1357. }
  1358. spnamearray.SetSize(noarray.GetSize());
  1359. for (i = 0; i < noarray.GetSize(); i++)
  1360. {
  1361. str = noarray.ElementAt(i);
  1362. spnamearray.SetAt(i, GetSelName(str, sparray));//+"-"+str );
  1363. }
  1364. CString strSaveDiretory; // 导出选好片的目录;
  1365. GetSavePath(strSaveDiretory);
  1366. if (strSaveDiretory.IsEmpty())return;
  1367. strSaveDiretory.TrimRight('\\');
  1368. strSaveDiretory += "\\";
  1369. strSaveDiretory += strOrderNumber;
  1370. strSaveDiretory += g_branchname;
  1371. if (g_bAllBranch)
  1372. {
  1373. if (GetBranchPhotoPath(branch) != "")
  1374. strSaveDiretory += branch;
  1375. }
  1376. strSaveDiretory += name1;
  1377. strSaveDiretory += name2;
  1378. strSaveDiretory += "选片";
  1379. strSaveDiretory += "\\";
  1380. CStringArray array;
  1381. CStringArray spnamearray2;
  1382. CString src, des;
  1383. // printf("m_mode = %d, m_seltxname = %s, m_bGrowthTX = %d, SrcDir = %s\n", selectdlg.m_mode, m_seltxname, m_bGrowthTX, strSrcDiretory);
  1384. if (selectdlg.m_mode == 0)
  1385. {
  1386. for (i = 0; i < noarray.GetSize(); i++)
  1387. {
  1388. if ((m_seltxname != "" && m_seltxname != "全部") || m_bGrowthTX == 0)
  1389. src.Format("%s%s.jpg", strSrcDiretory, noarray.ElementAt(i));
  1390. else
  1391. src = GetPathFromNo3(strSrcDiretory, noarray.ElementAt(i));
  1392. // printf("src1 = %s\n", src);
  1393. if (PathFileExists(src))
  1394. {
  1395. // printf("exists src = %s\n", src);
  1396. array.Add(src);
  1397. if (1)//selectdlg.m_check1)
  1398. spnamearray2.Add(spnamearray.ElementAt(i));
  1399. else
  1400. spnamearray2.Add(noarray.ElementAt(i));
  1401. }
  1402. else
  1403. AfxMessageBox("未找到初修过的文件:" + src.Right(src.GetLength() - src.ReverseFind('\\') - 1), MB_ICONINFORMATION);
  1404. }
  1405. }
  1406. // printf("arraySize1 = %d\n", array.GetSize());
  1407. if (array.GetSize() == 0)
  1408. {
  1409. if (selectdlg.m_mode == 0)
  1410. AfxMessageBox("注意:此单未修片, 导出的是原片!", MB_ICONINFORMATION);
  1411. if (g_bAllBranch)
  1412. {
  1413. CString branchpath = GetBranchPhotoPath(branch);
  1414. strSrcDiretory = g_path1 + branchpath + "\\";
  1415. }
  1416. else
  1417. strSrcDiretory = g_path1 + "\\";
  1418. strSrcDiretory += strOrderNumber;
  1419. strSrcDiretory += "\\";
  1420. strSaveDiretory.Delete(strSaveDiretory.GetLength() - 1, 1);
  1421. strSaveDiretory += "(未修)\\";
  1422. bOfmat = 1;
  1423. for (i = 0; i < noarray.GetSize(); i++)
  1424. {
  1425. // src.Format ("%s%s.jpg", strSrcDiretory, noarray.ElementAt (i));
  1426. src = GetPathFromNo2(strSrcDiretory, noarray.ElementAt(i));
  1427. // printf("src2 = %s\n", src);
  1428. if (PathFileExists(src))
  1429. {
  1430. // printf("exists src = %s\n", src);
  1431. array.Add(src);
  1432. if (1)//selectdlg.m_check1)
  1433. spnamearray2.Add(spnamearray.ElementAt(i));
  1434. else
  1435. spnamearray2.Add(noarray.ElementAt(i));
  1436. }
  1437. else
  1438. AfxMessageBox("未找到原片文件:" + src.Right(src.GetLength() - src.ReverseFind('\\') - 1), MB_ICONINFORMATION);
  1439. }
  1440. }
  1441. // printf("arraySize2 = %d\n", array.GetSize());
  1442. if (array.GetSize() == 0)
  1443. {
  1444. AfxMessageBox("此单未导入原片!", MB_ICONINFORMATION);
  1445. return;
  1446. }
  1447. ::CreateDirectory(strSaveDiretory, NULL);
  1448. #endif //#if USE_SHARE_FLORD
  1449. // 3.导出相片处理对象;
  1450. ImportPhoto dlg;
  1451. dlg.m_name = name1 + name2;
  1452. #if USE_SHARE_FLORD
  1453. dlg.m_bAddname = bExportWithName;
  1454. #else
  1455. dlg.m_bAddname = selectdlg.m_check1;
  1456. #endif
  1457. dlg.m_bOfmat = bOfmat;
  1458. dlg.m_mode = 1;
  1459. dlg.m_bOrigin = 1;
  1460. dlg.m_pArray = &array;
  1461. dlg.m_pArray2 = &spnamearray2;
  1462. dlg.m_savepath = strSaveDiretory;
  1463. dlg.DoModal();
  1464. //////////////
  1465. if (g_List1array.GetSize())
  1466. {
  1467. CStdioFile fp;
  1468. fp.Open(strSaveDiretory + "客户要求.txt", CFile::modeCreate | CFile::modeWrite);
  1469. fp.WriteString("选片要求:\n");
  1470. fp.WriteString(g_List1array.ElementAt(0).ElementAt(39) + " " + g_List1array.ElementAt(0).ElementAt(75));
  1471. fp.WriteString("\n");
  1472. fp.WriteString("\n");
  1473. fp.WriteString("订单要求:\n");
  1474. fp.WriteString(g_List1array.ElementAt(0).ElementAt(38));
  1475. fp.WriteString("\n");
  1476. fp.WriteString("\n");
  1477. fp.WriteString("客人产品:\n");
  1478. CString str;
  1479. str = "产品名称";
  1480. FillLength(str, 30);
  1481. str += "数量";
  1482. FillLength(str, 40);
  1483. #ifdef LKAY_VERSION
  1484. str += "P数";
  1485. FillLength(str, 50);
  1486. str += "加急";
  1487. FillLength(str, 60);
  1488. str += "取件日期";
  1489. FillLength(str, 70);
  1490. #else
  1491. str += "加急";
  1492. FillLength(str, 50);
  1493. str += "取件日期";
  1494. FillLength(str, 60);
  1495. #endif
  1496. fp.WriteString(str);
  1497. fp.WriteString("\n");
  1498. for (int i = 0; i < sparray2.GetSize(); i++)
  1499. {
  1500. str.Empty();
  1501. str = sparray2.ElementAt(i).ElementAt(0);
  1502. FillLength(str, 30);
  1503. str += sparray2.ElementAt(i).ElementAt(1);
  1504. FillLength(str, 40);
  1505. #ifdef LKAY_VERSION
  1506. str += sparray2.ElementAt(i).ElementAt(29);//p数
  1507. FillLength(str, 50);
  1508. str += sparray2.ElementAt(i).ElementAt(18);
  1509. FillLength(str, 60);
  1510. str += sparray2.ElementAt(i).ElementAt(19);
  1511. FillLength(str, 70);
  1512. #else
  1513. str += sparray2.ElementAt(i).ElementAt(18);
  1514. FillLength(str, 50);
  1515. str += sparray2.ElementAt(i).ElementAt(19);
  1516. FillLength(str, 60);
  1517. #endif
  1518. fp.WriteString(str);
  1519. fp.WriteString("\n");
  1520. }
  1521. fp.Close();
  1522. }
  1523. //////////////
  1524. AfxMessageBox("导片成功!", MB_ICONINFORMATION);
  1525. #if JEFF_TEST_ON // 导出裁剪效果图;
  1526. //strSrcDiretory; // 源相片目录;
  1527. //strSaveDiretory;// 导出选好片的目录;
  1528. if (FALSE == g_List1array.ElementAt(0).ElementAt(60).IsEmpty())
  1529. #if USE_SHARE_FLORD
  1530. ;
  1531. #else
  1532. // 使用多级共享目录,需要重写该函数;
  1533. ExportCutImageToFile(g_List1array.ElementAt(0).ElementAt(60), strSrcDiretory, strSaveDiretory+_T("裁剪效果\\"));
  1534. #endif
  1535. #else
  1536. {
  1537. ShowCut dlg;
  1538. dlg.m_branch = branch;
  1539. dlg.m_mode = 1;
  1540. dlg.m_id = strOrderNumber;
  1541. dlg.DoModal();
  1542. }
  1543. #endif
  1544. CString strlog;
  1545. strlog = " 导出选片 ";
  1546. strlog += "客人:";
  1547. strlog += name1 + name2 + strOrderNumber;
  1548. WriteLog(_T("精修导出选好的片"), strlog);
  1549. #endif
  1550. }
  1551. void BeautifySkinFrom2::OnBUTexportphoto2() // 导出精修的片 按钮;
  1552. {
  1553. #ifdef USE_KERNEL_DLL
  1554. // 判断登陆用户是否有导出原片的权限;
  1555. if ( !IsHasRights2new(11) )
  1556. {
  1557. AfxMessageBox(_T("您无权限导出原片!"),MB_ICONINFORMATION);
  1558. return;
  1559. }
  1560. // 获取列表信息:域名、订单号、景点名、顾客信息;
  1561. POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
  1562. if ( pos == NULL )
  1563. {
  1564. AfxMessageBox(_T("请选中您要导出原片的订单!"), MB_ICONINFORMATION);
  1565. return;
  1566. }
  1567. INT nItemCount = m_FurtherList.GetItemCount();
  1568. INT nSelectedItem = m_FurtherList.GetNextSelectedItem(pos);
  1569. CString strBranchId = _T("");
  1570. CString strOrderNum = _T("");
  1571. // 初修列表不支持景点名,需要从其他地方获取;
  1572. CString strScenery = _T("");
  1573. CString strCustomerInfo = _T("");
  1574. // 获取域名;
  1575. if ( g_bAllBranch )
  1576. {// 多店汇总时;
  1577. strBranchId = GetDomainFromBranch( m_FurtherList.GetItemText(nSelectedItem, 0) );
  1578. }
  1579. else
  1580. {
  1581. if ( g_branchname.IsEmpty() )
  1582. {// 连接本店时;
  1583. strBranchId = g_domain;
  1584. }
  1585. else
  1586. {// 连接分店时;
  1587. strBranchId = GetDomainFromBranch( g_branchname );
  1588. }
  1589. }
  1590. // 获取订单号;
  1591. strOrderNum = m_FurtherList.GetItemText(nSelectedItem, 0 + m_nAdd);
  1592. // 获取顾客信息;
  1593. strCustomerInfo = m_FurtherList.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_FurtherList.GetItemText(nSelectedItem, 2 + m_nAdd);
  1594. // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  1595. IsGrowthTx IsGrowthtxdlg;
  1596. IsGrowthtxdlg.m_mode = 1;
  1597. IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
  1598. IsGrowthtxdlg.DoModal();
  1599. if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
  1600. {
  1601. return;
  1602. }
  1603. if ( IsGrowthtxdlg.m_bGrowthTx )
  1604. {
  1605. // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  1606. strScenery = IsGrowthtxdlg.m_seltxname;
  1607. if ( strScenery == _T("全部") )
  1608. {
  1609. strScenery.Empty();
  1610. }
  1611. }
  1612. // 导出原片时,是否压缩导出;
  1613. DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素;
  1614. /////////////////////////////////////////////////////////////////////////////////////////////////
  1615. if ( g_pIMGProcess == NULL )
  1616. {
  1617. return ;
  1618. }
  1619. // 获取完信息,开始导出原片;
  1620. ImgExportInterface *pExport = NULL;
  1621. g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
  1622. if ( pExport )
  1623. {
  1624. pExport->ExportFurtherImg(
  1625. TRUE,
  1626. strBranchId,
  1627. strOrderNum,
  1628. strCustomerInfo,
  1629. !strScenery.IsEmpty(),
  1630. strScenery,
  1631. _T("*.jpg|*.jpeg"),
  1632. dwExportPix,
  1633. _T("*.nef|*.cr2|*.raw|*.ra2"),
  1634. FALSE,
  1635. FALSE
  1636. );
  1637. }
  1638. g_pIMGProcess->Release();
  1639. // 结束;
  1640. #else
  1641. if (IsHasRights2new(11) == 0)return;
  1642. POSITION pos;
  1643. pos = m_FurtherList.GetFirstSelectedItemPosition();
  1644. if (pos == NULL)
  1645. {
  1646. AfxMessageBox("请先选中您要导出片的定单!", MB_ICONINFORMATION);
  1647. return;
  1648. }
  1649. int iItem = m_FurtherList.GetNextSelectedItem(pos);
  1650. CString id = m_FurtherList.GetItemText(iItem, 0 + m_nAdd);
  1651. #if USE_SHARE_FLORD
  1652. CString branch;
  1653. if(g_bAllBranch)
  1654. branch=m_FurtherList.GetItemText (iItem, 0);
  1655. CString strDomain = _T("");
  1656. CString savepath = _T("");
  1657. if (g_bAllBranch)
  1658. {
  1659. if(branch != _T(""))
  1660. strDomain = GetDomainFromBranch(branch);
  1661. }
  1662. else
  1663. {
  1664. if(g_branchname != _T(""))
  1665. strDomain = GetDomainFromBranch(g_branchname);
  1666. }
  1667. // 导出原片时,可以选择只导出单独的景点相片;(如果是儿童版的成长套系,可以导出某个套系的相片)
  1668. // 得到源相片;
  1669. CStringArray array;
  1670. CNetShareInfo::GetInstance()->LoadOrderImages(3, id, strDomain,array);
  1671. // printf("size=%d\n", array.GetSize());
  1672. if(array.GetSize ()==0)
  1673. {
  1674. AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
  1675. return;
  1676. }
  1677. // 获取保存的路径;
  1678. CString dir;
  1679. GetSavePath(dir);
  1680. if(dir.IsEmpty())
  1681. {
  1682. return;
  1683. }
  1684. CString name1=m_FurtherList.GetItemText (iItem, 1+m_nAdd);
  1685. CString name2=m_FurtherList.GetItemText (iItem, 2+m_nAdd);
  1686. dir.TrimRight ('\\');
  1687. dir+="\\";
  1688. dir+=id;
  1689. dir+=g_branchname;
  1690. if(g_bAllBranch)
  1691. {
  1692. if(GetBranchPhotoPath(branch)!="")
  1693. dir+=branch;
  1694. }
  1695. dir+=name1;
  1696. dir+=name2;
  1697. dir+="精修好的片";
  1698. dir+="\\";
  1699. ::CreateDirectory (dir, NULL);
  1700. // 新的相片路径;
  1701. int nIndex = 0;
  1702. CString strTemp;
  1703. CStringArray desarray;
  1704. for ( int i = 0; i < array.GetSize(); i++ )
  1705. {
  1706. // 获取到订单号以后的路径字符;
  1707. strTemp = array.ElementAt(i).Mid(array.ElementAt(i).Find(id) + id.GetLength() + 1 );
  1708. desarray.Add(dir + strTemp);
  1709. if ( (nIndex = strTemp.Find("\\")) != -1 )
  1710. {
  1711. strTemp = strTemp.Left( nIndex + 1 );
  1712. CreateDirectory(dir + strTemp, NULL);
  1713. }
  1714. }
  1715. #else
  1716. CString branch;
  1717. if (g_bAllBranch)
  1718. branch = m_FurtherList.GetItemText(iItem, 0);
  1719. CString path;
  1720. if (g_bAllBranch)
  1721. {
  1722. CString branchpath = GetBranchPhotoPath(branch);
  1723. path = g_path4 + branchpath + "\\";
  1724. }
  1725. else
  1726. path = g_path4 + "\\";
  1727. path += id;
  1728. path += "\\";
  1729. CStringArray array;
  1730. CString dir;
  1731. GetSavePath(dir);
  1732. if (dir.IsEmpty())
  1733. {
  1734. return;
  1735. }
  1736. CString name1 = m_FurtherList.GetItemText(iItem, 1 + m_nAdd);
  1737. CString name2 = m_FurtherList.GetItemText(iItem, 2 + m_nAdd);
  1738. dir.TrimRight('\\');
  1739. dir += "\\";
  1740. dir += id;
  1741. dir += g_branchname;
  1742. if (g_bAllBranch)
  1743. {
  1744. if (GetBranchPhotoPath(branch) != "")
  1745. dir += branch;
  1746. }
  1747. dir += name1;
  1748. dir += name2;
  1749. dir += "精修好的片";
  1750. dir += "\\";
  1751. ::CreateDirectory(dir, NULL);
  1752. CStringArray desarray;
  1753. CStringArray dirarray;
  1754. CString savepath = dir;
  1755. CString str;
  1756. if (1)
  1757. {
  1758. using namespace helper_coffs;
  1759. ffsco o;
  1760. o.dirs(1);
  1761. o.find(LPCSTR(path), LPCSTR("*.*"));
  1762. ffsco::typeT coo;
  1763. ffsco::typeT::iterator it;
  1764. coo = o.co_dir();
  1765. for (it = coo.begin();coo.end() != it;it++)
  1766. {
  1767. str = (*it).c_str();
  1768. if (FindArray(&dirarray, str) == -1)
  1769. {
  1770. dirarray.Add(str);
  1771. if (str != dirarray.ElementAt(0))
  1772. {
  1773. str = savepath + str.Right(str.GetLength() - dirarray.ElementAt(0).GetLength());
  1774. if (::CheckFolderFileExist(str) == 0)
  1775. ::CreateDirectory(str, NULL);
  1776. }
  1777. }
  1778. }
  1779. }
  1780. if (1)
  1781. {
  1782. for (int i = 0; i < dirarray.GetSize(); i++)
  1783. {
  1784. using namespace helper_coffs;
  1785. ffsco o;
  1786. o.dirs(0);
  1787. o.find(LPCSTR(dirarray.ElementAt(i)), LPCSTR("*.jpg"));
  1788. ffsco::typeT coo;
  1789. ffsco::typeT::iterator it;
  1790. coo = o.co_file();
  1791. for (it = coo.begin();coo.end() != it;it++)
  1792. {
  1793. str = (*it).c_str();
  1794. if (str.GetAt(str.ReverseFind('\\') + 1) == 's')continue;
  1795. if (str.GetAt(str.ReverseFind('\\') + 1) == 'm')continue;
  1796. array.Add(str);
  1797. desarray.Add(savepath + dirarray.ElementAt(i).Right(dirarray.ElementAt(i).GetLength() - dirarray.ElementAt(0).GetLength()) + str.Right(str.GetLength() - str.ReverseFind('\\') - 1));
  1798. }
  1799. }
  1800. }
  1801. if (array.GetSize() == 0)
  1802. {
  1803. AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
  1804. return;
  1805. }
  1806. #endif
  1807. CCompressOption comoptdlg;
  1808. comoptdlg.DoModal();
  1809. ImportPhoto dlg;
  1810. dlg.m_nOutputSize = comoptdlg.m_nsize;
  1811. dlg.m_mode = 1;
  1812. dlg.m_pArray = &array;
  1813. dlg.m_pDesArray = &desarray;
  1814. dlg.m_savepath = dir;
  1815. dlg.DoModal(); AfxMessageBox("导片成功!", MB_ICONINFORMATION);
  1816. CString str;
  1817. str = " 导出精修片 ";
  1818. str += "客人:";
  1819. str += name1 + name2 + id;
  1820. WriteLog(_T("导出精修片"), str);
  1821. #endif
  1822. }
  1823. void BeautifySkinFrom2::OnButton1()
  1824. {
  1825. UpdateData();
  1826. m_filter.TrimLeft();
  1827. m_filter.TrimRight();
  1828. FillGrid();
  1829. }
  1830. void BeautifySkinFrom2::OnButton2() // 已选未修 按钮;
  1831. {
  1832. UpdateData();
  1833. m_filter.TrimLeft();
  1834. m_filter.TrimRight();
  1835. FillGrid(1);
  1836. }
  1837. void BeautifySkinFrom2::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
  1838. {
  1839. NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
  1840. POSITION pos;
  1841. pos = m_FurtherList.GetFirstSelectedItemPosition();
  1842. if (pos == NULL)
  1843. {
  1844. return;
  1845. }
  1846. int iItem = m_FurtherList.GetNextSelectedItem(pos);
  1847. if (IsHasRights2new(6) || IsHasRights2new(49))
  1848. {
  1849. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1850. }
  1851. else
  1852. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
  1853. /* if(waiter7.IsEmpty () && IsHasRights2new(6) || IsHasRights2new(49))
  1854. {
  1855. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1856. }
  1857. else if(waiter7==g_user.name && IsHasRights2new(6) )
  1858. {
  1859. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1860. }
  1861. else
  1862. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);*/
  1863. *pResult = 0;
  1864. }
  1865. void BeautifySkinFrom2::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  1866. {
  1867. POSITION pos;
  1868. pos = m_FurtherList.GetFirstSelectedItemPosition();
  1869. if (pos == NULL)return;
  1870. int iItem = m_FurtherList.GetNextSelectedItem(pos);
  1871. g_id = m_FurtherList.GetItemText(iItem, 0 + m_nAdd);
  1872. *pResult = 0;
  1873. }
  1874. void BeautifySkinFrom2::HidePrice()
  1875. {
  1876. #ifdef LKAY_VERSION
  1877. if (IsHasRights2new(31))return;
  1878. for (int i = 0; i < m_List1array.GetSize(); i++)
  1879. {
  1880. m_List1array.ElementAt(i).SetAt(14 + m_nAdd, "***");
  1881. m_List1array.ElementAt(i).SetAt(15 + m_nAdd, "***");
  1882. m_List1array.ElementAt(i).SetAt(16 + m_nAdd, "***");
  1883. m_List1array.ElementAt(i).SetAt(13 + m_nAdd, "***");
  1884. }
  1885. #else
  1886. if (IsHasRights2new(31))return;
  1887. for (int i = 0; i < m_List1array.GetSize(); i++)
  1888. {
  1889. m_List1array.ElementAt(i).SetAt(16 + m_nAdd, "***");
  1890. m_List1array.ElementAt(i).SetAt(15 + m_nAdd, "***");
  1891. }
  1892. #endif
  1893. }
  1894. void BeautifySkinFrom2::OnBtnsearchfilter()
  1895. {
  1896. SearchFilter dlg;
  1897. dlg.m_mode = 3;
  1898. if (dlg.DoModal() == IDOK)FillGrid();
  1899. g_bSearchFilter = 0;
  1900. }
  1901. void BeautifySkinFrom2::GetData()
  1902. {
  1903. if (g_bAllBranch == 0)
  1904. {
  1905. if (g_bShowOK == 0)
  1906. {
  1907. #ifdef LKAY_VERSION
  1908. CString filter = "status3='未取' and (dindantype<>'意向客户' or dindantype is null)";
  1909. #else
  1910. CString filter = "status3='未取'";
  1911. #endif
  1912. g_sendhead.bsql = 0;
  1913. g_sendhead.code[0] = 35;
  1914. g_sendhead.tabcount = 1;
  1915. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1916. if (g_bSendOK == 0)return;
  1917. }
  1918. else
  1919. {
  1920. g_sendhead.bsql = 0;
  1921. g_sendhead.code[0] = 35;
  1922. g_sendhead.tabcount = 1;
  1923. #ifdef LKAY_VERSION
  1924. CString filter = "dindantype<>'意向客户' or dindantype is null";
  1925. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1926. #else
  1927. g_pMainWnd->ProcessChatMessageRequest2(1);
  1928. #endif
  1929. if (g_bSendOK == 0)return;
  1930. }
  1931. DataToArray(&m_List1array);
  1932. }
  1933. else
  1934. {
  1935. //////////////数据汇总
  1936. m_List1array.RemoveAll();
  1937. CString branch;
  1938. for (int i = -1; i < g_brancharray.GetSize() - 1; i++)
  1939. {
  1940. if (i != -1)
  1941. {
  1942. branch = g_brancharray.ElementAt(i).ElementAt(0);
  1943. g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
  1944. g_pMainWnd->OnDisconnect();
  1945. g_branchname = branch;
  1946. g_bBranchModify = 1;
  1947. }
  1948. else
  1949. branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0);
  1950. if (g_bShowOK == 0)
  1951. {
  1952. CString filter = "status3='未取'";
  1953. g_sendhead.bsql = 0;
  1954. g_sendhead.code[0] = 35;
  1955. g_sendhead.tabcount = 1;
  1956. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1957. if (g_bSendOK == 0)continue;
  1958. }
  1959. else
  1960. {
  1961. g_sendhead.bsql = 0;
  1962. g_sendhead.code[0] = 35;
  1963. g_sendhead.tabcount = 1;
  1964. g_pMainWnd->ProcessChatMessageRequest2(1);
  1965. if (g_bSendOK == 0)continue;
  1966. }
  1967. CArray<CStringArray, CStringArray>List1array;
  1968. DataToArray(&List1array);
  1969. int size = m_List1array.GetSize();
  1970. for (int j = 0; j < List1array.GetSize(); j++)
  1971. {
  1972. size++;
  1973. m_List1array.SetSize(size, 1);
  1974. size--;
  1975. m_List1array.ElementAt(size).Copy(List1array.ElementAt(j));
  1976. m_List1array.ElementAt(size).InsertAt(0, branch);
  1977. size++;
  1978. }
  1979. }
  1980. g_pMainWnd->OnDisconnect();
  1981. g_bBranchModify = 0; g_branchip = g_branchname = "";
  1982. }
  1983. HidePrice();
  1984. FillGrid();
  1985. }
  1986. void BeautifySkinFrom2::OnBUTprint3()
  1987. {
  1988. GetData();
  1989. }
  1990. // Jeff.没看到调用的地方,也没有关联任何按钮控件.
  1991. // 应该是废弃的函数;
  1992. void BeautifySkinFrom2::OnBUTexportphotoAddName()
  1993. {
  1994. if (IsHasRights2new(10) == 0)return;
  1995. UpdateData();
  1996. POSITION pos;
  1997. pos = m_FurtherList.GetFirstSelectedItemPosition();
  1998. if (pos == NULL)
  1999. {
  2000. AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
  2001. return;
  2002. }
  2003. int iItem = m_FurtherList.GetNextSelectedItem(pos);
  2004. CString status2 = m_FurtherList.GetItemText(iItem, 4);
  2005. if (status2 != "OK")
  2006. {
  2007. AfxMessageBox("此单未选片!", MB_ICONINFORMATION);
  2008. return;
  2009. }
  2010. CString id = m_FurtherList.GetItemText(iItem, 0);
  2011. CString name1 = m_FurtherList.GetItemText(iItem, 1);
  2012. CString name2 = m_FurtherList.GetItemText(iItem, 2);
  2013. CString filter = "id='" + id + "';id='" + id + "'";
  2014. g_sendhead.bsql = 0;
  2015. g_sendhead.code[0] = 50;
  2016. g_sendhead.code[1] = 11;
  2017. g_sendhead.tabcount = 2;
  2018. g_pMainWnd->ProcessChatMessageRequest2(filter);
  2019. if (g_bSendOK == 0)return;
  2020. CArray<CStringArray, CStringArray>sparray;
  2021. DataToArray(&sparray, &g_List1array);
  2022. CString path = g_path2 + "\\";
  2023. SelectPhotoDlg selectdlg;
  2024. selectdlg.DoModal();
  2025. path += id;
  2026. path += "\\";
  2027. ////////////////////////////////////////
  2028. CString str, spname;
  2029. CStringArray noarray;
  2030. CStringArray spnamearray;
  2031. int i = 0;
  2032. for ( i = 0; i < sparray.GetSize(); i++)
  2033. {
  2034. str = sparray.ElementAt(i).ElementAt(6);
  2035. spname = sparray.ElementAt(i).ElementAt(5);
  2036. GetNo(str, noarray);
  2037. }
  2038. if (noarray.GetSize() == 0)
  2039. {
  2040. AfxMessageBox("此单未选片!", MB_ICONINFORMATION);
  2041. return;
  2042. }
  2043. spnamearray.SetSize(noarray.GetSize());
  2044. for (i = 0; i < noarray.GetSize(); i++)
  2045. {
  2046. str = noarray.ElementAt(i);
  2047. spnamearray.SetAt(i, GetSelName(str, sparray) + "-" + str);
  2048. }
  2049. CString dir;
  2050. GetSavePath(dir);
  2051. if (dir.IsEmpty())return;
  2052. dir.TrimRight('\\');
  2053. dir += "\\";
  2054. dir += id;
  2055. dir += name1;
  2056. dir += name2;
  2057. dir += "选片";
  2058. dir += "\\";
  2059. CStringArray array;
  2060. CStringArray spnamearray2;
  2061. CString src, des;
  2062. //selectdlg.m_mode: 1=原片 2=初修 0=初修+原片
  2063. if (selectdlg.m_mode == 2)
  2064. {
  2065. for (i = 0; i < noarray.GetSize(); i++)
  2066. {
  2067. src.Format("%s%s.jpg", path, noarray.ElementAt(i));
  2068. if (::CheckFolderFileExist(src))
  2069. {
  2070. array.Add(src);
  2071. if (selectdlg.m_check1)
  2072. spnamearray2.Add(spnamearray.ElementAt(i));
  2073. else
  2074. spnamearray2.Add(noarray.ElementAt(i));
  2075. }
  2076. else
  2077. AfxMessageBox("未找到初修过的文件:" + src.Right(src.GetLength() - src.ReverseFind('\\') - 1), MB_ICONINFORMATION);
  2078. }
  2079. }
  2080. if (array.GetSize() == 0)
  2081. {
  2082. if (selectdlg.m_mode == 2)
  2083. AfxMessageBox("注意:此单未修片, 导出的是原片!", MB_ICONINFORMATION);
  2084. path = g_path1 + "\\";
  2085. path += id;
  2086. path += "\\";
  2087. dir.Delete(dir.GetLength() - 1, 1);
  2088. dir += "(未修)\\";
  2089. for (i = 0; i < noarray.GetSize(); i++)
  2090. {
  2091. src = GetPathFromNo2(path, noarray.ElementAt(i));
  2092. if (PathFileExists(src))
  2093. {
  2094. array.Add(src);
  2095. if (selectdlg.m_check1)
  2096. spnamearray2.Add(spnamearray.ElementAt(i));
  2097. else
  2098. spnamearray2.Add(noarray.ElementAt(i));
  2099. }
  2100. }
  2101. }
  2102. if (array.GetSize() == 0)
  2103. {
  2104. AfxMessageBox("此单未导入原片!", MB_ICONINFORMATION);
  2105. return;
  2106. }
  2107. ::CreateDirectory(dir, NULL);
  2108. ImportPhoto dlg;
  2109. dlg.m_mode = 1;
  2110. dlg.m_pArray = &array;
  2111. dlg.m_pArray2 = &spnamearray2;
  2112. dlg.m_savepath = dir;
  2113. dlg.DoModal();
  2114. //////////////
  2115. if (g_List1array.GetSize())
  2116. {
  2117. CStdioFile fp;
  2118. fp.Open(dir + "客户要求.txt", CFile::modeCreate | CFile::modeWrite);
  2119. fp.WriteString(g_List1array.ElementAt(0).ElementAt(39));
  2120. fp.Close();
  2121. }
  2122. //////////////
  2123. AfxMessageBox("导片成功!", MB_ICONINFORMATION);
  2124. }
  2125. #if USE_SHARE_FLORD
  2126. /************************************************************************/
  2127. /*
  2128. 函数:GetCurSelRecord
  2129. 描述:获取当前List列表选中的项记录;
  2130. 参数:
  2131. OUT:strName1 选中项的顾客1姓名;
  2132. OUT:strName2 选中项的顾客2姓名;
  2133. OUT:strOrderNum 选中项的订单号;
  2134. OUT:strDomain 选中项的所在分店域名,本店为空;
  2135. 返回:
  2136. 调用约定:
  2137. 注意:
  2138. */
  2139. /************************************************************************/
  2140. void BeautifySkinFrom2::GetCurSelRecord(
  2141. OUT CString &strName1,
  2142. OUT CString &strName2,
  2143. OUT CString &strOrderNum,
  2144. OUT CString &strBranch,
  2145. OUT CString &strDomain)
  2146. {
  2147. UpdateData();
  2148. // 获取所中行;
  2149. POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
  2150. if ( pos == NULL)
  2151. {
  2152. AfxMessageBox(_T("请先选中您要导片的定单!"), MB_ICONINFORMATION);
  2153. return;
  2154. }
  2155. int nItem = m_FurtherList.GetNextSelectedItem(pos);
  2156. // 获取选片状态, m_nAdd作用?;
  2157. CString strStatus = m_FurtherList.GetItemText(nItem,4 + m_nAdd);
  2158. if ( strStatus != _T("OK") )
  2159. {
  2160. AfxMessageBox(_T("此单未选片!"), MB_ICONINFORMATION);
  2161. return;
  2162. }
  2163. strOrderNum = m_FurtherList.GetItemText(nItem, 0 + m_nAdd);
  2164. strName1 = m_FurtherList.GetItemText(nItem, 1 + m_nAdd);
  2165. strName2 = m_FurtherList.GetItemText(nItem, 2 + m_nAdd);
  2166. if ( g_bAllBranch )
  2167. {
  2168. // 多店汇总时;
  2169. strBranch = m_FurtherList.GetItemText(nItem, 0);
  2170. strDomain = GetDomainFromBranch(strBranch);
  2171. }
  2172. else
  2173. {
  2174. if(g_branchname != _T(""))
  2175. {
  2176. strBranch = g_branchname;
  2177. strDomain = GetDomainFromBranch(g_branchname);
  2178. }
  2179. }
  2180. }
  2181. /************************************************************************/
  2182. /*
  2183. 函数:GetImageWithGoods
  2184. 描述:获取每张相片对应的商品串;
  2185. 参数:
  2186. IN: strBranch 分店名(多店汇总时)
  2187. IN: strDomain 分店域名(多店汇总或分店连接时);
  2188. IN: strOrderNum 订单号;
  2189. OUT: bGrowth 是否是儿童套系;
  2190. OUT: strSelGrowth 若bGrowth为TRUE,则这里为选中的成长套系名称;
  2191. OUT: bExportWithName 导出选好的片是否带商品名;
  2192. OUT: strAryOfImagePath 选中的相片路径;
  2193. OUT: strEachImageOfGoods与strAryOfImagePath元素位置对应,每一个元素都是strAryOfImagePath元素的商品表(用分号隔开);
  2194. 返回:返回导出的相片类型,== -1 无相片, 1 == 原片,0 == 初修片, 3 == 无初修,使用原片, //== 4 选择的是原片,但原片空....
  2195. 调用约定:
  2196. 注意:
  2197. */
  2198. /************************************************************************/
  2199. int BeautifySkinFrom2::GetImageWithGoods(
  2200. IN CString &strBranch,
  2201. IN CString &strDomain,
  2202. IN CString &strOrderNum,
  2203. OUT BOOL &bGrowth,
  2204. OUT CString &strSelGrowth,
  2205. OUT BOOL &bExportWithName,
  2206. OUT CStringArray &strAryOfImagePath,
  2207. OUT CStringArray &strAryOfEachImageOfGoods,
  2208. OUT CArray<CStringArray, CStringArray> &sparray2)
  2209. {
  2210. // 若是儿童成长套系,则弹出选项框;
  2211. CStringArray strAryOfScenery;
  2212. IsGrowthTx growthtxdlg;
  2213. growthtxdlg.m_mode = 1;
  2214. growthtxdlg.m_pAryOfScenery = &strAryOfScenery;
  2215. growthtxdlg.m_strOrderNumber = strOrderNum;
  2216. growthtxdlg.DoModal();
  2217. bGrowth = growthtxdlg.m_bGrowthTx;
  2218. strSelGrowth = growthtxdlg.m_seltxname;
  2219. // 与服务器通信获取指定条件的订单商品信息;
  2220. CString strFilter = _T("");
  2221. #ifdef CHILD_VERSION
  2222. if ( !strSelGrowth.IsEmpty() && strSelGrowth != _T("全部") )
  2223. {
  2224. strFilter.Format(_T("id='%s' and growthtxname = '%s'; id='%s'; id='%s' and name <> '入册' and name <> '入底'"), strOrderNum, strSelGrowth, strOrderNum, strOrderNum);
  2225. }
  2226. else
  2227. {
  2228. strFilter.Format(_T("id='%s'; id='%s'; id='%s' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
  2229. }
  2230. #else
  2231. strFilter.Format(_T("id='%s'; id='%s'; id='%s' and kind <> '2' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
  2232. #endif
  2233. g_sendhead.bsql = 0;
  2234. g_sendhead.code[0] = 50;
  2235. g_sendhead.code[1] = 11;
  2236. g_sendhead.code[2] = 56;
  2237. g_sendhead.tabcount = 3;
  2238. if( !g_bAllBranch )
  2239. {
  2240. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  2241. }
  2242. else
  2243. {
  2244. g_branchip = GetIP(strBranch);
  2245. g_pMainWnd->OnDisconnect();
  2246. g_branchname = strBranch;
  2247. g_bBranchModify = 1;
  2248. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  2249. g_pMainWnd->OnDisconnect();
  2250. g_bBranchModify = 0;
  2251. g_branchip = g_branchname = _T("");
  2252. }
  2253. if( !g_bSendOK )
  2254. return -1;
  2255. CArray<CStringArray, CStringArray> sparray;
  2256. //CArray<CStringArray, CStringArray> sparray2;
  2257. DataToArray( &sparray, &g_List1array, &sparray2 );
  2258. CString strTemp;
  2259. CStringArray strAryOfImageNum; // 所有相片的数字编号;
  2260. // 获取所有dindansp记录no字段中的相片编号;
  2261. int i = 0;
  2262. int nSize = sparray.GetSize();
  2263. for ( i = 0; i < nSize; i++)
  2264. {
  2265. strTemp = sparray.ElementAt(i).ElementAt(6); // dindansp表中的no字段;
  2266. // WriteClientLog(_T("no:") + strTemp);
  2267. GetNo(strTemp, strAryOfImageNum);
  2268. }
  2269. if ( strAryOfImageNum.GetSize() == 0 )
  2270. {
  2271. AfxMessageBox(_T("此单未选片!"),MB_ICONINFORMATION);
  2272. return -1;
  2273. }
  2274. // 获取每个相片编号关联的商品集合,用分号隔开;
  2275. strAryOfEachImageOfGoods.SetSize(strAryOfImageNum.GetSize());
  2276. nSize = strAryOfImageNum.GetSize();
  2277. for( int n = 0; n < nSize; n++)
  2278. {
  2279. strTemp = strAryOfImageNum.ElementAt(n);
  2280. // WriteClientLog(_T("关联的号码:") + strTemp);
  2281. CString strspnames = GetSelName(strTemp, sparray);
  2282. // WriteClientLog(_T("关联的商品:") + strspnames);
  2283. strAryOfEachImageOfGoods.SetAt(n, strspnames);
  2284. }
  2285. CStringArray strTempImageGoods;
  2286. strTempImageGoods.Copy(strAryOfEachImageOfGoods);
  2287. SelectPhotoDlg selectdlg;
  2288. selectdlg.DoModal();
  2289. bExportWithName = selectdlg.m_check1;
  2290. int nPhotoType = selectdlg.m_mode; //mode模式:2.初修 1.原片 0.初修+原片 //相片类型1=原片 2=初修 3=精修 4=设计
  2291. // 遍历所有共享目录,查找相片路径;
  2292. CStringArray imagePathArr;
  2293. CStringArray imageNumArr;
  2294. imageNumArr.Copy(strAryOfImageNum);
  2295. if(nPhotoType == 0)
  2296. {
  2297. // printf(_T("原片+初修\n"));
  2298. for(i=2; i>0; --i)
  2299. {
  2300. imagePathArr.RemoveAll();
  2301. LoadExistsImagesEx(i, strDomain, strOrderNum, bGrowth, strSelGrowth, strAryOfScenery, imageNumArr, imagePathArr, strAryOfEachImageOfGoods);
  2302. if(strAryOfImagePath.GetSize() == 0)
  2303. strAryOfImagePath.Append(imagePathArr);
  2304. else
  2305. {
  2306. int nSize = strAryOfImagePath.GetSize();
  2307. for(int j=0; j<nSize; j++)
  2308. {
  2309. //去掉相同的相片
  2310. CString strName1 = strAryOfImagePath.ElementAt(j);
  2311. strName1 = strName1.Right(strName1.GetLength() - strName1.ReverseFind('\\') - 1);
  2312. for(int k=0; k<imagePathArr.GetSize(); k++)
  2313. {
  2314. CString strName2 = imagePathArr.ElementAt(k);
  2315. strName2 = strName2.Right(strName2.GetLength() - strName2.ReverseFind('\\') - 1);
  2316. if(strName1 == strName2)
  2317. {
  2318. imagePathArr.RemoveAt(k);
  2319. break;
  2320. }
  2321. }
  2322. }
  2323. if(imagePathArr.GetSize() > 0)
  2324. strAryOfImagePath.Append(imagePathArr);
  2325. }
  2326. }
  2327. }
  2328. else
  2329. {
  2330. LoadExistsImagesEx(nPhotoType, strDomain, strOrderNum, bGrowth, strSelGrowth, strAryOfScenery, imageNumArr, imagePathArr, strAryOfEachImageOfGoods);
  2331. if(imagePathArr.GetSize() > 0)
  2332. strAryOfImagePath.Copy(imagePathArr);
  2333. }
  2334. if ( strAryOfImagePath.GetSize() == 0 && nPhotoType == 2)
  2335. {
  2336. AfxMessageBox(_T("注意:此单未修片, 导出的是原片!"), MB_ICONINFORMATION);
  2337. nPhotoType = 1;
  2338. strAryOfImagePath.RemoveAll();
  2339. strAryOfEachImageOfGoods.RemoveAll();
  2340. strAryOfEachImageOfGoods.Copy(strTempImageGoods);
  2341. LoadExistsImagesEx(nPhotoType,strDomain,strOrderNum,bGrowth,strSelGrowth,strAryOfScenery,imageNumArr,imagePathArr,strAryOfEachImageOfGoods);
  2342. if(imagePathArr.GetSize() > 0)
  2343. strAryOfImagePath.Append(imagePathArr);
  2344. return strAryOfImagePath.GetSize() ? 3 : -1;
  2345. }
  2346. //按编号排序
  2347. CStringArray tempPathArr;
  2348. tempPathArr.Copy(strAryOfImagePath);
  2349. strAryOfImagePath.RemoveAll();
  2350. for(int j=0; j<imageNumArr.GetSize(); j++)
  2351. {
  2352. BOOL bExists = FALSE;
  2353. CString strNum = imageNumArr.ElementAt(j);
  2354. for(i=0; i<tempPathArr.GetSize(); i++)
  2355. {
  2356. CString strFile = tempPathArr.ElementAt(i);
  2357. strFile = strFile.Mid(strFile.ReverseFind('\\')+1);
  2358. int nPos = strFile.Find(_T("."));
  2359. if(nPos == -1)
  2360. continue;
  2361. strFile = strFile.Left(nPos);
  2362. if(strNum.CompareNoCase(strFile) == 0)
  2363. {
  2364. strAryOfImagePath.Add(tempPathArr.ElementAt(i));
  2365. bExists = TRUE;
  2366. break;
  2367. }
  2368. }
  2369. if(!bExists)
  2370. strAryOfImagePath.Add(_T(""));
  2371. }
  2372. return strAryOfImagePath.GetSize() ? selectdlg.m_mode : -1;
  2373. }
  2374. /************************************************************************/
  2375. /*
  2376. 函数:LoadExistsImagesEx
  2377. 描述:加载存在的相片编号文件;
  2378. 参数:
  2379. IN:nPhotoType 导出的相片类型;
  2380. IN:lpDomain 域名;
  2381. IN:lpOrderNum 订单号;
  2382. IN:bGrowTh 是否儿童成长套系;
  2383. IN:lpSelectName 选中的成长套系名;
  2384. IN:strAryOfScenery 订单下的景点名或儿童成长套系名数组;
  2385. IN:strAryOfImageNum 订单选好商品的相片编号数组;
  2386. OUT:strAryOfImagePath 存在于共享目录的相片编号文件路径数组;
  2387. OUT:strAryOfImageGoods 存在于共享目录的相片关联的商品数组;
  2388. 返回:
  2389. 调用约定:
  2390. 注意:
  2391. */
  2392. /************************************************************************/
  2393. void BeautifySkinFrom2::LoadExistsImagesEx(IN const int &nPhotoType,
  2394. IN LPCTSTR lpDomain,
  2395. IN LPCTSTR lpOrderNum,
  2396. IN BOOL bGrowTh,
  2397. IN LPCTSTR lpSelectName,
  2398. IN CStringArray &strAryOfScenery,
  2399. IN CStringArray &strAryOfImageNum,
  2400. OUT CStringArray &strAryOfImagePath,
  2401. OUT CStringArray &strAryOfImageGoods)
  2402. {
  2403. CStringArray strTempNum; //临时相片编号如:001,002
  2404. strTempNum.Copy(strAryOfImageNum);
  2405. CStringArray strTempImagePath; //临时相片路径集
  2406. //根据选好的相片编号查找
  2407. CNetShareInfo::GetInstance()->LoadOrderBySelectedImages(nPhotoType, lpOrderNum, lpDomain, strTempNum, strTempImagePath);
  2408. CString strScenery(lpSelectName);
  2409. /*
  2410. printf("-----bGrowTh = %d---------------strScenery = %s--------------------\n", bGrowTh, lpSelectName);
  2411. */
  2412. if ( bGrowTh && ( !strScenery.IsEmpty() && strScenery != _T("全部")) )
  2413. {
  2414. // 保留套系名下的相片;
  2415. CString str;
  2416. if ( nPhotoType == 1 )
  2417. {
  2418. // 原片;
  2419. for ( int i = 0; i < strTempImagePath.GetSize(); i++)
  2420. {
  2421. str = strTempImagePath.ElementAt(i);
  2422. str = str.Mid(str.Find(lpOrderNum) + strlen(lpOrderNum) + 1);
  2423. str = str.Left(str.Find('\\'));
  2424. if ( str.CompareNoCase(strScenery) == 0 )
  2425. {
  2426. strAryOfImagePath.Add(strTempImagePath.ElementAt(i));
  2427. }
  2428. }
  2429. }
  2430. else
  2431. {
  2432. // 初修;
  2433. for ( int i = 0; i < strTempImagePath.GetSize(); i++)
  2434. {
  2435. str = strTempImagePath.ElementAt(i);
  2436. int nIndex = str.Find(lpOrderNum);
  2437. str.Insert(nIndex + strlen(lpOrderNum) + 1, strScenery + _T("\\"));
  2438. if ( PathFileExists(str) )
  2439. strAryOfImagePath.Add(strTempImagePath.ElementAt(i));
  2440. }
  2441. }
  2442. }
  2443. else
  2444. {
  2445. /*
  2446. for(int i=0; i<strTempImagePath.GetSize(); )
  2447. {
  2448. CString strPath = strTempImagePath.ElementAt(i);
  2449. strPath = strPath.Right(strPath.GetLength() - strPath.ReverseFind('\\') - 1);
  2450. strPath = strPath.Left(strPath.Find('.'));
  2451. printf("strPath = %s\n", strPath);
  2452. if(FindArray(&strTempNum, strPath) == -1)
  2453. {
  2454. printf("remove = %s\n", strTempImagePath.ElementAt(i));
  2455. strTempImagePath.RemoveAt(i);
  2456. }
  2457. else
  2458. i++;
  2459. }
  2460. */
  2461. strAryOfImagePath.Copy(strTempImagePath);
  2462. }
  2463. /*test
  2464. for(int i=0; i<strAryOfImagePath.GetSize(); i++)
  2465. printf("path10 = %s\n", strAryOfImagePath.ElementAt(i));
  2466. */
  2467. }
  2468. #endif