12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702 |
- // DesignFrom.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "DesignFrom.h"
- #include "MyMdi.H"
- #include "ModifyDinDan.h"
- #include "ImportPhoto.h"
- #include "ClientRequirement.h"
- #include "ChooseDesignSkin.h"
- #include "./helper/ffsco.h"
- #include "SelectPhotoDlg.h"
- #include "ShowPic.h"
- #include "Login2.h"
- #include "ShowCut.h"
- #include "CompressOption.h"
- #include "DlgChuXiuInfo.h"
- #include "N8Process.h"
- #include "DlgN8ViewReuslt.h"
- #include "DlgCloudSelection.h"
- #include "DlgCloundResult.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- #pragma comment(lib, "Shlwapi.lib")
- IMPLEMENT_DYNCREATE(DesignFrom, MyFormView)
- DesignFrom::DesignFrom() : MyFormView(DesignFrom::IDD)
- {
- m_filter = _T("");
- m_nAdd = 0;
- if (g_bAllBranch)
- {
- m_nAdd = 1;
- }
- }
- DesignFrom::~DesignFrom()
- {
- }
- void DesignFrom::DoDataExchange(CDataExchange* pDX)
- {
- MyFormView::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_COMBO1, m_combo1);
- DDX_Control(pDX, IDC_LIST2, m_List1);
- DDX_Control(pDX, IDC_STATIC1, m_static1);
- DDX_CBString(pDX, IDC_COMBO1, m_filter);
- }
- BEGIN_MESSAGE_MAP(DesignFrom, MyFormView)
- ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
- ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
- ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
- ON_WM_TIMER()
- ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
- ON_BN_CLICKED(IDC_BUTexportphoto, OnBUTexportphoto)
- ON_BN_CLICKED(IDC_BUTimportphoto, OnBUTimportphoto)
- ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
- ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
- ON_BN_CLICKED(IDC_BUTimportphoto2, OnBUTimportphoto2)
- ON_BN_CLICKED(IDC_BUTimportphoto3, OnBUTimportphoto3)
- ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
- ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
- ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
- ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3)
- ON_BN_CLICKED(BTN_CloundXY, OnBnClickedCloundxy)
- ON_BN_CLICKED(BTN_RESULT, OnBnClickedResult)
- END_MESSAGE_MAP()
- #ifdef _DEBUG
- void DesignFrom::AssertValid() const
- {
- MyFormView::AssertValid();
- }
- void DesignFrom::Dump(CDumpContext& dc) const
- {
- MyFormView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- void DesignFrom::OnInitialUpdate()
- {
- MyFormView::OnInitialUpdate();
- CMyMdi Mdi;
- Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
- GetDlgItem(IDC_BUTimportphoto3)->EnableWindow(IsHasRights2new(12));
- GetDlgItem(IDC_BUTTON3)->EnableWindow(IsHasRights2new(12));
- GetDlgItem(IDC_BUTshowphoto)->EnableWindow(IsHasRights2new(15));
- CRect rc2;
- GetWindowRect(rc2);
- ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
- EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
- if (g_bAllBranch == 0)
- {
- int idarray[] = { IDC_BUTexportphoto, IDC_BUTimportphoto, IDC_BUTimportphoto2, IDC_BUTimportphoto3, IDC_BUTshowphoto, IDC_BUTTON3, IDC_BUTclose };
- int idcount = 7;
- int btnwid;
- CRect prerc;
- for (int a = idcount - 2; a >= 0; a--)
- {
- GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
- ScreenToClient(prerc);
- GetDlgItem(idarray[a])->GetWindowRect(rc2);
- ScreenToClient(rc2);
- btnwid = rc2.Width();
- rc2.right = prerc.left;
- rc2.left = rc2.right - btnwid;
- GetDlgItem(idarray[a])->MoveWindow(rc2);
- }
- }
- else
- {
- GetDlgItem(IDC_BUTshowphoto)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_BUTprint3)->ShowWindow(SW_SHOWNORMAL);
- int idarray[] = { IDC_BUTprint3, IDC_BUTexportphoto, IDC_BUTimportphoto, IDC_BUTimportphoto2, IDC_BUTimportphoto3, IDC_BUTTON3, IDC_BUTclose };
- int idcount = 7;
- int btnwid;
- CRect prerc;
- for (int a = idcount - 2; a >= 0; a--)
- {
- GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
- ScreenToClient(prerc);
- GetDlgItem(idarray[a])->GetWindowRect(rc2);
- ScreenToClient(rc2);
- btnwid = rc2.Width();
- rc2.right = prerc.left;
- rc2.left = rc2.right - btnwid;
- GetDlgItem(idarray[a])->MoveWindow(rc2);
- }
- }
- m_static1.SetFont(&g_titlefont);
- // Jeff.在精修状态后添加精修日期;
- if (g_bAllBranch == 0)
- {
- #ifdef CHILD_VERSION
- // 19 列;
- m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;精修,100;精修日期,100;设计,100;设计日期,100;看设计,100;看设计日期,100;加急,100;取件日期,100;看设计要求,100;接单人,100;看设计人,100;设计师,100;套系名称,100;套系价格,100;手机,100;固定电话,100");
- #else
- // 19 列;
- m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;精修,100;精修日期,100;设计,100;设计日期,100;看设计,100;看设计日期,100;加急,100;取件日期,100;看设计要求,100;接单人,100;看设计人,100;设计师,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
- #endif
- m_List1.LoadColumnInfo(119);
- }
- else
- {
- #ifdef CHILD_VERSION
- // 20 列;
- m_List1.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;精修,100;精修日期,100;设计,100;设计日期,100;看设计,100;看设计日期,100;加急,100;取件日期,100;看设计要求,100;接单人,100;看设计人,100;设计师,100;套系名称,100;套系价格,100;手机,100;固定电话,100");
- #else
- m_List1.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;精修,100;精修日期,100;设计,100;设计日期,100;看设计,100;看设计日期,100;加急,100;取件日期,100;看设计要求,100;接单人,100;看设计人,100;设计师,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
- #endif
- m_List1.LoadColumnInfo(199);
- }
- GetData();
- m_combo1.AddString(g_user.name);
- m_combo1.GetWindowRect(rc2);
- ScreenToClient(rc2);
- rc2.bottom += 200;
- m_combo1.MoveWindow(rc2);
- GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
- SetComboHei(&m_combo1, rc2.Height());
- GetDlgItem(IDC_BUTexportphoto)->EnableWindow(IsHasRights2new(11));
- m_bN8 = AfxGetApp()->GetProfileInt(LYFZVERSION, "N8SampleChoose", 0);
- if ( m_bN8 )
- {
- SetDlgItemText(IDC_STATIC1,_T("N8选版"));
- SetDlgItemText(IDC_BUTimportphoto, _T("导入N8选版"));
- SetDlgItemText(IDC_BUTTON3, _T("导出N8选版"));
- SetDlgItemText(IDC_BUTshowphoto, _T("N8选版"));
- GetDlgItem(IDC_BUTimportphoto2)->ShowWindow(SW_HIDE);
- GetDlgItem(IDC_BUTimportphoto3)->ShowWindow(SW_HIDE);
- // 移动按钮位置;
- CRect rc;
- GetDlgItem(IDC_BUTimportphoto)->GetWindowRect(rc);
- ScreenToClient(rc);
- printf("top:%d, left:%d, right:%d, bottom:%d, width=%d\n", rc.top, rc.left, rc.right, rc.bottom, rc.Width());
- rc.OffsetRect(rc.Width() + 1, 0);
- GetDlgItem(IDC_BUTshowphoto)->MoveWindow(rc);
- rc.OffsetRect(rc.Width() + 1, 0);
- GetDlgItem(IDC_BUTTON3)->MoveWindow(rc);
- }
- if ( !g_bEnableClound )
- {
- GetDlgItem(BTN_CloundXY)->ShowWindow(SW_HIDE);
- GetDlgItem(BTN_RESULT)->ShowWindow(SW_HIDE);
- }
- }
- void DesignFrom::FillGrid(BOOL bStatus)
- {
- if (g_bSearchFilter) // 开启条件查询;
- {
- m_List1.DeleteAllItems2();
- int ii = 0;
- m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
- int count = 0;
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (g_filterdate1 != "")
- {
- // 查询条件==设计日期; 原本在列5
- if (m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) < g_filterdate1 || m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) > g_filterdate2)
- continue;
- }
- if (g_waiter1 != "")
- {
- // 查询条件==设计师; 原本在列13
- if (m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd) != g_waiter1)
- continue;
- }
- if (g_bAllBranch && g_filterbranch != "")
- {
- if (m_List1array.ElementAt(ii).ElementAt(0) != g_filterbranch)
- continue;
- }
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- m_List1.m_arLabels.SetSize(count, 1);
- ii = count;
- m_List1.m_LabelCount = ii;
- m_List1.SetItemCountEx(ii);
- CString str;
- str.Format("单数:%d", ii);
- SetDlgItemText(IDC_STATIC2, str);
- }
- else // 未开启条件查询;
- {
- m_List1.DeleteAllItems2();
- int ii = 0;
- m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
- int count = 0;
- if (m_filter.IsEmpty())
- {
- if (bStatus)
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- // 查询条件==精修状态&&设计状态(原本列4);
- if (m_List1array.ElementAt(ii).ElementAt(3 + m_nAdd) == "OK" && m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK")
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- else
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- else
- {
- if (bStatus)
- {
- int type = GetType(m_filter);
- if (type == 1)//电话
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- // 查询条件==精修状态&&设计状态 &&(手机(原列16)||座机(原列17))
- if (m_List1array.ElementAt(ii).ElementAt(3 + m_nAdd) == "OK" &&
- m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK" &&
- (m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1 || m_List1array.ElementAt(ii).ElementAt(18 + m_nAdd).Find(m_filter) != -1))
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- else if (type == 2)//拼音
- {
- m_filter.MakeUpper();
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- // 查询条件==精修状态&&设计状态 &&(拼音1(原列18)||拼音2(原列19))
- if (m_List1array.ElementAt(ii).ElementAt(3 + m_nAdd) == "OK"
- &&m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"
- && (m_List1array.ElementAt(ii).ElementAt(19 + m_nAdd).Find(m_filter) != -1 || m_List1array.ElementAt(ii).ElementAt(20 + m_nAdd).Find(m_filter) != -1))
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- else
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- // 查询条件==精修状态&&设计状态 &&(……)
- if (m_List1array.ElementAt(ii).ElementAt(3 + m_nAdd) == "OK" &&
- m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK" &&
- (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(12).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(18).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(19).Find(m_filter) != -1))
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- }
- else
- {
- int type = GetType(m_filter);
- if (type == 1)//电话
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- // 查询条件==手机(原列16)||座机(原列17)
- if (m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1 ||
- m_List1array.ElementAt(ii).ElementAt(18 + m_nAdd).Find(m_filter) != -1)
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- else if (type == 2)//拼音
- {
- m_filter.MakeUpper();
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- // 查询条件==精拼音1(原列18)||拼音2(原列19)
- if (m_List1array.ElementAt(ii).ElementAt(19 + m_nAdd).Find(m_filter) != -1 ||
- m_List1array.ElementAt(ii).ElementAt(20 + m_nAdd).Find(m_filter) != -1)
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- else
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (m_List1array.ElementAt(ii).ElementAt(0).Find(m_filter) != -1 ||
- m_List1array.ElementAt(ii).ElementAt(1).Find(m_filter) != -1 ||
- m_List1array.ElementAt(ii).ElementAt(2).Find(m_filter) != -1 ||
- m_List1array.ElementAt(ii).ElementAt(3).Find(m_filter) != -1 ||
- m_List1array.ElementAt(ii).ElementAt(12).Find(m_filter) != -1 ||
- m_List1array.ElementAt(ii).ElementAt(13).Find(m_filter) != -1 ||
- m_List1array.ElementAt(ii).ElementAt(14).Find(m_filter) != -1 ||
- m_List1array.ElementAt(ii).ElementAt(15).Find(m_filter) != -1 ||
- m_List1array.ElementAt(ii).ElementAt(16).Find(m_filter) != -1 ||
- m_List1array.ElementAt(ii).ElementAt(17).Find(m_filter) != -1 ||
- m_List1array.ElementAt(ii).ElementAt(18).Find(m_filter) != -1 ||
- m_List1array.ElementAt(ii).ElementAt(19).Find(m_filter) != -1)
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- }
- }
- m_List1.m_arLabels.SetSize(count, 1);
- ii = count;
- m_List1.m_LabelCount = ii;
- m_List1.SetItemCountEx(ii);
- CString str;
- str.Format("单数:%d", ii);
- SetDlgItemText(IDC_STATIC2, str);
- }
- if (!g_id.IsEmpty())
- {
- for (int i = 0; i < m_List1.GetItemCount(); i++)
- {
- if (g_id == m_List1.GetItemText(i, 0 + m_nAdd))
- {
- m_List1.SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
- m_List1.EnsureVisible(i, FALSE);
- break;
- }
- }
- }
- }
- void DesignFrom::OnBUTclose()
- {
- GetParent()->SendMessage(WM_CLOSE);
- }
- void DesignFrom::OnSelchangeCombo1()
- {
- SetTimer(1, 100, NULL);
- }
- void DesignFrom::OnTimer(UINT nIDEvent)
- {
- KillTimer(nIDEvent);
- OnButton1();
- }
- BOOL DesignFrom::PreTranslateMessage(MSG* pMsg)
- {
- try
- {
- if (pMsg->message == WM_KEYDOWN)
- {
- switch (pMsg->wParam)
- {
- case VK_RETURN:
- OnButton1();
- return 1;
- case 0x43: // copy
- if ((GetKeyState(VK_CONTROL) & 0x80))
- {
- GetFocus()->SendMessage(WM_COPY);
- return TRUE;
- }
- break;
- case 0x56: //Ctrl + V:
- if ((GetKeyState(VK_CONTROL) & 0x80))
- {
- GetFocus()->SendMessage(WM_PASTE);
- return TRUE;
- }
- break;
- case 0x58: // cut
- if ((GetKeyState(VK_CONTROL) & 0x80))
- {
- GetFocus()->SendMessage(WM_CUT);
- return TRUE;
- }
- break;
- case 0x5A: //undo
- case 0x59: //redo
- if ((GetKeyState(VK_CONTROL) & 0x80))
- {
- GetFocus()->SendMessage(WM_UNDO);
- return TRUE;
- }
- break;
- }
- }
- else if (pMsg->message == WM_LBUTTONDBLCLK)
- {
- CPoint pt;
- CRect rc, rc2;
- ::GetCursorPos(&pt);
- m_List1.GetWindowRect(rc2);
- if (rc2.PtInRect(pt) == 0)
- return MyFormView::PreTranslateMessage(pMsg);
- pt.x -= rc2.left;
- pt.y -= rc2.top;
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)return MyFormView::PreTranslateMessage(pMsg);
- int iItem = m_List1.GetNextSelectedItem(pos);
- m_List1.GetSubItemRect(iItem, 11 + m_nAdd, LVIR_BOUNDS, rc);
- if (rc.PtInRect(pt))
- {
- CClientRequirement dlg;
- CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- CString str;
- if (g_bAllBranch == 0)
- {
- for (int i = 0; i < m_List1arraybak.GetSize(); i++)
- {
- if (m_List1arraybak.ElementAt(i).ElementAt(0 + m_nAdd) == id)
- {
- str = m_List1arraybak.ElementAt(i).ElementAt(11 + m_nAdd);
- break;
- }
- }
- }
- else
- {
- CString branch = m_List1.GetItemText(iItem, 0);
- for (int i = 0; i < m_List1arraybak.GetSize(); i++)
- {
- if (m_List1arraybak.ElementAt(i).ElementAt(0 + m_nAdd) == id && branch == m_List1array.ElementAt(i).ElementAt(0))
- {
- str = m_List1arraybak.ElementAt(i).ElementAt(11 + m_nAdd);
- break;
- }
- }
- }
- dlg.m_bz2 = str;
- dlg.m_bSave = 0;
- dlg.DoModal();
- }
- }
- }
- catch (...)
- {
- }
- return MyFormView::PreTranslateMessage(pMsg);
- }
- extern int CALLBACK BrowseProc(HWND hwnd, UINT msg, LPARAM lParam, LPARAM lpData);
- /*{
- switch(msg)
- {
- case BFFM_INITIALIZED:
- SendMessage(hwnd, BFFM_SETSELECTION, TRUE, NULL);
- break;
- case BFFM_SELCHANGED:
- {
- char szFileName[MAX_PATH];
- LPITEMIDLIST pidlCurrent = (LPITEMIDLIST)lParam;
- SHGetPathFromIDList(pidlCurrent, szFileName);
- SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM)szFileName);
- }
- break;
- }
- return 0;
- }*/
- void DesignFrom::GetSavePath(CString &path)
- {
- char lpszDisplayName[MAX_PATH], szFileName[MAX_PATH];
- LPITEMIDLIST pidlDesktop, pidlCurrent;
- if (SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidlDesktop) == NOERROR)
- {
- BROWSEINFO bi;
- bi.hwndOwner = this->m_hWnd;
- bi.pidlRoot = pidlDesktop;
- bi.pszDisplayName = lpszDisplayName;
- bi.lpszTitle = "\n文档保存的目录:";
- bi.ulFlags = BIF_STATUSTEXT&BIF_RETURNONLYFSDIRS;
- bi.lpfn = BrowseProc;
- bi.lParam = 0;
- bi.iImage = 0;
- pidlCurrent = SHBrowseForFolder(&bi);
- SHGetPathFromIDList(pidlCurrent, szFileName);
- path = szFileName;
- }
- }
- int DesignFrom::FindArray(CStringArray *pArray, CString Str)
- {
- for (int i = 0; i < pArray->GetSize(); i++)
- {
- if (pArray->ElementAt(i) == Str)
- return i;
- }
- return -1;
- }
- //-----------------------------------------------------------------
- // remark by Jeff 2014-12-12
- // 函数:GetNo
- // 描述:从str中解析出每个相片名,然后存入空的CStringArray中;
- // 参数:
- // str:选好的相片名串,如:"001,002,003" 后分隔符改为"|",结果应是"001|002|003"
- // array:空的数组,用来存放解析后的相片名;
- // 返回:
- // 注意:更换分隔符造成的问题,在该函数已解决;
- //-----------------------------------------------------------------
- void DesignFrom::GetNo(CString str, CStringArray &array)
- {
- if (!str.IsEmpty())
- {
- #ifdef USE_SEP_VEB
- int pos = str.Find(SEPS_VEB);
- #else
- int pos = str.Find(",");
- #endif
- while (pos != -1)
- {
- if (FindArray(&array, str.Left(pos)) == -1)
- array.Add(str.Left(pos));
- str = str.Right(str.GetLength() - pos - 1);
- #ifdef USE_SEP_VEB
- pos = str.Find(SEPS_VEB);
- #else
- pos = str.Find(",");
- #endif
- }
- if (FindArray(&array, str) == -1)
- array.Add(str);
- }
- }
- //-----------------------------------------------------------------
- // remark by Jeff 2014-12-12
- // 函数:GetSelName
- // 描述:
- // 参数:
- // name:由GetNo解析出来后的单个相片名,如:"001"
- // spnamearray:订单下的商品数组,case 50所得;
- // 返回:
- // 注意:更换分隔符造成的问题,在该函数已解决;
- //-----------------------------------------------------------------
- CString DesignFrom::GetSelName(CString name, CArray<CStringArray, CStringArray>&spnamearray)
- {
- CString ret;
- #ifdef USE_SEP_VEB
- name = SEPS_VEB + name + SEPS_VEB;
- #else
- name = "," + name + ",";
- #endif
- CString str;
- for (int i = 0; i < spnamearray.GetSize(); i++)
- {
- #ifdef USE_SEP_VEB
- str = SEPS_VEB + spnamearray.ElementAt(i).ElementAt(8) + SEPS_VEB;
- #else
- str = "," + spnamearray.ElementAt(i).ElementAt(8) + ",";
- #endif
- if (str.Find(name) != -1)
- {
- ret += spnamearray.ElementAt(i).ElementAt(5);
- ret += ";";
- }
- }
- ret.TrimRight(";");
- ret.Replace("*", "x");
- return ret;
- }
- //-----------------------------------------------------------------
- // remark by Jeff 2014-12-12
- // 函数:GetSelName2
- // 描述:
- // 参数:
- // name:由GetNo解析出来后的单个相片名,如:"001"
- // spnamearray:订单下的商品数组,case 50所得;
- // 返回:
- // 注意:更换分隔符造成的问题,在该函数已解决;
- //-----------------------------------------------------------------
- CString DesignFrom::GetSelName2(CString name, CArray<CStringArray, CStringArray>&spnamearray)
- {
- CString ret;
- #ifdef USE_SEP_VEB
- name = SEPS_VEB + name + SEPS_VEB;
- #else
- name = "," + name + ",";
- #endif
- CString str;
- for (int i = 0; i < spnamearray.GetSize(); i++)
- {
- #ifdef USE_SEP_VEB
- str = SEPS_VEB + spnamearray.ElementAt(i).ElementAt(8) + SEPS_VEB;
- #else
- str = "," + spnamearray.ElementAt(i).ElementAt(8) + ",";
- #endif
- if (str.Find(name) != -1)
- {
- ret += spnamearray.ElementAt(i).ElementAt(5);
- ret += ";";
- }
- }
- ret.TrimRight(";");
- ret.Replace("*", "x");
- return ret;
- }
- void DesignFrom::OnBUTexportphoto() // 导出精修好的片 按钮;
- {
- #ifdef USE_KERNEL_DLL
- // 判断登陆用户是否有导出原片的权限;
- if ( !IsHasRights2new(11) )
- {
- AfxMessageBox(_T("您无权限导出原片!"),MB_ICONINFORMATION);
- return;
- }
- // 获取列表信息:域名、订单号、景点名、顾客信息;
- POSITION pos = m_List1.GetFirstSelectedItemPosition();
- if ( pos == NULL )
- {
- AfxMessageBox(_T("请选中您要导出原片的订单!"), MB_ICONINFORMATION);
- return;
- }
- INT nItemCount = m_List1.GetItemCount();
- INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
- CString strBranchId = _T("");
- CString strOrderNum = _T("");
- // 初修列表不支持景点名,需要从其他地方获取;
- CString strScenery = _T("");
- CString strCustomerInfo = _T("");
- // 获取域名;
- if ( g_bAllBranch )
- {// 多店汇总时;
- strBranchId = GetDomainFromBranch( m_List1.GetItemText(nSelectedItem, 0) );
- }
- else
- {
- if ( g_branchname.IsEmpty() )
- {// 连接本店时;
- strBranchId = g_domain;
- }
- else
- {// 连接分店时;
- strBranchId = GetDomainFromBranch( g_branchname );
- }
- }
- // 获取订单号;
- strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
- // 获取顾客信息;
- strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
- // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
- IsGrowthTx IsGrowthtxdlg;
- IsGrowthtxdlg.m_mode = 1;
- IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
- IsGrowthtxdlg.DoModal();
- if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
- {
- return;
- }
- if ( IsGrowthtxdlg.m_bGrowthTx )
- {// 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
- strScenery = IsGrowthtxdlg.m_seltxname;
- if ( strScenery == _T("全部") )
- {
- strScenery.Empty();
- }
- }
- // 导出原片时,是否压缩导出;
- DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素;
- /////////////////////////////////////////////////////////////////////////////////////////////////
- if ( g_pIMGProcess == NULL )
- {
- return ;
- }
- // 获取完信息,开始导出原片;
- ImgExportInterface *pExport = NULL;
- g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
- if ( pExport )
- {
- pExport->ExportFurtherImg(
- TRUE,
- strBranchId,
- strOrderNum,
- strCustomerInfo,
- !strScenery.IsEmpty(),
- strScenery,
- _T("*.jpg|*.jpeg"),
- dwExportPix,
- _T("*.nef|*.cr2|*.raw|*.ra2"),
- FALSE,
- FALSE
- );
- }
- g_pIMGProcess->Release();
- WriteOptLog(_T("导出精修,订单号:%s"),strOrderNum);
- // 结束;
- #else
- if (IsHasRights2new(11) == 0)return;
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要导出片的定单!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List1.GetNextSelectedItem(pos);
- CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- CString branch;
- if (g_bAllBranch)
- branch = m_List1.GetItemText(iItem, 0);
- CString path;
- if (g_bAllBranch)
- {
- CString branchpath = GetBranchPhotoPath(branch);
- path = g_path4 + branchpath + "\\";
- }
- else
- path = g_path4 + "\\";
- path += id;
- path += "\\";
- CStringArray array;
- CString dir;
- GetSavePath(dir);
- if (dir.IsEmpty())
- {
- return;
- }
- CString name1 = m_List1.GetItemText(iItem, 1 + m_nAdd);
- CString name2 = m_List1.GetItemText(iItem, 2 + m_nAdd);
- dir.TrimRight('\\');
- dir += "\\";
- dir += id;
- dir += g_branchname;
- if (g_bAllBranch)
- {
- if (GetBranchPhotoPath(branch) != "")
- dir += branch;
- }
- dir += name1;
- dir += name2;
- dir += "精修好的片";
- dir += "\\";
- ::CreateDirectory(dir, NULL);
- CStringArray desarray;
- CStringArray dirarray;
- CString savepath = dir;
- CString str;
- if (1)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin(); coo.end() != it; it++)
- {
- str = (*it).c_str();
- if (FindArray(&dirarray, str) == -1)
- {
- dirarray.Add(str);
- if (str != dirarray.ElementAt(0))
- {
- str = savepath + str.Right(str.GetLength() - dirarray.ElementAt(0).GetLength());
- if (::CheckFolderFileExist(str) == 0)
- ::CreateDirectory(str, NULL);
- }
- }
- }
- }
- if (1)
- {
- for (int i = 0; i < dirarray.GetSize(); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt(i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin(); coo.end() != it; it++)
- {
- str = (*it).c_str();
- if (str.GetAt(str.ReverseFind('\\') + 1) == 's')continue;
- if (str.GetAt(str.ReverseFind('\\') + 1) == 'm')continue;
- array.Add(str);
- desarray.Add(savepath + dirarray.ElementAt(i).Right(dirarray.ElementAt(i).GetLength() - dirarray.ElementAt(0).GetLength()) + str.Right(str.GetLength() - str.ReverseFind('\\') - 1));
- }
- }
- }
- if (array.GetSize() == 0)
- {
- AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
- return;
- }
- CCompressOption comoptdlg;
- comoptdlg.DoModal();
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- // 导出精修好片;
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- ImportPhoto dlg;
- dlg.m_nOutputSize = comoptdlg.m_nsize; // 1.导出精修片时的尺寸;
- dlg.m_mode = 1; // 2.未知;
- dlg.m_pArray = &array; // 3.作为导出源的精修片路径集合;
- dlg.m_pDesArray = &desarray; // 4.作为导出目标的精修片路径集合;
- dlg.m_savepath = dir; // 5.保存导出精修片的目录;
- dlg.DoModal();
- AfxMessageBox("导片成功!", MB_ICONINFORMATION);
- // CString str;
- str = " 导出精修片 ";
- str += "客人:";
- str += name1 + name2 + id;
- WriteLog(_T("导出精修好片"), str);
- {
- ShowCut dlg;
- dlg.m_branch = branch;
- dlg.m_mode = 1;
- dlg.m_strOrderNum = id;
- dlg.DoModal();
- }
- #endif
- }
- void DesignFrom::OnBUTimportphoto() // 导入设计版/N8选版 按钮;
- {
- #ifdef USE_KERNEL_DLL
- // 获取列表信息;
- POSITION pos = m_List1.GetFirstSelectedItemPosition();
- if ( pos == NULL )
- {
- AfxMessageBox(_T("请选中您要导片的订单号!"), MB_ICONINFORMATION);
- return;
- }
- INT nItemCount = m_List1.GetItemCount();
- INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
- // 订单的设计信息店名、域名、订单号、景点名、顾客信息、设计状态、设计日期、设计师;
- CString strBranchName = _T("");
- CString strBranchId = _T("");
- CString strOrderNum = _T("");
- CString strScenery = _T("");
- CString strCustomerInfo = _T("");
- CString strDesignState = _T("");
- CString strDesignDate = _T("");
- CString strDesigner = _T("");
- // 获取域名;
- if ( g_bAllBranch )
- {// 多店汇总时;
- strBranchName = m_List1.GetItemText(nSelectedItem, 0);
- strBranchId = GetDomainFromBranch( strBranchName );
- }
- else
- {
- if ( g_branchname.IsEmpty() )
- {// 连接本店时;
- strBranchName = _T("");
- strBranchId = g_domain;
- }
- else
- {// 连接分店时;
- strBranchName = g_branchname;
- strBranchId = GetDomainFromBranch( g_branchname );
- }
- }
- // 获取订单号;
- strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
- // 获取设计师;
- strDesigner = m_List1.GetItemText(nSelectedItem, 14 + m_nAdd);
- // 获取设计状态;
- strDesignState = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd);
- // 获取设计日期;
- strDesignDate = m_List1.GetItemText(nSelectedItem, 6 + m_nAdd);
- // 获取顾客信息;
- strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
- CDlgChuXiuInfo xpdlg;
- xpdlg.m_nXiupianMode = 1;
- xpdlg.m_strOrderNumber = strOrderNum;
- xpdlg.m_strXiupianRen = strDesigner;
- if ( strDesignState == _T("OK") )
- xpdlg.m_nXiupianStatus = 0;
- else if ( strDesignState == _T("设计中"))
- xpdlg.m_nXiupianStatus = 1;
- else if ( strDesignState == _T("未设计"))
- xpdlg.m_nXiupianStatus = 2;
- CString strSQL = _T("");
- if( xpdlg.DoModal() == IDOK )
- {
- if ( xpdlg.m_bGrowthTx )
- strScenery = xpdlg.m_strScenery;
- if ( xpdlg.m_nXiupianStatus == 0 )
- strDesignState = _T("OK");
- else if ( xpdlg.m_nXiupianStatus == 1)
- strDesignState = _T("设计中");
- else if ( xpdlg.m_nXiupianStatus == 2 )
- strDesignState = _T("未设计");
- strDesigner = xpdlg.m_strXiupianRen;
- if (strDesignDate.IsEmpty())
- strSQL.Format(_T("update dindan set waiter4 = '%s', status5 = '%s', time10 = '%s' where id = '%s'"), strDesigner, strDesignState, g_date, strOrderNum);
- else
- strSQL.Format(_T("update dindan set waiter4 = '%s', status5 = '%s' where id = '%s'"), strDesigner, strDesignState, strOrderNum);
- /////////////////////////////////////////////////////////////////////////////////////////////////
- // 构建数据包;
- g_sendhead.bsql = TRUE;
- if ( g_bAllBranch )
- {// 多店汇总时;
- g_branchip = GetBranchIPbyId(strBranchId);
- g_pMainWnd->OnDisconnect();
- g_branchname = strBranchName;
- g_bBranchModify = TRUE;
- g_pMainWnd->ProcessChatMessageRequest2(strSQL);
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = FALSE;
- g_branchip = g_branchname = _T("");
- }
- else
- {// 连接本店或分店时;
- g_pMainWnd->ProcessChatMessageRequest2(strSQL);
- }
- // 刷新界面数据;
- if (g_bSendOK == 0)
- {
- OutputDebugString(_T("接收服务器数据失败!\n"));
- return;
- }
- if (g_bAllBranch == 0)
- {// 连接本店或分店时;
- GetData();
- }
- else
- {// 多店汇总时;
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- if (strOrderNum == m_List1array.ElementAt(i).ElementAt(1) && strBranchName == m_List1array.ElementAt(i).ElementAt(0))
- {
- m_List1array.ElementAt(i).SetAt(5 + m_nAdd, strDesignState);
- if (strDesignDate.IsEmpty())
- m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
- m_List1array.ElementAt(i).SetAt(14 + m_nAdd, strDesigner);
- FillGrid();
- break;
- }
- }
- }
- }
- else
- {
- // 开始导入初修片;
- if ( MessageBox(_T("是否现在开始导入设计片!"), _T("导片提示:导入设计片"), MB_TOPMOST|MB_YESNO|MB_ICONWARNING ) != IDYES )
- {// 是否马上导入相片;
- return;
- }
- if ( xpdlg.m_bGrowthTx )
- strScenery = xpdlg.m_strScenery;
- if ( xpdlg.m_bGrowthTx && strScenery.IsEmpty() )
- {
- AfxMessageBox(_T("儿童成长套系导片必须选择套系名!"));
- return;
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////
- if ( g_pIMGProcess == NULL )
- {
- return;
- }
- // 获取完信息,开始导入设计片;
- ImgImportInterface *pImport = NULL;
- g_pIMGProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
- if ( pImport )
- {
- if ( m_bN8 && PathFileExists(g_szN8Path) )
- {// N8选版功能启用;
- pImport->ImportN8(g_szN8ViewUserDir, strBranchId, strOrderNum, strCustomerInfo, !strScenery.IsEmpty(), strScenery, FALSE);
- WriteOptLog(_T("导入N8,订单号:%s"),strOrderNum);
- }
- else
- {
- pImport->ImportDesignImg(
- FALSE, // 相片源的类型:true = 选择文件夹形式; false = 选择文件形式;
- strBranchId, // 分店域名;
- strOrderNum, // 订单号;
- strCustomerInfo, // 顾客信息;
- !strScenery.IsEmpty(), // 导入时是否生成景点名;
- strScenery, // 要导入并生成的景点名;
- _T("*.jpg|*.jpeg"), // 要导入的扩展名;
- INVALID_COPY_PIX, // 要导入的相片的压缩像素大小;INVALID_COPY_PIX表示不压缩,原比例导入;
- _T("*.nef|*.cr2|*.raw|*.ra2"), // 导入相片时,附加要导入的扩展名;附加的相片不设置压缩像素;
- FALSE, // 导入操作时,是否生成缩略图;只生成lpImportExt的;
- INVALID_COPY_PIX, // 要生成的缩略图的像素大小;
- FALSE // 目标文件存在是否复制,只针对lpImportExt和lpImportWithExt对应的文件,缩略图直接覆盖;
- );
- WriteOptLog(_T("导入设计,订单号:%s"),strOrderNum);
- }
-
- g_pIMGProcess->Release();
- }
- // 结束;
- #else
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List1.GetNextSelectedItem(pos);
- CString branch;
- CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- if (g_bAllBranch)
- branch = m_List1.GetItemText(iItem, 0);
- // 原本4,5,改为5,6
- CString oldstatus = m_List1.GetItemText(iItem, 5 + m_nAdd);
- CString time10 = m_List1.GetItemText(iItem, 6 + m_nAdd);
- CString name = m_List1.GetItemText(iItem, 1 + m_nAdd) + "," + m_List1.GetItemText(iItem, 2 + m_nAdd);
- name.TrimLeft(",");
- name.TrimRight(",");
- name = "客人:" + name;
- CString phone = m_List1.GetItemText(iItem, 16 + m_nAdd) + "," + m_List1.GetItemText(iItem, 17 + m_nAdd);
- phone.TrimLeft(",");
- phone.TrimRight(",");
- phone = "电话:" + phone;
- CString strDomain = _T("");
- CString savepath = _T("");
- if (g_bAllBranch)
- strDomain = GetDomainFromBranch(branch);
- else
- {
- if(g_branchname != _T(""))
- strDomain = GetDomainFromBranch(g_branchname);
- }
- //////////////////////////////////////////////////////////////////////////
- // 获取可用的共享目录;
- #if USE_SHARE_FLORD
- TCHAR szSharePath[MAX_PATH] = {0};
- if ( CNetShareInfo::GetInstance()->GetEnableShareDirectory(4, id, strDomain, szSharePath) )
- {
- savepath.Format("%s\\",szSharePath);
- }
- else
- {
- AfxMessageBox(_T("没有可用的共享目录!"));
- return;
- }
- #else
- savepath += id + "\\";
- #endif //#if USE_SHARE_FLORD
-
- if (::CheckFolderFileExist(savepath) == 0)
- ::CreateDirectory(savepath, NULL);
- /* IsGrowthTx growthtxdlg;
- growthtxdlg.m_id=id;
- growthtxdlg.DoModal ();
- if(growthtxdlg.m_bReturnOK==0)
- return;
- if(growthtxdlg.m_bGrowthTx && growthtxdlg.m_seltxname.IsEmpty ())
- return;
- if(!growthtxdlg.m_seltxname.IsEmpty ())
- {
- savepath+=growthtxdlg.m_seltxname+"\\";
- if(::CheckFolderFileExist (savepath)==0)
- ::CreateDirectory (savepath, NULL);
- }*/
- CString srcdir; CString str;
- GetSavePath(srcdir);
- if (srcdir.IsEmpty())
- {
- CString status5;
- if (AfxMessageBox("客照是否全部设计完毕?", MB_YESNO | MB_ICONINFORMATION) == IDYES)
- status5 = "OK";
- else
- status5 = "设计中";
- CString sql;
- if (time10.IsEmpty())
- sql = "update dindan set status5='" + status5 + "',time10='" + g_date + "' where id='" + id + "'";
- else
- sql = "update dindan set status5='" + status5 + "' where id='" + id + "'";
- g_sendhead.bsql = 1;
- if (g_bAllBranch)
- {
- g_branchip = GetIP(branch);
- g_pMainWnd->OnDisconnect();
- g_branchname = branch;
- g_bBranchModify = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0;
- g_branchip = g_branchname = "";
- }
- else
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)return;
- if (g_bAllBranch == 0)
- {
- GetData();
- }
- else
- {
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- if (id == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
- {
- m_List1array.ElementAt(i).SetAt(4 + m_nAdd, status5);
- if (time10.IsEmpty())
- m_List1array.ElementAt(i).SetAt(5 + m_nAdd, g_date);
- FillGrid();
- break;
- }
- }
- }
- return;
- }
- if (srcdir.GetLength() < 4)
- {
- AfxMessageBox("请选择正确的您文件所在的目录!", MB_ICONSTOP);
- return;
- }
- if (oldstatus != "未设计")
- {
- CString str;
- str.Format("%s\r\n%s\r\n此单已导入过设计片, 确认您选中的照片没有导入过吗? 否则会覆盖原来的照片, 是否继续?", name, phone);
- if (AfxMessageBox(str, MB_YESNO | MB_ICONSTOP) != IDYES)
- return;
- }
- else
- {
- CString str;
- str.Format("%s\r\n%s\r\n确认您选中的照片与客户资料相符吗? 是否继续?", name, phone);
- if (AfxMessageBox(str, MB_YESNO | MB_ICONINFORMATION) != IDYES)
- return;
- }
- CStringArray array;
- CStringArray desarray;
- CStringArray dirarray;
- if (1)
- {
- // 1.获取源目录下的所有子目录;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(srcdir), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin(); coo.end() != it; it++)
- {
- str = (*it).c_str();
- if (FindArray(&dirarray, str) == -1)
- {
- dirarray.Add(str);
- if (str != dirarray.ElementAt(0))
- {
- str = savepath + str.Right(str.GetLength() - dirarray.ElementAt(0).GetLength());
- if (::CheckFolderFileExist(str) == 0)
- ::CreateDirectory(str, NULL);
- }
- }
- }
- }
- if (1)
- {
- // 2.从每个子目录下查找所有的相片;
- for (int i = 0; i < dirarray.GetSize(); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt(i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin(); coo.end() != it; it++)
- {
- str = (*it).c_str();
- array.Add(str);
- desarray.Add(savepath + dirarray.ElementAt(i).Right(dirarray.ElementAt(i).GetLength() - dirarray.ElementAt(0).GetLength()) + str.Right(str.GetLength() - str.ReverseFind('\\') - 1));
- }
- }
- }
- if (array.GetSize() == 0)return;
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- // 导入设计的片;
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- ImportPhoto dlg;
- dlg.m_branch = branch; // 1.订单分店名;
- dlg.m_nphototype = 3; // 2.未知;
- dlg.m_pArray = &array; // 3.作为源的设计片路径集合;
- dlg.m_pDesArray = &desarray; // 4.作为目标的设计片路径集合;
- dlg.m_savepath = savepath; // 5.导出时的保存目录;
- #ifdef ENTERPRISE_VERSION
- // if(!g_branchname.IsEmpty ())
- {
- dlg.m_bSaveUploadTask = g_bSaveUploadTask4;
- dlg.m_sel = g_cominfoarraylocal.ElementAt(0).ElementAt(81);
- dlg.m_uploadtaskarray.Add(id + ";" + name);
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- }
- #endif
- dlg.DoModal();
- CString status5;
- if (AfxMessageBox("客照是否全部设计完毕?", MB_YESNO | MB_ICONINFORMATION) == IDYES)
- status5 = "OK";
- else
- status5 = "设计中";
- CString sql;
- if (time10.IsEmpty())
- sql = "update dindan set status5='" + status5 + "',waiter4='" + g_user.name + "',time10='" + g_date + "' where id='" + id + "'";
- else
- sql = "update dindan set status5='" + status5 + "',waiter4='" + g_user.name + "' where id='" + id + "'";
- g_sendhead.bsql = 1;
- if (g_bAllBranch)
- {
- g_branchip = GetIP(branch);
- g_pMainWnd->OnDisconnect();
- g_branchname = branch;
- g_bBranchModify = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0;
- g_branchip = g_branchname = "";
- }
- else
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)return;
- savepath += "ok";
- ::DeleteFile(savepath); // 删除ok文件;
- AfxMessageBox("导入客照成功!", MB_ICONINFORMATION);
- if (g_bAllBranch == 0)
- {
- GetData();
- }
- else
- {
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- if (id == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
- {
- m_List1array.ElementAt(i).SetAt(4 + m_nAdd, status5);
- if (time10.IsEmpty())
- m_List1array.ElementAt(i).SetAt(5 + m_nAdd, g_date);
- m_List1array.ElementAt(i).SetAt(13 + m_nAdd, g_user.name);
- FillGrid();
- break;
- }
- }
- }
- #endif
- }
- // Jeff:选设计版按钮;
- void DesignFrom::OnBUTshowphoto() //Jeff:选设计版、N8按钮;
- {
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
- return;
- }
- int nSelectedItem = m_List1.GetNextSelectedItem(pos);
-
- // 订单号;
- CString strOrderNum = m_List1.GetItemText(nSelectedItem, 0);
- // 设计状态;
- CString strDesignStatus = m_List1.GetItemText(nSelectedItem, 5);
- // 设计日期;
- CString strDesignDate = m_List1.GetItemText(nSelectedItem, 6);
- // 选设计人;
- CString strXuanPainRen = m_List1.GetItemText(nSelectedItem, 13);
- //////////////////////////////////////////////////////////////////////////
- if ( m_bN8 && PathFileExists(g_szN8Path) )
- {// N8选版;
- // SETUP1.获取List控件的记录信息和域名信息;
- CString strTemp = _T("");
- CString strBranchId = _T("");
- CString strBranchName =_T("");
- CString strScenery = _T("");
- // 获取域名;
- if ( g_bAllBranch )
- {// 多店汇总;
- strBranchName = m_List1.GetItemText(nSelectedItem, 0);
- strBranchId = GetDomainFromBranch(strBranchName);
- }
- else
- {
- if ( g_branchname.IsEmpty() )
- {// 连接本店时;
- strBranchId = g_domain;
- }
- else
- {//连接分店时;
- strBranchName = g_branchname;
- strBranchId = GetDomainFromBranch( g_branchname );
- }
- }
- // SETUP2.获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
- IsGrowthTx IsGrowthtxdlg;
- IsGrowthtxdlg.m_mode = 1;
- IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
- IsGrowthtxdlg.DoModal();
- if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
- {
- return;
- }
- if ( IsGrowthtxdlg.m_bGrowthTx )
- {
- // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
- strScenery = IsGrowthtxdlg.m_seltxname;
- }
- // SETUP3.获得选版目录,并判断是否存在或已选;
- BOOL bViewFinish = FALSE;
- CString strUserPath = _T("");
- CString strUserPath2 = _T("");
- if ( strBranchId != g_domain )
- {
- if ( IsGrowthtxdlg.m_bGrowthTx )
- {
- strUserPath.Format(_T("%s\\%s"), strBranchId, strOrderNum);
- strUserPath2.Format(_T("%s\\%s"), strBranchId, strOrderNum);
- }
- else
- {
- strUserPath.Format(_T("%s\\%s"), strBranchId, strOrderNum);
- strUserPath2.Format(_T("%s\\[已选]%s"), strBranchId, strOrderNum);
- }
- }
- else
- {
- if ( IsGrowthtxdlg.m_bGrowthTx )
- {
- strUserPath.Format(_T("%s"), strOrderNum);
- strUserPath2.Format(_T("%s"), strOrderNum);
- }
- else
- {
- strUserPath.Format(_T("%s"), strOrderNum);
- strUserPath2.Format(_T("[已选]%s"), strOrderNum);
- }
- }
- if ( IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
- {
- strUserPath += _T("\\[已选]") + strScenery;
- }
- strTemp.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath2);
- if ( PathFileExists(strTemp) )
- {
- if (IsGrowthtxdlg.m_bGrowthTx)
- AfxMessageBox(_T("该套系选版已完成!"));
- else
- AfxMessageBox(_T("该订单选版已完成!"));
- bViewFinish = TRUE;
- }
- else
- {
- strTemp.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath);
- if ( !PathFileExists(strTemp) )
- {
- if (IsGrowthtxdlg.m_bGrowthTx)
- AfxMessageBox(_T("未找到该套系数据,选版未设计!"));
- else
- AfxMessageBox(_T("未找到该订单数据,选版未设计!"));
- return;
- }
- }
-
- //////////////////////////////////////////////////////////////////////////
- // 传参N8运行;
- CString strParamter = _T("");
- strParamter.Format(_T("/t \"<task userfolder='%s' staffid='%s' serverip='%s'/>\""),
- strUserPath,
- g_user.account,
- g_szN8SvIP);
- //strUserPath = strTemp;
- //////////////////////////////////////////////////////////////////////////
- #ifdef CHILD_VERSION
- if ( IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
- strTemp.Format(_T("id = '%s' and growthxname = '%s'"), strOrderNum, strScenery, strOrderNum, strOrderNum);
- else
- strTemp.Format(_T("id = '%s'"), strOrderNum, strOrderNum, strOrderNum);
- #else
- strTemp.Format(_T("id = '%s'"), strOrderNum, strOrderNum, strOrderNum);
- #endif//CHILD_VERSION
- g_sendhead.bsql = FALSE;
- g_sendhead.code[0] = 50; // dindansp;
- g_sendhead.tabcount = 1;
- if( g_bAllBranch )
- {//多店汇总时;
- g_branchip = GetBranchIPbyId(strBranchId);
- g_pMainWnd->OnDisconnect();
- g_branchname = strBranchName;
- g_bBranchModify = TRUE;
- g_pMainWnd->ProcessChatMessageRequest2(strTemp);
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = FALSE;
- g_branchip = g_branchname = _T("");
- }
- else
- {// 连接本店或分店时;
- g_pMainWnd->ProcessChatMessageRequest2(strTemp);
- }
- if( !g_bSendOK )
- return ;
- CArray<CStringArray, CStringArray> Arydindansp;
- DataToArray( &Arydindansp );
- //////////////////////////////////////////////////////////////////////////
- strTemp.Format(_T("%s\\选版结果\\"), strUserPath);
- if ( !PathFileExists(strTemp) )
- {
- CreateDirectory(strTemp,NULL);
- }
- N8Process::CResultProduct rp;
- if ( !PathFileExists(strTemp + _T("Product.data")) )
- rp.CreateXML(strTemp + _T("Product.data"));
- rp.SetXMLPath(strTemp + _T("Product.data"));
- N8Process::CResultVgProduct rvgp;
- if ( !PathFileExists(strTemp + _T("VgProduct.data")) )
- rvgp.CreateXML(strTemp + _T("VgProduct.data"));
- rvgp.SetXMLPath(strTemp + _T("VgProduct.data"));
- for ( int i = 0; i < Arydindansp.GetSize(); i++ )
- {
- rp.InsertItem(Arydindansp.ElementAt(i).ElementAt(1), NULL, Arydindansp.ElementAt(i).ElementAt(5), NULL, NULL);
- rvgp.InsertItem(Arydindansp.ElementAt(i).ElementAt(1), NULL, Arydindansp.ElementAt(i).ElementAt(5), NULL, NULL);
- }
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
- ZeroMemory(&si, sizeof(STARTUPINFO));
- si.cb = sizeof(STARTUPINFO);
- ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
- TCHAR szCommonLine[MAX_PATH] = {0};
- sprintf(szCommonLine, _T("%s"), strParamter);
- if ( !CreateProcess(g_szN8Path, szCommonLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi) )
- {
- return;
- }
- WaitForSingleObject(pi.hProcess, INFINITE);
- AfxMessageBox(_T("选版结束"));
- if ( !bViewFinish )
- {
- strTemp.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath2);
- if ( PathFileExists(strTemp) )
- {
- bViewFinish = TRUE;
- }
- }
-
- CString strViewFinishXml = _T("");
- if ( bViewFinish )
- {
- strTemp.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath2);
- if ( PathFileExists(strTemp) )
- {
- CString strXML = _T("");
- strTemp.TrimRight(_T("\\"));
- int nIndex = strTemp.ReverseFind(_T('\\'));
- if ( nIndex != -1 )
- {
- strXML = strTemp.Mid(nIndex+1);
- strTemp = strTemp.Left(nIndex);
- }
- strViewFinishXml.Format(_T("%s\\%s.xml"), strTemp, strXML);
- if ( !PathFileExists(strViewFinishXml) )
- {
- strViewFinishXml.Empty();
- }
- }
- }
- printf("\t目录1:%s\n,\t目录2:%s",strUserPath,strUserPath2);
- CDlgN8ViewReuslt N8dlg;
- if ( !bViewFinish )
- N8dlg.m_strUserDir.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath);
- else
- N8dlg.m_strUserDir.Format(_T("%s\\%s\\"), g_szN8ViewUserDir, strUserPath2);
- printf("\t最终目录:%s\n",N8dlg.m_strUserDir);
- N8dlg.m_strOrderNum = strOrderNum;
- if ( bViewFinish )
- {
- N8dlg.m_bViewFinish = TRUE;
- if ( !strViewFinishXml.IsEmpty() )
- N8dlg.m_strViewFinishxml = strViewFinishXml;
- }
- if (IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
- N8dlg.m_strScenery = strScenery;
- N8dlg.m_strCustomer.Format(_T("%s,%s"), m_List1.GetItemText(nSelectedItem, 1), m_List1.GetItemText(nSelectedItem, 2));
- // 读取\版面\Ablum.pwt文件;
- // 读取\选版结果\Product.data文件;
- // 读取\选版结果\VgProduct.data文件;
- // 读取[已选].xml文件;
- N8dlg.DoModal();
- CloseHandle(pi.hProcess);
- CloseHandle(pi.hThread);
- return;
- }
- //////////////////////////////////////////////////////////////////////////
- ChooseDesignSkin dlg; // 选设计对话框;
- dlg.SetLiaPath("3.lia");
- dlg.m_strOrderNumber = strOrderNum;
- dlg.m_path = g_path3 + "\\";
- dlg.m_path += strOrderNum;
- dlg.m_path += "\\";
- dlg.DoModal();
- g_bInSkin = 0;
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- if (strOrderNum == m_List1array.ElementAt(i).ElementAt(0))
- {
- m_List1array.ElementAt(i).SetAt(11, dlg.m_bz3); // 看设计备注;
- m_List1array.ElementAt(i).SetAt(7, dlg.m_status8); // 看设计状态;
- m_List1array.ElementAt(i).SetAt(10, dlg.m_time5); // 取件日期;
- if (dlg.m_status8 != "OK")
- m_List1array.ElementAt(i).SetAt(5, "设计中");
- else
- m_List1array.ElementAt(i).SetAt(5, "OK");
- FillGrid();
- break;
- }
- }
- }
- void DesignFrom::OnButton1() // 查询 按钮;
- {
- UpdateData();
- m_filter.TrimLeft();
- m_filter.TrimRight();
- FillGrid();
- }
- // 已选未设计 按钮; "已选未设计"命名不合理,不知是"已选片OK未设计"还是"已精修未设计",意义待定
- void DesignFrom::OnButton2() // 已精修未设计 按钮;
- {
- UpdateData();
- m_filter.TrimLeft();
- m_filter.TrimRight();
- FillGrid(1);
- }
- void DesignFrom::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- return;
- }
- int iItem = m_List1.GetNextSelectedItem(pos);
- // CString waiter4=m_List1.GetItemText (iItem, 11);
- if (IsHasRights2new(7) || IsHasRights2new(49))
- {
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
- // GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(1);
- }
- else
- {
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
- // GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(0);
- }
- /* if(waiter4.IsEmpty () && IsHasRights2new(7) || IsHasRights2new(49) )
- {
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
- GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(1);
- }
- else if(waiter4==g_user.name && IsHasRights2new(7) )
- {
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
- GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(1);
- }
- else
- {
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
- GetDlgItem(IDC_BUTimportphoto2)->EnableWindow(0);
- }*/
- *pResult = 0;
- }
- void DesignFrom::OnBUTimportphoto2() // 查看 按钮;
- {
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List1.GetNextSelectedItem(pos);
- CString branch;
- CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- if (g_bAllBranch)
- branch = m_List1.GetItemText(iItem, 0);
- CString name = m_List1.GetItemText(iItem, 1 + m_nAdd) + "," + m_List1.GetItemText(iItem, 2 + m_nAdd);
- name.TrimLeft(",");
- name.TrimRight(",");
- name = "客人:" + name;
- ShowPic dlg;
- dlg.m_id = id;
- dlg.m_name = name;
- dlg.m_name2 = m_List1.GetItemText(iItem, 1 + m_nAdd) + m_List1.GetItemText(iItem, 2 + m_nAdd);
- // 设计要求(原列10)
- dlg.remark = m_List1.GetItemText(iItem, 11 + m_nAdd);
- dlg.m_mode = 5;
- CString strDomain = _T("");
- CString savepath = _T("");
- if (g_bAllBranch)
- {
- if(branch == _T(""))
- savepath = g_path3 + "\\";
- else
- {
- strDomain = GetDomainFromBranch(branch);
- savepath = g_path3 + "\\" + strDomain + "\\";
- }
-
- if (::CheckFolderFileExist(savepath) == 0)
- ::CreateDirectory(savepath, NULL);
- }
- else
- {
- if(g_branchname == _T(""))
- savepath = g_path3 + "\\";
- else
- strDomain = GetDomainFromBranch(g_branchname);
- }
- #if !USE_SHARE_FLORD
- // 根据域名,相片类型,订单号查找相片;
- dlg.m_aryOfShareDirectory.RemoveAll();
- CNetShareInfo::GetInstance()->LoadOrderImages(dlg.m_mode, dlg.m_id, g_domain, dlg.m_patharray1, &dlg.m_aryOfShareDirectory);
- #endif
- dlg.m_branch = strDomain;
- dlg.m_path = g_path3 + _T("\\");
- dlg.m_path += id;
- dlg.m_path += "\\";
- dlg.DoModal();
- }
- void DesignFrom::OnBUTimportphoto3() // 导出 (设计好的片) 按钮;
- {
- #ifdef USE_KERNEL_DLL
- // 判断登陆用户是否有导出原片的权限;
- if ( !IsHasRights2new(12) )
- {
- AfxMessageBox(_T("您无权限导出原片!"),MB_ICONINFORMATION);
- return;
- }
- // 获取列表信息:域名、订单号、景点名、顾客信息;
- POSITION pos = m_List1.GetFirstSelectedItemPosition();
- if ( pos == NULL )
- {
- AfxMessageBox(_T("请选中您要导出原片的订单!"), MB_ICONINFORMATION);
- return;
- }
- INT nItemCount = m_List1.GetItemCount();
- INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
- CString strBranchId = _T("");
- CString strOrderNum = _T("");
- // 初修列表不支持景点名,需要从其他地方获取;
- CString strScenery = _T("");
- CString strCustomerInfo = _T("");
- // 获取域名;
- if ( g_bAllBranch )
- {// 多店汇总时;
- strBranchId = GetDomainFromBranch( m_List1.GetItemText(nSelectedItem, 0) );
- }
- else
- {
- if ( g_branchname.IsEmpty() )
- {// 连接本店时;
- strBranchId = g_domain;
- }
- else
- {// 连接分店时;
- strBranchId = GetDomainFromBranch( g_branchname );
- }
- }
- // 获取订单号;
- strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
- // 获取顾客信息;
- strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
- // 加上设计要求;
- strCustomerInfo += _T("$");
- strCustomerInfo += m_List1.GetItemText(nSelectedItem, 11 + m_nAdd);
- // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
- IsGrowthTx IsGrowthtxdlg;
- IsGrowthtxdlg.m_mode = 1;
- IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
- IsGrowthtxdlg.DoModal();
- if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
- {
- return;
- }
- if ( IsGrowthtxdlg.m_bGrowthTx )
- {
- // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
- strScenery = IsGrowthtxdlg.m_seltxname;
- if ( strScenery == _T("全部") )
- {
- strScenery.Empty();
- }
- }
- // 导出原片时,是否压缩导出;
- DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素;
- /////////////////////////////////////////////////////////////////////////////////////////////////
- if ( g_pIMGProcess == NULL )
- {
- return ;
- }
- // 获取完信息,开始导出原片;
- ImgExportInterface *pExport = NULL;
- g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
- if ( pExport )
- {
- pExport->ExportDesignImg(
- TRUE,
- strBranchId,
- strOrderNum,
- strCustomerInfo,
- !strScenery.IsEmpty(),
- strScenery,
- _T("*.jpg|*.jpeg"),
- dwExportPix,
- _T("*.nef|*.cr2|*.raw|*.ra2"),
- FALSE,
- FALSE
- );
- }
- g_pIMGProcess->Release();
- WriteOptLog(_T("导出设计,订单号:%s"),strOrderNum);
- // 结束;
- #else
- if (IsHasRights2new(12) == 0)return;
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要导出片的定单!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List1.GetNextSelectedItem(pos);
- CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- CString branch;
- if (g_bAllBranch)
- branch = m_List1.GetItemText(iItem, 0);
- CString path;
- if (g_bAllBranch)
- {
- CString branchpath = GetBranchPhotoPath(branch);
- path = g_path3 + branchpath + "\\";
- }
- else
- path = g_path3 + "\\";
- path += id;
- path += "\\";
- CStringArray array;
- CString dir;
- GetSavePath(dir);
- if (dir.IsEmpty())
- {
- return;
- }
- CString name1 = m_List1.GetItemText(iItem, 1 + m_nAdd);
- CString name2 = m_List1.GetItemText(iItem, 2 + m_nAdd);
- CString remark = m_List1.GetItemText(iItem, 11 + m_nAdd); // 设计要求,原列10
- dir.TrimRight('\\');
- dir += "\\";
- dir += id;
- dir += g_branchname;
- if (g_bAllBranch)
- {
- if (GetBranchPhotoPath(branch) != "")
- dir += branch;
- }
- dir += name1;
- dir += name2;
- dir += "设计好的片";
- dir += "\\";
- ::CreateDirectory(dir, NULL);
- CStringArray desarray;
- CStringArray dirarray;
- CString savepath = dir;
- CString str;
- if (1)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin(); coo.end() != it; it++)
- {
- str = (*it).c_str();
- if (FindArray(&dirarray, str) == -1)
- {
- dirarray.Add(str);
- if (str != dirarray.ElementAt(0))
- {
- str = savepath + str.Right(str.GetLength() - dirarray.ElementAt(0).GetLength());
- if (::CheckFolderFileExist(str) == 0)
- ::CreateDirectory(str, NULL);
- }
- }
- }
- }
- if (1)
- {
- for (int i = 0; i < dirarray.GetSize(); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt(i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin(); coo.end() != it; it++)
- {
- str = (*it).c_str();
- if (str.GetAt(str.ReverseFind('\\') + 1) == 's')continue;
- if (str.GetAt(str.ReverseFind('\\') + 1) == 'm')continue;
- array.Add(str);
- desarray.Add(savepath + dirarray.ElementAt(i).Right(dirarray.ElementAt(i).GetLength() - dirarray.ElementAt(0).GetLength()) + str.Right(str.GetLength() - str.ReverseFind('\\') - 1));
- }
- }
- }
- if (array.GetSize() == 0)
- {
- AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
- return;
- }
- CStdioFile fp;
- fp.Open(dir + "客户要求.txt", CFile::modeCreate | CFile::modeWrite);
- fp.WriteString(remark);
- fp.Close();
- CCompressOption comoptdlg;
- comoptdlg.DoModal();
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- // 导出设计好片;
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- ImportPhoto dlg;
- dlg.m_nOutputSize = comoptdlg.m_nsize; // 1.导出设计好的片的尺寸;
- dlg.m_mode = 1; // 2.未知;
- dlg.m_pArray = &array; // 3.作为导出时的源设计片路径集合;
- dlg.m_pDesArray = &desarray; // 4.作为导出时的目标设计片路径集合;
- dlg.m_savepath = dir; // 5.导出设计片时的保存路径;
- dlg.DoModal();
- AfxMessageBox("导片成功!", MB_ICONINFORMATION);
- // CString str;
- str = " 导出设计片 ";
- str += "客人:";
- str += name1 + name2 + id;
- WriteLog(_T("导出设计好片"), str);
- #endif
- }
- void DesignFrom::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)return;
- int iItem = m_List1.GetNextSelectedItem(pos);
- g_id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- *pResult = 0;
- }
- // 需要处理更换分隔符造成的问题;
- // 已处理分隔符问题;
- void DesignFrom::OnButton3() // 导出选设计 按钮;导出N8选版;
- {
- #ifdef USE_KERNEL_DLL
- // 判断用户是否有权限导出选设计的片
- if ( !IsHasRights2new(12))
- {
- AfxMessageBox(_T("您没有权限导出选设计的片!"));
- return;
- }
- // 获取列表信息;
- POSITION pos = m_List1.GetFirstSelectedItemPosition();
- if ( pos == NULL )
- {
- AfxMessageBox(_T("请您选中要导片的订单!"));
- return;
- }
- INT nItemCount = m_List1.GetItemCount();
- INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
- // 获取域名、订单号、景点名、顾客信息、设计状态、设计日期、设计师、选设计人、选设计状态(看设计状态)、选设计日期;
- CString strBranchName = _T("");
- CString strBranchId = _T("");
- CString strOrderNum = _T("");
- CString strScenery = _T("");
- CString strCustomerInfo = _T("");
- CString strDesignState = _T("");
- CString strDesignDate = _T("");
- CString strDesigner = _T("");
- CString strXuanpianRen = _T("");
- CString strXuanpianState = _T("");
- CString strXuanpianDate = _T("");
- // 获取订单号;
- strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
- // 获取顾客信息;
- strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
- // 获取设计状态;
- strDesignState = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd);
- // 获取设计日期;
- strDesignState = m_List1.GetItemText(nSelectedItem, 6 + m_nAdd);
- // 获取设计师;
- strDesigner = m_List1.GetItemText(nSelectedItem, 15 + m_nAdd);
- // 获取看设计状态;
- strXuanpianState = m_List1.GetItemText(nSelectedItem, 7 + m_nAdd);
- // 获取选设计日期;
- strXuanpianDate = m_List1.GetItemText(nSelectedItem, 8 + m_nAdd);
- // 获取看设计师;
- strXuanpianRen = m_List1.GetItemText(nSelectedItem, 14 + m_nAdd);
- if ( strDesignState == _T("未设计") )
- {
- MessageBox(_T("此单未设计!"), _T("影楼管理"), MB_OK | MB_TOPMOST | MB_ICONINFORMATION );
- return;
- }
- // 获取域名;
- if ( g_bAllBranch )
- {// 多店汇总;
- strBranchName = m_List1.GetItemText(nSelectedItem, 0);
- strBranchId = GetDomainFromBranch(strBranchName);
- }
- else
- {
- if ( g_branchname.IsEmpty() )
- {// 连接本店时;
- strBranchId = g_domain;
- }
- else
- {//连接分店时;
- strBranchName = g_branchname;
- strBranchId = GetDomainFromBranch( g_branchname );
- }
- }
- // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
- IsGrowthTx IsGrowthtxdlg;
- IsGrowthtxdlg.m_mode = 1;
- IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
- IsGrowthtxdlg.DoModal();
- if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
- {
- return;
- }
- if ( IsGrowthtxdlg.m_bGrowthTx )
- {
- // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
- strScenery = IsGrowthtxdlg.m_seltxname;
- if ( strScenery == _T("全部") )
- {
- strScenery.Empty();
- }
- }
- if ( m_bN8 && PathFileExists(g_szN8Path) )
- {// N8选版;
- ImgExportInterface *pN8Export = NULL;
- if ( g_pIMGProcess == NULL )
- {
- return ;
- }
- g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pN8Export);
- if ( pN8Export )
- {// 导出选好的片;
- pN8Export->ExportN8(
- g_szN8ViewUserDir,
- strBranchId,
- strOrderNum,
- strCustomerInfo,
- !strScenery.IsEmpty(),
- strScenery,
- FALSE
- );
- pN8Export->Release();
- WriteOptLog(_T("导出N8,订单号:%s"),strOrderNum);
- OutputDebugString(_T("导出N8!\n"));
- }
- return;
- }
- //////////////////////////////////////////////////////////////////////////
- CString strSQL = _T("");
- #ifdef CHILD_VERSION
- if ( IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
- strSQL.Format(_T("id = '%s' and growthxname = '%s'; id = '%s'; id = '%s' and name <> '入册' and name <> '入底'"), strOrderNum, strScenery, strOrderNum, strOrderNum);
- else
- strSQL.Format(_T("id = '%s'; id = '%s'; id = '%s' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
- #else
- strSQL.Format(_T("id = '%s'; id = '%s'; id = '%s' and kind <> '2' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
- #endif//CHILD_VERSION
- g_sendhead.bsql = FALSE;
- g_sendhead.code[0] = 50; // dindansp;
- g_sendhead.code[1] = 11; // dindan;
- g_sendhead.code[2] = 56; // dindansp;
- g_sendhead.tabcount = 3;
- if( g_bAllBranch )
- {//多店汇总时;
- g_branchip = GetBranchIPbyId(strBranchId);
- g_pMainWnd->OnDisconnect();
- g_branchname = strBranchName;
- g_bBranchModify = TRUE;
- g_pMainWnd->ProcessChatMessageRequest2(strSQL);
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = FALSE;
- g_branchip = g_branchname = _T("");
- }
- else
- {// 连接本店或分店时;
- g_pMainWnd->ProcessChatMessageRequest2(strSQL);
- }
- if( !g_bSendOK )
- return ;
- CArray<CStringArray, CStringArray> Arydindan;
- CArray<CStringArray, CStringArray> Arydindansp;
- CArray<CStringArray, CStringArray> Arydindansp2;
- DataToArray( &Arydindansp, &Arydindan, &Arydindansp2 );
- CString strTemp = _T("");
- CStringArray AryImgNums;
- CStringArray AryPerImgGoods;
- // 获取所有dindansp记录no2字段中的相片编号;
- int i = 0;
- int nSize = Arydindansp.GetSize();
- for ( i = 0; i < nSize; i++)
- {
- strTemp = Arydindansp.ElementAt(i).ElementAt(8); // dindansp表中的no2字段;
- GetNo(strTemp, AryImgNums);
- }
- // 获取每张相片编号对应的商品,每个商品间用分号隔开;
- nSize = AryImgNums.GetSize();
- AryPerImgGoods.SetSize(nSize);
- for ( i = 0; i < nSize; i++ )
- {
- strTemp = AryImgNums.ElementAt(i);
- AryPerImgGoods.SetAt(i, GetSelName(strTemp, Arydindansp));
- }
- // 由于VC6.0传CStringArray给VC9.0DLL 时,会产生无法避免的兼容性问题,故使用CString传;
- CString strImgNums = _T("");
- for ( i = 0; i < AryImgNums.GetSize(); i++ )
- {
- strImgNums += AryImgNums.ElementAt(i);
- strImgNums += _T("?|?");
- }
- CString strPerImgGoods = _T("");
- for ( i = 0; i < AryPerImgGoods.GetSize(); i++ )
- {// 商品名称,应该禁止包含非法字符;
- strPerImgGoods += AryPerImgGoods.ElementAt(i);
- strPerImgGoods += _T("?|?");
- }
- // 保存导出相片的路径;
- CString strSaveDirectory = _T("");
- ImgExportInterface *pExport = NULL;
- if ( g_pIMGProcess == NULL )
- {
- return ;
- }
- g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
- if ( pExport )
- {// 导出选好的片;
- pExport->ExportSelectedDesignImg(
- strBranchId,
- strOrderNum,
- strCustomerInfo,
- !strScenery.IsEmpty(),
- strScenery,
- _T("*.jpg|*.jpeg"),
- INVALID_COPY_PIX,
- _T("*.nef|*.cr2|*.raw|"),
- FALSE,
- IsGrowthtxdlg.m_bGrowthTx,
- strImgNums,
- strPerImgGoods,
- Arydindan.ElementAt(0).ElementAt(60)
- );
- pExport->Release();
- WriteOptLog(_T("导出选设计,订单号:%s"),strOrderNum);
- OutputDebugString(_T("导出设计好的片!\n"));
- }
- // 结束;
- #else
- if (IsHasRights2new(12) == 0)return;
- UpdateData();
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List1.GetNextSelectedItem(pos);
- CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- CString branch;
- if (g_bAllBranch)
- branch = m_List1.GetItemText(iItem, 0);
- CString name1 = m_List1.GetItemText(iItem, 1 + m_nAdd);
- CString name2 = m_List1.GetItemText(iItem, 2 + m_nAdd);
- #ifdef CHILD_VERSION
- CString filter = "id='" + id + "';id='" + id + "';id='" + id + "' and name<>'入册' and name<>'入底'";
- #else
- CString filter = "id='" + id + "';id='" + id + "';id='" + id + "' and kind<>'2' and name<>'入册' and name<>'入底'";
- #endif
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 50;
- g_sendhead.code[1] = 11;
- g_sendhead.code[2] = 56;
- g_sendhead.tabcount = 3;
- if (g_bAllBranch)
- {
- g_branchip = GetIP(branch);
- g_pMainWnd->OnDisconnect();
- g_branchname = branch;
- g_bBranchModify = 1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0;
- g_branchip = g_branchname = "";
- }
- else
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>sparray2;
- DataToArray(&sparray, &g_List1array, &sparray2);
- CString path;
- if (g_bAllBranch)
- {
- CString branchpath = GetBranchPhotoPath(branch);
- path = g_path3 + branchpath + "\\";
- }
- else
- path = g_path3 + "\\";
- path += id;
- path += "\\";
- ////////////////////////////////////////
- CString str, spname;
- CStringArray noarray;
- CStringArray spnamearray;
- int i = 0;
- for ( i = 0; i < sparray.GetSize(); i++)
- {
- str = sparray.ElementAt(i).ElementAt(8);
- spname = sparray.ElementAt(i).ElementAt(5);
- GetNo(str, noarray);
- }
- if (noarray.GetSize() == 0)
- {
- AfxMessageBox("此单未选设计版!", MB_ICONINFORMATION);
- return;
- }
- spnamearray.SetSize(noarray.GetSize());
- for (i = 0; i < noarray.GetSize(); i++)
- {
- str = noarray.ElementAt(i);
- spnamearray.SetAt(i, GetSelName2(str, sparray));
- }
- CString dir;
- GetSavePath(dir);
- if (dir.IsEmpty())return;
- dir.TrimRight('\\');
- dir += "\\";
- dir += id;
- dir += g_branchname;
- if (g_bAllBranch)
- {
- if (GetBranchPhotoPath(branch) != "")
- dir += branch;
- }
- dir += name1;
- dir += name2;
- dir += "选设计";
- dir += "\\";
- CStringArray array;
- CStringArray spnamearray2;
- CString src, des;
- for (i = 0; i < noarray.GetSize(); i++)
- {
- src.Format("%s%s.jpg", path, noarray.ElementAt(i));
- if (PathFileExists(src))
- {
- array.Add(src);
- src = spnamearray.ElementAt(i);
- spnamearray2.Add(spnamearray.ElementAt(i));
- }
- else
- AfxMessageBox("未找到设计版:" + src.Right(src.GetLength() - src.ReverseFind('\\') - 1), MB_ICONINFORMATION);
- }
- ::CreateDirectory(dir, NULL);
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- // 导出选设计的片;
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- ImportPhoto dlg;
- dlg.m_mode = 1; // 1.未知;
- dlg.m_bOrigin = 1; // 2.未知;
- dlg.m_pArray = &array; // 3.作为导出源的选好的设计片路径集合;
- dlg.m_pArray2 = &spnamearray2; // 4.作为导出目标的选好的设计片路径集合;
- dlg.m_savepath = dir; // 5.保存选好的设计片的目录;
- dlg.DoModal();
- //////////////
- if (g_List1array.GetSize())
- {
- CStdioFile fp;
- fp.Open(dir + "客户要求.txt", CFile::modeCreate | CFile::modeWrite);
- fp.WriteString("选设计要求:\n");
- fp.WriteString(g_List1array.ElementAt(0).ElementAt(57));
- fp.WriteString("\n");
- fp.WriteString("\n");
- fp.WriteString("设计版替换照片:\n");
- CString replace = g_List1array.ElementAt(0).ElementAt(59);
- if (!replace.IsEmpty())
- {
- replace.Delete(0, 1);
- replace.Replace("$", "\n");
- }
- fp.WriteString(replace);
- fp.WriteString("\n");
- fp.WriteString("\n");
- fp.WriteString("订单要求:\n");
- fp.WriteString(g_List1array.ElementAt(0).ElementAt(38));
- fp.WriteString("\n");
- fp.WriteString("\n");
- fp.WriteString("客人产品:\n");
- CString str;
- str = "产品名称";
- FillLength(str, 20);
- str += "数量";
- FillLength(str, 30);
- str += "加急";
- FillLength(str, 40);
- str += "取件日期";
- FillLength(str, 50);
- fp.WriteString(str);
- fp.WriteString("\n");
- for (int i = 0; i < sparray2.GetSize(); i++)
- {
- str.Empty();
- str = sparray2.ElementAt(i).ElementAt(0);
- FillLength(str, 20);
- str += sparray2.ElementAt(i).ElementAt(1);
- FillLength(str, 30);
- str += sparray2.ElementAt(i).ElementAt(18);
- FillLength(str, 40);
- str += sparray2.ElementAt(i).ElementAt(19);
- FillLength(str, 50);
- fp.WriteString(str);
- fp.WriteString("\n");
- }
- fp.Close();
- }
- //////////////
- AfxMessageBox("导片成功!", MB_ICONINFORMATION);
- // CString str;
- str = " 导出选设计片 ";
- str += "客人:";
- str += name1 + name2 + id;
- WriteLog(_T("导出选设计片"), str);
- #endif
- }
- void DesignFrom::HidePrice()
- {
- #ifdef LKAY_VERSION
- return;
-
- #else
- return;
-
- #endif
- }
- void DesignFrom::OnBtnsearchfilter() // 条件查询 按钮;
- {
- SearchFilter dlg;
- dlg.m_mode = 5;
- if (dlg.DoModal() == IDOK)FillGrid();
- g_bSearchFilter = 0;
- }
- void DesignFrom::GetData()
- {
- if (g_bAllBranch == 0)
- {
- if (g_bShowOK == 0)
- {
- #ifdef LKAY_VERSION
- CString filter = "status3='未取' and (dindantype<>'意向客户' or dindantype is null)";
- #else
- CString filter = "status3='未取'";
- #endif
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 31;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if (g_bSendOK == 0)return;
- }
- else
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 31;
- g_sendhead.tabcount = 1;
- #ifdef LKAY_VERSION
- CString filter = "dindantype<>'意向客户' or dindantype is null";
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- #else
- g_pMainWnd->ProcessChatMessageRequest2(1);
- #endif
- if (g_bSendOK == 0)return;
- }
- DataToArray(&m_List1array);
- }
- else
- {
- //////////////数据汇总
- m_List1array.RemoveAll();
- CString branch;
- for (int i = -1; i < g_brancharray.GetSize() - 1; i++)
- {
- if (i != -1)
- {
- branch = g_brancharray.ElementAt(i).ElementAt(0);
- g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
- g_pMainWnd->OnDisconnect();
- g_branchname = branch;
- g_bBranchModify = 1;
- }
- else
- branch = g_brancharray.ElementAt(g_brancharray.GetSize() - 1).ElementAt(0);
- if (g_bShowOK == 0)
- {
- CString filter = "status3='未取'";
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 31;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if (g_bSendOK == 0)continue;
- }
- else
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 31;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- if (g_bSendOK == 0)continue;
- }
- CArray<CStringArray, CStringArray>List1array;
- DataToArray(&List1array);
- int size = m_List1array.GetSize();
- for (int j = 0; j < List1array.GetSize(); j++)
- {
- size++;
- m_List1array.SetSize(size, 1);
- size--;
- m_List1array.ElementAt(size).Copy(List1array.ElementAt(j));
- m_List1array.ElementAt(size).InsertAt(0, branch);
- size++;
- }
- }
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0;
- g_branchip = g_branchname = "";
- }
- m_List1arraybak.SetSize(m_List1array.GetSize(), 1);
- for (int ii = 0; ii < m_List1array.GetSize(); ii++)
- {
- m_List1arraybak.ElementAt(ii).Copy(m_List1array.ElementAt(ii));
- // 设计要求;原列10
- if (m_List1array.ElementAt(ii).ElementAt(11).GetLength() > 256)
- {
- m_List1array.ElementAt(ii).SetAt(11, m_List1array.ElementAt(ii).ElementAt(11).Left(256) + "...");
- }
- }
- HidePrice();
- FillGrid();
- }
- void DesignFrom::OnBUTprint3() // 更新数据 按钮;
- {
- GetData();
- }
- void DesignFrom::OnBnClickedCloundxy() // 云选样;
- {
- // TODO: 在此添加控件通知处理程序代码
- POSITION pos = m_List1.GetFirstSelectedItemPosition();
- if ( pos == NULL)
- {
- AfxMessageBox(_T("请选中要使用云选片的订单!"));
- return ;
- }
- INT nItem = m_List1.GetNextSelectedItem(pos);
- CString strOrderNum = _T("");
- CString strScenery = _T("");
- CString strCustomerName = _T("");
- CString strCustomerTel = _T("");
- CString strStudioName = _T("");
- CString strStudioTel = _T("");
- CString strUniqueId = _T("");
- CString strClounSite = _T("");
- CString strTemp;
- strOrderNum = m_List1.GetItemText(nItem, 0);
- strCustomerName.Format(_T("%s,%s"), m_List1.GetItemText(nItem, m_nAdd + 1), m_List1.GetItemText(nItem, m_nAdd + 2));
- strCustomerTel.Format(_T("%s,%s"), m_List1.GetItemText(nItem, m_nAdd + 17), m_List1.GetItemText(nItem,m_nAdd + 18));
- strStudioName = g_cominfoarray.ElementAt(0).ElementAt(10);
- strStudioTel = g_cominfoarray.ElementAt(0).ElementAt(11);
- strClounSite = m_List1.m_arLabels.ElementAt(nItem).ElementAt(21);
- INT nIndex = 0;
- strTemp = g_branchname.IsEmpty() ? g_domain : g_branchname;
- if ( ( nIndex = strTemp.Find(_T(".ly.com"))) == -1)
- {
- AfxMessageBox(_T("域名无效!"));
- return;
- }
- strTemp = strTemp.Left(nIndex);
- strTemp = strTemp.Right(6);
- strUniqueId.Format(_T("%s_A_%s_1"), strTemp, strOrderNum);
- if ( lyfzLibrary::LoadCloudSelectionLib() )
- {
- CDlgCloudSelection dlg;
- dlg.SetParamters(1, strUniqueId, g_branchname.IsEmpty() ? g_domain : g_branchname, strStudioName, strStudioTel, strOrderNum,strScenery, m_List1.GetItemText(nItem, m_nAdd + 1),m_List1.GetItemText(nItem, m_nAdd + 2), m_List1.GetItemText(nItem, m_nAdd + 17),m_List1.GetItemText(nItem, m_nAdd + 18), strClounSite);
- dlg.DoModal();
- lyfzLibrary::FreeCloudSelectionLib();
- }
- else
- {
- AfxMessageBox(_T("加载云选片失败,请检查模块文件是否在客户目录下!"));
- }
- }
- void DesignFrom::OnBnClickedResult() // 获取选样结果;
- {
- // TODO: 在此添加控件通知处理程序代码
- CDlgCloundResult dlg;
- dlg.m_pList = &m_List1;
- dlg.m_nAdd = m_nAdd;
- dlg.m_nCloundType = 1;
- POSITION pos = m_List1.GetFirstSelectedItemPosition();
- if ( pos != NULL )
- {
- INT nItem = m_List1.GetNextSelectedItem(pos);
- dlg.m_nSelItem = nItem;
- }
- dlg.DoModal();
- }
|