补档.cpp 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689
  1. #include <stdio.h>
  2. /////////////////////////////////////////////////////////////////////////////////////////////////
  3. // 重写导入设计片按钮函数;
  4. void CDesignFrom::OnBUTimportphoto() // 导入设计版 按钮;
  5. {
  6. // 获取列表信息;
  7. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  8. if ( pos == NULL )
  9. {
  10. AfxMessageBox(_T("请选中您要导片的订单号!"), MB_ICONINFORMATION);
  11. return;
  12. }
  13. INT nItemCount = m_List1.GetItemCount();
  14. INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
  15. // 订单的设计信息店名、域名、订单号、景点名、顾客信息、设计状态、设计日期、设计师;
  16. CString strBranchName = _T("");
  17. CString strBranchId = _T("");
  18. CString strOrderNum = _T("");
  19. CString strScenery = _T("");
  20. CString strCustomerInfo = _T("");
  21. CString strDesignState = _T("");
  22. CString strDesignDate = _T("");
  23. CString strDesigner = _T("");
  24. // 获取域名;
  25. if ( g_bAllBranch )
  26. {// 多店汇总时;
  27. strBranchName = m_List1.GetItemText(nSelectedItem, 0);
  28. strBranchId = GetDomainFromBranch( strBranchName );
  29. }
  30. else
  31. {
  32. if ( g_branchname.IsEmpty() )
  33. {// 连接本店时;
  34. strBranchName = _T("");
  35. strBranchId = g_domain;
  36. }
  37. else
  38. {// 连接分店时;
  39. strBranchName = g_branchname;
  40. strBranchId = GetDomainFromBranch( g_branchname );
  41. }
  42. }
  43. // 获取订单号;
  44. strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
  45. // 获取设计师;
  46. strDesigner = m_List1.GetItemText(nSelectedItem, 14 + m_nAdd);
  47. // 获取设计状态;
  48. strDesignState = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd);
  49. // 获取设计日期;
  50. strDesignDate = m_List1.GetItemText(nSelectedItem, 6 + m_nAdd);
  51. // 获取顾客信息;
  52. strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
  53. CDlgChuXiuInfo xpdlg;
  54. xpdlg.m_strOrderNumber = strOrderNum;
  55. xpdlg.m_strXiupianRen = strDesigner;
  56. if ( strDesignState == _T("OK") )
  57. xpdlg.m_nXiupianStatus = 0;
  58. else if ( strDesignState == _T("设计中"))
  59. xpdlg.m_nXiupianStatus = 1;
  60. else if ( strDesignState == _T("未设计"))
  61. xpdlg.m_nXiupianStatus = 2;
  62. CString strSQL = _T("");
  63. if( xpdlg.Domodal() == IDOK )
  64. {
  65. if ( xpdlg.m_bGrowthTx )
  66. strScenery = xpdlg.m_strScenery;
  67. if ( xpdlg.m_nXiupianStatus == 0 )
  68. strDesignState = _T("OK");
  69. else if ( xpdlg.m_nXiupianStatus == 1)
  70. strDesignState = _T("设计中");
  71. else if ( xpdlg.m_nXiupianStatus == 2 )
  72. strDesignState = _T("未设计");
  73. strDesigner = xpdlg.m_strXiupianRen;
  74. if (strDesignDate.IsEmpty())
  75. strSQL.Format(_T("update dindan set waiter4 = '%s', status5 = '%s', time10 = '%s' where id = '%s'"), strDesigner, strDesignState, g_date, strOrderNum);
  76. else
  77. strSQL.Format(_T("update dindan set waiter4 = '%s', status5 = '%s' where id = '%s'"), strDesigner, strDesignState, strOrderNum);
  78. /////////////////////////////////////////////////////////////////////////////////////////////////
  79. // 构建数据包;
  80. g_sendhead.bsql = TRUE;
  81. if ( g_bAllBranch )
  82. {// 多店汇总时;
  83. g_branchip = GetBranchIPbyId(strBranchId);
  84. g_pMainWnd->OnDisconnect();
  85. g_branchname = strBranchName;
  86. g_bBranchModify = TRUE;
  87. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  88. g_pMainWnd->OnDisconnect();
  89. g_bBranchModify = FALSE;
  90. g_branchip = g_branchname = _T("");
  91. }
  92. else
  93. {// 连接本店或分店时;
  94. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  95. }
  96. // 刷新界面数据;
  97. if (g_bSendOK == 0)
  98. {
  99. OutputDebugString(_T("接收服务器数据失败!\n"));
  100. return;
  101. }
  102. if (g_bAllBranch == 0)
  103. {// 连接本店或分店时;
  104. GetData();
  105. }
  106. else
  107. {// 多店汇总时;
  108. for (int i = 0; i < m_List1array.GetSize(); i++)
  109. {
  110. if (strOrderNum == m_List1array.ElementAt(i).ElementAt(1) && strBranchName == m_List1array.ElementAt(i).ElementAt(0))
  111. {
  112. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, strDesignState);
  113. if (strDesignDate.IsEmpty())
  114. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
  115. m_List1array.ElementAt(i).SetAt(14 + m_nAdd, strDesigner);
  116. FillGrid();
  117. break;
  118. }
  119. }
  120. }
  121. }
  122. }
  123. /////////////////////////////////////////////////////////////////////////////////////////////////
  124. // 重写拍照导入原片按钮函数;
  125. // 1.更新dindan表或dindanjd表;
  126. // 2.导入相片;
  127. // 3.生成上传任务;
  128. // 4.写入增量备份信息;
  129. // 5.删除ok文件(ok作用:用来判断是否需要生成缩略图。多目录下,这个意义不大。直接在导入时生成。);
  130. // 6.发送拍照完成短信;
  131. void TakeFrom::OnBUTimportphoto()
  132. {
  133. INT nFirstItem = 0;
  134. INT nEndofItem = 0;
  135. STOrederInfo tagOrderInfo;
  136. INT nSelectedItem = GetSelectedOrderInfo(tagOrderInfo, nFirstItem, nEndofItem);
  137. // 有多少拍照OK的景点;
  138. INT nOKSize = 0;
  139. vector<STSceneryInfo>::iterator it = NULL;
  140. for ( it = tagOrderInfo.vtOrderScenery.begin(); it != tagOrderInfo.vtOrderScenery.end(); it++ )
  141. {
  142. if ( it->strStatus == _T("OK") )
  143. nOKSize++;
  144. }
  145. CSetOrderInfo dlg;
  146. for ( it = tagOrderInfo.vtOrderScenery.begin(); it != tagOrderInfo.vtOrderScenery.end(); it++ )
  147. {
  148. // 当前选中的景点列;
  149. if ( it->bSelected == TRUE )
  150. {
  151. dlg.waiter1 = it->strLensman;
  152. dlg.waiter12 = it->strLensmanAssistant;
  153. dlg.waiter2 = it->strBootDivision;
  154. dlg.waiter22 = it->strBootDivisionAssistant;
  155. // 让对话窗口弹出时,显示当前景点的拍照状态;
  156. if(it->strStatus == _T("OK"))
  157. dlg.m_nStatus = 0;
  158. else if( it->strStatus == _T("拍照中") )
  159. dlg.m_nStatus = 1;
  160. else if( it->strStatus == _T("未拍") )
  161. dlg.m_nStatus = 2;
  162. break;
  163. }
  164. }
  165. if ( dlg.DoModal() == IDOK )
  166. {
  167. it->strLensman = dlg.waiter1;
  168. it->strLensmanAssistant = dlg.waiter12;
  169. it->strBootDivision = dlg.waiter2;
  170. it->strBootDivisionAssistant = dlg.waiter22;
  171. // m_nStatus:
  172. // 0:此景点拍照OK; 1:此景点拍照中; 2:此景点未拍照; 3:全部景点拍照OK;
  173. if ( dlg.m_nStatus == 0 )
  174. {// 所选景点设置OK,nOKSize加;
  175. if ( it->strStatus != _T("OK"))
  176. nOKSize++;
  177. it->strStatus = _T("OK");
  178. }
  179. else if ( dlg.m_nStatus == 1 )
  180. {// 所选景点设置拍照中; 若原本景点OK,nOKSize减;
  181. if ( it->strStatus == _T("OK"))
  182. nOKSize--;
  183. it->strStatus = _T("拍照中");
  184. }
  185. else if ( dlg.m_nStatus == 2 )
  186. {// 所选景点设置未拍照;若原本景点OK,nOKSize加;
  187. if ( it->strStatus == _T("OK"))
  188. nOKSize--;
  189. it->strStatus = _T("未拍");
  190. }
  191. else if ( dlg.m_nStatus == 3 )
  192. {// 全部景点设置OK;
  193. nOKSize = tagOrderInfo.vtOrderScenery.size();
  194. it->strStatus = _T("OK");
  195. }
  196. //////////////////////////////////////////////////////////////////////////
  197. // SQL语句;
  198. CString strSQL = _T("");
  199. CString strSQL2 = _T("");
  200. if ( nOKSize == 0 )
  201. {// 全部景点未拍照;
  202. //strSQL.Format(_T("update dindan set [status] = '未拍' where id = '%s'"), tagOrderInfo.strOrderNumber);
  203. strSQL.Format(_T("update dindan set [status] = case when status <> 'OK' then '未拍' else status end where id = '%s'"), tagOrderInfo.strOrderNumber);
  204. }
  205. else if ( nOKSize == tagOrderInfo.vtOrderScenery.size() )
  206. {// 全部景点都OK,设置所有dindanjd表的订单景点拍照状态OK;
  207. strSQL.Format(_T("update dindan set [status] = 'OK' where id = '%s'"), tagOrderInfo.strOrderNumber);
  208. strSQL2.Format(_T("***update dindanjd set [status] = 'OK' where id = '%s'"),tagOrderInfo.strOrderNumber);
  209. strSQL += strSQL2;
  210. //////////////////////////////////////////////////////////////////////////
  211. // 全部景点拍照OK时,判断是否需要生成短信;
  212. if ( atoi(g_cominfoarray.ElementAt(0).ElementAt(101)) )
  213. {
  214. CString strTimeStamp = _T("msgtimestamp");
  215. CString strSMSContent = CString(g_cominfoarray.ElementAt(0).ElementAt(105));
  216. // 获取用户手机号码;
  217. CString strPhone1 = tagOrderInfo.strPhone;
  218. CString strPhone2 = tagOrderInfo.strTelPhone;
  219. if ( strPhone1.Find(_T("***")) != -1 )
  220. {//若用户权限不足以获取手机号码,重新获取;
  221. CString strBranchName = GetBranchNamebyId(tagOrderInfo.strBranchId);
  222. if ( g_bAllBranch )
  223. {
  224. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  225. {
  226. if (tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && strBranchName == m_List1arrayBak.ElementAt(i).ElementAt(0))
  227. {
  228. strPhone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  229. strPhone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  230. break;
  231. }
  232. }
  233. }
  234. else
  235. {
  236. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  237. {
  238. if (tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0))
  239. {
  240. strPhone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  241. strPhone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  242. break;
  243. }
  244. }
  245. }
  246. }
  247. // 生成短信内容;
  248. CString strtemp = _T("");
  249. #ifdef CHILD_VERSION
  250. if ( !tagOrderInfo.strName1.IsEmpty() )
  251. strtemp = tagOrderInfo.strName1 + _T(",");
  252. strtemp += tagOrderInfo.strName2;
  253. strtemp.TrimRight(_T(","));
  254. if( !strtemp.IsEmpty() && CheckPhoneType(strPhone1) != -1 && CheckBadWords(strtemp,0) )
  255. {
  256. strtemp += strSMSContent;
  257. strtemp.Replace(_T("xxx小朋友"), _T(""));
  258. int nCount = GetLengthEx(strtemp)/MSG_LENGTH;
  259. if( GetLengthEx(strtemp)%MSG_LENGTH )
  260. nCount++;
  261. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, strTimeStamp, nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  262. strSQL += _T("***") + strSQL2;
  263. }
  264. #else
  265. if ( strSMSContent.Find(_T("xxx先生/女士")) != -1 )
  266. {
  267. int nCount = 0;
  268. // 男士短信;
  269. if ( !tagOrderInfo.strName1.IsEmpty() && CheckPhoneType(strPhone1) != -1 && CheckBadWords(tagOrderInfo.strName1, 0) )
  270. {
  271. strtemp = strSMSContent;
  272. strtemp.Replace(_T("xxx先生/女士"), tagOrderInfo.strName1 + _T("先生"));
  273. nCount = GetLengthEx(strtemp) / MSG_LENGTH;
  274. if ( GetLengthEx(strtemp) % MSG_LENGTH )
  275. nCount++;
  276. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, strTimeStamp, nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  277. strSQL += _T("***") + strSQL2;
  278. }
  279. // 女士短信;
  280. if ( !tagOrderInfo.strName2.IsEmpty() && CheckPhoneType(strPhone2) != -1 && CheckBadWords(tagOrderInfo.strName2, 0) )
  281. {
  282. strtemp = strSMSContent;
  283. strtemp.Replace(_T("xxx先生/女士"), tagOrderInfo.strName1 + _T("先生"));
  284. nCount = GetLengthEx(strtemp) / MSG_LENGTH;
  285. if ( GetLengthEx(strtemp) % MSG_LENGTH )
  286. nCount++;
  287. strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, _T("msgtimexxstamp"), nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
  288. strSQL += _T("***") + strSQL2;
  289. }
  290. }
  291. #endif
  292. }
  293. }
  294. else
  295. {// 部分景点拍照;拍照中;
  296. //strSQL.Format(_T("update dindan set [status] = '拍照中' where id = '%s'"), tagOrderInfo.strOrderNumber);
  297. strSQL.Format(_T("update dindan set [status] = case when status <> 'OK' then '拍照中' else status end where id = '%s'"), tagOrderInfo.strOrderNumber);
  298. }
  299. // 最多4个景点,4组摄影师+化妆师;
  300. if ( nSelectedItem == nFirstItem )
  301. {
  302. strSQL2.Format(_T("***update dindan set waiter1 = '%s', waiter2 = '%s' where id = '%s'"),
  303. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  304. }
  305. else if ( nSelectedItem == nFirstItem + 1)
  306. {
  307. strSQL2.Format(_T("***update dindan set waiter12 = '%s', waiter22 = '%s' where id = '%s'"),
  308. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  309. }
  310. else if ( nSelectedItem == nFirstItem + 2)
  311. {
  312. strSQL2.Format(_T("***update dindan set waiter13 = '%s', waiter23 = '%s' where id = '%s'"),
  313. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  314. }
  315. else if ( nSelectedItem == nFirstItem + 3)
  316. {
  317. strSQL2.Format(_T("***update dindan set waiter14 = '%s', waiter24 = '%s' where id = '%s'"),
  318. it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
  319. }
  320. strSQL += strSQL2;
  321. strSQL2.Format(_T("***update dindanjd set [date]= '%s', [status] = '%s', [waiter1] = '%s', [waiter12] = '%s', [waiter2] = '%s',[waiter22] ='%s' where id = '%s' and [name] = '%s' "),
  322. g_date, it->strStatus, it->strLensman, it->strLensmanAssistant, it->strBootDivision, it->strBootDivisionAssistant, tagOrderInfo.strOrderNumber, it->strScenery);
  323. strSQL += strSQL2;
  324. strSQL2.Format(_T("***gentakecontent:"),tagOrderInfo.strOrderNumber);//拍照OK时记录客人预定内容
  325. strSQL += strSQL2;
  326. //////////////////////////////////////////////////////////////////////////
  327. // 构建发送给服务器的包;
  328. g_sendhead.bsql = TRUE;
  329. if ( g_bAllBranch )
  330. {
  331. // 多店汇总;
  332. g_branchip = GetIP(tagOrderInfo.strBranchId);
  333. g_pMainWnd->OnDisconnect();
  334. g_branchname = tagOrderInfo.strBranchId;
  335. g_bBranchModify = TRUE;
  336. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  337. g_pMainWnd->OnDisconnect();
  338. g_bBranchModify = FALSE;
  339. g_branchip = g_branchname = _T("");
  340. }
  341. else
  342. {
  343. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  344. }
  345. //////////////////////////////////////////////////////////////////////////
  346. // 接收服务器返回的数据;
  347. if (g_bSendOK == 0)
  348. {
  349. OutputDebugString(_T("\n服务器返回数据失败!\n"));
  350. return;
  351. }
  352. if (g_bAllBranch == 0)
  353. {// 连接本店或分店时;
  354. GetData();
  355. }
  356. else
  357. {// 多店汇总时;
  358. BOOL bFind = 0;
  359. for (int i = 0; i < m_List1array.GetSize(); i++)
  360. {
  361. if (bFind && m_List1array.ElementAt(i).ElementAt(1) != _T(""))break;
  362. if (tagOrderInfo.strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && tagOrderInfo.strBranchId == m_List1array.ElementAt(i).ElementAt(0))
  363. {
  364. bFind = 1;
  365. }
  366. if (bFind && it->strScenery == m_List1array.ElementAt(i).ElementAt(4))
  367. {
  368. m_List1array.ElementAt(i).SetAt(7 + m_nAdd, it->strLensman);
  369. m_List1array.ElementAt(i).SetAt(8 + m_nAdd, it->strLensmanAssistant);
  370. m_List1array.ElementAt(i).SetAt(9 + m_nAdd, it->strBootDivision);
  371. m_List1array.ElementAt(i).SetAt(10 + m_nAdd, it->strBootDivisionAssistant);
  372. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, it->strStatus);
  373. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
  374. //m_List1array.ElementAt(i).SetAt(3 + m_nAdd, sbeginno);
  375. FillGrid();
  376. break;
  377. }
  378. }
  379. }
  380. }
  381. //////////////////////////////////////////////////////////////////////////
  382. INT nImgNum = atoi(tagOrderInfo.strImageNumber);
  383. if ( nImgNum <= 0)
  384. nImgNum = 1;
  385. else
  386. ++nImgNum;
  387. ImgImportInterface *pImport = NULL;
  388. g_pIMSProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
  389. if ( pImport )
  390. {
  391. pImport->ImportOriginalImg(
  392. TRUE, // 文件夹形式打开源或多选文件形式;
  393. TRUE, // 相片是否需要重命名;
  394. nImgNum, // 相片数字编号;
  395. tagOrderInfo.strBranchId, // 分店域名;
  396. tagOrderInfo.strOrderNumber, // 订单号;
  397. tagOrderInfo.strName1 + _T(",") + tagOrderInfo.strName2, // 顾客信息,可任意组合;
  398. TRUE, // 导入时,是否生成景点名文件夹;
  399. it->strScenery, // 导入时,景点名;
  400. _T("*.jpg|*.jpeg"), // 导入时,主扩展名相片;
  401. INVALID_COPY_PIX, // 导入时,主扩展名相片的压缩像素;
  402. _T("*.nef|*.cr2|*.raw"), // 导入时,附加的扩展名相片;
  403. TRUE, // 导入时,是否生成缩略图;
  404. SET_PIX(100,100), // 导入时,生成的缩略图像素大小;
  405. FALSE // 导入时,文件存在时是否覆盖;
  406. );
  407. g_pIMSProcess->Release();
  408. }
  409. // 结束;
  410. }
  411. void TakeFrom::GetSelectedOrderInfo( OUT STOrederInfo &tagOrderInfo )
  412. {
  413. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  414. if ( pos == NULL )
  415. {
  416. AfxMessageBox(_T("未选中要导入相片的订单!",MB_ICONINFORMATION));
  417. return;
  418. }
  419. INT nItemCount = m_List1.GetItemCount();
  420. INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
  421. INT nSceneryItem = nSelectedItem;
  422. if ( m_List1.GetItemText(nSelectedItem, 0 + m_nAdd) == _T("") )
  423. {
  424. STSceneryInfo tagSceneryInfo;
  425. tagSceneryInfo.bSelected = TRUE;
  426. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  427. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  428. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  429. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  430. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  431. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  432. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  433. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  434. // 查找所有下行;
  435. nSceneryItem++;
  436. if ( nSceneryItem < nItemCount )
  437. {
  438. while( m_List1.GetItemText(nSceneryItem, 0 + m_nAdd) == _T("") )
  439. {
  440. tagSceneryInfo.bSelected = FALSE;
  441. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  442. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  443. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  444. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  445. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  446. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  447. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  448. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  449. nSceneryItem++;
  450. if ( nSceneryItem >= nItemCount )
  451. break;
  452. }
  453. }
  454. // 查找所有上行;
  455. nSceneryItem = nSelectedItem - 1;
  456. if ( nSceneryItem >= 0)
  457. {
  458. while( m_List1.GetItemText(nSceneryItem, 0 + m_nAdd) == _T("") )
  459. {
  460. tagSceneryInfo.bSelected = FALSE;
  461. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  462. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  463. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  464. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  465. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  466. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  467. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  468. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  469. nSceneryItem--;
  470. if ( nSceneryItem < 0 )
  471. break;
  472. }
  473. }
  474. // 上行结束后,是头位置;
  475. if ( nSceneryItem >= 0 )
  476. {
  477. // 用头景点行初始化订单信息;
  478. if ( g_bAllBranch )
  479. {// 多店汇总;
  480. tagOrderInfo.strBranchId = GetDomainFromBranch(m_List1.GetItemText(nSceneryItem, 0 ));
  481. }
  482. else
  483. {
  484. if ( g_branchname.IsEmpty() )
  485. {// 连接本店;
  486. tagOrderInfo.strBranchId = g_domain;
  487. }
  488. else
  489. {// 连接分店;
  490. tagOrderInfo.strBranchId = GetDomainFromBranch(g_branchname);
  491. }
  492. }
  493. tagOrderInfo.strOrderNumber = m_List1.GetItemText(nSceneryItem, 0 + m_nAdd);
  494. tagOrderInfo.strName1 = m_List1.GetItemText(nSceneryItem, 1 + m_nAdd);
  495. tagOrderInfo.strName2 = m_List1.GetItemText(nSceneryItem, 2 + m_nAdd);
  496. tagOrderInfo.strImageNumber = m_List1.GetItemText(nSceneryItem, 3 + m_nAdd);
  497. tagOrderInfo.strClerk = m_List1.GetItemText(nSceneryItem, 11 + m_nAdd);
  498. // 如果用户权限不足,13和14显示的是"*"符号;
  499. #if 1
  500. tagOrderInfo.strPhone = m_List1.GetItemText(nSceneryItem, 14 + m_nAdd);
  501. tagOrderInfo.strTelPhone = m_List1.GetItemText(nSceneryItem, 15 + m_nAdd);
  502. #else
  503. if ( g_bAllBranch )
  504. {// 多店汇总时;
  505. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  506. {
  507. if ( tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && tagOrderInfo.strBranchId == m_List1arrayBak.ElementAt(i).ElementAt(0) )
  508. {
  509. tagOrderInfo.strPhone = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  510. tagOrderInfo.strTelPhone = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  511. break;
  512. }
  513. }
  514. }
  515. else
  516. {// 连接分店或本店时;
  517. for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
  518. {
  519. if ( tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0) )
  520. {
  521. tagOrderInfo.strPhone = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
  522. tagOrderInfo.strTelPhone = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
  523. break;
  524. }
  525. }
  526. }
  527. #endif
  528. // 同时push头景点;
  529. tagSceneryInfo.bSelected = FALSE;
  530. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  531. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  532. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  533. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  534. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  535. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  536. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  537. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  538. }
  539. }
  540. else
  541. {
  542. // 用头景点行初始化订单信息;
  543. if ( g_bAllBranch )
  544. {// 多店汇总;
  545. tagOrderInfo.strBranchId = GetDomainFromBranch(m_List1.GetItemText(nSceneryItem, 0 ));
  546. }
  547. else
  548. {
  549. if ( g_branchname.IsEmpty() )
  550. {// 连接本店;
  551. tagOrderInfo.strBranchId = g_domain;
  552. }
  553. else
  554. {// 连接分店;
  555. tagOrderInfo.strBranchId = GetDomainFromBranch(g_branchname);
  556. }
  557. }
  558. tagOrderInfo.strOrderNumber = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
  559. tagOrderInfo.strName1 = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd);
  560. tagOrderInfo.strName2 = m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
  561. tagOrderInfo.strImageNumber = m_List1.GetItemText(nSelectedItem, 3 + m_nAdd);
  562. tagOrderInfo.strClerk = m_List1.GetItemText(nSelectedItem, 11 + m_nAdd);
  563. tagOrderInfo.strPhone = m_List1.GetItemText(nSelectedItem, 14 + m_nAdd);
  564. tagOrderInfo.strTelPhone = m_List1.GetItemText(nSelectedItem, 15 + m_nAdd);
  565. // push头景点;
  566. STSceneryInfo tagSceneryInfo;
  567. tagSceneryInfo.bSelected = TRUE;
  568. tagSceneryInfo.strScenery = m_List1.GetItemText(nSelectedItem, 4 + m_nAdd);
  569. tagSceneryInfo.strStatus = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd);
  570. tagSceneryInfo.strTime = m_List1.GetItemText(nSelectedItem, 6 + m_nAdd);
  571. tagSceneryInfo.strLensman = m_List1.GetItemText(nSelectedItem, 7 + m_nAdd);
  572. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSelectedItem, 8 + m_nAdd);
  573. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSelectedItem, 9 + m_nAdd);
  574. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSelectedItem, 10 + m_nAdd);
  575. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  576. // 读取下一行,看是否属于本订单的景点;
  577. nSceneryItem++;
  578. if ( nSceneryItem < nItemCount )
  579. {
  580. while( m_List1.GetItemText( nSceneryItem, 0 + m_nAdd ) == _T("") )
  581. {
  582. tagSceneryInfo.bSelected = FALSE;
  583. tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
  584. tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
  585. tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
  586. tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
  587. tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
  588. tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
  589. tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
  590. tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
  591. nSceneryItem++;
  592. if ( nSceneryItem >= nItemCount )
  593. break;
  594. }
  595. }
  596. }
  597. }
  598. /////////////////////////////////////////////////////////////////////////////////////////////////
  599. // 重写拍照查看原片按钮函数;
  600. // 1.首先加载大图;
  601. // 2.其实加载有大图的小图;
  602. void TakeFrom::OnBUTshowphoto()
  603. {
  604. POSITION pos = m_List.GetFirstSelectedItemPosition();
  605. if ( pos == NULL )
  606. {
  607. AfxMessageBox(_T("请选中您要查看的订单!"), MB_ICONINFORMATION);
  608. return;
  609. }
  610. INT nItemCount = m_List.GetItemCount();
  611. INT nSelectedItem = m_List.GetNextSelectedItem(pos);
  612. // 获取域名、订单号、顾客姓名、景点名;
  613. CString strBranchId = _T("");
  614. CString strOrderNum = _T("");
  615. CString strScenery = _T("");
  616. CString strCustomerInfo = _T("");
  617. strScenery = m_List.GetItemText(nSelectedItem, 4 + m_nAdd);
  618. // 获取订单行(所选行的订单号为空时,表示选中的是景点);
  619. if ( m_List.GetItemText(nSelectedItem, 0 + m_nAdd) == _T("") )
  620. {
  621. do
  622. {
  623. --nSelectedItem;
  624. if ( nSelectedItem == -1)
  625. break;
  626. }
  627. while ( m_List.GetItemText(nSelectedItem, 0 + m_nAdd) == _T("") );
  628. if ( nSelectedItem == -1 )
  629. {
  630. OutputDebugString(_T("获取订单列时出错!\n"));
  631. return;
  632. }
  633. }
  634. // 获取域名;
  635. if ( g_bAllBranch )
  636. {// 多店汇总时;
  637. strBranchId = GetDomainFromBranch( m_List.GetItemText(nSelectedItem, 0) );
  638. }
  639. else
  640. {
  641. if ( g_branchname.IsEmpty() )
  642. {// 连接本店;
  643. strBranchId = g_domain;
  644. }
  645. else
  646. {// 连接分店时;
  647. strBranchId = GetDomainFromBranch( g_branchname );
  648. }
  649. }
  650. // 获取订单号;
  651. strOrderNum = m_List.GetItemText(nSelectedItem, 0 + m_nAdd);
  652. // 顾客信息;
  653. strCustomerInfo = m_List.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List.GetItemText(nSelectedItem, 2 + m_nAdd);
  654. // 判断是否按下CTRL键或Shift键;
  655. if ( !g_pMainWnd->IsCtrlDown() && !g_pMainWnd->IsShiftDown() )
  656. {
  657. // 重置景点名为空,查看整个订单的相片;
  658. strScenery.Empty();
  659. }
  660. //////////////////////////////////////////////////////////////////////////
  661. // 传参给缩略图对话框;
  662. ShowPic dlg;
  663. dlg.m_id = strOrderNum;
  664. dlg.m_name = strCustomerInfo;
  665. dlg.m_mode = 1; // 原片;
  666. dlg.m_branch = strBranchId;
  667. // 在ShowPic内部使用kernel模块查找出指定相片路径;
  668. dlg.DoModal();
  669. // 刷新拍照列表;
  670. if ( dlg.m_bdelall )
  671. {
  672. for (int i = 0; i < m_List1array.GetSize(); i++ )
  673. {
  674. if ( g_bAllBranch )
  675. {// 多店汇总时;
  676. if ( strOrderNum == m_List1array.ElementAt(i).ElementAt(1) && strBranchId == m_List1array.ElementAt(i).ElementAt(0))
  677. {
  678. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "0");
  679. FillGrid();
  680. break;
  681. }
  682. }
  683. else
  684. {// 连接本店或分店;
  685. if ( strOrderNum == m_List1array.ElementAt(i).ElementAt(0))
  686. {
  687. m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "0");
  688. FillGrid();
  689. break;
  690. }
  691. }
  692. }
  693. }
  694. // end;
  695. }
  696. /////////////////////////////////////////////////////////////////////////////////////////////////
  697. // 重写初修导入修片按钮函数;
  698. // 1.更新数据,dindan表;
  699. // 2.导入相片;
  700. // 3.生成上传任务;
  701. // 4.写入增量备份信息;
  702. // 5.删除ok文件;
  703. void BeautifySkinFrom::OnBUTimportphoto()
  704. {
  705. POSITION pos = m_List1.GetFirstSelectedItemPosition();
  706. if ( pos == NULL )
  707. {
  708. AfxMessageBox(_T("请选中您要导入初修片的订单!"),MB_ICONINFORMATION);
  709. return;
  710. }
  711. INT nItemCount = m_List1.GetItemCount();
  712. INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
  713. // 获取列表订单信息:域名、订单号、景点名、顾客信息……
  714. CString strBranchName = _T("");
  715. CString strBranchId = _T("");
  716. CString strOrderNum = _T("");
  717. CString strScenery = _T("");
  718. CString strCustomerInfo = _T(""); // 顾客信息;
  719. CString strXiupianDate = _T(""); // 修片日期;
  720. CString strXiupianRen = _T(""); // 修片人;
  721. CString strPhone = _T(""); // 顾客手机;
  722. CString strXiupianStatus = _T(""); // 初修状态;
  723. // 获取域名;
  724. if ( g_bAllBranch )
  725. {// 多店汇总时:
  726. strBranchName = m_List1.GetItemText( nSelectedItem, 0);
  727. strBranchId = GetDomainFromBranch( strBranchName );
  728. }
  729. else
  730. {
  731. if ( g_branchname.IsEmpty() )
  732. {// 连接本店时;
  733. strBranchName = _T("");
  734. strBranchId = g_domain;
  735. }
  736. else
  737. {// 连接分店时;
  738. strBranchName = g_branchname;
  739. strBranchId = GetDomainFromBranch( g_branchname );
  740. }
  741. }
  742. // 获取订单号;
  743. strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
  744. // 获取修片状态;
  745. strXiupianStatus = m_List1.GetItemText(nSelectedItem, 4 + m_nAdd);
  746. // 获取修片人;
  747. strXiupianRen = m_List1.GetItemText(nSelectedItem, 9 + m_nAdd);
  748. // 获取顾客信息;
  749. strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
  750. CDlgChuXiuInfo xpdlg;
  751. xpdlg.m_strOrderNumber = strOrderNum;
  752. xpdlg.m_strXiupianRen = strXiupianRen;
  753. if ( strXiupianStatus == _T("OK") )
  754. xpdlg.m_nXiupianStatus = 0;
  755. else if ( strXiupianStatus == _T("修片中"))
  756. xpdlg.m_nXiupianStatus = 1;
  757. else if ( strXiupianStatus == _T("未修"))
  758. xpdlg.m_nXiupianStatus = 2;
  759. CString strSQL = _T("");
  760. if ( xpdlg.DoModal() == IDOK )
  761. {
  762. if ( xpdlg.m_bGrowthTx )
  763. strScenery = xpdlg.m_strScenery;
  764. if ( xpdlg.m_nXiupianStatus == 0 )
  765. strXiupianStatus = _T("OK");
  766. else if ( xpdlg.m_nXiupianStatus == 1)
  767. strXiupianStatus = _T("修片中");
  768. else if ( xpdlg.m_nXiupianStatus == 2 )
  769. strXiupianStatus = _T("未修");
  770. strXiupianRen = xpdlg.m_strXiupianRen;
  771. if (strXiupianDate.IsEmpty())
  772. strSQL.Format(_T("update dindan set waiter5 = '%s', status4 = '%s', time8 = '%s' where id = '%s'"), strXiupianRen, strXiupianStatus, g_date, strOrderNum);
  773. else
  774. strSQL.Format(_T("update dindan set waiter5 = '%s', status4 = '%s' where id = '%s'"), strXiupianRen, strXiupianStatus, strOrderNum);
  775. g_sendhead.bsql = TRUE;
  776. if( g_bAllBranch )
  777. {// 多店汇总时;
  778. g_branchip = GetBranchIPbyId(strBranchId);
  779. g_pMainWnd->OnDisconnect();
  780. g_branchname = strBranchName;
  781. g_bBranchModify = TRUE;
  782. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  783. g_bBranchModify = FALSE;
  784. g_branchip = g_branchname = _T("");
  785. }
  786. else
  787. {// 连接分店或本店时;
  788. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  789. }
  790. if( !g_bSendOK )
  791. {
  792. OutputDebugString(_T("连接服务器失败!\n"));
  793. return;
  794. }
  795. if( !g_bAllBranch )
  796. {
  797. GetData();
  798. }
  799. else
  800. {// 多店汇总时;
  801. for(int i = 0; i < m_List1array.GetSize(); i++ )
  802. {
  803. if( strOrderNum == m_List1array.ElementAt(i).ElementAt(1) && strBranchName == m_List1array.ElementAt(i).ElementAt(0) )
  804. {
  805. m_List1array.ElementAt(i).SetAt(4 + m_nAdd, strXiupianStatus);
  806. if(strXiupianDate.IsEmpty())
  807. m_List1array.ElementAt(i).SetAt(5 + m_nAdd, g_date);
  808. m_List1array.ElementAt(i).SetAt( 9 + m_nAdd, strXiupianRen);
  809. FillGrid();
  810. break;
  811. }
  812. }
  813. }
  814. }
  815. /////////////////////////////////////////////////////////////////////////////////////////////////
  816. // 获取完信息,开始导入初修片;
  817. ImgImportInterface *pImport = NULL;
  818. g_pIMSProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
  819. if ( pImport )
  820. {
  821. pImport->ImportSecondaryImg(
  822. TRUE,
  823. strBranchId,
  824. strOrderNum,
  825. strCustomerInfo,
  826. !strScenery.IsEmpty(),
  827. strScenery,
  828. _T("*.jpg|*.jpeg"),
  829. INVALID_COPY_PIX,
  830. _T("*.nef|*.cr2|*.raw|*.ra2"),
  831. FALSE,
  832. INVALID_COPY_PIX,
  833. FALSE
  834. );
  835. }
  836. // 结束;
  837. }
  838. /////////////////////////////////////////////////////////////////////////////////////////////////
  839. // 重写初修导出原片按钮函数;
  840. void BeautifySkinFrom::OnBUTexportphoto()
  841. {
  842. // 1.判断登陆用户是否有导出原片的权限;
  843. if ( !IsHasRights2new(8) )
  844. {
  845. AfxMessageBox(_T("您无权限导出原片!"),MB_ICONINFORMATION);
  846. return;
  847. }
  848. // 获取列表信息:域名、订单号、景点名、顾客信息;
  849. POSITION pos = m_List.GetFirstSelectedItemPosition();
  850. if ( pos == NULL )
  851. {
  852. AfxMessageBox(_T("请选中您要导出原片的订单!"), MB_ICONINFORMATION);
  853. return;
  854. }
  855. INT nItemCount = m_List.GetItemCount();
  856. INT nSelectedItem = m_List.GetNextSelectedItem(pos);
  857. CString strBranchId = _T("");
  858. CString strOrderNum = _T("");
  859. // 初修列表不支持景点名,需要从其他地方获取;
  860. CString strScenery = _T("");
  861. CString strCustomerInfo = _T("");
  862. // 获取域名;
  863. if ( g_bAllBranch )
  864. {// 多店汇总时;
  865. strBranchId = GetDomainFromBranch( m_List.GetItemText(nSelectedItem, 0) );
  866. }
  867. else
  868. {
  869. if ( g_branchname.IsEmpty() )
  870. {// 连接本店时;
  871. strBranchId = g_domain;
  872. }
  873. else
  874. {// 连接分店时;
  875. strBranchId = GetDomainFromBranch( g_branchname );
  876. }
  877. }
  878. // 获取订单号;
  879. strOrderNum = m_List.GetItemText(nSelectedItem, 0 + m_nAdd);
  880. // 获取顾客信息;
  881. strCustomerInfo = m_List.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List.GetItemText(nSelectedItem, 2 + m_nAdd);
  882. // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  883. if ( _T("若dindan表字段 txtype== '成长套系'") )
  884. {
  885. // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  886. strScenery = _T("选中的成长套系名");
  887. if ( strScenery == _T("全部") )
  888. {
  889. strScenery.IsEmpty();
  890. }
  891. }
  892. // 导出原片时,是否压缩导出;
  893. DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素;
  894. /////////////////////////////////////////////////////////////////////////////////////////////////
  895. // 获取完信息,开始导出原片;
  896. ImgExportInterface *pExport = NULL;
  897. g_pIEPtr->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
  898. if ( pExport )
  899. {
  900. pExport->ExportOriginalImg(
  901. TRUE,
  902. strBranchId,
  903. strOrderNum,
  904. strCustomerInfo,
  905. !strScenery.IsEmpty(),
  906. strScenery,
  907. _T("*.jpg|*.jpeg"),
  908. dwExportPix,
  909. _T("*.nef|*.cr2|*.raw|*.ra2"),
  910. FALSE,
  911. FALSE
  912. );
  913. }
  914. // 结束;
  915. }
  916. /////////////////////////////////////////////////////////////////////////////////////////////////
  917. // 重写初修导出修片按钮函数;
  918. void BeautifySkinFrom::OnBUTexportphoto2()
  919. {
  920. // 判断登陆用户是否有导出原片的权限;
  921. if ( !IsHasRights2new(9) )
  922. {
  923. AfxMessageBox(_T("您无权限导出初修片!"),MB_ICONINFORMATION);
  924. return;
  925. }
  926. // 获取列表信息:域名、订单号、景点名、顾客信息;
  927. POSITION pos = m_List.GetFirstSelectedItemPosition();
  928. if ( pos == NULL )
  929. {
  930. AfxMessageBox(_T("请选中您要导出初修片的订单!"), MB_ICONINFORMATION);
  931. return;
  932. }
  933. INT nItemCount = m_List.GetItemCount();
  934. INT nSelectedItem = m_List.GetNextSelectedItem(pos);
  935. CString strBranchId = _T("");
  936. CString strOrderNum = _T("");
  937. // 初修列表不支持景点名,需要从其他地方获取;
  938. CString strScenery = _T("");
  939. CString strCustomerInfo = _T("");
  940. // 获取域名;
  941. if ( g_bAllBranch )
  942. {// 多店汇总时;
  943. strBranchId = GetDomainFromBranch( m_List.GetItemText(nSelectedItem, 0) );
  944. }
  945. else
  946. {
  947. if ( g_branchname.IsEmpty() )
  948. {// 连接本店时;
  949. strBranchId = g_domain;
  950. }
  951. else
  952. {// 连接分店时;
  953. strBranchId = GetDomainFromBranch( g_branchname );
  954. }
  955. }
  956. // 获取订单号;
  957. strOrderNum = m_List.GetItemText(nSelectedItem, 0 + m_nAdd);
  958. // 获取顾客信息;
  959. strCustomerInfo = m_List.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List.GetItemText(nSelectedItem, 2 + m_nAdd);
  960. // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  961. if ( _T("若dindan表字段 txtype== '成长套系'") )
  962. {
  963. // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  964. strScenery = _T("选中的成长套系名");
  965. if ( strScenery == _T("全部") )
  966. {
  967. strScenery.IsEmpty();
  968. }
  969. }
  970. // 导出原片时,是否压缩导出;
  971. DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素;
  972. /////////////////////////////////////////////////////////////////////////////////////////////////
  973. // 获取完信息,开始导出原片;
  974. ImgExportInterface *pExport = NULL;
  975. g_pIEPtr->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
  976. if ( pExport )
  977. {
  978. pExport->ExportSecondaryImg(
  979. TRUE,
  980. strBranchId,
  981. strOrderNum,
  982. strCustomerInfo,
  983. !strScenery.IsEmpty(),
  984. strScenery,
  985. _T("*.jpg|*.jpeg"),
  986. dwExportPix,
  987. _T("*.nef|*.cr2|*.raw|*.ra2"),
  988. FALSE,
  989. FALSE
  990. );
  991. }
  992. // 结束;
  993. }
  994. /////////////////////////////////////////////////////////////////////////////////////////////////
  995. // 重写查看初修片按钮函数;
  996. void BeautifySkinFrom::OnBUTshowphoto()
  997. {
  998. POSITION pos = m_List.GetFirstSelectedItemPosition();
  999. if ( pos == NULL )
  1000. {
  1001. AfxMessageBox(_T("请选中您要查看的订单!"), MB_ICONINFORMATION);
  1002. return;
  1003. }
  1004. INT nItemCount = m_List.GetItemCount();
  1005. INT nSelectedItem = m_List.GetNextSelectedItem(pos);
  1006. // 获取域名、订单号、顾客姓名、景点名;
  1007. CString strBranchId = _T("");
  1008. CString strOrderNum = _T("");
  1009. CString strScenery = _T("");
  1010. CString strCustomerInfo = _T("");
  1011. // 获取域名;
  1012. if ( g_bAllBranch )
  1013. {// 多店汇总时;
  1014. strBranchId = GetDomainFromBranch( m_List.GetItemText(nSelectedItem, 0) );
  1015. }
  1016. else
  1017. {
  1018. if ( g_branchname.IsEmpty() )
  1019. {// 连接本店时;
  1020. strBranchId = g_domain;
  1021. }
  1022. else
  1023. {// 连接分店时;
  1024. strBranchId = GetDomainFromBranch( g_branchname );
  1025. }
  1026. }
  1027. // 获取订单号;
  1028. strOrderNum = m_List.GetItemText(nSelectedItem, 0 + m_nAdd);
  1029. // 顾客信息;
  1030. strCustomerInfo = m_List.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List.GetItemText(nSelectedItem, 2 + m_nAdd);
  1031. // 获取景点名;
  1032. strScenery = _T("如果需要,则返回景点名,只查看某个景点,但只限于儿童成长套系!");
  1033. if ( strScenery == _T("全部") )
  1034. {
  1035. // 重置景点名为空,查看整个订单的相片;
  1036. strScenery.Empty();
  1037. }
  1038. //////////////////////////////////////////////////////////////////////////
  1039. // 传参给缩略图对话框;
  1040. ShowPic dlg;
  1041. dlg.m_id = strOrderNum;
  1042. dlg.m_name = strCustomerInfo;
  1043. dlg.m_mode = 2; // 初修片;
  1044. dlg.m_branch = strBranchId;
  1045. // 在ShowPic内部使用kernel模块查找出指定相片路径;
  1046. dlg.DoModal();
  1047. // end;
  1048. }
  1049. /////////////////////////////////////////////////////////////////////////////////////////////////
  1050. // 重写精修导入精修片按钮函数;
  1051. void BeautifySkinFrom2::OnBUTimportphoto()
  1052. {
  1053. POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
  1054. if ( pos == NULL )
  1055. {
  1056. AfxMessageBox(_T("请选中您要导入精修片的订单!"),MB_ICONINFORMATION);
  1057. return;
  1058. }
  1059. INT nItemCount = m_FurtherList.GetItemCount();
  1060. INT nSelectedItem = m_FurtherList.GetNextSelectedItem(pos);
  1061. // 获取列表信息:域名、订单号、顾客信息、精修人、精修状态、精修日期;
  1062. CString strBranchName = _T("");
  1063. CString strBranchId = _T("");
  1064. CString strOrderNum = _T("");
  1065. CString strCustomerInfo = _T("");
  1066. CString strJingxiuRen = _T("");
  1067. CString strJingxiuState = _T("");
  1068. CString strJingxiuDate = _T("");
  1069. // 获取域名;
  1070. if ( g_bAllBranch )
  1071. {// 多店汇总时;
  1072. strBranchName = m_FurtherList.GetItemText(nSelectedItem, 0);
  1073. strBranchId = GetDomainFromBranch( strBranchName );
  1074. }
  1075. else
  1076. {
  1077. if ( g_branchname.IsEmpty() )
  1078. {// 连接本店时;
  1079. strBranchId = g_domain;
  1080. }
  1081. else
  1082. {// 连接分店时;
  1083. strBranchName = g_branchname;
  1084. strBranchId = GetDomainFromBranch( g_branchname );
  1085. }
  1086. }
  1087. // 获取订单号;
  1088. strOrderNum = m_FurtherList.GetItemText(nSelectedItem, 0 + m_nAdd);
  1089. // 获取精修师;
  1090. strJingxiuRen = m_FurtherList.GetItemText(nSelectedItem, 11 + m_nAdd);
  1091. // 获取精修状态;
  1092. strJingxiuState = m_FurtherList.GetItemText(nSelectedItem, 6 + m_nAdd);
  1093. // 获取精修日期;
  1094. strJingxiuDate = m_FurtherList.GetItemText(nSelectedItem, 7 + m_nAdd);
  1095. // 获取顾客信息;
  1096. strCustomerInfo = m_FurtherList.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_FurtherList.GetItemText(nSelectedItem, 2 + m_nAdd);
  1097. CDlgChuXiuInfo xpdlg;
  1098. xpdlg.m_strOrderNumber = strOrderNum;
  1099. xpdlg.m_strXiupianRen = strJingxiuRen;
  1100. if ( strJingxiuState == _T("OK") )
  1101. xpdlg.m_nXiupianStatus = 0;
  1102. else if ( strJingxiuState == _T("修片中"))
  1103. xpdlg.m_nXiupianStatus = 1;
  1104. else if ( strJingxiuState == _T("未修"))
  1105. xpdlg.m_nXiupianStatus = 2;
  1106. CString strSQL = _T("");
  1107. if ( xpdlg.DoModal() == IDOK )
  1108. {
  1109. if ( xpdlg.m_bGrowthTx )
  1110. strScenery = xpdlg.m_strScenery;
  1111. if ( xpdlg.m_nXiupianStatus == 0 )
  1112. strJingxiuState = _T("OK");
  1113. else if ( xpdlg.m_nXiupianStatus == 1)
  1114. strJingxiuState = _T("修片中");
  1115. else if ( xpdlg.m_nXiupianStatus == 2 )
  1116. strJingxiuState = _T("未修");
  1117. strJingxiuRen = xpdlg.m_strXiupianRen;
  1118. if (strJingxiuDate.IsEmpty())
  1119. strSQL.Format(_T("update dindan set waiter7 = '%s', status6 = '%s', time9 = '%s' where id = '%s' "), strJingxiuRen, strJingxiuState, g_date, strOrderNum);
  1120. else
  1121. strSQL.Format(_T("update dindan set waiter7 = '%s', status6 = '%s' where id = '%s'"), strJingxiuRen, strJingxiuState, strOrderNum);
  1122. // 构建更新包,发送到服务端更新数据;
  1123. g_sendhead.bsql = TRUE;
  1124. if ( g_bAllBranch )
  1125. { // 多店汇总时;
  1126. g_branchip = GetBranchIPbyId(strBranchId);
  1127. g_pMainWnd->OnDisconnect();
  1128. g_branchname = strBranchName;
  1129. g_bBranchModify = TRUE;
  1130. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  1131. g_pMainWnd->OnDisconnect();
  1132. g_bBranchModify = FALSE;
  1133. g_branchip = g_branchname = "";
  1134. }
  1135. else
  1136. {// 连接本店或分店时;
  1137. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  1138. }
  1139. /////////////////////////////////////////////////////////////////////////////////////////////////
  1140. // 接收服务器返回的数据,并刷新界面;
  1141. if (g_bSendOK == 0)
  1142. {
  1143. OutputDebugString(_T("接收服务信息失败\n"));
  1144. return;
  1145. }
  1146. if ( g_bAllBranch == 0)
  1147. {// 连接本店或分店时;
  1148. GetData();
  1149. }
  1150. else
  1151. {// 多店汇总时;
  1152. for (int i = 0; i < m_List1array.GetSize(); i++)
  1153. {
  1154. if ( strOrderNum == m_List1array.ElementAt(i).ElementAt(1) && strBranchName == m_List1array.ElementAt(i).ElementAt(0))
  1155. {
  1156. m_List1array.ElementAt(i).SetAt(6 + m_nAdd, strJingxiuState);
  1157. if ( strJingxiuDate.IsEmpty() )
  1158. m_List1array.ElementAt(i).SetAt(7 + m_nAdd, g_date);
  1159. m_List1array.ElementAt(i).SetAt(11 + m_nAdd, strJingxiuRen);
  1160. FillGrid();
  1161. break;
  1162. }
  1163. }
  1164. }
  1165. }
  1166. ImgImportInterface *pImport = NULL;
  1167. g_pIMSProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
  1168. if ( pImport )
  1169. {
  1170. pImport->ImportFurtherImg(
  1171. FALSE, // 文件夹形式打开源或多选文件形式;
  1172. strBranchId, // 分店域名;
  1173. strOrderNum, // 订单号;
  1174. strCustomerInfo, // 顾客信息,可任意组合;
  1175. FALSE, // 导入时,是否生成景点名文件夹;
  1176. NULL, // 导入时,景点名;
  1177. _T("*.jpg|*.jpeg"), // 导入时,主扩展名相片;
  1178. INVALID_COPY_PIX, // 导入时,主扩展名相片的压缩像素;
  1179. _T("*.nef|*.cr2"), // 导入时,附加的扩展名相片;
  1180. TRUE, // 导入时,是否生成缩略图;
  1181. SET_PIX(100,100), // 导入时,生成的缩略图像素大小;
  1182. FALSE // 导入时,文件存在时是否覆盖;
  1183. );
  1184. }
  1185. // 结束;
  1186. }
  1187. /////////////////////////////////////////////////////////////////////////////////////////////////
  1188. // 重写查看精修片按钮函数;
  1189. void BeautifySkinFrom2::OnBUTshowphoto()
  1190. {
  1191. POSITION pos = m_List.GetFirstSelectedItemPosition();
  1192. if ( pos == NULL )
  1193. {
  1194. AfxMessageBox(_T("请选中您要查看的订单!"), MB_ICONINFORMATION);
  1195. return;
  1196. }
  1197. INT nItemCount = m_List.GetItemCount();
  1198. INT nSelectedItem = m_List.GetNextSelectedItem(pos);
  1199. // 获取域名、订单号、顾客姓名、景点名;
  1200. CString strBranchId = _T("");
  1201. CString strOrderNum = _T("");
  1202. CString strScenery = _T("");
  1203. CString strCustomerInfo = _T("");
  1204. // 获取域名;
  1205. if ( g_bAllBranch )
  1206. {// 多店汇总时;
  1207. strBranchId = GetDomainFromBranch( m_List.GetItemText(nSelectedItem, 0) );
  1208. }
  1209. else
  1210. {
  1211. if ( g_branchname.IsEmpty() )
  1212. {// 连接本店时;
  1213. strBranchId = g_domain;
  1214. }
  1215. else
  1216. {// 连接分店时;
  1217. strBranchId = GetDomainFromBranch( g_branchname );
  1218. }
  1219. }
  1220. // 获取订单号;
  1221. strOrderNum = m_List.GetItemText(nSelectedItem, 0 + m_nAdd);
  1222. // 顾客信息;
  1223. strCustomerInfo = m_List.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List.GetItemText(nSelectedItem, 2 + m_nAdd);
  1224. // 获取景点名;
  1225. strScenery = _T("如果需要,则返回景点名,只查看某个景点,但只限于儿童成长套系!");
  1226. if ( strScenery == _T("全部") )
  1227. {
  1228. // 重置景点名为空,查看整个订单的相片;
  1229. strScenery.Empty();
  1230. }
  1231. //////////////////////////////////////////////////////////////////////////
  1232. // 传参给缩略图对话框;
  1233. ShowPic dlg;
  1234. dlg.m_id = strOrderNum;
  1235. dlg.m_name = strCustomerInfo;
  1236. dlg.m_mode = 2; // 初修片;
  1237. dlg.m_branch = strBranchId;
  1238. // 在ShowPic内部使用kernel模块查找出指定相片路径;
  1239. dlg.DoModal();
  1240. // end;
  1241. }
  1242. /////////////////////////////////////////////////////////////////////////////////////////////////
  1243. // 重写精修导出精修片按钮函数;
  1244. void BeautifySkinFrom2::OnBUTexportphoto2()
  1245. {
  1246. // 判断登陆用户是否有导出精修片的权限;
  1247. if ( !IsHasRights2new(11) )
  1248. {
  1249. AfxMessageBox(_T("您无权限导出原片!"),MB_ICONINFORMATION);
  1250. return;
  1251. }
  1252. // 获取列表信息:域名、订单号、景点名、顾客信息;
  1253. POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
  1254. if ( pos == NULL )
  1255. {
  1256. AfxMessageBox(_T("请选中您要导出原片的订单!"), MB_ICONINFORMATION);
  1257. return;
  1258. }
  1259. INT nItemCount = m_FurtherList.GetItemCount();
  1260. INT nSelectedItem = m_FurtherList.GetNextSelectedItem(pos);
  1261. CString strBranchId = _T("");
  1262. CString strOrderNum = _T("");
  1263. // 初修列表不支持景点名,需要从其他地方获取;
  1264. CString strScenery = _T("");
  1265. CString strCustomerInfo = _T("");
  1266. // 获取域名;
  1267. if ( g_bAllBranch )
  1268. {// 多店汇总时;
  1269. strBranchId = GetDomainFromBranch( m_FurtherList.GetItemText(nSelectedItem, 0) );
  1270. }
  1271. else
  1272. {
  1273. if ( g_branchname.IsEmpty() )
  1274. {// 连接本店时;
  1275. strBranchId = g_domain;
  1276. }
  1277. else
  1278. {// 连接分店时;
  1279. strBranchId = GetDomainFromBranch( g_branchname );
  1280. }
  1281. }
  1282. // 获取订单号;
  1283. strOrderNum = m_FurtherList.GetItemText(nSelectedItem, 0 + m_nAdd);
  1284. // 获取顾客信息;
  1285. strCustomerInfo = m_FurtherList.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_FurtherList.GetItemText(nSelectedItem, 2 + m_nAdd);
  1286. // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  1287. IsGrowthTx IsGrowthtxdlg;
  1288. IsGrowthtxdlg.m_mode = 1;
  1289. IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
  1290. IsGrowthtxdlg.DoModal();
  1291. if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
  1292. {
  1293. return;
  1294. }
  1295. if ( IsGrowthtxdlg.m_bGrowthTx )
  1296. {
  1297. // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  1298. strScenery = IsGrowthtxdlg.m_seltxname;
  1299. if ( strScenery == _T("全部") )
  1300. {
  1301. strScenery.Empty();
  1302. }
  1303. }
  1304. // 导出原片时,是否压缩导出;
  1305. DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素;
  1306. /////////////////////////////////////////////////////////////////////////////////////////////////
  1307. // 获取完信息,开始导出原片;
  1308. ImgExportInterface *pExport = NULL;
  1309. g_pIMSProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
  1310. if ( pExport )
  1311. {
  1312. pExport->ExportFurtherImg(
  1313. TRUE,
  1314. strBranchId,
  1315. strOrderNum,
  1316. strCustomerInfo,
  1317. !strScenery.IsEmpty(),
  1318. strScenery,
  1319. _T("*.jpg|*.jpeg"),
  1320. dwExportPix,
  1321. _T("*.nef|*.cr2|*.raw|*.ra2"),
  1322. FALSE,
  1323. FALSE
  1324. );
  1325. }
  1326. g_pIMSProcess->Release();
  1327. // 结束;
  1328. }
  1329. /////////////////////////////////////////////////////////////////////////////////////////////////
  1330. // 重写精修导出选好的片按钮函数; // 未完!
  1331. void BeautifySkinFrom2::OnBUTexportphoto() // 导出选好的片 按钮;
  1332. {
  1333. // 判断用户是否有权限导出选好的片;
  1334. if ( !IsHasRights2new(10) )
  1335. {
  1336. AfxMessageBox(_T("您没有权限导出选好的片!"));
  1337. return;
  1338. }
  1339. // 获取列表信息;
  1340. POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
  1341. if ( pos == NULL )
  1342. {
  1343. AfxMessageBox(__T("请选中您要导片的订单!"));
  1344. return;
  1345. }
  1346. INT nItemCount = m_FurtherList.GetItemCount();
  1347. INT nSelectedItem = m_FurtherList.GetNextSelectedItem(pos);
  1348. // 获取域名、订单号、景点名、顾客信息、选片人、选片状态、选片日期;
  1349. CString strBranchName = _T("");
  1350. CString strBranchId = _T("");
  1351. CString strOrderNum = _T("");
  1352. CString strScenery = _T("");
  1353. CString strCustomerInfo = _T("");
  1354. CString strXuanpianRen = _T("");
  1355. CString strXuanpianState = _T("");
  1356. CString strXuanpianDate = _T("");
  1357. // 获取订单号;
  1358. strOrderNum = m_FurtherList.GetItemText(nSelectedItem, 0 + m_nAdd);
  1359. // 获取顾客信息;
  1360. strCustomerInfo = m_FurtherList.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_FurtherList.GetItemText(nSelectedItem, 2 + m_nAdd);
  1361. // 获取选片状态;
  1362. strXuanpianState = m_FurtherList.GetItemText(nSelectedItem, 4 + m_nAdd);
  1363. // 获取选片日期;
  1364. strXuanpianRen = m_FurtherList.GetItemText(nSelectedItem, 5 + m_nAdd);
  1365. if ( strXuanpianState == _T("未选") )
  1366. {
  1367. MessageBox(_T("此单未选片!"), _T("影楼管理"), MB_OK | MB_TOPMOST | MB_ICONINFORMATION );
  1368. return;
  1369. }
  1370. // 获取域名;
  1371. if ( g_bAllBranch )
  1372. {// 多店汇总;
  1373. strBranchName = m_FurtherList.GetItemText(nSelectedItem, 0);
  1374. strBranchId = GetDomainFromBranch(strBranchName);
  1375. }
  1376. else
  1377. {
  1378. if ( g_branchname.IsEmpty() )
  1379. {// 连接本店时;
  1380. strBranchId = g_domain;
  1381. }
  1382. else
  1383. {//连接分店时;
  1384. strBranchName = g_branchname;
  1385. strBranchId = GetDomainFromBranch( g_branchname );
  1386. }
  1387. }
  1388. // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
  1389. IsGrowthTx IsGrowthtxdlg;
  1390. IsGrowthtxdlg.m_mode = 1;
  1391. IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
  1392. IsGrowthtxdlg.DoModal();
  1393. if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
  1394. {
  1395. return;
  1396. }
  1397. if ( IsGrowthtxdlg.m_bGrowthTx )
  1398. {
  1399. // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
  1400. strScenery = IsGrowthtxdlg.m_seltxname;
  1401. if ( strScenery == _T("全部") )
  1402. {
  1403. strScenery.Empty();
  1404. }
  1405. }
  1406. /////////////////////////////////////////////////////////////////////////////////////////////////
  1407. // 与服务器通信获取指定条件的订单商品信息;
  1408. CString strSQL = _T("");
  1409. #ifdef CHILD_VERSION
  1410. if ( IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
  1411. strSQL.Format(_T("id='%s' and growthtxname = '%s'; id='%s'; id='%s' and name <> '入册' and name <> '入底'"), strOrderNum, strScenery, strOrderNum, strOrderNum);
  1412. else
  1413. strSQL.Format(_T("id='%s'; id='%s'; id='%s' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
  1414. #else
  1415. strSQL.Format(_T("id='%s'; id='%s'; id='%s' and kind <> '2' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
  1416. #endif//CHILD_VERSION
  1417. g_sendhead.bsql = FALSE;
  1418. g_sendhead.code[0] = 50; // dindansp;
  1419. g_sendhead.code[1] = 11; // dindan;
  1420. g_sendhead.code[2] = 56; // dindansp;
  1421. g_sendhead.tabcount = 3;
  1422. if( g_bAllBranch )
  1423. {//多店汇总时;
  1424. g_branchip = GetBranchIPbyId(strBranchId);
  1425. g_pMainWnd->OnDisconnect();
  1426. g_branchname = strBranchName;
  1427. g_bBranchModify = TRUE;
  1428. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  1429. g_pMainWnd->OnDisconnect();
  1430. g_bBranchModify = FALSE;
  1431. g_branchip = g_branchname = _T("");
  1432. }
  1433. else
  1434. {// 连接本店或分店时;
  1435. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  1436. }
  1437. if( !g_bSendOK )
  1438. return ;
  1439. CArray<CStringArray, CStringArray> Arydindan;
  1440. CArray<CStringArray, CStringArray> Arydindansp;
  1441. CArray<CStringArray, CStringArray> Arydindansp2;
  1442. DataToArray( &Arydindansp, &Arydindan, &Arydindansp2 );
  1443. CString strTemp = _T("");
  1444. CStringArray AryImgNums;
  1445. CStringArray AryPerImgGoods;
  1446. // 获取所有dindansp记录no字段中的相片编号;
  1447. int i = 0;
  1448. int nSize = Arydindansp.GetSize();
  1449. for ( i = 0; i < nSize; i++)
  1450. {
  1451. strTemp = Arydindansp.ElementAt(i).ElementAt(6); // dindansp表中的no字段;
  1452. GetNo(strTemp, AryImgNums);
  1453. }
  1454. // 获取每张相片编号对应的商品,每个商品间用分号隔开;
  1455. nSize = AryImgNums.GetSize();
  1456. AryPerImgGoods.SetSize(nSize);
  1457. for ( i = 0; i < nSize; i++ )
  1458. {
  1459. strTemp = AryImgNums.ElementAt(i);
  1460. AryPerImgGoods.SetAt(i, GetSelName(strTemp, Arydindansp));
  1461. }
  1462. // 由于VC6.0传CStringArray给VC9.0DLL 时,会产生无法避免的兼容性问题,故使用CString传;
  1463. CString strImgNums = _T("");
  1464. for ( i = 0; i < AryImgNums.GetSize(); i++ )
  1465. {
  1466. strImgNums += AryImgNums.ElementAt(i);
  1467. strImgNums += _T("?|?");
  1468. }
  1469. CString strPerImgGoods = _T("");
  1470. for ( i = 0; i < AryPerImgGoods.GetSize(); i++ )
  1471. {// 商品名称,应该禁止包含非法字符;
  1472. strPerImgGoods += AryPerImgGoods.ElementAt(i);
  1473. strPerImgGoods += _T("?|?");
  1474. }
  1475. // 再选择导出的是初修片、原片、初修+原片,并且是否按产品生成文件夹分类相片或者相片名后带产品名;
  1476. SelectPhotoDlg selectdlg;
  1477. selectdlg.DoModal();
  1478. BOOL bExportWithName = selectdlg.m_check1;
  1479. INT bExportMode = selectdlg.m_mode; // 0 原片+初修, 1 原片, 2 初修;
  1480. ImgExportInterface *pExport = NULL;
  1481. g_pIMSProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
  1482. if ( pExport )
  1483. {// 导出选好的片;
  1484. INT nCount = pExport->ExportSelectedBeautifyImg(
  1485. strBranchId,
  1486. strOrderNum,
  1487. strCustomerInfo,
  1488. !strScenery.IsEmpty(),
  1489. strScenery,
  1490. _T("*.jpg|*.jpeg"),
  1491. INVALID_COPY_PIX,
  1492. _T("*.nef|*.cr2|*.raw|"),
  1493. FALSE,
  1494. bExportWithName,
  1495. IsGrowthtxdlg.m_bGrowthTx,
  1496. bExportMode,
  1497. strImgNums,
  1498. strPerImgGoods,
  1499. Arydindan.ElementAt(0).ElementAt(60)
  1500. );
  1501. OutputDebugString(_T("导出选好的片!\n"));
  1502. }
  1503. pExport->Release();
  1504. // 读取出选片的客户要求;
  1505. CString strCustomerRequire = _T("");
  1506. if ( Arydindan.GetSize())
  1507. {
  1508. }
  1509. }