TakeFrom.cpp 77 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475
  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 "SelWaiter2.h"
  11. #include "TakeStautsSel.h"
  12. #include "SalaryRateSet2.h"
  13. #include "UploadPhoto.h"
  14. #include "NetShareInfo.h"
  15. #include "SetOrderInfo.h"
  16. #ifdef _DEBUG
  17. #define new DEBUG_NEW
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21. #pragma comment(lib, "Shlwapi.lib")
  22. IMPLEMENT_DYNCREATE(TakeFrom, MyFormView)
  23. TakeFrom::TakeFrom() : MyFormView(TakeFrom::IDD)
  24. {
  25. m_filter = _T("");
  26. m_nAdd = 0;
  27. if (g_bAllBranch)
  28. {
  29. m_nAdd = 1;
  30. }
  31. }
  32. TakeFrom::~TakeFrom()
  33. {
  34. }
  35. void TakeFrom::DoDataExchange(CDataExchange* pDX)
  36. {
  37. MyFormView::DoDataExchange(pDX);
  38. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  39. DDX_Control(pDX, IDC_LIST2, m_List1);
  40. DDX_Control(pDX, IDC_STATIC1, m_static1);
  41. DDX_CBString(pDX, IDC_COMBO1, m_filter);
  42. }
  43. BEGIN_MESSAGE_MAP(TakeFrom, MyFormView)
  44. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  45. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  46. ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  47. ON_WM_TIMER()
  48. ON_BN_CLICKED(IDC_BUTimportphoto, OnBUTimportphoto)
  49. ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
  50. ON_BN_CLICKED(IDC_BUTmoney, OnBUTmoney)
  51. ON_BN_CLICKED(IDC_BTNaddsp, OnBTNaddsp)
  52. ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
  53. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  54. ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
  55. ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
  56. ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
  57. ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3)
  58. ON_BN_CLICKED(Btn_MicroShare, OnBnClickedMicroshare)
  59. ON_MESSAGE(MSG_KERNEL_CALLBACK, OnKernelCallBack)
  60. END_MESSAGE_MAP()
  61. #ifdef _DEBUG
  62. void TakeFrom::AssertValid() const
  63. {
  64. MyFormView::AssertValid();
  65. }
  66. void TakeFrom::Dump(CDumpContext& dc) const
  67. {
  68. MyFormView::Dump(dc);
  69. }
  70. #endif //_DEBUG
  71. LRESULT TakeFrom::OnKernelCallBack(WPARAM wp,LPARAM lp)
  72. {
  73. GetData();
  74. return 0;
  75. }
  76. void TakeFrom::OnInitialUpdate()
  77. {
  78. MyFormView::OnInitialUpdate();
  79. // TODO: Add your specialized code here and/or call the base class
  80. CMyMdi Mdi;
  81. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  82. // Here we create the outbar control using the splitter as its parent
  83. // and setting its id to the first pane.
  84. CRect rc2;
  85. GetWindowRect(rc2);
  86. ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
  87. EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
  88. int idarray[] = { IDC_BUTprint3, IDC_BUTimportphoto, IDC_BUTshowphoto, IDC_BUTTON2, IDC_BUTclose };
  89. int idcount = 5;
  90. int btnwid;
  91. CRect prerc;
  92. for (int a = idcount - 2; a >= 0; a--)
  93. {
  94. GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
  95. ScreenToClient(prerc);
  96. GetDlgItem(idarray[a])->GetWindowRect(rc2);
  97. ScreenToClient(rc2);
  98. btnwid = rc2.Width();
  99. rc2.right = prerc.left;
  100. rc2.left = rc2.right - btnwid;
  101. GetDlgItem(idarray[a])->MoveWindow(rc2);
  102. }
  103. m_static1.SetFont(&g_titlefont);
  104. if (g_bAllBranch == 0)
  105. {
  106. #ifdef CHILD_VERSION
  107. #ifdef LKAY_VERSION
  108. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;相片张数,100;景点,100;拍照,100;导片日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  109. #else
  110. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  111. #endif
  112. #else
  113. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  114. #endif
  115. m_List1.LoadColumnInfo(114);
  116. }
  117. else
  118. {
  119. #ifdef CHILD_VERSION
  120. m_List1.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
  121. #else
  122. m_List1.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
  123. #endif
  124. m_List1.LoadColumnInfo(196);
  125. GetDlgItem(IDC_BUTprint3)->ShowWindow(1);
  126. }
  127. #if JEFF_DELETE_OFF // 多景点时排序有问题!
  128. m_List1.m_bSortSupport = 0;
  129. #endif
  130. GetData();
  131. m_combo1.AddString(g_user.name);
  132. m_combo1.GetWindowRect(rc2);
  133. ScreenToClient(rc2);
  134. rc2.bottom += 200;
  135. m_combo1.MoveWindow(rc2);
  136. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  137. SetComboHei(&m_combo1, rc2.Height());
  138. }
  139. void TakeFrom::FillGrid(BOOL bStatus/*=0*/)
  140. {
  141. if (g_bSearchFilter) // 1.按钮:条件查询;
  142. {
  143. m_List1.DeleteAllItems2();
  144. int ii = 0;
  145. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  146. int count = 0;
  147. {
  148. BOOL bFinded = 0;
  149. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  150. {
  151. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  152. {
  153. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  154. continue;
  155. }
  156. if (g_filterdate1 != "") // Jeff.查询过滤条件:日期;
  157. {
  158. if (m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) < g_filterdate1 || m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) > g_filterdate2)
  159. {
  160. bFinded = 0;
  161. continue;
  162. }
  163. }
  164. if (g_waiter1 != "") // Jeff.查询过滤条件:门市;
  165. {
  166. if (m_List1array.ElementAt(ii).ElementAt(11 + m_nAdd) != g_waiter1)
  167. {
  168. bFinded = 0;
  169. continue;
  170. }
  171. }
  172. if (g_waiter2 != "") // Jeff.查询过滤条件:摄影师;
  173. {
  174. if (m_List1array.ElementAt(ii).ElementAt(7 + m_nAdd) != g_waiter2)
  175. {
  176. bFinded = 0;
  177. continue;
  178. }
  179. }
  180. if (g_waiter3 != "") // Jeff.查询过滤条件:化妆师;
  181. {
  182. if (m_List1array.ElementAt(ii).ElementAt(9 + m_nAdd) != g_waiter3)
  183. {
  184. bFinded = 0;
  185. continue;
  186. }
  187. }
  188. if (g_waiter4 != "") // Jeff.查询套系类别;
  189. {
  190. if (m_List1array.ElementAt(ii).ElementAt(3) != g_waiter4)
  191. {
  192. bFinded = 0;
  193. continue;
  194. }
  195. }
  196. if (g_bAllBranch && g_filterbranch != "") // Jeff.集团版查询过滤条件:分店名称;
  197. {
  198. if (m_List1array.ElementAt(ii).ElementAt(0) != g_filterbranch)
  199. {
  200. bFinded = 0;
  201. continue;
  202. }
  203. }
  204. // 2015.03.30
  205. // Jeff:上面已有判断,这里必须判断订单号非空才能添加,否则会添加其他空的选项;
  206. if (!m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  207. {
  208. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  209. bFinded = 1;
  210. }
  211. }
  212. }
  213. m_List1.m_arLabels.SetSize(count, 1);
  214. ii = count;
  215. m_List1.m_LabelCount = ii;
  216. m_List1.SetItemCountEx(ii);
  217. CString str;
  218. str.Format("单数:%d", ii);
  219. SetDlgItemText(IDC_STATIC2, str);
  220. }
  221. else // 2.其他显示;
  222. {
  223. m_List1.DeleteAllItems2();
  224. int ii = 0;
  225. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  226. int count = 0;
  227. if (m_filter.IsEmpty()) // 2.1.没有查询关键字;
  228. {
  229. if (bStatus == 1) // bStatus==1,没用到;
  230. {
  231. BOOL bFinded = 0;
  232. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  233. {
  234. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  235. {
  236. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  237. continue;
  238. }
  239. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0)
  240. {
  241. bFinded = 1;
  242. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  243. }
  244. else
  245. {
  246. bFinded = 0;
  247. }
  248. }
  249. }
  250. else if (bStatus == 2) // 今拍按钮用到;
  251. {
  252. BOOL bFinded = 0;
  253. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  254. {
  255. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  256. {
  257. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  258. continue;
  259. }
  260. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK" && m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date)
  261. {
  262. bFinded = 1;
  263. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  264. }
  265. else
  266. {
  267. bFinded = 0;
  268. }
  269. }
  270. }
  271. else // bStatus==0;默认使用的值;
  272. {
  273. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  274. {
  275. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  276. }
  277. }
  278. }
  279. else // 2.2.指定查询条件 ;
  280. {
  281. if (bStatus == 1)
  282. {
  283. BOOL bFinded = 0;
  284. int type = GetType(m_filter);
  285. if (type == 1)//电话
  286. {
  287. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  288. {
  289. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  290. {
  291. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  292. continue;
  293. }
  294. 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 || \
  295. m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1))
  296. {
  297. bFinded = 1;
  298. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  299. }
  300. else
  301. {
  302. bFinded = 0;
  303. }
  304. }
  305. }
  306. else if (type == 2)//拼音
  307. {
  308. BOOL bFinded = 0;
  309. m_filter.MakeUpper();
  310. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  311. {
  312. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  313. {
  314. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  315. continue;
  316. }
  317. 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 || \
  318. m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1))
  319. {
  320. bFinded = 1;
  321. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  322. }
  323. else
  324. {
  325. bFinded = 0;
  326. }
  327. }
  328. }
  329. else
  330. {
  331. BOOL bFinded = 0;
  332. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  333. {
  334. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  335. {
  336. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  337. continue;
  338. }
  339. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&\
  340. m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0 && \
  341. (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  342. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  343. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  344. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  345. m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
  346. m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
  347. m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
  348. m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
  349. m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
  350. m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
  351. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
  352. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
  353. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  354. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  355. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  356. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  357. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1))
  358. {
  359. bFinded = 1;
  360. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  361. }
  362. else
  363. {
  364. bFinded = 0;
  365. }
  366. }
  367. }
  368. }
  369. else if (bStatus == 2)
  370. {
  371. BOOL bFinded = 0;
  372. int type = GetType(m_filter);
  373. if (type == 1)//电话
  374. {
  375. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  376. {
  377. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  378. {
  379. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  380. continue;
  381. }
  382. 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 || \
  383. m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1))
  384. {
  385. bFinded = 1;
  386. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  387. }
  388. else
  389. {
  390. bFinded = 0;
  391. }
  392. }
  393. }
  394. else if (type == 2)//拼音
  395. {
  396. BOOL bFinded = 0;
  397. m_filter.MakeUpper();
  398. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  399. {
  400. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  401. {
  402. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  403. continue;
  404. }
  405. 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 || \
  406. m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1))
  407. {
  408. bFinded = 1;
  409. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  410. }
  411. else
  412. {
  413. bFinded = 0;
  414. }
  415. }
  416. }
  417. else
  418. {
  419. BOOL bFinded = 0;
  420. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  421. {
  422. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  423. {
  424. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  425. continue;
  426. }
  427. if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date &&\
  428. (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  429. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  430. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  431. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  432. m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
  433. m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
  434. m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
  435. m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
  436. m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
  437. m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
  438. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
  439. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
  440. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  441. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  442. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  443. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  444. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1))
  445. {
  446. bFinded = 1;
  447. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  448. }
  449. else
  450. {
  451. bFinded = 0;
  452. }
  453. }
  454. }
  455. }
  456. else
  457. {
  458. int type = GetType(m_filter);
  459. if (type == 1)//电话
  460. {
  461. BOOL bFinded = 0;
  462. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  463. {
  464. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  465. {
  466. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  467. continue;
  468. }
  469. if (m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1 || \
  470. m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1)
  471. {
  472. bFinded = 1;
  473. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  474. }
  475. else
  476. {
  477. bFinded = 0;
  478. }
  479. }
  480. }
  481. else if (type == 2)//拼音
  482. {
  483. BOOL bFinded = 0;
  484. m_filter.MakeUpper();
  485. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  486. {
  487. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  488. {
  489. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  490. continue;
  491. }
  492. if (m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1 || \
  493. m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1)
  494. {
  495. bFinded = 1;
  496. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  497. }
  498. else
  499. {
  500. bFinded = 0;
  501. }
  502. }
  503. }
  504. else
  505. {
  506. BOOL bFinded = 0;
  507. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  508. {
  509. if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
  510. {
  511. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  512. continue;
  513. }
  514. if (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
  515. m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
  516. m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
  517. m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
  518. m_List1array.ElementAt(ii).ElementAt(4).Find(m_filter) != -1 || \
  519. m_List1array.ElementAt(ii).ElementAt(5).Find(m_filter) != -1 || \
  520. m_List1array.ElementAt(ii).ElementAt(6).Find(m_filter) != -1 || \
  521. m_List1array.ElementAt(ii).ElementAt(7).Find(m_filter) != -1 || \
  522. m_List1array.ElementAt(ii).ElementAt(8).Find(m_filter) != -1 || \
  523. m_List1array.ElementAt(ii).ElementAt(9).Find(m_filter) != -1 || \
  524. m_List1array.ElementAt(ii).ElementAt(10).Find(m_filter) != -1 || \
  525. m_List1array.ElementAt(ii).ElementAt(11).Find(m_filter) != -1 || \
  526. m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
  527. m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
  528. m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
  529. m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
  530. m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1)
  531. {
  532. bFinded = 1;
  533. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  534. }
  535. else
  536. {
  537. bFinded = 0;
  538. }
  539. }
  540. }
  541. }
  542. }
  543. m_List1.m_arLabels.SetSize(count, 1);
  544. ii = count;
  545. m_List1.m_LabelCount = ii;
  546. m_List1.SetItemCountEx(ii);
  547. CString str;
  548. str.Format("单数:%d", ii);
  549. SetDlgItemText(IDC_STATIC2, str);
  550. }
  551. if (!g_id.IsEmpty())
  552. {
  553. for (int i = 0; i < m_List1.GetItemCount(); i++)
  554. {
  555. if (g_id == m_List1.GetItemText(i, 0 + m_nAdd))
  556. {
  557. m_List1.SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
  558. m_List1.EnsureVisible(i, FALSE);
  559. break;
  560. }
  561. }
  562. }
  563. }
  564. void TakeFrom::OnBUTclose()
  565. {
  566. // TODO: Add your control notification handler code here
  567. GetParent()->SendMessage(WM_CLOSE);
  568. }
  569. void TakeFrom::OnSelchangeCombo1()
  570. {
  571. // TODO: Add your control notification handler code here
  572. SetTimer(1, 100, NULL);
  573. }
  574. void TakeFrom::OnTimer(UINT nIDEvent)
  575. {
  576. // TODO: Add your message handler code here and/or call default
  577. KillTimer(nIDEvent);
  578. OnButton1();
  579. }
  580. BOOL TakeFrom::PreTranslateMessage(MSG* pMsg)
  581. {
  582. // TODO: Add your specialized code here and/or call the base class
  583. try
  584. {
  585. if (pMsg->message == WM_KEYDOWN)
  586. {
  587. switch (pMsg->wParam)
  588. {
  589. case VK_RETURN:
  590. OnButton1();
  591. return 1;
  592. case 0x43: // copy
  593. if ((GetKeyState(VK_CONTROL) & 0x80))
  594. {
  595. GetFocus()->SendMessage(WM_COPY);
  596. return TRUE;
  597. }
  598. break;
  599. case 0x56: //Ctrl + V:
  600. if ((GetKeyState(VK_CONTROL) & 0x80))
  601. {
  602. GetFocus()->SendMessage(WM_PASTE);
  603. return TRUE;
  604. }
  605. break;
  606. case 0x58: // cut
  607. if ((GetKeyState(VK_CONTROL) & 0x80))
  608. {
  609. GetFocus()->SendMessage(WM_CUT);
  610. return TRUE;
  611. }
  612. break;
  613. case 0x5A: //undo
  614. case 0x59: //redo
  615. if ((GetKeyState(VK_CONTROL) & 0x80))
  616. {
  617. GetFocus()->SendMessage(WM_UNDO);
  618. return TRUE;
  619. }
  620. break;
  621. }
  622. }
  623. return MyFormView::PreTranslateMessage(pMsg);
  624. }
  625. catch (...)
  626. {
  627. }
  628. return true;
  629. }
  630. // Jeff.remark.
  631. // 1.弹出"拍照状态确认"对话框前,需要获取订单的拍照状态,以此来确定是否需要禁用check状态框;
  632. //
  633. void TakeFrom::OnBUTimportphoto() // 导入原片按钮;
  634. {
  635. #ifdef USE_KERNEL_DLL
  636. INT nFirstItem = 0;
  637. INT nEndofItem = 0;
  638. STOrederInfo tagOrderInfo;
  639. INT nSelectedItem = GetSelectedOrderInfo(tagOrderInfo, nFirstItem, nEndofItem);
  640. // 有多少拍照OK的景点;
  641. INT nOKSize = 0;
  642. // 有多少景点未拍的;
  643. INT nUnOKSize = 0;
  644. vector<STSceneryInfo>::iterator it;
  645. for ( it = tagOrderInfo.vtOrderScenery.begin(); it != tagOrderInfo.vtOrderScenery.end(); it++ )
  646. {
  647. if ( it->strStatus == _T("OK") )
  648. nOKSize++;
  649. if ( it->strStatus == _T("未拍"))
  650. nUnOKSize++;
  651. }
  652. CSetOrderInfo dlg;
  653. for ( it = tagOrderInfo.vtOrderScenery.begin(); it != tagOrderInfo.vtOrderScenery.end(); it++ )
  654. {
  655. // 当前选中的景点列;
  656. if ( it->bSelected == TRUE )
  657. {
  658. dlg.waiter1 = it->strLensman;
  659. dlg.waiter12 = it->strLensmanAssistant;
  660. dlg.waiter2 = it->strBootDivision;
  661. dlg.waiter22 = it->strBootDivisionAssistant;
  662. // 让对话窗口弹出时,显示当前景点的拍照状态;
  663. if(it->strStatus == _T("OK"))
  664. dlg.m_nStatus = 0;
  665. else if( it->strStatus == _T("拍摄中") )
  666. dlg.m_nStatus = 1;
  667. else if( it->strStatus == _T("未拍") )
  668. dlg.m_nStatus = 2;
  669. break;
  670. }
  671. }
  672. if ( dlg.DoModal() == IDOK )
  673. {
  674. it->strLensman = dlg.waiter1;
  675. it->strLensmanAssistant = dlg.waiter12;
  676. it->strBootDivision = dlg.waiter2;
  677. it->strBootDivisionAssistant = dlg.waiter22;
  678. // m_nStatus:
  679. // 0:此景点拍照OK; 1:此景点拍照中; 2:此景点未拍照; 3:全部景点拍照OK;
  680. if ( dlg.m_nStatus == 0 )
  681. {// 所选景点设置OK,nOKSize加;
  682. if ( it->strStatus != _T("OK"))
  683. {
  684. nOKSize++;
  685. if ( it->strStatus == _T("未拍"))
  686. nUnOKSize--;
  687. }
  688. it->strStatus = _T("OK");
  689. }
  690. else if ( dlg.m_nStatus == 1 )
  691. {// 所选景点设置拍照中; 若原本景点OK,nOKSize减;
  692. if ( it->strStatus == _T("OK"))
  693. nOKSize--;
  694. if (it->strStatus == _T("未拍"))
  695. nUnOKSize--;
  696. it->strStatus = _T("拍摄中");
  697. }
  698. else if ( dlg.m_nStatus == 2 )
  699. {// 所选景点设置未拍照;若原本景点OK,nOKSize加;
  700. if ( it->strStatus == _T("OK"))
  701. {
  702. nOKSize--;
  703. nUnOKSize++;
  704. }
  705. if ( it->strStatus == _T("拍摄中"))
  706. nUnOKSize++;
  707. it->strStatus = _T("未拍");
  708. }
  709. else if ( dlg.m_nStatus == 3 )
  710. {// 全部景点设置OK;
  711. nOKSize = tagOrderInfo.vtOrderScenery.size();
  712. nUnOKSize = 0;
  713. it->strStatus = _T("OK");
  714. }
  715. //////////////////////////////////////////////////////////////////////////
  716. // SQL语句;
  717. CString strSQL = _T("");
  718. CString strSQL2 = _T("");
  719. if ( nOKSize == 0 )
  720. {// 全部景点未拍照 (若已全部景点OK,不改变订单的拍照状态和订单的拍照日期);
  721. if ( nUnOKSize == 0)
  722. 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);
  723. else
  724. 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);
  725. }
  726. else if ( nOKSize == tagOrderInfo.vtOrderScenery.size() )
  727. {// 全部景点都OK,设置所有dindanjd表的订单景点拍照状态OK,且设置订单的拍照日期(原本状态OK的,不改变拍照日期);
  728. 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);
  729. strSQL2.Format(_T("***update dindanjd set [status] = 'OK' where id = '%s'"),tagOrderInfo.strOrderNumber);
  730. strSQL += strSQL2;
  731. //////////////////////////////////////////////////////////////////////////
  732. // 全部景点拍照OK时,判断是否需要生成短信;
  733. if ( atoi(g_cominfoarray.ElementAt(0).ElementAt(101)) )
  734. {
  735. CString strTimeStamp = _T("msgtimestamp");
  736. CString strSMSContent = CString(g_cominfoarray.ElementAt(0).ElementAt(105));
  737. // 获取用户手机号码;
  738. CString strPhone1 = tagOrderInfo.strPhone;
  739. CString strPhone2 = tagOrderInfo.strTelPhone;
  740. if ( strPhone1.Find(_T("***")) != -1 )
  741. {//若用户权限不足以获取手机号码,重新获取;
  742. CString strBranchName = GetBranchNamebyId(tagOrderInfo.strBranchId);
  743. if ( g_bAllBranch )
  744. {
  745. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  746. {
  747. if (tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && strBranchName == m_List1arrayBak.ElementAt(i).ElementAt(0))
  748. {
  749. strPhone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  750. strPhone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  751. break;
  752. }
  753. }
  754. }
  755. else
  756. {
  757. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  758. {
  759. if (tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0))
  760. {
  761. strPhone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  762. strPhone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  763. break;
  764. }
  765. }
  766. }
  767. }
  768. // 生成短信内容;
  769. CString strtemp = _T("");
  770. #ifdef CHILD_VERSION
  771. if ( !tagOrderInfo.strName1.IsEmpty() )
  772. strtemp = tagOrderInfo.strName1 + _T(",");
  773. strtemp += tagOrderInfo.strName2;
  774. strtemp.TrimRight(_T(","));
  775. if( !strtemp.IsEmpty() && CheckPhoneType(strPhone1) != -1 && CheckBadWords(strtemp,0) )
  776. {
  777. strtemp += strSMSContent;
  778. strtemp.Replace(_T("xxx小朋友"), _T(""));
  779. int nCount = GetLengthEx(strtemp)/MSG_LENGTH;
  780. if( GetLengthEx(strtemp)%MSG_LENGTH )
  781. nCount++;
  782. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, strTimeStamp, nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  783. strSQL += _T("***") + strSQL2;
  784. }
  785. #else
  786. if ( strSMSContent.Find(_T("xxx先生/女士")) != -1 )
  787. {
  788. int nCount = 0;
  789. // 男士短信;
  790. if ( !tagOrderInfo.strName1.IsEmpty() && CheckPhoneType(strPhone1) != -1 && CheckBadWords(tagOrderInfo.strName1, 0) )
  791. {
  792. strtemp = strSMSContent;
  793. strtemp.Replace(_T("xxx先生/女士"), tagOrderInfo.strName1 + _T("先生"));
  794. nCount = GetLengthEx(strtemp) / MSG_LENGTH;
  795. if ( GetLengthEx(strtemp) % MSG_LENGTH )
  796. nCount++;
  797. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, strTimeStamp, nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  798. strSQL += _T("***") + strSQL2;
  799. }
  800. // 女士短信;
  801. if ( !tagOrderInfo.strName2.IsEmpty() && CheckPhoneType(strPhone2) != -1 && CheckBadWords(tagOrderInfo.strName2, 0) )
  802. {
  803. strtemp = strSMSContent;
  804. strtemp.Replace(_T("xxx先生/女士"), tagOrderInfo.strName2 + _T("女士"));
  805. nCount = GetLengthEx(strtemp) / MSG_LENGTH;
  806. if ( GetLengthEx(strtemp) % MSG_LENGTH )
  807. nCount++;
  808. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone2, strtemp, _T("msgtimexxstamp"), nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  809. strSQL += _T("***") + strSQL2;
  810. }
  811. }
  812. #endif
  813. }
  814. }
  815. else
  816. {// 部分景点拍照;拍照中(若订单的拍照状态已OK,不修改状态);
  817. 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);
  818. }
  819. // 最多4个景点,4组摄影师+化妆师;
  820. if ( nSelectedItem == nFirstItem )
  821. {
  822. strSQL2.Format(_T("***update dindan set waiter1 = '%s', waiter2 = '%s' where id = '%s'"),
  823. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  824. }
  825. else if ( nSelectedItem == nFirstItem + 1)
  826. {
  827. strSQL2.Format(_T("***update dindan set waiter12 = '%s', waiter22 = '%s' where id = '%s'"),
  828. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  829. }
  830. else if ( nSelectedItem == nFirstItem + 2)
  831. {
  832. strSQL2.Format(_T("***update dindan set waiter13 = '%s', waiter23 = '%s' where id = '%s'"),
  833. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  834. }
  835. else if ( nSelectedItem == nFirstItem + 3)
  836. {
  837. strSQL2.Format(_T("***update dindan set waiter14 = '%s', waiter24 = '%s' where id = '%s'"),
  838. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  839. }
  840. strSQL += strSQL2;
  841. strSQL2.Format(_T("***update dindanjd set [date]= '%s', [status] = '%s', [waiter1] = '%s', [waiter12] = '%s', [waiter2] = '%s',[waiter22] ='%s' where id = '%s' and [name] = '%s' "),
  842. g_date, it->strStatus, it->strLensman, it->strLensmanAssistant, it->strBootDivision, it->strBootDivisionAssistant, tagOrderInfo.strOrderNumber, it->strScenery);
  843. strSQL += strSQL2;
  844. strSQL2.Format(_T("***gentakecontent:"),tagOrderInfo.strOrderNumber);//拍照OK时记录客人预定内容
  845. strSQL += strSQL2;
  846. //////////////////////////////////////////////////////////////////////////
  847. // 构建发送给服务器的包;
  848. g_sendhead.bsql = TRUE;
  849. if ( g_bAllBranch )
  850. {
  851. // 多店汇总;
  852. g_branchip = GetIP(tagOrderInfo.strBranchId);
  853. g_pMainWnd->OnDisconnect();
  854. g_branchname = tagOrderInfo.strBranchId;
  855. g_bBranchModify = TRUE;
  856. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  857. g_pMainWnd->OnDisconnect();
  858. g_bBranchModify = FALSE;
  859. g_branchip = g_branchname = _T("");
  860. }
  861. else
  862. {
  863. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  864. }
  865. //////////////////////////////////////////////////////////////////////////
  866. // 接收服务器返回的数据;
  867. if (g_bSendOK == 0)
  868. {
  869. OutputDebugString(_T("\n服务器返回数据失败!\n"));
  870. return;
  871. }
  872. if (g_bAllBranch == 0)
  873. {// 连接本店或分店时;
  874. GetData();
  875. }
  876. else
  877. {// 多店汇总时;
  878. BOOL bFind = 0;
  879. for (int i = 0; i < m_List1array.GetSize(); i++)
  880. {
  881. if (bFind && m_List1array.ElementAt(i).ElementAt(1) != _T(""))break;
  882. if (tagOrderInfo.strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && tagOrderInfo.strBranchId == m_List1array.ElementAt(i).ElementAt(0))
  883. {
  884. bFind = 1;
  885. }
  886. if (bFind && it->strScenery == m_List1array.ElementAt(i).ElementAt(4))
  887. {
  888. m_List1array.ElementAt(i).SetAt(7 + m_nAdd, it->strLensman);
  889. m_List1array.ElementAt(i).SetAt(8 + m_nAdd, it->strLensmanAssistant);
  890. m_List1array.ElementAt(i).SetAt(9 + m_nAdd, it->strBootDivision);
  891. m_List1array.ElementAt(i).SetAt(10 + m_nAdd, it->strBootDivisionAssistant);
  892. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, it->strStatus);
  893. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
  894. //m_List1array.ElementAt(i).SetAt(3 + m_nAdd, sbeginno);
  895. FillGrid();
  896. break;
  897. }
  898. }
  899. }
  900. }
  901. // 开始导入初修片;
  902. if ( MessageBox(_T("是否现在开始导入原片!"), _T("导片提示:导入原片"), MB_TOPMOST|MB_YESNO|MB_ICONWARNING ) != IDYES )
  903. {// 是否马上导入相片;
  904. return;
  905. }
  906. //////////////////////////////////////////////////////////////////////////
  907. INT nImgNum = atoi(tagOrderInfo.strImageNumber);
  908. if ( nImgNum <= 0)
  909. nImgNum = 1;
  910. else
  911. ++nImgNum;
  912. ImgImportInterface *pImport = NULL;
  913. if ( g_pIMGProcess == NULL )
  914. {
  915. AfxMessageBox(_T("lyfzIMGProcess模块加载失败!"));
  916. return;
  917. }
  918. g_pIMGProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
  919. if ( pImport )
  920. {
  921. pImport->ImportOriginalImg(
  922. TRUE, // 文件夹形式打开源或多选文件形式;
  923. !g_bOriginal, // 相片是否需要重命名;
  924. nImgNum, // 相片数字编号;
  925. tagOrderInfo.strBranchId, // 分店域名;
  926. tagOrderInfo.strOrderNumber, // 订单号;
  927. tagOrderInfo.strName1 + _T(",") + tagOrderInfo.strName2, // 顾客信息,可任意组合;
  928. TRUE, // 导入时,是否生成景点名文件夹;
  929. it->strScenery, // 导入时,景点名;
  930. _T("*.jpg|*.jpeg"), // 导入时,主扩展名相片;
  931. INVALID_COPY_PIX, // 导入时,主扩展名相片的压缩像素;
  932. _T("*.nef|*.cr2|*.raw"), // 导入时,附加的扩展名相片;
  933. TRUE, // 导入时,是否生成缩略图;
  934. SET_PIX(100,100), // 导入时,生成的缩略图像素大小;
  935. FALSE // 导入时,文件存在时是否覆盖;
  936. );
  937. g_pIMGProcess->Release();
  938. WriteOptLog(_T("导入原片,订单号:%s"),tagOrderInfo.strOrderNumber);
  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. }