TakeFrom.cpp 77 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474
  1. // TakeFrom.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "TakeFrom.h"
  6. #include "MyMdi.H"
  7. #include "ModifyDinDan.h"
  8. #include "ImportPhoto.h"
  9. #include "ShowPic.h"
  10. #include "TakeMoney2.h"
  11. #include "SelWaiter2.h"
  12. #include "TakeStautsSel.h"
  13. #include "SalaryRateSet2.h"
  14. #include "UploadPhoto.h"
  15. #include "NetShareInfo.h"
  16. #include "SetOrderInfo.h"
  17. #ifdef _DEBUG
  18. #define new DEBUG_NEW
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22. #pragma comment(lib, "Shlwapi.lib")
  23. IMPLEMENT_DYNCREATE(TakeFrom, MyFormView)
  24. TakeFrom::TakeFrom() : MyFormView(TakeFrom::IDD)
  25. {
  26. m_filter = _T("");
  27. m_nAdd = 0;
  28. if (g_bAllBranch)
  29. {
  30. m_nAdd = 1;
  31. }
  32. }
  33. TakeFrom::~TakeFrom()
  34. {
  35. }
  36. void TakeFrom::DoDataExchange(CDataExchange* pDX)
  37. {
  38. MyFormView::DoDataExchange(pDX);
  39. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  40. DDX_Control(pDX, IDC_LIST2, m_List1);
  41. DDX_Control(pDX, IDC_STATIC1, m_static1);
  42. DDX_CBString(pDX, IDC_COMBO1, m_filter);
  43. }
  44. BEGIN_MESSAGE_MAP(TakeFrom, MyFormView)
  45. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  46. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  47. ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  48. ON_WM_TIMER()
  49. ON_BN_CLICKED(IDC_BUTimportphoto, OnBUTimportphoto)
  50. ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
  51. ON_BN_CLICKED(IDC_BUTmoney, OnBUTmoney)
  52. ON_BN_CLICKED(IDC_BTNaddsp, OnBTNaddsp)
  53. ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
  54. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  55. ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
  56. ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
  57. ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
  58. ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3)
  59. ON_BN_CLICKED(Btn_MicroShare, OnBnClickedMicroshare)
  60. ON_MESSAGE(MSG_KERNEL_CALLBACK, OnKernelCallBack)
  61. END_MESSAGE_MAP()
  62. #ifdef _DEBUG
  63. void TakeFrom::AssertValid() const
  64. {
  65. MyFormView::AssertValid();
  66. }
  67. void TakeFrom::Dump(CDumpContext& dc) const
  68. {
  69. MyFormView::Dump(dc);
  70. }
  71. #endif //_DEBUG
  72. LRESULT TakeFrom::OnKernelCallBack(WPARAM wp,LPARAM lp)
  73. {
  74. GetData();
  75. return 0;
  76. }
  77. void TakeFrom::OnInitialUpdate()
  78. {
  79. MyFormView::OnInitialUpdate();
  80. // TODO: Add your specialized code here and/or call the base class
  81. CMyMdi Mdi;
  82. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  83. // Here we create the outbar control using the splitter as its parent
  84. // and setting its id to the first pane.
  85. CRect rc2;
  86. GetWindowRect(rc2);
  87. ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
  88. EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
  89. int idarray[] = { IDC_BUTprint3, IDC_BUTimportphoto, IDC_BUTshowphoto, IDC_BUTTON2, IDC_BUTclose };
  90. int idcount = 5;
  91. int btnwid;
  92. CRect prerc;
  93. for (int a = idcount - 2; a >= 0; a--)
  94. {
  95. GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
  96. ScreenToClient(prerc);
  97. GetDlgItem(idarray[a])->GetWindowRect(rc2);
  98. ScreenToClient(rc2);
  99. btnwid = rc2.Width();
  100. rc2.right = prerc.left;
  101. rc2.left = rc2.right - btnwid;
  102. GetDlgItem(idarray[a])->MoveWindow(rc2);
  103. }
  104. m_static1.SetFont(&g_titlefont);
  105. if (g_bAllBranch == 0)
  106. {
  107. #ifdef CHILD_VERSION
  108. #ifdef LKAY_VERSION
  109. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;相片张数,100;景点,100;拍照,100;导片日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  110. #else
  111. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  112. #endif
  113. #else
  114. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  115. #endif
  116. m_List1.LoadColumnInfo(114);
  117. }
  118. else
  119. {
  120. #ifdef CHILD_VERSION
  121. m_List1.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  122. #else
  123. m_List1.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  124. #endif
  125. m_List1.LoadColumnInfo(196);
  126. GetDlgItem(IDC_BUTprint3)->ShowWindow(1);
  127. }
  128. #if JEFF_DELETE_OFF // 多景点时排序有问题!
  129. m_List1.m_bSortSupport = 0;
  130. #endif
  131. GetData();
  132. m_combo1.AddString(g_user.name);
  133. m_combo1.GetWindowRect(rc2);
  134. ScreenToClient(rc2);
  135. rc2.bottom += 200;
  136. m_combo1.MoveWindow(rc2);
  137. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  138. SetComboHei(&m_combo1, rc2.Height());
  139. }
  140. void TakeFrom::FillGrid(BOOL bStatus/*=0*/)
  141. {
  142. if (g_bSearchFilter) // 1.按钮:条件查询;
  143. {
  144. m_List1.DeleteAllItems2();
  145. int ii = 0;
  146. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  147. int count = 0;
  148. {
  149. BOOL bFinded = 0;
  150. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  151. {
  152. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  153. {
  154. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  155. continue;
  156. }
  157. if (g_filterdate1 != "") // Jeff.查询过滤条件:日期;
  158. {
  159. if (m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) < g_filterdate1 || m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) > g_filterdate2)
  160. {
  161. bFinded = 0;
  162. continue;
  163. }
  164. }
  165. if (g_waiter1 != "") // Jeff.查询过滤条件:门市;
  166. {
  167. if (m_List1array.ElementAt(ii).ElementAt(11 + m_nAdd) != g_waiter1)
  168. {
  169. bFinded = 0;
  170. continue;
  171. }
  172. }
  173. if (g_waiter2 != "") // Jeff.查询过滤条件:摄影师;
  174. {
  175. if (m_List1array.ElementAt(ii).ElementAt(7 + m_nAdd) != g_waiter2)
  176. {
  177. bFinded = 0;
  178. continue;
  179. }
  180. }
  181. if (g_waiter3 != "") // Jeff.查询过滤条件:化妆师;
  182. {
  183. if (m_List1array.ElementAt(ii).ElementAt(9 + m_nAdd) != g_waiter3)
  184. {
  185. bFinded = 0;
  186. continue;
  187. }
  188. }
  189. if (g_waiter4 != "") // Jeff.查询套系类别;
  190. {
  191. if (m_List1array.ElementAt(ii).ElementAt(3) != g_waiter4)
  192. {
  193. bFinded = 0;
  194. continue;
  195. }
  196. }
  197. if (g_bAllBranch && g_filterbranch != "") // Jeff.集团版查询过滤条件:分店名称;
  198. {
  199. if (m_List1array.ElementAt(ii).ElementAt(0) != g_filterbranch)
  200. {
  201. bFinded = 0;
  202. continue;
  203. }
  204. }
  205. // 2015.03.30
  206. // Jeff:上面已有判断,这里必须判断订单号非空才能添加,否则会添加其他空的选项;
  207. if (!m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  208. {
  209. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  210. bFinded = 1;
  211. }
  212. }
  213. }
  214. m_List1.m_arLabels.SetSize(count, 1);
  215. ii = count;
  216. m_List1.m_LabelCount = ii;
  217. m_List1.SetItemCountEx(ii);
  218. CString str;
  219. str.Format("单数:%d", ii);
  220. SetDlgItemText(IDC_STATIC2, str);
  221. }
  222. else // 2.其他显示;
  223. {
  224. m_List1.DeleteAllItems2();
  225. int ii = 0;
  226. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  227. int count = 0;
  228. if (m_filter.IsEmpty()) // 2.1.没有查询关键字;
  229. {
  230. if (bStatus == 1) // bStatus==1,没用到;
  231. {
  232. BOOL bFinded = 0;
  233. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  234. {
  235. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  236. {
  237. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  238. continue;
  239. }
  240. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0)
  241. {
  242. bFinded = 1;
  243. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  244. }
  245. else
  246. {
  247. bFinded = 0;
  248. }
  249. }
  250. }
  251. else if (bStatus == 2) // 今拍按钮用到;
  252. {
  253. BOOL bFinded = 0;
  254. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  255. {
  256. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  257. {
  258. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  259. continue;
  260. }
  261. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK" && m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date)
  262. {
  263. bFinded = 1;
  264. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  265. }
  266. else
  267. {
  268. bFinded = 0;
  269. }
  270. }
  271. }
  272. else // bStatus==0;默认使用的值;
  273. {
  274. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  275. {
  276. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  277. }
  278. }
  279. }
  280. else // 2.2.指定查询条件 ;
  281. {
  282. if (bStatus == 1)
  283. {
  284. BOOL bFinded = 0;
  285. int type = GetType(m_filter);
  286. if (type == 1)//电话
  287. {
  288. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  289. {
  290. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  291. {
  292. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  293. continue;
  294. }
  295. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0 && (m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1 || \
  296. m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1))
  297. {
  298. bFinded = 1;
  299. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  300. }
  301. else
  302. {
  303. bFinded = 0;
  304. }
  305. }
  306. }
  307. else if (type == 2)//拼音
  308. {
  309. BOOL bFinded = 0;
  310. m_filter.MakeUpper();
  311. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  312. {
  313. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  314. {
  315. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  316. continue;
  317. }
  318. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0 && (m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1 || \
  319. m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1))
  320. {
  321. bFinded = 1;
  322. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  323. }
  324. else
  325. {
  326. bFinded = 0;
  327. }
  328. }
  329. }
  330. else
  331. {
  332. BOOL bFinded = 0;
  333. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  334. {
  335. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  336. {
  337. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  338. continue;
  339. }
  340. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&\
  341. m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0 && \
  342. (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  343. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  344. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  345. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  346. m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
  347. m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
  348. m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
  349. m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
  350. m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
  351. m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
  352. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
  353. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
  354. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  355. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  356. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  357. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  358. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1))
  359. {
  360. bFinded = 1;
  361. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  362. }
  363. else
  364. {
  365. bFinded = 0;
  366. }
  367. }
  368. }
  369. }
  370. else if (bStatus == 2)
  371. {
  372. BOOL bFinded = 0;
  373. int type = GetType(m_filter);
  374. if (type == 1)//电话
  375. {
  376. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  377. {
  378. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  379. {
  380. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  381. continue;
  382. }
  383. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date && (m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1 || \
  384. m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1))
  385. {
  386. bFinded = 1;
  387. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  388. }
  389. else
  390. {
  391. bFinded = 0;
  392. }
  393. }
  394. }
  395. else if (type == 2)//拼音
  396. {
  397. BOOL bFinded = 0;
  398. m_filter.MakeUpper();
  399. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  400. {
  401. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  402. {
  403. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  404. continue;
  405. }
  406. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date && (m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1 || \
  407. m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1))
  408. {
  409. bFinded = 1;
  410. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  411. }
  412. else
  413. {
  414. bFinded = 0;
  415. }
  416. }
  417. }
  418. else
  419. {
  420. BOOL bFinded = 0;
  421. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  422. {
  423. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  424. {
  425. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  426. continue;
  427. }
  428. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date &&\
  429. (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  430. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  431. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  432. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  433. m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
  434. m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
  435. m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
  436. m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
  437. m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
  438. m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
  439. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
  440. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
  441. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  442. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  443. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  444. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  445. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1))
  446. {
  447. bFinded = 1;
  448. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  449. }
  450. else
  451. {
  452. bFinded = 0;
  453. }
  454. }
  455. }
  456. }
  457. else
  458. {
  459. int type = GetType(m_filter);
  460. if (type == 1)//电话
  461. {
  462. BOOL bFinded = 0;
  463. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  464. {
  465. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  466. {
  467. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  468. continue;
  469. }
  470. if (m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1 || \
  471. m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1)
  472. {
  473. bFinded = 1;
  474. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  475. }
  476. else
  477. {
  478. bFinded = 0;
  479. }
  480. }
  481. }
  482. else if (type == 2)//拼音
  483. {
  484. BOOL bFinded = 0;
  485. m_filter.MakeUpper();
  486. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  487. {
  488. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  489. {
  490. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  491. continue;
  492. }
  493. if (m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1 || \
  494. m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1)
  495. {
  496. bFinded = 1;
  497. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  498. }
  499. else
  500. {
  501. bFinded = 0;
  502. }
  503. }
  504. }
  505. else
  506. {
  507. BOOL bFinded = 0;
  508. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  509. {
  510. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  511. {
  512. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  513. continue;
  514. }
  515. if (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  516. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  517. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  518. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  519. m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
  520. m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
  521. m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
  522. m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
  523. m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
  524. m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
  525. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
  526. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
  527. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  528. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  529. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  530. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  531. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1)
  532. {
  533. bFinded = 1;
  534. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  535. }
  536. else
  537. {
  538. bFinded = 0;
  539. }
  540. }
  541. }
  542. }
  543. }
  544. m_List1.m_arLabels.SetSize(count, 1);
  545. ii = count;
  546. m_List1.m_LabelCount = ii;
  547. m_List1.SetItemCountEx(ii);
  548. CString str;
  549. str.Format("单数:%d", ii);
  550. SetDlgItemText(IDC_STATIC2, str);
  551. }
  552. if (!g_id.IsEmpty())
  553. {
  554. for (int i = 0; i < m_List1.GetItemCount(); i++)
  555. {
  556. if (g_id == m_List1.GetItemText(i, 0 + m_nAdd))
  557. {
  558. m_List1.SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
  559. m_List1.EnsureVisible(i, FALSE);
  560. break;
  561. }
  562. }
  563. }
  564. }
  565. void TakeFrom::OnBUTclose()
  566. {
  567. // TODO: Add your control notification handler code here
  568. GetParent()->SendMessage(WM_CLOSE);
  569. }
  570. void TakeFrom::OnSelchangeCombo1()
  571. {
  572. // TODO: Add your control notification handler code here
  573. SetTimer(1, 100, NULL);
  574. }
  575. void TakeFrom::OnTimer(UINT nIDEvent)
  576. {
  577. // TODO: Add your message handler code here and/or call default
  578. KillTimer(nIDEvent);
  579. OnButton1();
  580. }
  581. BOOL TakeFrom::PreTranslateMessage(MSG* pMsg)
  582. {
  583. // TODO: Add your specialized code here and/or call the base class
  584. try
  585. {
  586. if (pMsg->message == WM_KEYDOWN)
  587. {
  588. switch (pMsg->wParam)
  589. {
  590. case VK_RETURN:
  591. OnButton1();
  592. return 1;
  593. case 0x43: // copy
  594. if ((GetKeyState(VK_CONTROL) & 0x80))
  595. {
  596. GetFocus()->SendMessage(WM_COPY);
  597. return TRUE;
  598. }
  599. break;
  600. case 0x56: //Ctrl + V:
  601. if ((GetKeyState(VK_CONTROL) & 0x80))
  602. {
  603. GetFocus()->SendMessage(WM_PASTE);
  604. return TRUE;
  605. }
  606. break;
  607. case 0x58: // cut
  608. if ((GetKeyState(VK_CONTROL) & 0x80))
  609. {
  610. GetFocus()->SendMessage(WM_CUT);
  611. return TRUE;
  612. }
  613. break;
  614. case 0x5A: //undo
  615. case 0x59: //redo
  616. if ((GetKeyState(VK_CONTROL) & 0x80))
  617. {
  618. GetFocus()->SendMessage(WM_UNDO);
  619. return TRUE;
  620. }
  621. break;
  622. }
  623. }
  624. return MyFormView::PreTranslateMessage(pMsg);
  625. }
  626. catch (...)
  627. {
  628. }
  629. return true;
  630. }
  631. // Jeff.remark.
  632. // 1.弹出"拍照状态确认"对话框前,需要获取订单的拍照状态,以此来确定是否需要禁用check状态框;
  633. //
  634. void TakeFrom::OnBUTimportphoto() // 导入原片按钮;
  635. {
  636. #ifdef USE_KERNEL_DLL
  637. INT nFirstItem = 0;
  638. INT nEndofItem = 0;
  639. STOrederInfo tagOrderInfo;
  640. INT nSelectedItem = GetSelectedOrderInfo(tagOrderInfo, nFirstItem, nEndofItem);
  641. // 有多少拍照OK的景点;
  642. INT nOKSize = 0;
  643. // 有多少景点未拍的;
  644. INT nUnOKSize = 0;
  645. vector<STSceneryInfo>::iterator it;
  646. for ( it = tagOrderInfo.vtOrderScenery.begin(); it != tagOrderInfo.vtOrderScenery.end(); it++ )
  647. {
  648. if ( it->strStatus == _T("OK") )
  649. nOKSize++;
  650. if ( it->strStatus == _T("未拍"))
  651. nUnOKSize++;
  652. }
  653. CSetOrderInfo dlg;
  654. for ( it = tagOrderInfo.vtOrderScenery.begin(); it != tagOrderInfo.vtOrderScenery.end(); it++ )
  655. {
  656. // 当前选中的景点列;
  657. if ( it->bSelected == TRUE )
  658. {
  659. dlg.waiter1 = it->strLensman;
  660. dlg.waiter12 = it->strLensmanAssistant;
  661. dlg.waiter2 = it->strBootDivision;
  662. dlg.waiter22 = it->strBootDivisionAssistant;
  663. // 让对话窗口弹出时,显示当前景点的拍照状态;
  664. if(it->strStatus == _T("OK"))
  665. dlg.m_nStatus = 0;
  666. else if( it->strStatus == _T("拍摄中") )
  667. dlg.m_nStatus = 1;
  668. else if( it->strStatus == _T("未拍") )
  669. dlg.m_nStatus = 2;
  670. break;
  671. }
  672. }
  673. if ( dlg.DoModal() == IDOK )
  674. {
  675. it->strLensman = dlg.waiter1;
  676. it->strLensmanAssistant = dlg.waiter12;
  677. it->strBootDivision = dlg.waiter2;
  678. it->strBootDivisionAssistant = dlg.waiter22;
  679. // m_nStatus:
  680. // 0:此景点拍照OK; 1:此景点拍照中; 2:此景点未拍照; 3:全部景点拍照OK;
  681. if ( dlg.m_nStatus == 0 )
  682. {// 所选景点设置OK,nOKSize加;
  683. if ( it->strStatus != _T("OK"))
  684. {
  685. nOKSize++;
  686. if ( it->strStatus == _T("未拍"))
  687. nUnOKSize--;
  688. }
  689. it->strStatus = _T("OK");
  690. }
  691. else if ( dlg.m_nStatus == 1 )
  692. {// 所选景点设置拍照中; 若原本景点OK,nOKSize减;
  693. if ( it->strStatus == _T("OK"))
  694. nOKSize--;
  695. if (it->strStatus == _T("未拍"))
  696. nUnOKSize--;
  697. it->strStatus = _T("拍摄中");
  698. }
  699. else if ( dlg.m_nStatus == 2 )
  700. {// 所选景点设置未拍照;若原本景点OK,nOKSize加;
  701. if ( it->strStatus == _T("OK"))
  702. {
  703. nOKSize--;
  704. nUnOKSize++;
  705. }
  706. if ( it->strStatus == _T("拍摄中"))
  707. nUnOKSize++;
  708. it->strStatus = _T("未拍");
  709. }
  710. else if ( dlg.m_nStatus == 3 )
  711. {// 全部景点设置OK;
  712. nOKSize = tagOrderInfo.vtOrderScenery.size();
  713. nUnOKSize = 0;
  714. it->strStatus = _T("OK");
  715. }
  716. //////////////////////////////////////////////////////////////////////////
  717. // SQL语句;
  718. CString strSQL = _T("");
  719. CString strSQL2 = _T("");
  720. if ( nOKSize == 0 )
  721. {// 全部景点未拍照 (若已全部景点OK,不改变订单的拍照状态和订单的拍照日期);
  722. if ( nUnOKSize == 0)
  723. strSQL.Format(_T("update dindan set [status] = case when status <> 'OK' then '拍摄中' else status end, [time2] = case when status <> 'OK' then '%s' else time2 end where id = '%s'"), g_date, tagOrderInfo.strOrderNumber);
  724. else
  725. strSQL.Format(_T("update dindan set [status] = case when status <> 'OK' then '未拍' else status end, [time2] = case when status <> 'OK' then '%s' else time2 end where id = '%s'"), g_date, tagOrderInfo.strOrderNumber);
  726. }
  727. else if ( nOKSize == tagOrderInfo.vtOrderScenery.size() )
  728. {// 全部景点都OK,设置所有dindanjd表的订单景点拍照状态OK,且设置订单的拍照日期(原本状态OK的,不改变拍照日期);
  729. strSQL.Format(_T("update dindan set [status] = 'OK', [time2] = case when status <> 'OK' then '%s' else time2 end where id = '%s'"), g_date, tagOrderInfo.strOrderNumber);
  730. strSQL2.Format(_T("***update dindanjd set [status] = 'OK' where id = '%s'"),tagOrderInfo.strOrderNumber);
  731. strSQL += strSQL2;
  732. //////////////////////////////////////////////////////////////////////////
  733. // 全部景点拍照OK时,判断是否需要生成短信;
  734. if ( atoi(g_cominfoarray.ElementAt(0).ElementAt(101)) )
  735. {
  736. CString strTimeStamp = _T("msgtimestamp");
  737. CString strSMSContent = CString(g_cominfoarray.ElementAt(0).ElementAt(105));
  738. // 获取用户手机号码;
  739. CString strPhone1 = tagOrderInfo.strPhone;
  740. CString strPhone2 = tagOrderInfo.strTelPhone;
  741. if ( strPhone1.Find(_T("***")) != -1 )
  742. {//若用户权限不足以获取手机号码,重新获取;
  743. CString strBranchName = GetBranchNamebyId(tagOrderInfo.strBranchId);
  744. if ( g_bAllBranch )
  745. {
  746. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  747. {
  748. if (tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && strBranchName == m_List1arrayBak.ElementAt(i).ElementAt(0))
  749. {
  750. strPhone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  751. strPhone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  752. break;
  753. }
  754. }
  755. }
  756. else
  757. {
  758. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  759. {
  760. if (tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0))
  761. {
  762. strPhone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  763. strPhone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  764. break;
  765. }
  766. }
  767. }
  768. }
  769. // 生成短信内容;
  770. CString strtemp = _T("");
  771. #ifdef CHILD_VERSION
  772. if ( !tagOrderInfo.strName1.IsEmpty() )
  773. strtemp = tagOrderInfo.strName1 + _T(",");
  774. strtemp += tagOrderInfo.strName2;
  775. strtemp.TrimRight(_T(","));
  776. if( !strtemp.IsEmpty() && CheckPhoneType(strPhone1) != -1 && CheckBadWords(strtemp,0) )
  777. {
  778. strtemp += strSMSContent;
  779. strtemp.Replace(_T("xxx小朋友"), _T(""));
  780. int nCount = GetLengthEx(strtemp)/MSG_LENGTH;
  781. if( GetLengthEx(strtemp)%MSG_LENGTH )
  782. nCount++;
  783. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, strTimeStamp, nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  784. strSQL += _T("***") + strSQL2;
  785. }
  786. #else
  787. if ( strSMSContent.Find(_T("xxx先生/女士")) != -1 )
  788. {
  789. int nCount = 0;
  790. // 男士短信;
  791. if ( !tagOrderInfo.strName1.IsEmpty() && CheckPhoneType(strPhone1) != -1 && CheckBadWords(tagOrderInfo.strName1, 0) )
  792. {
  793. strtemp = strSMSContent;
  794. strtemp.Replace(_T("xxx先生/女士"), tagOrderInfo.strName1 + _T("先生"));
  795. nCount = GetLengthEx(strtemp) / MSG_LENGTH;
  796. if ( GetLengthEx(strtemp) % MSG_LENGTH )
  797. nCount++;
  798. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, strTimeStamp, nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  799. strSQL += _T("***") + strSQL2;
  800. }
  801. // 女士短信;
  802. if ( !tagOrderInfo.strName2.IsEmpty() && CheckPhoneType(strPhone2) != -1 && CheckBadWords(tagOrderInfo.strName2, 0) )
  803. {
  804. strtemp = strSMSContent;
  805. strtemp.Replace(_T("xxx先生/女士"), tagOrderInfo.strName1 + _T("先生"));
  806. nCount = GetLengthEx(strtemp) / MSG_LENGTH;
  807. if ( GetLengthEx(strtemp) % MSG_LENGTH )
  808. nCount++;
  809. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, _T("msgtimexxstamp"), nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  810. strSQL += _T("***") + strSQL2;
  811. }
  812. }
  813. #endif
  814. }
  815. }
  816. else
  817. {// 部分景点拍照;拍照中(若订单的拍照状态已OK,不修改状态);
  818. strSQL.Format(_T("update dindan set [status] = case when status <> 'OK' then '拍摄中' else status end, [time2] = case when status <> 'OK' then '%s' else time2 end where id = '%s'"), g_date, tagOrderInfo.strOrderNumber);
  819. }
  820. // 最多4个景点,4组摄影师+化妆师;
  821. if ( nSelectedItem == nFirstItem )
  822. {
  823. strSQL2.Format(_T("***update dindan set waiter1 = '%s', waiter2 = '%s' where id = '%s'"),
  824. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  825. }
  826. else if ( nSelectedItem == nFirstItem + 1)
  827. {
  828. strSQL2.Format(_T("***update dindan set waiter12 = '%s', waiter22 = '%s' where id = '%s'"),
  829. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  830. }
  831. else if ( nSelectedItem == nFirstItem + 2)
  832. {
  833. strSQL2.Format(_T("***update dindan set waiter13 = '%s', waiter23 = '%s' where id = '%s'"),
  834. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  835. }
  836. else if ( nSelectedItem == nFirstItem + 3)
  837. {
  838. strSQL2.Format(_T("***update dindan set waiter14 = '%s', waiter24 = '%s' where id = '%s'"),
  839. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  840. }
  841. strSQL += strSQL2;
  842. strSQL2.Format(_T("***update dindanjd set [date]= '%s', [status] = '%s', [waiter1] = '%s', [waiter12] = '%s', [waiter2] = '%s',[waiter22] ='%s' where id = '%s' and [name] = '%s' "),
  843. g_date, it->strStatus, it->strLensman, it->strLensmanAssistant, it->strBootDivision, it->strBootDivisionAssistant, tagOrderInfo.strOrderNumber, it->strScenery);
  844. strSQL += strSQL2;
  845. strSQL2.Format(_T("***gentakecontent:"),tagOrderInfo.strOrderNumber);//拍照OK时记录客人预定内容
  846. strSQL += strSQL2;
  847. //////////////////////////////////////////////////////////////////////////
  848. // 构建发送给服务器的包;
  849. g_sendhead.bsql = TRUE;
  850. if ( g_bAllBranch )
  851. {
  852. // 多店汇总;
  853. g_branchip = GetIP(tagOrderInfo.strBranchId);
  854. g_pMainWnd->OnDisconnect();
  855. g_branchname = tagOrderInfo.strBranchId;
  856. g_bBranchModify = TRUE;
  857. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  858. g_pMainWnd->OnDisconnect();
  859. g_bBranchModify = FALSE;
  860. g_branchip = g_branchname = _T("");
  861. }
  862. else
  863. {
  864. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  865. }
  866. //////////////////////////////////////////////////////////////////////////
  867. // 接收服务器返回的数据;
  868. if (g_bSendOK == 0)
  869. {
  870. OutputDebugString(_T("\n服务器返回数据失败!\n"));
  871. return;
  872. }
  873. if (g_bAllBranch == 0)
  874. {// 连接本店或分店时;
  875. GetData();
  876. }
  877. else
  878. {// 多店汇总时;
  879. BOOL bFind = 0;
  880. for (int i = 0; i < m_List1array.GetSize(); i++)
  881. {
  882. if (bFind && m_List1array.ElementAt(i).ElementAt(1) != _T(""))break;
  883. if (tagOrderInfo.strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && tagOrderInfo.strBranchId == m_List1array.ElementAt(i).ElementAt(0))
  884. {
  885. bFind = 1;
  886. }
  887. if (bFind && it->strScenery == m_List1array.ElementAt(i).ElementAt(4))
  888. {
  889. m_List1array.ElementAt(i).SetAt(7 + m_nAdd, it->strLensman);
  890. m_List1array.ElementAt(i).SetAt(8 + m_nAdd, it->strLensmanAssistant);
  891. m_List1array.ElementAt(i).SetAt(9 + m_nAdd, it->strBootDivision);
  892. m_List1array.ElementAt(i).SetAt(10 + m_nAdd, it->strBootDivisionAssistant);
  893. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, it->strStatus);
  894. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
  895. //m_List1array.ElementAt(i).SetAt(3 + m_nAdd, sbeginno);
  896. FillGrid();
  897. break;
  898. }
  899. }
  900. }
  901. }
  902. // 开始导入初修片;
  903. if ( MessageBox(_T("是否现在开始导入原片!"), _T("导片提示:导入原片"), MB_TOPMOST|MB_YESNO|MB_ICONWARNING ) != IDYES )
  904. {// 是否马上导入相片;
  905. return;
  906. }
  907. //////////////////////////////////////////////////////////////////////////
  908. INT nImgNum = atoi(tagOrderInfo.strImageNumber);
  909. if ( nImgNum <= 0)
  910. nImgNum = 1;
  911. else
  912. ++nImgNum;
  913. ImgImportInterface *pImport = NULL;
  914. if ( g_pIMGProcess == NULL )
  915. {
  916. AfxMessageBox(_T("lyfzIMGProcess模块加载失败!"));
  917. return;
  918. }
  919. g_pIMGProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
  920. if ( pImport )
  921. {
  922. pImport->ImportOriginalImg(
  923. TRUE, // 文件夹形式打开源或多选文件形式;
  924. !g_bOriginal, // 相片是否需要重命名;
  925. nImgNum, // 相片数字编号;
  926. tagOrderInfo.strBranchId, // 分店域名;
  927. tagOrderInfo.strOrderNumber, // 订单号;
  928. tagOrderInfo.strName1 + _T(",") + tagOrderInfo.strName2, // 顾客信息,可任意组合;
  929. TRUE, // 导入时,是否生成景点名文件夹;
  930. it->strScenery, // 导入时,景点名;
  931. _T("*.jpg|*.jpeg"), // 导入时,主扩展名相片;
  932. INVALID_COPY_PIX, // 导入时,主扩展名相片的压缩像素;
  933. _T("*.nef|*.cr2|*.raw"), // 导入时,附加的扩展名相片;
  934. TRUE, // 导入时,是否生成缩略图;
  935. SET_PIX(100,100), // 导入时,生成的缩略图像素大小;
  936. FALSE // 导入时,文件存在时是否覆盖;
  937. );
  938. g_pIMGProcess->Release();
  939. }
  940. //////////////////////////////////////////////////////////////////////////
  941. #else
  942. POSITION pos;
  943. pos = m_List1.GetFirstSelectedItemPosition();
  944. if (pos == NULL)
  945. {
  946. AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
  947. return;
  948. }
  949. // 1.选中的起始行号;
  950. int iItem = m_List1.GetNextSelectedItem(pos);
  951. // 2.选中的行数;
  952. int itemcount = m_List1.GetItemCount();
  953. int iItemBak = iItem;
  954. CString status2 = "OK";
  955. CString branch;
  956. CString strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd); // .OrderNumber订单号;
  957. int beginno = atoi(m_List1.GetItemText(iItem, 3 + m_nAdd)) + 1; // .Jeff.起始编号,即下一次相片命名的号码数;由服务器减1,客户端加1;
  958. if (g_bAllBranch)
  959. branch = m_List1.GetItemText(iItem, 0);
  960. // Jeff.多景点时,选择了不是第一个景点,订单是空的;
  961. while (strOrderNumber == "")
  962. {
  963. iItem--;
  964. strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
  965. beginno = atoi(m_List1.GetItemText(iItem, 3 + m_nAdd)) + 1; // 由服务器减1,客户端加1;
  966. }
  967. int nTopItem = iItem;// Jeff add:记录第一个有订单号的项;
  968. //int nNotOkItem = -1; // Jeff add:第一个被记录未拍照ok的子景点项;如果是头景点呢?
  969. // .jdpos景点位置;并不能用来判断该订单是否多个景点,因为如果iItem是有订单号的话,无效;
  970. int jdpos = iItemBak - iItem;
  971. // .订单拍摄如果不是ok状态,设置为拍摄中;
  972. BOOL bOK = TRUE; //Jeff.add;
  973. #if 1 // Jeff.用于判断是否只剩下一个 未OK 状态时,拍照确认对话框的复选是否需要勾上;
  974. // 此时iItem为有订单号的头景点;
  975. if (m_List1.GetItemText(iItem, 5 + m_nAdd) != "OK")
  976. {
  977. status2 = "拍摄中";
  978. //bOK = FALSE;
  979. }
  980. // .子景点(如果有的话);
  981. ++iItem;
  982. while (iItem < itemcount && m_List1.GetItemText(iItem, 0 + m_nAdd) == "" && status2 != "拍摄中")
  983. {
  984. if (m_List1.GetItemText(iItem, 5 + m_nAdd) != "OK" && iItemBak != iItem) // Jeff.如果只有两个景点这里出错:第一个ok,第二个未拍;这里会跳出;
  985. {
  986. status2 = "拍摄中";
  987. //bOK = FALSE;
  988. //nNotOkItem = iItem;
  989. break;
  990. }
  991. iItem++;
  992. }
  993. // printf("Jeff:对话框前的状态:%s\n\n",status2);
  994. #endif //#if 1
  995. iItem = iItemBak;
  996. CString dindanjd = m_List1.GetItemText(iItem, 4 + m_nAdd);
  997. CString waiter1 = m_List1.GetItemText(iItem, 7 + m_nAdd);
  998. CString waiter12 = m_List1.GetItemText(iItem, 8 + m_nAdd);
  999. CString waiter2 = m_List1.GetItemText(iItem, 9 + m_nAdd);
  1000. CString waiter22 = m_List1.GetItemText(iItem, 10 + m_nAdd);
  1001. strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1002. while (strOrderNumber == "")
  1003. {
  1004. iItem--;
  1005. strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1006. }
  1007. CString name = m_List1.GetItemText(iItem, 1 + m_nAdd) + "," + m_List1.GetItemText(iItem, 2 + m_nAdd);
  1008. name.TrimLeft(",");
  1009. name.TrimRight(",");
  1010. name = "客人:" + name;
  1011. CString phone = m_List1.GetItemText(iItem, 14 + m_nAdd) + "," + m_List1.GetItemText(iItem, 15 + m_nAdd);
  1012. phone.TrimLeft(",");
  1013. phone.TrimRight(",");
  1014. phone = "电话:" + phone;
  1015. CString strDomain = _T("");
  1016. CString savepath = _T("");
  1017. if (g_bAllBranch)
  1018. strDomain = GetDomainFromBranch(branch);
  1019. else
  1020. {
  1021. if(g_branchname != _T(""))
  1022. strDomain = GetDomainFromBranch(g_branchname);
  1023. }
  1024. //////////////////////////////////////////////////////////////////////////
  1025. // 获取可用的共享目录;
  1026. #if USE_SHARE_FLORD // 2015.04.13
  1027. TCHAR szSharePath[MAX_PATH] = {0};
  1028. if ( CNetShareInfo::GetInstance()->GetEnableShareDirectory(1, strOrderNumber, strDomain, szSharePath) )
  1029. {
  1030. savepath.Format("%s\\",szSharePath);
  1031. }
  1032. else
  1033. {
  1034. AfxMessageBox(_T("没有可用的共享目录!"));
  1035. return;
  1036. }
  1037. #else
  1038. savepath += strOrderNumber + "\\";
  1039. #endif //#if USE_SHARE_FLORD
  1040. //////////////////////////////////////////////////////////////////////////
  1041. if ( !CheckFolderFileExist(savepath) )
  1042. {
  1043. if( !CreateDirectory(savepath, NULL) )
  1044. {
  1045. AfxMessageBox(_T("无法创建订单目录,确认权限充足"));
  1046. return;
  1047. }
  1048. }
  1049. CString calnopath = savepath;
  1050. savepath += dindanjd + "\\";
  1051. if (::CheckFolderFileExist(savepath) == 0)
  1052. ::CreateDirectory(savepath, NULL);
  1053. CString Filter = "图片文件 (*.jpg)|*.jpg|原始格式RAW (*.raw)|*.raw|原始格式NEF (*.nef)|*.nef|原始格式CR2 (*.cr2)|*.cr2||";
  1054. // .选择要导入的相片,可多选;
  1055. CFileDialog fdlg(true, NULL, "openfile", OFN_ALLOWMULTISELECT, Filter);
  1056. TCHAR szBuffer[60000] = { 0 };
  1057. fdlg.m_ofn.lpstrFile = szBuffer;
  1058. fdlg.m_ofn.nMaxFile = 60000;
  1059. if (fdlg.DoModal() != IDOK)
  1060. {
  1061. // .拍摄人员确认 SelWaiter2;
  1062. SelWaiter2 waiterdlg;
  1063. waiterdlg.waiter1 = waiter1;
  1064. waiterdlg.waiter12 = waiter12;
  1065. waiterdlg.waiter2 = waiter2;
  1066. waiterdlg.waiter22 = waiter22;
  1067. waiterdlg.beginno = beginno;// Jeff,实际上SelWaiter::beginno并没有任何作用,这里放置具有误导性!
  1068. if (waiterdlg.DoModal() != IDOK)return;
  1069. waiter1 = waiterdlg.waiter1;
  1070. waiter12 = waiterdlg.waiter12;
  1071. waiter2 = waiterdlg.waiter2;
  1072. waiter22 = waiterdlg.waiter22;
  1073. beginno = waiterdlg.beginno;
  1074. CString status;
  1075. // .拍照状态确认.对话框.
  1076. TakeStautsSel dlg2;
  1077. if (status2 == "OK") // .拍照状态为ok时;
  1078. {
  1079. dlg2.m_check1 = 1;
  1080. // Jeff.add:已经是ok的拍照状态,禁用用户修改该状态;IDC_CHECK1
  1081. //dlg2.DisEnableCheck();
  1082. dlg2.m_bCheckEnalbe = FALSE;
  1083. }
  1084. dlg2.DoModal();
  1085. if (dlg2.m_radio1 == 0)
  1086. {
  1087. status = "OK";
  1088. }
  1089. else if (dlg2.m_radio1 == 1)
  1090. {
  1091. status = "拍摄中";
  1092. //dlg2.CheckChange();
  1093. }
  1094. else
  1095. {
  1096. status = "未拍";
  1097. //dlg2.CheckChange();
  1098. }
  1099. #if 1
  1100. //本次选择ok时,需要再检查一下,看是否全部都已经ok;
  1101. // 此时iItem为有订单号的头景点;
  1102. // printf("Jeff:景点拍照完成,nTopItem=%d\n\n",nTopItem);
  1103. bOK = TRUE;
  1104. status2 = "OK";
  1105. int nItem = nTopItem;
  1106. if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK")
  1107. {
  1108. if (nItem != iItemBak)
  1109. {
  1110. status2 = "拍摄中";
  1111. // printf("Jeff:景点%d拍照完成\n\n",nItem);
  1112. bOK = FALSE;
  1113. }
  1114. else if (status != "OK")
  1115. {
  1116. status2 = "拍摄中";
  1117. // printf("Jeff:景点%d拍照完成\n\n",nItem);
  1118. bOK = FALSE;
  1119. }
  1120. }
  1121. // .子景点(如果有的话);
  1122. ++nItem;
  1123. while (nItem < itemcount && m_List1.GetItemText(nItem, 0 + m_nAdd) == "" && status2 != "拍摄中")
  1124. {
  1125. if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK" && iItemBak != nItem) // Jeff.如果只有两个景点这里出错:第一个ok,第二个未拍;这里会跳出;
  1126. {
  1127. status2 = "拍摄中";
  1128. bOK = FALSE;
  1129. // printf("Jeff:景点%d拍照完成\n\n",nItem);
  1130. break;
  1131. }
  1132. else
  1133. {
  1134. if (status != "OK")
  1135. {
  1136. status2 = "拍摄中";
  1137. bOK = FALSE;
  1138. }
  1139. }
  1140. ++nItem;
  1141. }
  1142. if (bOK) status2 = "OK";
  1143. #endif
  1144. #if 1
  1145. //if ( !bOK )
  1146. // status2 = "拍摄中";
  1147. //else if(dlg2.m_check1) // .拍照景点全部ok状态;
  1148. // status2 = "OK";
  1149. CString sql;
  1150. if (dlg2.m_check1)
  1151. {
  1152. status2 = "OK";
  1153. // Jeff:如果有多个景点,全部设置为拍照ok;
  1154. // 需要遍历处理;
  1155. sql.Format("update dindanjd set [status]='OK' where id='%s'", strOrderNumber);
  1156. // printf("Jeff:全部景点选择拍照OK,SQL=%s\n\n",sql);
  1157. }
  1158. #endif //#if 1
  1159. //CString sql;
  1160. //sql="update dindanjd set [status]='"+status+"',[waiter1]='"+waiter1+"',[waiter12]='"+waiter12+"',[waiter2]='"+waiter2+"',[waiter22]='"+waiter22+"' where [id]='"+id+"' and [name]='"+dindanjd+"'";
  1161. sql += "***update dindanjd set [status]='" + status + "',[waiter1]='" + waiter1 + "',[waiter12]='" + waiter12 + "',[waiter2]='" + waiter2 + "',[waiter22]='" + waiter22 + "' where [id]='" + strOrderNumber + "' and [name]='" + dindanjd + "'";
  1162. #ifndef LYFZ_VERSION
  1163. if (jdpos == 0)
  1164. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter1]='" + waiter1 + "',[waiter2]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
  1165. else if (jdpos == 1)
  1166. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter12]='" + waiter1 + "',[waiter22]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
  1167. else if (jdpos == 2)
  1168. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter13]='" + waiter1 + "',[waiter23]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
  1169. else if (jdpos == 3)
  1170. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter14]='" + waiter1 + "',[waiter24]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
  1171. else
  1172. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end where [id]='" + strOrderNumber + "'";
  1173. #else
  1174. sql+="***update dindan set [status]=case when [status]<>'OK' then '"+status2+"' else [status] end where [id]='"+strOrderNumber+"'";
  1175. #endif //#ifndef LYFZ_VERSION
  1176. CString sql2;
  1177. if (1)
  1178. {
  1179. sql2 = "***gentakecontent:" + strOrderNumber;
  1180. sql += sql2;
  1181. }
  1182. g_sendhead.bsql = 1;
  1183. if (g_bAllBranch)
  1184. {
  1185. g_branchip = GetIP(branch);
  1186. g_pMainWnd->OnDisconnect();
  1187. g_branchname = branch;
  1188. g_bBranchModify = 1;
  1189. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1190. g_pMainWnd->OnDisconnect();
  1191. g_bBranchModify = 0;
  1192. g_branchip = g_branchname = "";
  1193. }
  1194. else
  1195. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1196. if (g_bSendOK == 0)return;
  1197. if (g_bAllBranch == 0)
  1198. {
  1199. GetData();
  1200. }
  1201. else
  1202. {
  1203. BOOL bFind = 0;
  1204. for (int i = 0; i < m_List1array.GetSize(); i++)
  1205. {
  1206. if (bFind && m_List1array.ElementAt(i).ElementAt(1) != "")break;
  1207. if (strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
  1208. {
  1209. bFind = 1;
  1210. }
  1211. if (bFind && dindanjd == m_List1array.ElementAt(i).ElementAt(4))
  1212. {
  1213. m_List1array.ElementAt(i).SetAt(7 + m_nAdd, waiter1);
  1214. m_List1array.ElementAt(i).SetAt(8 + m_nAdd, waiter12);
  1215. m_List1array.ElementAt(i).SetAt(9 + m_nAdd, waiter2);
  1216. m_List1array.ElementAt(i).SetAt(10 + m_nAdd, waiter22);
  1217. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, status);
  1218. FillGrid();
  1219. break;
  1220. }
  1221. }
  1222. }
  1223. return;
  1224. }
  1225. pos = fdlg.GetStartPosition();
  1226. CStringArray array;
  1227. while (pos != NULL)
  1228. {
  1229. array.Add(fdlg.GetNextPathName(pos));
  1230. }
  1231. if (array.GetSize() == 0)return;
  1232. if (1)
  1233. {
  1234. CString str;
  1235. str.Format("%s\r\n%s\r\n景点:%s\r\n确认您选中的照片与客户资料相符吗? 是否继续?", name, phone, dindanjd);
  1236. if (AfxMessageBox(str, MB_YESNO | MB_ICONINFORMATION) != IDYES)
  1237. return;
  1238. }
  1239. SelWaiter2 waiterdlg;
  1240. waiterdlg.waiter1 = waiter1;
  1241. waiterdlg.waiter12 = waiter12;
  1242. waiterdlg.waiter2 = waiter2;
  1243. waiterdlg.waiter22 = waiter22;
  1244. waiterdlg.beginno = beginno;
  1245. if (waiterdlg.DoModal() != IDOK)return;
  1246. waiter1 = waiterdlg.waiter1;
  1247. waiter12 = waiterdlg.waiter12;
  1248. waiter2 = waiterdlg.waiter2;
  1249. waiter22 = waiterdlg.waiter22;
  1250. beginno = waiterdlg.beginno;
  1251. //----------------------------------------------------------------------------------------------
  1252. //----------------------------------------------------------------------------------------------
  1253. //----------------------------------------------------------------------------------------------
  1254. // 导入拍照好的相片;
  1255. ImportPhoto dlg;
  1256. #if USE_SHARE_FLORD
  1257. dlg.m_id = strOrderNumber; // add by 2015-07-06 Jeff;
  1258. #endif //#if USE_SHARE_FLORD
  1259. dlg.beginno = beginno; // 当前订单相片编号;
  1260. dlg.m_bOfmat = 1; // 是否导入或导出同名的原始格式相片;
  1261. dlg.m_branch = branch; // 分店名称;
  1262. dlg.m_nphototype = 0; // 相片类型,==0表示原片;
  1263. dlg.m_calnopath = calnopath; // 未知;
  1264. dlg.m_mode = 2; // 未知;
  1265. dlg.m_bOrigin = 1; // 未知;
  1266. dlg.m_pArray = &array; // 要导入的相片路径集合;
  1267. dlg.m_savepath = savepath; // 保存相片的目录;
  1268. #ifdef ENTERPRISE_VERSION
  1269. // if(!g_branchname.IsEmpty())
  1270. {
  1271. dlg.m_id = strOrderNumber;
  1272. dlg.m_bSaveUploadTask = g_bSaveUploadTask1;
  1273. dlg.m_sel = g_cominfoarraylocal.ElementAt(0).ElementAt(78);
  1274. dlg.m_uploadtaskarray.Add(strOrderNumber + ";" + name);
  1275. dlg.m_uploadtaskarray.Add("");
  1276. dlg.m_uploadtaskarray.Add("");
  1277. dlg.m_uploadtaskarray.Add("");
  1278. dlg.m_uploadtaskarray.Add("");
  1279. dlg.m_uploadtaskarray.Add("1"); // 索引5表示相片类型;
  1280. dlg.m_uploadtaskarray.Add("");
  1281. dlg.m_uploadtaskarray.Add("");
  1282. dlg.m_uploadtaskarray.Add("");
  1283. dlg.m_uploadtaskarray.Add("");
  1284. }
  1285. #endif //#ifdef ENTERPRISE_VERSION
  1286. dlg.DoModal();
  1287. // Jeff.每次重新导入相片时,都删除ok文件;
  1288. beginno = dlg.beginno;
  1289. savepath += "ok";
  1290. ::DeleteFile(savepath); // 删除ok文件;
  1291. CString status;
  1292. TakeStautsSel dlg2;
  1293. if (status2 == "OK")
  1294. {
  1295. dlg2.m_check1 = 1;
  1296. dlg2.m_bCheckEnalbe = FALSE;
  1297. }
  1298. dlg2.DoModal();
  1299. if (dlg2.m_radio1 == 0)
  1300. {
  1301. status = "OK";
  1302. }
  1303. else if (dlg2.m_radio1 == 1)
  1304. {
  1305. status = "拍摄中";
  1306. //dlg2.CheckChange();
  1307. }
  1308. else
  1309. {
  1310. status = "未拍";
  1311. //dlg2.CheckChange();
  1312. }
  1313. #if 1
  1314. //本次选择ok时,需要再检查一下,看是否全部都已经ok;
  1315. // 此时iItem为有订单号的头景点;
  1316. // printf("Jeff:景点拍照完成,nTopItem=%d\n\n",nTopItem);
  1317. bOK = TRUE;
  1318. status2 = "OK";
  1319. int nItem = nTopItem;
  1320. if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK")
  1321. {
  1322. if (nItem != iItemBak)
  1323. {
  1324. status2 = "拍摄中";
  1325. // printf("Jeff:景点%d拍照完成\n\n",nItem);
  1326. bOK = FALSE;
  1327. }
  1328. else if (status != "OK")
  1329. {
  1330. status2 = "拍摄中";
  1331. // printf("Jeff:景点%d拍照完成\n\n",nItem);
  1332. bOK = FALSE;
  1333. }
  1334. }
  1335. // .子景点(如果有的话);
  1336. ++nItem;
  1337. while (nItem < itemcount && m_List1.GetItemText(nItem, 0 + m_nAdd) == "" && status2 != "拍摄中")
  1338. {
  1339. if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK" && iItemBak != nItem) // Jeff.如果只有两个景点这里出错:第一个ok,第二个未拍;这里会跳出;
  1340. {
  1341. status2 = "拍摄中";
  1342. bOK = FALSE;
  1343. // printf("Jeff:景点%d拍照完成\n\n",nItem);
  1344. break;
  1345. }
  1346. else
  1347. {
  1348. if (status != "OK")
  1349. {
  1350. status2 = "拍摄中";
  1351. bOK = FALSE;
  1352. }
  1353. }
  1354. ++nItem;
  1355. }
  1356. if (bOK) status2 = "OK";
  1357. #endif //#if 1
  1358. #if 1
  1359. //if ( !bOK )
  1360. // status2 = "拍摄中";
  1361. //else if(dlg2.m_check1) // .拍照景点全部ok状态;
  1362. // status2 = "OK";
  1363. CString sql;
  1364. if (dlg2.m_check1)
  1365. {
  1366. status2 = "OK";
  1367. // Jeff:如果有多个景点,全部设置为拍照ok;
  1368. // 需要遍历处理?;
  1369. // 批量处理某个订单的就可以了;
  1370. // SQL:update dindanjd set [status]='OK' where id='';
  1371. // CString SQL;
  1372. sql.Format("update dindanjd set [status]='OK' where id='%s'", strOrderNumber);
  1373. // printf("Jeff:全部景点选择拍照OK,SQL=%s\n\n",sql);
  1374. }
  1375. #endif //#if 1
  1376. //CString sql;
  1377. //sql="update dindanjd set [status]='"+status+"',[date]='"+g_date+"',[waiter1]='"+waiter1+"',[waiter12]='"+waiter12+"',[waiter2]='"+waiter2+"',[waiter22]='"+waiter22+"' where [id]='"+id+"' and [name]='"+dindanjd+"'";
  1378. sql += "***update dindanjd set [status]='" + status + "',[date]='" + g_date + "',[waiter1]='" + waiter1 + "',[waiter12]='" + waiter12 + "',[waiter2]='" + waiter2 + "',[waiter22]='" + waiter22 + "' where [id]='" + strOrderNumber + "' and [name]='" + dindanjd + "'";
  1379. CString sbeginno;
  1380. sbeginno.Format("%d", beginno);
  1381. #ifdef LYFZ_VERSION
  1382. //sql+="***update dindan set [status]='"+status2+"' where [id]='"+id+"'";//旧文;
  1383. sql+="***update dindan set [status]=case when [status]<>'OK' then '"+status2+"' else [status] end"+" where [id]='"+id+"'";
  1384. #else
  1385. /* dindan time2为拍照时间,在第一次ok时,这个时间不能再修改;
  1386. // Jeff.SQL参考例子:
  1387. // update dindan set time2='2014-06-28' where id='20140628-007' and isnull(time2,'')=''
  1388. if(jdpos==0)
  1389. sql+="***update dindan set [status]='"+status2+"',[waiter1]='"+waiter1+"',[waiter2]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
  1390. else if(jdpos==1)
  1391. sql+="***update dindan set [status]='"+status2+"',[waiter12]='"+waiter1+"',[waiter22]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
  1392. else if(jdpos==2)
  1393. sql+="***update dindan set [status]='"+status2+"',[waiter13]='"+waiter1+"',[waiter23]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
  1394. else if(jdpos==3)
  1395. sql+="***update dindan set [status]='"+status2+"',[waiter14]='"+waiter1+"',[waiter24]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
  1396. else
  1397. sql+="***update dindan set [status]='"+status2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
  1398. */
  1399. //--------------------------------------------------------------------------
  1400. // Jeff.SQL参考语句示例:
  1401. // update dindan set time2=case when isnull(time2,'')='' then '2014-07-28' else time2 end , name2='OK',time3='2015-01-01',time1='2014-05-30' where id='20140628-007'
  1402. //---------------------------------------------------------------------
  1403. // printf("Jeff:拍照状态=%s\n\n",status2);
  1404. if (status2 != "OK") // !=ok,不记录拍照时间;--这样是否合理?
  1405. {
  1406. // 当数据库原本status不为OK时,可以修改时间和状态;否则状态和时间都不能修改,保持原样;
  1407. if (jdpos == 0)
  1408. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter1]='" + waiter1 + "',[waiter2]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1409. else if (jdpos == 1)
  1410. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter12]='" + waiter1 + "',[waiter22]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1411. else if (jdpos == 2)
  1412. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter13]='" + waiter1 + "',[waiter23]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1413. else if (jdpos == 3)
  1414. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter14]='" + waiter1 + "',[waiter24]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1415. else
  1416. sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[curno]='" + sbeginno + "' where [id]='" + strOrderNumber + "'";
  1417. // printf("Jeff:拍照中,SQL=%s\n\n",sql);
  1418. }
  1419. else // ==ok时,才记录拍照时间;
  1420. {
  1421. /*if(jdpos==0)
  1422. sql+="***update dindan set [status]='"+status2+"',[waiter1]='"+waiter1+"',[waiter2]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";
  1423. else if(jdpos==1)
  1424. sql+="***update dindan set [status]='"+status2+"',[waiter12]='"+waiter1+"',[waiter22]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" +" where [id]='"+id+"'";
  1425. else if(jdpos==2)
  1426. sql+="***update dindan set [status]='"+status2+"',[waiter13]='"+waiter1+"',[waiter23]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";
  1427. else if(jdpos==3)
  1428. sql+="***update dindan set [status]='"+status2+"',[waiter14]='"+waiter1+"',[waiter24]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";
  1429. else
  1430. sql+="***update dindan set [status]='"+status2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";*/
  1431. // 当数据库原本status为OK时,不可修改时间;否则可以修改时间;
  1432. if (jdpos == 0)
  1433. sql += "***update dindan set [status]='" + status2 + "',[waiter1]='" + waiter1 + "',[waiter2]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1434. else if (jdpos == 1)
  1435. sql += "***update dindan set [status]='" + status2 + "',[waiter12]='" + waiter1 + "',[waiter22]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1436. else if (jdpos == 2)
  1437. sql += "***update dindan set [status]='" + status2 + "',[waiter13]='" + waiter1 + "',[waiter23]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1438. else if (jdpos == 3)
  1439. sql += "***update dindan set [status]='" + status2 + "',[waiter14]='" + waiter1 + "',[waiter24]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1440. else
  1441. sql += "***update dindan set [status]='" + status2 + "',[curno]='" + sbeginno + "', [time2]=case when isnull([time2],'')='' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
  1442. // printf("Jeff:拍照OK,SQL=%s\n\n",sql);
  1443. }
  1444. #endif
  1445. /////////////////////////
  1446. CString m_name1 = m_List1.GetItemText(iItem, 1 + m_nAdd);
  1447. CString m_name2 = m_List1.GetItemText(iItem, 2 + m_nAdd);
  1448. CString m_phone1 = m_List1.GetItemText(iItem, 14 + m_nAdd);
  1449. CString m_phone2 = m_List1.GetItemText(iItem, 15 + m_nAdd);
  1450. if (g_bAllBranch)
  1451. {
  1452. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  1453. {
  1454. if (strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && branch == m_List1arrayBak.ElementAt(i).ElementAt(0))
  1455. {
  1456. m_phone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  1457. m_phone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  1458. }
  1459. }
  1460. }
  1461. else
  1462. {
  1463. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  1464. {
  1465. if (strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0))
  1466. {
  1467. m_phone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  1468. m_phone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  1469. }
  1470. }
  1471. }
  1472. CString sql2;
  1473. BOOL msgcheck = atoi(g_cominfoarray.ElementAt(0).ElementAt(101));
  1474. CString msgcontent = g_cominfoarray.ElementAt(0).ElementAt(105);
  1475. if (status != "OK")msgcheck = 0;
  1476. #ifdef CHILD_VERSION
  1477. if(msgcheck )
  1478. {
  1479. CString m_content3 = msgcontent;
  1480. CString str,timestamp;
  1481. timestamp="msgtimestamp";
  1482. {
  1483. CString name;
  1484. if(!m_name1.IsEmpty ())
  1485. name=m_name1+",";
  1486. name+=m_name2;
  1487. name.TrimRight (",");
  1488. if(name.IsEmpty ()==0 && CheckPhoneType(m_phone1)!=-1 && CheckBadWords(name,0) )
  1489. {
  1490. str=name+m_content3;
  1491. str.Replace ("xxx小朋友", "");
  1492. int count=GetLengthEx(str)/MSG_LENGTH;
  1493. if(GetLengthEx(str)%MSG_LENGTH)
  1494. count++;
  1495. CString scount;
  1496. scount.Format ("%d", count);
  1497. #if JEFF_TEST_ON
  1498. sql2.Format(INSERT_SENDREG, _T("11"), m_phone1, str, timestamp, scount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  1499. sql += _T("***") + sql2;
  1500. #else
  1501. sql2="***insert into sendreg([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('"+m_phone1+"','"+str+"','"+timestamp+"','"+scount+"','0','0','0','系统自动发送')";
  1502. sql+=sql2;
  1503. #endif //#if JEFF_TEST_ON
  1504. }
  1505. }
  1506. }
  1507. #else
  1508. if (msgcheck)
  1509. {
  1510. CString m_content3 = msgcontent;
  1511. CString str, timestamp;
  1512. timestamp = "msgtimestamp";
  1513. int pos = m_content3.Find("xxx先生/女士");
  1514. if (pos != -1)
  1515. {
  1516. if (m_name1.IsEmpty() == 0 && CheckPhoneType(m_phone1) != -1 && CheckBadWords(m_name1, 0) )
  1517. {
  1518. str = m_content3;
  1519. str.Replace("xxx先生/女士", m_name1 + "先生");
  1520. int count = GetLengthEx(str) / MSG_LENGTH;
  1521. if (GetLengthEx(str) % MSG_LENGTH)
  1522. count++;
  1523. CString scount;
  1524. scount.Format("%d", count);
  1525. #if JEFF_TEST_ON
  1526. sql2.Format(INSERT_SENDREG, _T("11"), m_phone1, str, timestamp, scount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  1527. sql += _T("***") + sql2;
  1528. #else
  1529. sql2 = "***insert into sendreg([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('" + m_phone1 + "','" + str + "','" + timestamp + "','" + scount + "','0','0','0','系统自动发送')";
  1530. sql += sql2;
  1531. #endif //#if JEFF_TEST_ON
  1532. }
  1533. if (m_name2.IsEmpty() == 0 && CheckPhoneType(m_phone2) != -1 && CheckBadWords(m_name2, 0) )
  1534. {
  1535. str = m_content3;
  1536. str.Replace("xxx先生/女士", m_name2 + "女士");
  1537. int count = GetLengthEx(str) / MSG_LENGTH;
  1538. if (GetLengthEx(str) % MSG_LENGTH)
  1539. count++;
  1540. CString scount;
  1541. scount.Format("%d", count);
  1542. CTime tm = CTime::GetCurrentTime();
  1543. tm += CTimeSpan(0, 0, 0, 3);
  1544. timestamp = tm.Format("%Y%m%d%H%M%S");
  1545. timestamp = "msgtimexxstamp";
  1546. #if JEFF_TEST_ON
  1547. sql2.Format(INSERT_SENDREG, _T("11"), m_phone2, str, timestamp, scount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  1548. sql += _T("***") + sql2;
  1549. #else
  1550. sql2 = "***insert into sendreg([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('" + m_phone2 + "','" + str + "','" + timestamp + "','" + scount + "','0','0','0','系统自动发送')";
  1551. sql += sql2;
  1552. #endif //#if JEFF_TEST_ON
  1553. }
  1554. }
  1555. }
  1556. #endif //#ifdef CHILD_VERSION
  1557. /////////////////////////
  1558. if (1)//拍照OK时记录客人预定内容
  1559. {
  1560. sql2 = "***gentakecontent:" + strOrderNumber;
  1561. sql += sql2;
  1562. }
  1563. g_sendhead.bsql = 1;
  1564. if (g_bAllBranch)
  1565. {
  1566. g_branchip = GetIP(branch);
  1567. g_pMainWnd->OnDisconnect();
  1568. g_branchname = branch;
  1569. g_bBranchModify = 1;
  1570. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1571. g_pMainWnd->OnDisconnect();
  1572. g_bBranchModify = 0;
  1573. g_branchip = g_branchname = "";
  1574. }
  1575. else
  1576. g_pMainWnd->ProcessChatMessageRequest2(sql);
  1577. if (g_bSendOK == 0)
  1578. return;
  1579. AfxMessageBox("导入客照成功!", MB_ICONINFORMATION);
  1580. WriteLog(_T("拍照导入"), _T("拍照导入相片"));
  1581. if (g_bAllBranch == 0)
  1582. {
  1583. GetData();
  1584. }
  1585. else
  1586. {
  1587. BOOL bFind = 0;
  1588. for (int i = 0; i < m_List1array.GetSize(); i++)
  1589. {
  1590. if (bFind && m_List1array.ElementAt(i).ElementAt(1) != "")break;
  1591. if (strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
  1592. {
  1593. bFind = 1;
  1594. }
  1595. if (bFind && dindanjd == m_List1array.ElementAt(i).ElementAt(4))
  1596. {
  1597. m_List1array.ElementAt(i).SetAt(7 + m_nAdd, waiter1);
  1598. m_List1array.ElementAt(i).SetAt(8 + m_nAdd, waiter12);
  1599. m_List1array.ElementAt(i).SetAt(9 + m_nAdd, waiter2);
  1600. m_List1array.ElementAt(i).SetAt(10 + m_nAdd, waiter22);
  1601. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, status);
  1602. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
  1603. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, sbeginno);
  1604. FillGrid();
  1605. break;
  1606. }
  1607. }
  1608. }
  1609. #endif
  1610. }
  1611. void TakeFrom::OnBUTshowphoto() // 查看原片
  1612. {
  1613. POSITION pos;
  1614. pos = m_List1.GetFirstSelectedItemPosition();
  1615. if (pos == NULL)
  1616. {
  1617. AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
  1618. return;
  1619. }
  1620. int iItem = m_List1.GetNextSelectedItem(pos);
  1621. CString dindanjd = m_List1.GetItemText(iItem, 4 + m_nAdd);
  1622. CString branch;
  1623. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1624. if (g_bAllBranch)
  1625. branch = m_List1.GetItemText(iItem, 0);
  1626. while (id == "")
  1627. {
  1628. iItem--;
  1629. id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1630. }
  1631. CString name = m_List1.GetItemText(iItem, 1 + m_nAdd) + "," + m_List1.GetItemText(iItem, 2 + m_nAdd);
  1632. name.TrimLeft(",");
  1633. name.TrimRight(",");
  1634. name = "客人:" + name;
  1635. ShowPic dlg;
  1636. dlg.m_id = id;
  1637. dlg.m_name = name;
  1638. dlg.m_mode = 1;
  1639. if(g_branchname == _T(""))
  1640. dlg.m_path = g_path1 + "\\";
  1641. else
  1642. {
  1643. dlg.m_branch = GetDomainFromBranch(g_branchname);
  1644. CString branchpath = GetBranchPhotoPath(g_branchname);
  1645. dlg.m_path = g_path1 + branchpath + "\\";
  1646. }
  1647. #ifndef USE_KERNEL_DLL
  1648. #if USE_SHARE_FLORD
  1649. // 根据域名,相片类型,订单号查找相片;
  1650. dlg.m_aryOfShareDirectory.RemoveAll();
  1651. CNetShareInfo::GetInstance()->LoadOrderImages(dlg.m_mode, dlg.m_id, g_domain, dlg.m_patharray1, &dlg.m_aryOfShareDirectory);
  1652. #endif
  1653. dlg.m_path += id;
  1654. dlg.m_path += "\\";
  1655. if (g_pMainWnd->IsCtrlDown() == 0 && g_pMainWnd->IsShiftDown() == 0 && dindanjd != "")
  1656. {
  1657. if (AfxMessageBox("是否查看全部景点?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
  1658. {
  1659. if (dindanjd == "系统默认景点")
  1660. {
  1661. if (::PathFileExists(dlg.m_path + dindanjd))
  1662. {
  1663. dlg.m_path += dindanjd;
  1664. dlg.m_path += "\\";
  1665. }
  1666. }
  1667. else
  1668. {
  1669. dlg.m_path += dindanjd;
  1670. dlg.m_path += "\\";
  1671. }
  1672. }
  1673. }
  1674. else if (g_pMainWnd->IsCtrlDown())
  1675. {
  1676. if (dindanjd == "系统默认景点")
  1677. {
  1678. if (::PathFileExists(dlg.m_path + dindanjd))
  1679. {
  1680. dlg.m_path += dindanjd;
  1681. dlg.m_path += "\\";
  1682. }
  1683. }
  1684. else
  1685. {
  1686. dlg.m_path += dindanjd;
  1687. dlg.m_path += "\\";
  1688. }
  1689. }
  1690. #endif
  1691. dlg.DoModal();
  1692. if (dlg.m_bdelall)
  1693. {
  1694. for (int i = 0; i < m_List1array.GetSize(); i++)
  1695. {
  1696. if (g_bAllBranch)
  1697. {
  1698. if (id == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
  1699. {
  1700. #if JEFF_TEST_ON // 全部删除后,这里显示的值应该为0;
  1701. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "0");
  1702. #else
  1703. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "1");
  1704. #endif
  1705. FillGrid();
  1706. break;
  1707. }
  1708. }
  1709. else
  1710. {
  1711. if (id == m_List1array.ElementAt(i).ElementAt(0))
  1712. {
  1713. #if JEFF_TEST_ON // 全部删除后,这里显示的值应该为0;
  1714. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "0");
  1715. #else
  1716. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "1");
  1717. #endif
  1718. FillGrid();
  1719. break;
  1720. }
  1721. }
  1722. }
  1723. }
  1724. }
  1725. void TakeFrom::OnBUTmoney() // 今拍 按钮;
  1726. {
  1727. // TODO: Add your control notification handler code here
  1728. UpdateData();
  1729. m_filter.TrimLeft();
  1730. m_filter.TrimRight();
  1731. FillGrid(2);
  1732. }
  1733. void TakeFrom::OnBTNaddsp()
  1734. {
  1735. }
  1736. void TakeFrom::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
  1737. {
  1738. NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
  1739. // TODO: Add your control notification handler code here
  1740. POSITION pos;
  1741. pos = m_List1.GetFirstSelectedItemPosition();
  1742. if (pos == NULL)
  1743. {
  1744. return;
  1745. }
  1746. int iItem = m_List1.GetNextSelectedItem(pos);
  1747. if (IsHasRights2new(4) || IsHasRights2new(49))
  1748. {
  1749. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  1750. }
  1751. else
  1752. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
  1753. *pResult = 0;
  1754. }
  1755. void TakeFrom::OnButton1() // 查询按钮;
  1756. {
  1757. // TODO: Add your control notification handler code here
  1758. UpdateData();
  1759. m_filter.TrimLeft();
  1760. m_filter.TrimRight();
  1761. FillGrid();
  1762. }
  1763. void TakeFrom::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  1764. {
  1765. // TODO: Add your control notification handler code here
  1766. POSITION pos;
  1767. pos = m_List1.GetFirstSelectedItemPosition();
  1768. if (pos == NULL)return;
  1769. int iItem = m_List1.GetNextSelectedItem(pos);
  1770. g_id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1771. while (g_id == "")
  1772. {
  1773. iItem--;
  1774. g_id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1775. }
  1776. *pResult = 0;
  1777. }
  1778. void TakeFrom::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
  1779. {
  1780. // TODO: Add your control notification handler code here
  1781. OnBUTshowphoto();
  1782. *pResult = 0;
  1783. }
  1784. void TakeFrom::HidePrice()
  1785. {
  1786. int i = 0;
  1787. m_List1arrayBak.RemoveAll();
  1788. m_List1arrayBak.SetSize(m_List1array.GetSize());
  1789. for ( i = 0; i < m_List1array.GetSize(); i++)
  1790. {
  1791. m_List1arrayBak.ElementAt(i).Copy(m_List1array.ElementAt(i));
  1792. }
  1793. #ifdef LKAY_VERSION
  1794. if(IsHasRights2new(31))return;
  1795. for( i=0; i<m_List1array.GetSize (); i++)
  1796. {
  1797. m_List1array.ElementAt (i).SetAt (11+m_nAdd, "***");
  1798. m_List1array.ElementAt (i).SetAt (12+m_nAdd, "***");
  1799. m_List1array.ElementAt (i).SetAt (13+m_nAdd, "***");
  1800. m_List1array.ElementAt (i).SetAt (14+m_nAdd, "***");
  1801. }
  1802. #else
  1803. if (IsHasRights2new(31))return;
  1804. for (i = 0; i < m_List1array.GetSize(); i++)
  1805. {
  1806. m_List1array.ElementAt(i).SetAt(14 + m_nAdd, "***");
  1807. m_List1array.ElementAt(i).SetAt(15 + m_nAdd, "***");
  1808. }
  1809. #endif
  1810. }
  1811. void TakeFrom::OnBtnsearchfilter() // 条件查询按钮;
  1812. {
  1813. SearchFilter dlg;
  1814. dlg.m_mode = 1;
  1815. if (dlg.DoModal() == IDOK)
  1816. FillGrid();
  1817. g_bSearchFilter = 0;
  1818. }
  1819. void TakeFrom::OnBUTprint3()
  1820. {
  1821. GetData();
  1822. }
  1823. void TakeFrom::OnButton2() // 客人头像按钮;
  1824. {
  1825. POSITION pos;
  1826. pos = m_List1.GetFirstSelectedItemPosition();
  1827. if (pos == NULL)
  1828. {
  1829. AfxMessageBox("请先选中您要拍头像的客人!", MB_ICONINFORMATION);
  1830. return;
  1831. }
  1832. int iItem = m_List1.GetNextSelectedItem(pos);
  1833. CString branch;
  1834. CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1835. if (g_bAllBranch)
  1836. branch = m_List1.GetItemText(iItem, 0);
  1837. while (id == "")
  1838. {
  1839. iItem--;
  1840. id = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1841. }
  1842. UploadPhoto dlg;
  1843. if (g_bAllBranch)
  1844. {
  1845. CString branchpath = GetBranchPhotoPath(branch);
  1846. dlg.m_path = g_path1 + branchpath + "\\";
  1847. if (::CheckFolderFileExist(dlg.m_path) == 0)
  1848. ::CreateDirectory(dlg.m_path, NULL);
  1849. }
  1850. else
  1851. dlg.m_path = g_path1 + "\\";
  1852. dlg.m_path += "客人头像\\";
  1853. if (::CheckFolderFileExist(dlg.m_path) == 0)
  1854. ::CreateDirectory(dlg.m_path, NULL);
  1855. dlg.m_path += id + "\\";
  1856. if (::CheckFolderFileExist(dlg.m_path) == 0)
  1857. ::CreateDirectory(dlg.m_path, NULL);
  1858. dlg.DoModal();
  1859. }
  1860. void TakeFrom::GetData()
  1861. {
  1862. if (g_bAllBranch == 0)
  1863. {
  1864. if (g_bShowOK == 0)
  1865. {
  1866. #ifdef LKAY_VERSION
  1867. CString filter="status3='未取' and (dindantype<>'意向客户' or dindantype is null)";
  1868. #else
  1869. CString filter = "status3='未取'";
  1870. #endif
  1871. g_sendhead.bsql = 0;
  1872. g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
  1873. g_sendhead.tabcount = 1;
  1874. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1875. if (g_bSendOK == 0)return;
  1876. }
  1877. else
  1878. {
  1879. g_sendhead.bsql = 0;
  1880. g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
  1881. g_sendhead.tabcount = 1;
  1882. #ifdef LKAY_VERSION
  1883. CString filter="dindantype<>'意向客户' or dindantype is null";
  1884. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1885. #else
  1886. g_pMainWnd->ProcessChatMessageRequest2(1);
  1887. #endif
  1888. if (g_bSendOK == 0)return;
  1889. }
  1890. DataToArray(&m_List1array);
  1891. }
  1892. else
  1893. {
  1894. //////////////数据汇总
  1895. m_List1array.RemoveAll();
  1896. CString branch;
  1897. for (int i = -1; i < g_brancharray.GetSize() - 1; i++)
  1898. {
  1899. if (i != -1)
  1900. {
  1901. branch = g_brancharray.ElementAt(i).ElementAt(0);
  1902. g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
  1903. g_pMainWnd->OnDisconnect();
  1904. g_branchname = branch;
  1905. g_bBranchModify = 1;
  1906. }
  1907. else
  1908. branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0);
  1909. if (g_bShowOK == 0)
  1910. {
  1911. CString filter = "status3='未取'";
  1912. g_sendhead.bsql = 0;
  1913. g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
  1914. g_sendhead.tabcount = 1;
  1915. g_pMainWnd->ProcessChatMessageRequest2(filter);
  1916. if (g_bSendOK == 0) continue;
  1917. }
  1918. else
  1919. {
  1920. g_sendhead.bsql = 0;
  1921. g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
  1922. g_sendhead.tabcount = 1;
  1923. g_pMainWnd->ProcessChatMessageRequest2(1);
  1924. if (g_bSendOK == 0) continue;
  1925. }
  1926. CArray<CStringArray, CStringArray>List1array;
  1927. DataToArray(&List1array);
  1928. int size = m_List1array.GetSize();
  1929. for (int j = 0; j < List1array.GetSize(); j++)
  1930. {
  1931. size++;
  1932. m_List1array.SetSize(size, 1);
  1933. size--;
  1934. m_List1array.ElementAt(size).Copy(List1array.ElementAt(j));
  1935. m_List1array.ElementAt(size).InsertAt(0, branch);
  1936. size++;
  1937. }
  1938. }
  1939. g_pMainWnd->OnDisconnect();
  1940. g_bBranchModify = 0;
  1941. g_branchip = g_branchname = "";
  1942. }
  1943. HidePrice();
  1944. FillGrid();
  1945. }
  1946. void TakeFrom::OnBnClickedMicroshare() // 微分享;
  1947. {
  1948. // 定义变量;
  1949. CString strOrderNumber = _T(""); // 订单号;
  1950. CString strScenery = _T(""); // 景点名;
  1951. CString strCustomer = _T(""); // 顾客名;
  1952. CString strMakeupArtist = _T(""); // 化妆师;
  1953. CString strSourcePath = _T(""); // 相片根目录;
  1954. CString strBranchName = _T(""); // 分店名;
  1955. CString strBranchDomain = _T(""); // 分店域名;
  1956. TCHAR szShareId[MAX_PATH] = _T(""); // 微分享相册ID;
  1957. // 获取变量值;
  1958. POSITION pos;
  1959. pos = m_List1.GetFirstSelectedItemPosition();
  1960. if (pos == NULL)
  1961. {
  1962. AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
  1963. return;
  1964. }
  1965. int iItem = m_List1.GetNextSelectedItem(pos);
  1966. strScenery = m_List1.GetItemText(iItem, 4 + m_nAdd);
  1967. strMakeupArtist = m_List1.GetItemText(iItem, 9 + m_nAdd);
  1968. strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1969. if (g_bAllBranch)
  1970. strBranchName = m_List1.GetItemText(iItem, 0);
  1971. while (strOrderNumber == "")
  1972. {
  1973. iItem--;
  1974. strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
  1975. }
  1976. #if 0
  1977. if (g_bAllBranch)
  1978. {
  1979. strBranchDomain = GetBranchPhotoPath(strBranchName);
  1980. strSourcePath = g_path1 + strBranchDomain + "\\";
  1981. }
  1982. else
  1983. {
  1984. strSourcePath = g_path1 + "\\";
  1985. }
  1986. strSourcePath += strOrderNumber;
  1987. strSourcePath += "\\";
  1988. if (AfxMessageBox("是否查看全部景点?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
  1989. {
  1990. if (::PathFileExists(strSourcePath + strScenery))
  1991. {
  1992. strSourcePath += strScenery;
  1993. strSourcePath += "\\";
  1994. }
  1995. }
  1996. #else
  1997. CString str;
  1998. CStringArray AryOrderPath;
  1999. int nSize = g_aryOfSharePathInfo.GetSize();
  2000. for ( int i = 0; i < nSize; i++ )
  2001. {
  2002. if ( 1 == atoi(g_aryOfSharePathInfo.ElementAt(i).ElementAt(5)) )
  2003. {
  2004. str = g_aryOfSharePathInfo.ElementAt(i).ElementAt(2);
  2005. if ( g_bAllBranch )
  2006. {
  2007. strBranchDomain = GetBranchPhotoPath(strBranchName);
  2008. str += strBranchDomain;
  2009. }
  2010. str += _T("\\");
  2011. str += strOrderNumber;
  2012. str += _T("\\");
  2013. if ( PathFileExists(str) )
  2014. {
  2015. AryOrderPath.Add(str);
  2016. }
  2017. }
  2018. }
  2019. str = g_path1;
  2020. if ( g_bAllBranch )
  2021. {
  2022. strBranchDomain = GetBranchPhotoPath(strBranchName);
  2023. str += strBranchDomain + "\\";
  2024. }
  2025. str += _T("\\");
  2026. str += strOrderNumber;
  2027. str += _T("\\");
  2028. if ( PathFileExists(str) )
  2029. {
  2030. AryOrderPath.Add(str);
  2031. }
  2032. if (AfxMessageBox("是否查看全部景点?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
  2033. {
  2034. int n = AryOrderPath.GetSize();
  2035. for ( int j = 0; j < n; j++ )
  2036. {
  2037. if ( PathFileExists(AryOrderPath.ElementAt(j) + strScenery) )
  2038. {
  2039. strSourcePath = AryOrderPath.ElementAt(j) + strScenery;
  2040. strSourcePath += _T("\\");
  2041. strSourcePath += _T("#");
  2042. }
  2043. }
  2044. }
  2045. else
  2046. {
  2047. for ( int k = 0; k < AryOrderPath.GetSize(); k++ )
  2048. {
  2049. strSourcePath = AryOrderPath.ElementAt(k) ;
  2050. strSourcePath += _T("#");
  2051. }
  2052. }
  2053. #endif
  2054. // 加载动态库;
  2055. if (LoadMicroShareLibrary() == FALSE)
  2056. return;
  2057. if ( g_lyfzCreateShare )
  2058. {
  2059. g_lyfzCreateShare(
  2060. g_cominfoarray.ElementAt(0).ElementAt(147), // 微分享的登录账号;
  2061. g_cominfoarray.ElementAt(0).ElementAt(148), // 微分享的登录账号密码;
  2062. strSourcePath, // 相片根级目录;
  2063. strBranchDomain.Mid(1), // 分店域名;
  2064. strOrderNumber, // 订单号,用于生成二维码文件名;
  2065. strScenery, // 景点名;
  2066. strSourcePath,
  2067. m_List1.GetItemText(iItem, 1 + m_nAdd), // 客人姓名1 ;
  2068. m_List1.GetItemText(iItem, 2 + m_nAdd), // 客人姓名2
  2069. strMakeupArtist, // 化妆师;
  2070. szShareId // 返回微相册ID;
  2071. );
  2072. }
  2073. FreeMicroShareLibrary();
  2074. }
  2075. /************************************************************************/
  2076. /*
  2077. 函数:GetSelectedOrderInfo
  2078. 描述:获取选中的列表项的订单信息;
  2079. 参数:
  2080. [OUT] tagOrderInfo
  2081. [OUT] nFirstItem 第一个景点项索引;
  2082. [OUT] nEndofItem 最后一个景点项索引;
  2083. 返回:空
  2084. 注意:
  2085. 要求:
  2086. 示例:
  2087. 修改:
  2088. 日期:
  2089. 内容:
  2090. */
  2091. /************************************************************************/
  2092. INT TakeFrom::GetSelectedOrderInfo( OUT STOrederInfo &tagOrderInfo, OUT INT& nFirstItem, OUT INT& nEndofItem )
  2093. {
  2094. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  2095. if ( pos == NULL )
  2096. {
  2097. AfxMessageBox(_T("未选中要导入相片的订单!"),MB_ICONINFORMATION);
  2098. return -1;
  2099. }
  2100. INT nItemCount = m_List1.GetItemCount();
  2101. INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
  2102. //INT nFirstItem = 0; // 记录第一个景点项索引;
  2103. //INT nEndofItem = 0; // 记录最后一个景点项索引;
  2104. INT nSceneryItem = nSelectedItem;
  2105. if ( m_List1.GetItemText(nSelectedItem, 0 + m_nAdd) == _T("") )
  2106. {
  2107. STSceneryInfo tagSceneryInfo;
  2108. tagSceneryInfo.bSelected = TRUE;
  2109. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  2110. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  2111. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  2112. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  2113. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  2114. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  2115. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  2116. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  2117. // 查找所有下行;
  2118. nSceneryItem++;
  2119. if ( nSceneryItem < nItemCount )
  2120. {
  2121. while( m_List1.GetItemText(nSceneryItem, 0 + m_nAdd) == _T("") )
  2122. {
  2123. tagSceneryInfo.bSelected = FALSE;
  2124. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  2125. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  2126. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  2127. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  2128. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  2129. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  2130. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  2131. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  2132. nSceneryItem++;
  2133. if ( nSceneryItem >= nItemCount )
  2134. break;
  2135. }
  2136. // 记录最后一个景点项索引;
  2137. nEndofItem = nSceneryItem - 1;
  2138. }
  2139. // 查找所有上行;
  2140. nSceneryItem = nSelectedItem - 1;
  2141. if ( nSceneryItem >= 0)
  2142. {
  2143. while( m_List1.GetItemText(nSceneryItem, 0 + m_nAdd) == _T("") )
  2144. {
  2145. tagSceneryInfo.bSelected = FALSE;
  2146. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  2147. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  2148. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  2149. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  2150. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  2151. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  2152. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  2153. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  2154. nSceneryItem--;
  2155. if ( nSceneryItem < 0 )
  2156. break;
  2157. }
  2158. }
  2159. // 上行结束后,是头位置;
  2160. if ( nSceneryItem >= 0 )
  2161. {
  2162. // 记录第一个景点项索引;
  2163. nFirstItem = nSceneryItem;
  2164. // 用头景点行初始化订单信息;
  2165. if ( g_bAllBranch ) // 是否多店汇总;
  2166. {
  2167. tagOrderInfo.strBranchId = GetDomainFromBranch(m_List1.GetItemText(nSceneryItem, 0 ));
  2168. }
  2169. else
  2170. {
  2171. if ( g_branchname == _T(""))
  2172. tagOrderInfo.strBranchId = g_domain;
  2173. else
  2174. tagOrderInfo.strBranchId = GetDomainFromBranch(g_branchname);
  2175. }
  2176. tagOrderInfo.strOrderNumber = m_List1.GetItemText(nSceneryItem, 0 + m_nAdd);
  2177. tagOrderInfo.strName1 = m_List1.GetItemText(nSceneryItem, 1 + m_nAdd);
  2178. tagOrderInfo.strName2 = m_List1.GetItemText(nSceneryItem, 2 + m_nAdd);
  2179. tagOrderInfo.strImageNumber = m_List1.GetItemText(nSceneryItem, 3 + m_nAdd);
  2180. tagOrderInfo.strClerk = m_List1.GetItemText(nSceneryItem, 11 + m_nAdd);
  2181. // 如果用户权限不足,13和14显示的是"*"符号;
  2182. #if 1
  2183. tagOrderInfo.strPhone = m_List1.GetItemText(nSceneryItem, 14 + m_nAdd);
  2184. tagOrderInfo.strTelPhone = m_List1.GetItemText(nSceneryItem, 15 + m_nAdd);
  2185. #else
  2186. if ( g_bAllBranch )
  2187. {
  2188. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  2189. {
  2190. if ( tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && tagOrderInfo.strBranchId == m_List1arrayBak.ElementAt(i).ElementAt(0) )
  2191. {
  2192. tagOrderInfo.strPhone = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  2193. tagOrderInfo.strTelPhone = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  2194. break;
  2195. }
  2196. }
  2197. }
  2198. else
  2199. {
  2200. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  2201. {
  2202. if ( tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0) )
  2203. {
  2204. tagOrderInfo.strPhone = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  2205. tagOrderInfo.strTelPhone = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  2206. break;
  2207. }
  2208. }
  2209. }
  2210. #endif
  2211. // 同时push头景点;
  2212. tagSceneryInfo.bSelected = FALSE;
  2213. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  2214. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  2215. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  2216. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  2217. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  2218. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  2219. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  2220. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  2221. }
  2222. }
  2223. else
  2224. {
  2225. // 记录第一个景点项索引;
  2226. nFirstItem = nSceneryItem;
  2227. // 用头景点行初始化订单信息;
  2228. if ( g_bAllBranch ) // 是否多店汇总;
  2229. {
  2230. tagOrderInfo.strBranchId = GetDomainFromBranch(m_List1.GetItemText(nSceneryItem, 0 ));
  2231. }
  2232. else
  2233. {
  2234. if ( g_branchname == _T(""))
  2235. tagOrderInfo.strBranchId = g_domain;
  2236. else
  2237. tagOrderInfo.strBranchId = GetDomainFromBranch(g_branchname);
  2238. }
  2239. tagOrderInfo.strOrderNumber = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
  2240. tagOrderInfo.strName1 = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd);
  2241. tagOrderInfo.strName2 = m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
  2242. tagOrderInfo.strImageNumber = m_List1.GetItemText(nSelectedItem, 3 + m_nAdd);
  2243. tagOrderInfo.strClerk = m_List1.GetItemText(nSelectedItem, 11 + m_nAdd);
  2244. tagOrderInfo.strPhone = m_List1.GetItemText(nSelectedItem, 14 + m_nAdd);
  2245. tagOrderInfo.strTelPhone = m_List1.GetItemText(nSelectedItem, 15 + m_nAdd);
  2246. // push头景点;
  2247. STSceneryInfo tagSceneryInfo;
  2248. tagSceneryInfo.bSelected = TRUE;
  2249. tagSceneryInfo.strScenery = m_List1.GetItemText(nSelectedItem, 4 + m_nAdd);
  2250. tagSceneryInfo.strStatus = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd);
  2251. tagSceneryInfo.strTime = m_List1.GetItemText(nSelectedItem, 6 + m_nAdd);
  2252. tagSceneryInfo.strLensman = m_List1.GetItemText(nSelectedItem, 7 + m_nAdd);
  2253. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSelectedItem, 8 + m_nAdd);
  2254. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSelectedItem, 9 + m_nAdd);
  2255. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSelectedItem, 10 + m_nAdd);
  2256. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  2257. // 读取下一行,看是否属于本订单的景点;
  2258. nSceneryItem++;
  2259. if ( nSceneryItem < nItemCount )
  2260. {
  2261. while( m_List1.GetItemText( nSceneryItem, 0 + m_nAdd ) == _T("") )
  2262. {
  2263. tagSceneryInfo.bSelected = FALSE;
  2264. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  2265. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  2266. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  2267. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  2268. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  2269. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  2270. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  2271. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  2272. nSceneryItem++;
  2273. if ( nSceneryItem >= nItemCount )
  2274. break;
  2275. }
  2276. // 记录最后一个景点项索引;
  2277. nEndofItem = nSceneryItem - 1;
  2278. }
  2279. }
  2280. return nSelectedItem;
  2281. }