DesignFrom.cpp 62 KB

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