1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725 |
- #include "stdafx.h"
- #include "ylgl.h"
- #include "BeautifySkinFrom2.h"
- #include "MyMdi.H"
- #include "ModifyDinDan.h"
- #include "ImportPhoto.h"
- #include "ShowPic.h"
- #include "SelectPhotoDlg.h"
- #include "./helper/ffsco.h"
- #include "ShowCut.h"
- #include "CompressOption.h"
- #include "NetShareInfo.h"
- #include "DlgChuXiuInfo.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- IMPLEMENT_DYNCREATE(BeautifySkinFrom2, MyFormView)
- BeautifySkinFrom2::BeautifySkinFrom2(): MyFormView(BeautifySkinFrom2::IDD)
- {
- m_filter = _T("");
- m_nAdd = 0;
- if (g_bAllBranch)
- {
- m_nAdd = 1;
- }
- }
- BeautifySkinFrom2::~BeautifySkinFrom2()
- {
- }
- void BeautifySkinFrom2::DoDataExchange(CDataExchange* pDX)
- {
- MyFormView::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_COMBO1, m_combo1);
- DDX_Control(pDX, IDC_LIST2, m_FurtherList);
- DDX_Control(pDX, IDC_STATIC1, m_static1);
- DDX_CBString(pDX, IDC_COMBO1, m_filter);
- }
- BEGIN_MESSAGE_MAP(BeautifySkinFrom2, 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_BUTimportphoto, OnBUTimportphoto)
- ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
- ON_BN_CLICKED(IDC_BUTexportphoto, OnBUTexportphoto)
- ON_BN_CLICKED(IDC_BUTexportphoto2, OnBUTexportphoto2)
- ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
- ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
- ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
- ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
- ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3)
- END_MESSAGE_MAP()
- #ifdef _DEBUG
- void BeautifySkinFrom2::AssertValid() const
- {
- MyFormView::AssertValid();
- }
- void BeautifySkinFrom2::Dump(CDumpContext& dc) const
- {
- MyFormView::Dump(dc);
- }
- #endif
- void BeautifySkinFrom2::OnInitialUpdate()
- {
- MyFormView::OnInitialUpdate();
- CMyMdi Mdi;
- Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
- 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);
- int idarray[] = { IDC_BUTprint3, IDC_BUTexportphoto, IDC_BUTimportphoto, IDC_BUTshowphoto, IDC_BUTexportphoto2, IDC_BUTclose };
- int idcount = 6;
- 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);
- if (g_bAllBranch == 0)
- {
- #ifdef CHILD_VERSION
- m_FurtherList.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;修片,100;选片,100;选片日期,100;精修,100;精修日期,100;设计,100;看设计日期,100;加急,100;取件日期,100;修片人,100;精修人,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100");
- #else
- m_FurtherList.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;修片,100;选片,100;选片日期,100;精修,100;精修日期,100;设计,100;看设计日期,100;加急,100;取件日期,100;修片人,100;精修人,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
- #endif
- m_FurtherList.LoadColumnInfo(122);
- }
- else
- {
- #ifdef CHILD_VERSION
- m_FurtherList.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;修片,100;选片,100;选片日期,100;精修,100;精修日期,100;设计,100;看设计日期,100;加急,100;取件日期,100;修片人,100;精修人,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100");
- #else
- m_FurtherList.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;修片,100;选片,100;选片日期,100;精修,100;精修日期,100;设计,100;看设计日期,100;加急,100;取件日期,100;修片人,100;精修人,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
- #endif
- m_FurtherList.LoadColumnInfo(198);
- GetDlgItem(IDC_BUTprint3)->ShowWindow(1);
- }
- 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(10));
- GetDlgItem(IDC_BUTexportphoto2)->EnableWindow(IsHasRights2new(11));
- }
- void BeautifySkinFrom2::FillGrid(BOOL bStatus)
- {
- if (g_bSearchFilter)
- {
- m_FurtherList.DeleteAllItems2();
- int ii = 0;
- m_FurtherList.m_arLabels.SetSize(m_List1array.GetSize(), 1);
- int count = 0;
- {
- for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
- {
-
- if (g_filterdate1 != "")
- {
- if (m_List1array.ElementAt(ii).ElementAt(7 + m_nAdd) < g_filterdate1 || m_List1array.ElementAt(ii).ElementAt(7 + m_nAdd) > g_filterdate2)
- continue;
- }
- if (g_waiter1 != "")
- {
-
- if (m_List1array.ElementAt(ii).ElementAt(13 + m_nAdd) != g_waiter1)
- continue;
- }
- if (g_bAllBranch && g_filterbranch != "")
- {
- if (m_List1array.ElementAt(ii).ElementAt(0) != g_filterbranch)
- continue;
- }
- if (1)
- {
- m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- m_FurtherList.m_arLabels.SetSize(count, 1);
- ii = count;
- m_FurtherList.m_LabelCount = ii;
- m_FurtherList.SetItemCountEx(ii);
- CString str;
- str.Format("单数:%d", ii);
- SetDlgItemText(IDC_STATIC2, str);
- }
- else
- {
- m_FurtherList.DeleteAllItems2();
- int ii = 0;
- m_FurtherList.m_arLabels.SetSize(m_List1array.GetSize(), 1);
- int count = 0;
- if (m_filter.IsEmpty())
- {
- if (bStatus)
- {
- for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
- {
-
- if (m_List1array.ElementAt(ii).ElementAt(4 + m_nAdd) == "OK" && m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) != "OK")
- m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- else
- {
- for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
- {
- m_FurtherList.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_FurtherList.m_arLabels.GetSize(); ii++)
- {
-
- if (m_List1array.ElementAt(ii).ElementAt(4 + m_nAdd) == "OK" &&
- m_List1array.ElementAt(ii).ElementAt(6 + 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_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- else if (type == 2)
- {
- m_filter.MakeUpper();
- for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
- {
-
- if (m_List1array.ElementAt(ii).ElementAt(4 + m_nAdd) == "OK" &&
- m_List1array.ElementAt(ii).ElementAt(6 + 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_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- else
- {
- for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
- {
-
- if (m_List1array.ElementAt(ii).ElementAt(4 + m_nAdd) == "OK" &&
- m_List1array.ElementAt(ii).ElementAt(6 + 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_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- }
- else
- {
- int type = GetType(m_filter);
- if (type == 1)
- {
- for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
- {
-
- 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_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- else if (type == 2)
- {
- m_filter.MakeUpper();
- for (ii = 0; ii < m_FurtherList.m_arLabels.GetSize(); ii++)
- {
-
- 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_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- else
- {
- for (ii = 0; ii < m_FurtherList.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(20).Find(m_filter) != -1)
- {
- m_FurtherList.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- }
- }
- m_FurtherList.m_arLabels.SetSize(count, 1);
- ii = count;
- m_FurtherList.m_LabelCount = ii;
- m_FurtherList.SetItemCountEx(ii);
- CString str;
- str.Format("单数:%d", ii);
- SetDlgItemText(IDC_STATIC2, str);
- }
- if (!g_id.IsEmpty())
- {
- for (int i = 0; i < m_FurtherList.GetItemCount(); i++)
- {
- if (g_id == m_FurtherList.GetItemText(i, 0 + m_nAdd))
- {
- m_FurtherList.SetItemState(i, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
- m_FurtherList.EnsureVisible(i, FALSE);
- break;
- }
- }
- }
- }
- void BeautifySkinFrom2::OnBUTclose()
- {
- GetParent()->SendMessage(WM_CLOSE);
- }
- void BeautifySkinFrom2::OnSelchangeCombo1()
- {
- SetTimer(1, 100, NULL);
- }
- void BeautifySkinFrom2::OnTimer(UINT nIDEvent)
- {
- KillTimer(nIDEvent);
- OnButton1();
- }
- BOOL BeautifySkinFrom2::PreTranslateMessage(MSG* pMsg)
- {
- try
- {
- if (pMsg->message == WM_KEYDOWN)
- {
- switch (pMsg->wParam)
- {
- case VK_RETURN:
- OnButton1();
- return 1;
- case 0x43:
- if ((GetKeyState(VK_CONTROL) & 0x80))
- {
- GetFocus()->SendMessage(WM_COPY);
- return TRUE;
- }
- break;
- case 0x56:
- if ((GetKeyState(VK_CONTROL) & 0x80))
- {
- GetFocus()->SendMessage(WM_PASTE);
- return TRUE;
- }
- break;
- case 0x58:
- if ((GetKeyState(VK_CONTROL) & 0x80))
- {
- GetFocus()->SendMessage(WM_CUT);
- return TRUE;
- }
- break;
- case 0x5A:
- case 0x59:
- if ((GetKeyState(VK_CONTROL) & 0x80))
- {
- GetFocus()->SendMessage(WM_UNDO);
- return TRUE;
- }
- break;
- }
- }
- return MyFormView::PreTranslateMessage(pMsg);
- }
- catch (...)
- {
- }
- return true;
- }
- void BeautifySkinFrom2::OnBUTimportphoto()
- {
- #ifdef USE_KERNEL_DLL
- POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
- if ( pos == NULL )
- {
- AfxMessageBox(_T("请选中您要导入精修片的订单!"),MB_ICONINFORMATION);
- return;
- }
- INT nItemCount = m_FurtherList.GetItemCount();
- INT nSelectedItem = m_FurtherList.GetNextSelectedItem(pos);
-
- CString strBranchName = _T("");
- CString strBranchId = _T("");
- CString strOrderNum = _T("");
- CString strScenery = _T("");
- CString strCustomerInfo = _T("");
- CString strJingxiuRen = _T("");
- CString strJingxiuState = _T("");
- CString strJingxiuDate = _T("");
-
- if ( g_bAllBranch )
- {
- strBranchName = m_FurtherList.GetItemText(nSelectedItem, 0);
- strBranchId = GetDomainFromBranch( strBranchName );
- }
- else
- {
- if ( g_branchname.IsEmpty() )
- {
- strBranchId = g_domain;
- }
- else
- {
- strBranchName = g_branchname;
- strBranchId = GetDomainFromBranch( g_branchname );
- }
- }
-
- strOrderNum = m_FurtherList.GetItemText(nSelectedItem, 0 + m_nAdd);
-
- strJingxiuRen = m_FurtherList.GetItemText(nSelectedItem, 13 + m_nAdd);
-
- strJingxiuState = m_FurtherList.GetItemText(nSelectedItem, 6 + m_nAdd);
-
- strJingxiuDate = m_FurtherList.GetItemText(nSelectedItem, 7 + m_nAdd);
-
- strCustomerInfo = m_FurtherList.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_FurtherList.GetItemText(nSelectedItem, 2 + m_nAdd);
- CDlgChuXiuInfo xpdlg;
- xpdlg.m_strOrderNumber = strOrderNum;
- xpdlg.m_strXiupianRen = strJingxiuRen;
- if ( strJingxiuState == _T("OK") )
- xpdlg.m_nXiupianStatus = 0;
- else if ( strJingxiuState == _T("修片中"))
- xpdlg.m_nXiupianStatus = 1;
- else if ( strJingxiuState == _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 )
- strJingxiuState = _T("OK");
- else if ( xpdlg.m_nXiupianStatus == 1)
- strJingxiuState = _T("修片中");
- else if ( xpdlg.m_nXiupianStatus == 2 )
- strJingxiuState = _T("未修");
- strJingxiuRen = xpdlg.m_strXiupianRen;
- if (strJingxiuDate.IsEmpty())
- strSQL.Format(_T("update dindan set waiter7 = '%s', status6 = '%s', time9 = '%s' where id = '%s' "), strJingxiuRen, strJingxiuState, g_date, strOrderNum);
- else
- strSQL.Format(_T("update dindan set waiter7 = '%s', status6 = '%s' where id = '%s'"), strJingxiuRen, strJingxiuState, 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 = "";
- }
- 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(6 + m_nAdd, strJingxiuState);
- if ( strJingxiuDate.IsEmpty() )
- m_List1array.ElementAt(i).SetAt(7 + m_nAdd, g_date);
- m_List1array.ElementAt(i).SetAt(13 + m_nAdd, strJingxiuRen);
- 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 )
- {
- pImport->ImportFurtherImg(
- FALSE,
- strBranchId,
- strOrderNum,
- strCustomerInfo,
- !strScenery.IsEmpty(),
- strScenery,
- _T("*.jpg|*.jpeg"),
- INVALID_COPY_PIX,
- _T("*.nef|*.cr2"),
- TRUE,
- SET_PIX(100,100),
- FALSE
- );
- g_pIMGProcess->Release();
- }
-
- #else
- POSITION pos;
- pos = m_FurtherList.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_FurtherList.GetNextSelectedItem(pos);
- CString branch;
- CString id = m_FurtherList.GetItemText(iItem, 0 + m_nAdd);
- if (g_bAllBranch)
- branch = m_FurtherList.GetItemText(iItem, 0);
- CString oldstatus = m_FurtherList.GetItemText(iItem, 6 + m_nAdd);
- CString time9 = m_FurtherList.GetItemText(iItem, 7 + m_nAdd);
- CString name = m_FurtherList.GetItemText(iItem, 1 + m_nAdd) + "," + m_FurtherList.GetItemText(iItem, 2 + m_nAdd);
- name.TrimLeft(",");
- name.TrimRight(",");
- name = "客人:" + name;
- CString phone = m_FurtherList.GetItemText(iItem, 15 + m_nAdd) + "," + m_FurtherList.GetItemText(iItem, 16 + 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];
-
- if (CNetShareInfo::GetInstance()->GetEnableShareDirectory(3, id, strDomain, szSharePath))
- {
- savepath.Format("%s\\",szSharePath);
- }
- else
- {
- AfxMessageBox(_T("没有可用的共享目录!"));
- return;
- }
- #else
- savepath += id + "\\";
- #endif
-
- if (::CheckFolderFileExist(savepath) == 0)
- {
- if ( !CreateDirectory(savepath, NULL) )
- {
- DWORD dwError = GetLastError();
- AfxMessageBox(_T("创建精修订单目录失败"));
- return;
- }
- }
- CString srcdir; CString str;
- GetSavePath(srcdir);
- if (srcdir.IsEmpty())
- {
- CString status6;
- if (AfxMessageBox("客照是否全部精修完毕?", MB_YESNO | MB_ICONINFORMATION) == IDYES)
- status6 = "OK";
- else
- status6 = "修片中";
- CString sql;
- if (time9.IsEmpty())
- sql = "update dindan set status6='" + status6 + "',time9='" + g_date + "' where id='" + id + "'";
- else
- sql = "update dindan set status6='" + status6 + "' 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(6 + m_nAdd, status6);
- if (time9.IsEmpty())
- m_List1array.ElementAt(i).SetAt(7 + m_nAdd, g_date);
- FillGrid();
- break;
- }
- }
- }
- return;
- }
- if (srcdir.GetLength() < 4)
- {
- AfxMessageBox("请选择正确的您文件所在的目录!", MB_ICONSTOP);
- return;
- }
- if (oldstatus != "未修")
- {
- str.Format("%s\r\n%s\r\n此单已导入过修片,确认您选中的照片没有导入过吗? 否则会覆盖原来的照片, 是否继续?", name, phone);
- if (AfxMessageBox(str, MB_YESNO | MB_ICONSTOP) != IDYES)
- return;
- }
- else
- {
- 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)
- {
-
- 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)
- {
-
- 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;
- #if USE_SHARE_FLORD
- dlg.m_id = id;
- #endif
- dlg.m_branch = branch;
- dlg.m_nphototype = 2;
- dlg.m_bOverWrite = 1;
- dlg.m_pArray = &array;
- dlg.m_pDesArray = &desarray;
- dlg.m_savepath = savepath;
- #ifdef ENTERPRISE_VERSION
-
- {
- dlg.m_bSaveUploadTask = g_bSaveUploadTask3;
- dlg.m_sel = g_cominfoarraylocal.ElementAt(0).ElementAt(80);
- 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 status6;
- if (AfxMessageBox("客照是否全部精修完毕?", MB_YESNO | MB_ICONINFORMATION) == IDYES)
- status6 = "OK";
- else
- status6 = "修片中";
- CString sql;
- if (time9.IsEmpty())
- sql = "update dindan set status6='" + status6 + "',waiter7='" + g_user.name + "',time9='" + g_date + "' where id='" + id + "'";
- else
- sql = "update dindan set status6='" + status6 + "',waiter7='" + 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);
- 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(6 + m_nAdd, status6);
- if (time9.IsEmpty())
- m_List1array.ElementAt(i).SetAt(7 + m_nAdd, g_date);
- m_List1array.ElementAt(i).SetAt(11 + m_nAdd, g_user.name);
- FillGrid();
- break;
- }
- }
- }
- #endif
- }
- void BeautifySkinFrom2::OnBUTshowphoto()
- {
- POSITION pos;
- pos = m_FurtherList.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_FurtherList.GetNextSelectedItem(pos);
- CString branch;
- CString id = m_FurtherList.GetItemText(iItem, 0 + m_nAdd);
- if (g_bAllBranch)
- branch = m_FurtherList.GetItemText(iItem, 0);
- CString name = m_FurtherList.GetItemText(iItem, 1 + m_nAdd) + "," + m_FurtherList.GetItemText(iItem, 2 + m_nAdd);
- name.TrimLeft(",");
- name.TrimRight(",");
- name = "客人:" + name;
- ShowPic dlg;
- dlg.m_id = id;
- dlg.m_name = name;
- dlg.m_mode = 3;
- if(g_branchname == _T(""))
- dlg.m_path = g_path1 + "\\";
- else
- {
- dlg.m_branch = GetDomainFromBranch(g_branchname);
- CString branchpath = GetBranchPhotoPath(g_branchname);
- dlg.m_path = g_path1 + branchpath + "\\";
- }
- #ifndef USE_KERNEL_DLL
- #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
- #endif
- dlg.m_path += id;
- dlg.m_path += "\\";
- dlg.DoModal();
- }
- void BeautifySkinFrom2::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);
- }
- }
- CString BeautifySkinFrom2::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(6) + SEPS_VEB;
- #else
- str = "," + spnamearray.ElementAt(i).ElementAt(6) + ",";
- #endif
- if (str.Find(name) != -1)
- {
- ret += spnamearray.ElementAt(i).ElementAt(5);
- ret += ";";
- }
- }
- ret.TrimRight(";");
- ret.Replace("*", "x");
- return ret;
- }
- CString GetPathFromNo2(CString dir, CString no)
- {
- CString sRet;
- dir.TrimRight('\\');
- dir += "\\";
- CStringArray dirarray;
- CString temp;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(dir), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();coo.end() != it;it++)
- {
- temp = (*it).c_str();
- if (::FindArray(&dirarray, temp) == -1 && temp != dir)
- {
- dirarray.Add(temp);
- }
- }
- for (int i = 0; i < dirarray.GetSize(); i++)
- {
- temp = dirarray.ElementAt(i);
- sRet.Format("%s%s.jpg", temp, no);
- if (::PathFileExists(sRet))return sRet;
- sRet.Replace(".jpg", ".raw");
- if (::PathFileExists(sRet))return sRet;
- sRet.Replace(".raw", ".nef");
- if (::PathFileExists(sRet))return sRet;
- sRet.Replace(".nef", ".cr2");
- if (::PathFileExists(sRet))return sRet;
- sRet.Replace(".cr2", ".jpg");
- if (::PathFileExists(sRet))return sRet;
- }
- return dir + no + ".jpg";
- }
- CString GetPathFromNo3(CString dir, CString no)
- {
- CString sRet;
- dir.TrimRight('\\');
- dir += "\\";
- CStringArray dirarray;
- CString temp;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(dir), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();coo.end() != it;it++)
- {
- temp = (*it).c_str();
- if (::FindArray(&dirarray, temp) == -1 && temp != dir)
- {
- dirarray.Add(temp);
- }
- }
- for (int i = 0; i < dirarray.GetSize(); i++)
- {
- temp = dirarray.ElementAt(i);
- sRet.Format("%s%s.jpg", temp, no);
- if (::PathFileExists(sRet))return sRet;
- }
- return dir + no + ".jpg";
- }
- void BeautifySkinFrom2::OnBUTexportphoto()
- {
- #ifdef USE_KERNEL_DLL
-
- if ( !IsHasRights2new(10) )
- {
- AfxMessageBox(_T("您没有权限导出选好的片!"));
- return;
- }
-
- POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
- if ( pos == NULL )
- {
- AfxMessageBox(__T("请选中您要导片的订单!"));
- return;
- }
- INT nItemCount = m_FurtherList.GetItemCount();
- INT nSelectedItem = m_FurtherList.GetNextSelectedItem(pos);
-
- CString strBranchName = _T("");
- CString strBranchId = _T("");
- CString strOrderNum = _T("");
- CString strScenery = _T("");
- CString strCustomerInfo = _T("");
- CString strXuanpianRen = _T("");
- CString strXuanpianState = _T("");
- CString strXuanpianDate = _T("");
-
- strOrderNum = m_FurtherList.GetItemText(nSelectedItem, 0 + m_nAdd);
-
- strCustomerInfo = m_FurtherList.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_FurtherList.GetItemText(nSelectedItem, 2 + m_nAdd);
-
- strXuanpianState = m_FurtherList.GetItemText(nSelectedItem, 4 + m_nAdd);
-
- strXuanpianRen = m_FurtherList.GetItemText(nSelectedItem, 5 + m_nAdd);
- if ( strXuanpianState == _T("未选") )
- {
- MessageBox(_T("此单未选片!"), _T("影楼管理"), MB_OK | MB_TOPMOST | MB_ICONINFORMATION );
- return;
- }
-
- if ( g_bAllBranch )
- {
- strBranchName = m_FurtherList.GetItemText(nSelectedItem, 0);
- strBranchId = GetDomainFromBranch(strBranchName);
- }
- else
- {
- if ( g_branchname.IsEmpty() )
- {
- strBranchId = g_domain;
- }
- else
- {
- strBranchName = g_branchname;
- strBranchId = GetDomainFromBranch( g_branchname );
- }
- }
-
- 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 )
- {
-
- strScenery = IsGrowthtxdlg.m_seltxname;
- if ( strScenery == _T("全部") )
- {
- strScenery.Empty();
- }
- }
-
-
- CString strSQL = _T("");
- #ifdef CHILD_VERSION
- if ( IsGrowthtxdlg.m_bGrowthTx && !strScenery.IsEmpty() )
- strSQL.Format(_T("id='%s' and growthtxname = '%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
- g_sendhead.bsql = FALSE;
- g_sendhead.code[0] = 50;
- g_sendhead.code[1] = 11;
- g_sendhead.code[2] = 56;
- 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;
-
- int i = 0;
- int nSize = Arydindansp.GetSize();
- for ( i = 0; i < nSize; i++)
- {
- strTemp = Arydindansp.ElementAt(i).ElementAt(6);
- 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));
- }
-
- 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("?|?");
- }
-
- SelectPhotoDlg selectdlg;
- selectdlg.DoModal();
- BOOL bExportWithName = selectdlg.m_check1;
- INT bExportMode = selectdlg.m_mode;
-
- CString strSaveDirectory = _T("");
- if ( g_pIMGProcess == NULL )
- {
- return ;
- }
- ImgExportInterface *pExport = NULL;
- g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
- if ( pExport )
- {
- HGLOBAL hMemery = pExport->ExportSelectedBeautifyImg(
- strBranchId,
- strOrderNum,
- strCustomerInfo,
- !strScenery.IsEmpty(),
- strScenery,
- _T("*.jpg|*.jpeg"),
- INVALID_COPY_PIX,
- _T("*.nef|*.cr2|*.raw|"),
- FALSE,
- bExportWithName,
- IsGrowthtxdlg.m_bGrowthTx,
- bExportMode,
- strImgNums,
- strPerImgGoods,
- Arydindan.ElementAt(0).ElementAt(60)
- );
- if ( hMemery )
- {
- CString strDir = _T("");
- TCHAR* pszSaveDirectory = (TCHAR*)GlobalLock(hMemery);
- GlobalUnlock(hMemery);
-
- strDir.Format(_T("%s\\客户要求.txt"), pszSaveDirectory);
- if ( Arydindan.GetSize() )
- {
- CStdioFile fp;
- fp.Open(strDir, CFile::modeCreate | CFile::modeWrite);
- fp.WriteString(_T("选片要求:\n"));
- fp.WriteString(Arydindan.ElementAt(0).ElementAt(39) + _T(" ") + Arydindan.ElementAt(0).ElementAt(75));
- fp.WriteString(_T("\n"));
- fp.WriteString(_T("\n"));
- fp.WriteString(_T("订单要求:\n"));
- fp.WriteString(Arydindan.ElementAt(0).ElementAt(38));
- fp.WriteString(_T("\n"));
- fp.WriteString(_T("\n"));
- fp.WriteString(_T("客人产品:\n"));
- CString str;
- str = _T("产品名称");
- FillLength(str, 30);
- str += _T("数量");
- FillLength(str, 40);
- #ifdef LKAY_VERSION
- str += _T("P数");
- FillLength(str, 50);
- str += _T("加急");
- FillLength(str, 60);
- str += _T("取件日期");
- FillLength(str, 70);
- #else
- str += _T("加急");
- FillLength(str, 50);
- str += _T("取件日期");
- FillLength(str, 60);
- #endif
- fp.WriteString(str);
- fp.WriteString(_T("\n"));
- for (int i = 0; i < Arydindansp2.GetSize(); i++)
- {
- str.Empty();
- str = Arydindansp2.ElementAt(i).ElementAt(0);
- FillLength(str, 30);
- str += Arydindansp2.ElementAt(i).ElementAt(1);
- FillLength(str, 40);
- #ifdef LKAY_VERSION
- str += Arydindansp2.ElementAt(i).ElementAt(29);
- FillLength(str, 50);
- str += Arydindansp2.ElementAt(i).ElementAt(18);
- FillLength(str, 60);
- str += Arydindansp2.ElementAt(i).ElementAt(19);
- FillLength(str, 70);
- #else
- str += Arydindansp2.ElementAt(i).ElementAt(18);
- FillLength(str, 50);
- str += Arydindansp2.ElementAt(i).ElementAt(19);
- FillLength(str, 60);
- #endif
- fp.WriteString(str);
- fp.WriteString(_T("\n"));
- }
- fp.Close();
- }
-
- if ( g_bExportBarCode )
- {
- for ( int j = Arydindansp.GetSize() - 1; j >= 0; j-- )
- {
- if ( Arydindansp.ElementAt(j).ElementAt(6).IsEmpty() )
- Arydindansp.RemoveAt(j);
- }
- if ( !bExportWithName )
- {
- for ( int i = 0; i < Arydindansp.GetSize(); i++ )
- {
- strDir.Format(_T("%s\\%s"), pszSaveDirectory, Arydindansp.ElementAt(i).ElementAt(5));
- if ( PathFileExists(strDir) )
- {
-
- pExport->ExportBarCodeImg(0, g_screenwid, g_screenhei, 1, 40, Arydindansp.ElementAt(i).ElementAt(7), Arydindansp.ElementAt(i).ElementAt(0), Arydindansp.ElementAt(i).ElementAt(5), strDir);
- }
- }
- }
- pExport->ExportOrderBarCodeImg(0, g_screenwid, g_screenhei*3, 1, 40, Arydindansp, pszSaveDirectory);
- }
- }
- OutputDebugString(_T("导出选好的片!\n"));
- }
- pExport->Release();
-
- #else
-
- if (IsHasRights2new(10) == 0)return;
- #if USE_SHARE_FLORD
- BOOL bOfmat = FALSE;
- BOOL bGrowth = FALSE;
- BOOL bExportWithName = FALSE;
- CString name1,name2,branch,strdomain,strOrderNumber,strGrowhTx = _T("");
- CStringArray array,spnamearray2;
- OUT CArray<CStringArray, CStringArray> sparray2;
- GetCurSelRecord(name1,name2,strOrderNumber,branch,strdomain);
- int nResult = GetImageWithGoods(branch,strdomain,strOrderNumber,bGrowth,strGrowhTx,bExportWithName,array,spnamearray2,sparray2);
- if ( nResult == -1 )
- {
-
- return;
- }
- CString strSaveDiretory;
- GetSavePath(strSaveDiretory);
- if(strSaveDiretory.IsEmpty())return;
- strSaveDiretory.TrimRight ('\\');
- strSaveDiretory+="\\";
- strSaveDiretory+=strOrderNumber;
- strSaveDiretory+=g_branchname;
- if(g_bAllBranch)
- {
- if(GetBranchPhotoPath(branch)!="")
- strSaveDiretory+=branch;
- }
- strSaveDiretory+=name1;
- strSaveDiretory+=name2;
- strSaveDiretory+="选片";
- strSaveDiretory+="\\";
- if ( nResult == 3 )
- {
-
- strSaveDiretory.Delete(strSaveDiretory.GetLength()-1, 1);
- strSaveDiretory += _T("(未修)\\");
- bOfmat = TRUE;
- }
- ::CreateDirectory (strSaveDiretory, NULL);
- #else
-
- UpdateData();
- POSITION pos;
- pos = m_FurtherList.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
- return;
- }
-
- int iItem = m_FurtherList.GetNextSelectedItem(pos);
- CString status2 = m_FurtherList.GetItemText(iItem, 4 + m_nAdd);
- if (status2 != "OK")
- {
- AfxMessageBox("此单未选片!", MB_ICONINFORMATION);
- return;
- }
-
- BOOL bOfmat = 0;
- CString strOrderNumber = m_FurtherList.GetItemText(iItem, 0 + m_nAdd);
- CString branch;
- if (g_bAllBranch)
- branch = m_FurtherList.GetItemText(iItem, 0);
- CString name1 = m_FurtherList.GetItemText(iItem, 1 + m_nAdd);
- CString name2 = m_FurtherList.GetItemText(iItem, 2 + m_nAdd);
-
- IsGrowthTx growthtxdlg;
- growthtxdlg.m_mode = 1;
- growthtxdlg.m_strOrderNumber = strOrderNumber;
- growthtxdlg.DoModal();
- BOOL m_bGrowthTX = growthtxdlg.m_bGrowthTx;
- CString m_seltxname = growthtxdlg.m_seltxname;
- #ifdef CHILD_VERSION
- CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底'";
- if (m_seltxname != "" && m_seltxname != "全部")
- {
- filter = "id='" + strOrderNumber + "' and growthtxname='" + m_seltxname + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底'";
- }
- #else
- CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"' 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 strSrcDiretory;
- if (g_bAllBranch)
- {
- CString branchpath = GetBranchPhotoPath(branch);
- strSrcDiretory = g_path2 + branchpath + "\\";
- }
- else
- strSrcDiretory = g_path2 + "\\";
-
- SelectPhotoDlg selectdlg;
- selectdlg.DoModal();
- strSrcDiretory += strOrderNumber;
- strSrcDiretory += "\\";
- if (m_seltxname != "" && m_seltxname != "全部")
- {
- strSrcDiretory += m_seltxname;
- strSrcDiretory += "\\";
- }
-
- CString str, spname;
- CStringArray noarray;
- CStringArray spnamearray;
- for (int i = 0; i < sparray.GetSize(); i++)
- {
- str = sparray.ElementAt(i).ElementAt(6);
- 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, GetSelName(str, sparray));
- }
- CString strSaveDiretory;
- GetSavePath(strSaveDiretory);
- if (strSaveDiretory.IsEmpty())return;
- strSaveDiretory.TrimRight('\\');
- strSaveDiretory += "\\";
- strSaveDiretory += strOrderNumber;
- strSaveDiretory += g_branchname;
- if (g_bAllBranch)
- {
- if (GetBranchPhotoPath(branch) != "")
- strSaveDiretory += branch;
- }
- strSaveDiretory += name1;
- strSaveDiretory += name2;
- strSaveDiretory += "选片";
- strSaveDiretory += "\\";
- CStringArray array;
- CStringArray spnamearray2;
- CString src, des;
- if (selectdlg.m_mode == 0)
- {
- for (i = 0; i < noarray.GetSize(); i++)
- {
- if ((m_seltxname != "" && m_seltxname != "全部") || m_bGrowthTX == 0)
- src.Format("%s%s.jpg", strSrcDiretory, noarray.ElementAt(i));
- else
- src = GetPathFromNo3(strSrcDiretory, noarray.ElementAt(i));
-
- if (PathFileExists(src))
- {
-
- array.Add(src);
- if (1)
- spnamearray2.Add(spnamearray.ElementAt(i));
- else
- spnamearray2.Add(noarray.ElementAt(i));
- }
- else
- AfxMessageBox("未找到初修过的文件:" + src.Right(src.GetLength() - src.ReverseFind('\\') - 1), MB_ICONINFORMATION);
- }
- }
- if (array.GetSize() == 0)
- {
- if (selectdlg.m_mode == 0)
- AfxMessageBox("注意:此单未修片, 导出的是原片!", MB_ICONINFORMATION);
- if (g_bAllBranch)
- {
- CString branchpath = GetBranchPhotoPath(branch);
- strSrcDiretory = g_path1 + branchpath + "\\";
- }
- else
- strSrcDiretory = g_path1 + "\\";
- strSrcDiretory += strOrderNumber;
- strSrcDiretory += "\\";
- strSaveDiretory.Delete(strSaveDiretory.GetLength() - 1, 1);
- strSaveDiretory += "(未修)\\";
- bOfmat = 1;
- for (i = 0; i < noarray.GetSize(); i++)
- {
-
- src = GetPathFromNo2(strSrcDiretory, noarray.ElementAt(i));
-
- if (PathFileExists(src))
- {
-
- array.Add(src);
- if (1)
- spnamearray2.Add(spnamearray.ElementAt(i));
- else
- spnamearray2.Add(noarray.ElementAt(i));
- }
- else
- AfxMessageBox("未找到原片文件:" + src.Right(src.GetLength() - src.ReverseFind('\\') - 1), MB_ICONINFORMATION);
- }
- }
- if (array.GetSize() == 0)
- {
- AfxMessageBox("此单未导入原片!", MB_ICONINFORMATION);
- return;
- }
- ::CreateDirectory(strSaveDiretory, NULL);
- #endif
-
- ImportPhoto dlg;
- dlg.m_name = name1 + name2;
- #if USE_SHARE_FLORD
- dlg.m_bAddname = bExportWithName;
- #else
- dlg.m_bAddname = selectdlg.m_check1;
- #endif
- dlg.m_bOfmat = bOfmat;
- dlg.m_mode = 1;
- dlg.m_bOrigin = 1;
- dlg.m_pArray = &array;
- dlg.m_pArray2 = &spnamearray2;
- dlg.m_savepath = strSaveDiretory;
- dlg.DoModal();
-
- if (g_List1array.GetSize())
- {
- CStdioFile fp;
- fp.Open(strSaveDiretory + "客户要求.txt", CFile::modeCreate | CFile::modeWrite);
- fp.WriteString("选片要求:\n");
- fp.WriteString(g_List1array.ElementAt(0).ElementAt(39) + " " + g_List1array.ElementAt(0).ElementAt(75));
- 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, 30);
- str += "数量";
- FillLength(str, 40);
- #ifdef LKAY_VERSION
- str += "P数";
- FillLength(str, 50);
- str += "加急";
- FillLength(str, 60);
- str += "取件日期";
- FillLength(str, 70);
- #else
- str += "加急";
- FillLength(str, 50);
- str += "取件日期";
- FillLength(str, 60);
- #endif
- fp.WriteString(str);
- fp.WriteString("\n");
- for (int i = 0; i < sparray2.GetSize(); i++)
- {
- str.Empty();
- str = sparray2.ElementAt(i).ElementAt(0);
- FillLength(str, 30);
- str += sparray2.ElementAt(i).ElementAt(1);
- FillLength(str, 40);
- #ifdef LKAY_VERSION
- str += sparray2.ElementAt(i).ElementAt(29);
- FillLength(str, 50);
- str += sparray2.ElementAt(i).ElementAt(18);
- FillLength(str, 60);
- str += sparray2.ElementAt(i).ElementAt(19);
- FillLength(str, 70);
- #else
- str += sparray2.ElementAt(i).ElementAt(18);
- FillLength(str, 50);
- str += sparray2.ElementAt(i).ElementAt(19);
- FillLength(str, 60);
- #endif
- fp.WriteString(str);
- fp.WriteString("\n");
- }
- fp.Close();
- }
-
- AfxMessageBox("导片成功!", MB_ICONINFORMATION);
- #if JEFF_TEST_ON
-
-
- if (FALSE == g_List1array.ElementAt(0).ElementAt(60).IsEmpty())
- #if USE_SHARE_FLORD
- ;
- #else
-
- ExportCutImageToFile(g_List1array.ElementAt(0).ElementAt(60), strSrcDiretory, strSaveDiretory+_T("裁剪效果\\"));
- #endif
- #else
- {
- ShowCut dlg;
- dlg.m_branch = branch;
- dlg.m_mode = 1;
- dlg.m_id = strOrderNumber;
- dlg.DoModal();
- }
- #endif
- CString strlog;
- strlog = " 导出选片 ";
- strlog += "客人:";
- strlog += name1 + name2 + strOrderNumber;
- WriteLog(_T("精修导出选好的片"), strlog);
- #endif
- }
- void BeautifySkinFrom2::OnBUTexportphoto2()
- {
- #ifdef USE_KERNEL_DLL
-
- if ( !IsHasRights2new(11) )
- {
- AfxMessageBox(_T("您无权限导出原片!"),MB_ICONINFORMATION);
- return;
- }
-
- POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
- if ( pos == NULL )
- {
- AfxMessageBox(_T("请选中您要导出原片的订单!"), MB_ICONINFORMATION);
- return;
- }
- INT nItemCount = m_FurtherList.GetItemCount();
- INT nSelectedItem = m_FurtherList.GetNextSelectedItem(pos);
- CString strBranchId = _T("");
- CString strOrderNum = _T("");
-
- CString strScenery = _T("");
- CString strCustomerInfo = _T("");
-
- if ( g_bAllBranch )
- {
- strBranchId = GetDomainFromBranch( m_FurtherList.GetItemText(nSelectedItem, 0) );
- }
- else
- {
- if ( g_branchname.IsEmpty() )
- {
- strBranchId = g_domain;
- }
- else
- {
- strBranchId = GetDomainFromBranch( g_branchname );
- }
- }
-
- strOrderNum = m_FurtherList.GetItemText(nSelectedItem, 0 + m_nAdd);
-
- strCustomerInfo = m_FurtherList.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_FurtherList.GetItemText(nSelectedItem, 2 + m_nAdd);
-
- 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 )
- {
-
- 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();
-
- #else
- if (IsHasRights2new(11) == 0)return;
- POSITION pos;
- pos = m_FurtherList.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要导出片的定单!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_FurtherList.GetNextSelectedItem(pos);
- CString id = m_FurtherList.GetItemText(iItem, 0 + m_nAdd);
- #if USE_SHARE_FLORD
- CString branch;
- if(g_bAllBranch)
- branch=m_FurtherList.GetItemText (iItem, 0);
- CString strDomain = _T("");
- CString savepath = _T("");
- if (g_bAllBranch)
- {
- if(branch != _T(""))
- strDomain = GetDomainFromBranch(branch);
- }
- else
- {
- if(g_branchname != _T(""))
- strDomain = GetDomainFromBranch(g_branchname);
- }
-
-
- CStringArray array;
- CNetShareInfo::GetInstance()->LoadOrderImages(3, id, strDomain,array);
- if(array.GetSize ()==0)
- {
- AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
- return;
- }
-
- CString dir;
- GetSavePath(dir);
- if(dir.IsEmpty())
- {
- return;
- }
- CString name1=m_FurtherList.GetItemText (iItem, 1+m_nAdd);
- CString name2=m_FurtherList.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);
-
- int nIndex = 0;
- CString strTemp;
- CStringArray desarray;
- for ( int i = 0; i < array.GetSize(); i++ )
- {
-
- strTemp = array.ElementAt(i).Mid(array.ElementAt(i).Find(id) + id.GetLength() + 1 );
- desarray.Add(dir + strTemp);
- if ( (nIndex = strTemp.Find("\\")) != -1 )
- {
- strTemp = strTemp.Left( nIndex + 1 );
- CreateDirectory(dir + strTemp, NULL);
- }
- }
- #else
- CString branch;
- if (g_bAllBranch)
- branch = m_FurtherList.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_FurtherList.GetItemText(iItem, 1 + m_nAdd);
- CString name2 = m_FurtherList.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;
- }
- #endif
- CCompressOption comoptdlg;
- comoptdlg.DoModal();
- ImportPhoto dlg;
- dlg.m_nOutputSize = comoptdlg.m_nsize;
- dlg.m_mode = 1;
- dlg.m_pArray = &array;
- dlg.m_pDesArray = &desarray;
- dlg.m_savepath = dir;
- dlg.DoModal(); AfxMessageBox("导片成功!", MB_ICONINFORMATION);
- CString str;
- str = " 导出精修片 ";
- str += "客人:";
- str += name1 + name2 + id;
- WriteLog(_T("导出精修片"), str);
- #endif
- }
- void BeautifySkinFrom2::OnButton1()
- {
- UpdateData();
- m_filter.TrimLeft();
- m_filter.TrimRight();
- FillGrid();
- }
- void BeautifySkinFrom2::OnButton2()
- {
- UpdateData();
- m_filter.TrimLeft();
- m_filter.TrimRight();
- FillGrid(1);
- }
- void BeautifySkinFrom2::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
- POSITION pos;
- pos = m_FurtherList.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- return;
- }
- int iItem = m_FurtherList.GetNextSelectedItem(pos);
- if (IsHasRights2new(6) || IsHasRights2new(49))
- {
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
- }
- else
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
-
- *pResult = 0;
- }
- void BeautifySkinFrom2::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- POSITION pos;
- pos = m_FurtherList.GetFirstSelectedItemPosition();
- if (pos == NULL)return;
- int iItem = m_FurtherList.GetNextSelectedItem(pos);
- g_id = m_FurtherList.GetItemText(iItem, 0 + m_nAdd);
- *pResult = 0;
- }
- void BeautifySkinFrom2::HidePrice()
- {
- #ifdef LKAY_VERSION
- if (IsHasRights2new(31))return;
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- m_List1array.ElementAt(i).SetAt(14 + m_nAdd, "***");
- m_List1array.ElementAt(i).SetAt(15 + m_nAdd, "***");
- m_List1array.ElementAt(i).SetAt(16 + m_nAdd, "***");
- m_List1array.ElementAt(i).SetAt(13 + m_nAdd, "***");
- }
- #else
- if (IsHasRights2new(31))return;
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- m_List1array.ElementAt(i).SetAt(17 + m_nAdd, "***");
- m_List1array.ElementAt(i).SetAt(18 + m_nAdd, "***");
- }
- #endif
- }
- void BeautifySkinFrom2::OnBtnsearchfilter()
- {
- SearchFilter dlg;
- dlg.m_mode = 3;
- if (dlg.DoModal() == IDOK)FillGrid();
- g_bSearchFilter = 0;
- }
- void BeautifySkinFrom2::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] = 35;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if (g_bSendOK == 0)return;
- }
- else
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 35;
- 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] = 35;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if (g_bSendOK == 0)continue;
- }
- else
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 35;
- 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 = "";
- }
- HidePrice();
- FillGrid();
- }
- void BeautifySkinFrom2::OnBUTprint3()
- {
- GetData();
- }
- void BeautifySkinFrom2::OnBUTexportphotoAddName()
- {
- if (IsHasRights2new(10) == 0)return;
- UpdateData();
- POSITION pos;
- pos = m_FurtherList.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_FurtherList.GetNextSelectedItem(pos);
- CString status2 = m_FurtherList.GetItemText(iItem, 4);
- if (status2 != "OK")
- {
- AfxMessageBox("此单未选片!", MB_ICONINFORMATION);
- return;
- }
- CString id = m_FurtherList.GetItemText(iItem, 0);
- CString name1 = m_FurtherList.GetItemText(iItem, 1);
- CString name2 = m_FurtherList.GetItemText(iItem, 2);
- CString filter = "id='" + id + "';id='" + id + "'";
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 50;
- g_sendhead.code[1] = 11;
- g_sendhead.tabcount = 2;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- DataToArray(&sparray, &g_List1array);
- CString path = g_path2 + "\\";
- SelectPhotoDlg selectdlg;
- selectdlg.DoModal();
- 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(6);
- 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, GetSelName(str, sparray) + "-" + str);
- }
- CString dir;
- GetSavePath(dir);
- if (dir.IsEmpty())return;
- dir.TrimRight('\\');
- dir += "\\";
- dir += id;
- dir += name1;
- dir += name2;
- dir += "选片";
- dir += "\\";
- CStringArray array;
- CStringArray spnamearray2;
- CString src, des;
-
- if (selectdlg.m_mode == 2)
- {
- for (i = 0; i < noarray.GetSize(); i++)
- {
- src.Format("%s%s.jpg", path, noarray.ElementAt(i));
- if (::CheckFolderFileExist(src))
- {
- array.Add(src);
- if (selectdlg.m_check1)
- spnamearray2.Add(spnamearray.ElementAt(i));
- else
- spnamearray2.Add(noarray.ElementAt(i));
- }
- else
- AfxMessageBox("未找到初修过的文件:" + src.Right(src.GetLength() - src.ReverseFind('\\') - 1), MB_ICONINFORMATION);
- }
- }
- if (array.GetSize() == 0)
- {
- if (selectdlg.m_mode == 2)
- AfxMessageBox("注意:此单未修片, 导出的是原片!", MB_ICONINFORMATION);
- path = g_path1 + "\\";
- path += id;
- path += "\\";
- dir.Delete(dir.GetLength() - 1, 1);
- dir += "(未修)\\";
- for (i = 0; i < noarray.GetSize(); i++)
- {
- src = GetPathFromNo2(path, noarray.ElementAt(i));
- if (PathFileExists(src))
- {
- array.Add(src);
- if (selectdlg.m_check1)
- spnamearray2.Add(spnamearray.ElementAt(i));
- else
- spnamearray2.Add(noarray.ElementAt(i));
- }
- }
- }
- if (array.GetSize() == 0)
- {
- AfxMessageBox("此单未导入原片!", MB_ICONINFORMATION);
- return;
- }
- ::CreateDirectory(dir, NULL);
- ImportPhoto dlg;
- dlg.m_mode = 1;
- dlg.m_pArray = &array;
- dlg.m_pArray2 = &spnamearray2;
- dlg.m_savepath = dir;
- dlg.DoModal();
-
- if (g_List1array.GetSize())
- {
- CStdioFile fp;
- fp.Open(dir + "客户要求.txt", CFile::modeCreate | CFile::modeWrite);
- fp.WriteString(g_List1array.ElementAt(0).ElementAt(39));
- fp.Close();
- }
-
- AfxMessageBox("导片成功!", MB_ICONINFORMATION);
- }
- #if USE_SHARE_FLORD
- void BeautifySkinFrom2::GetCurSelRecord(
- OUT CString &strName1,
- OUT CString &strName2,
- OUT CString &strOrderNum,
- OUT CString &strBranch,
- OUT CString &strDomain)
- {
- UpdateData();
-
- POSITION pos = m_FurtherList.GetFirstSelectedItemPosition();
- if ( pos == NULL)
- {
- AfxMessageBox(_T("请先选中您要导片的定单!"), MB_ICONINFORMATION);
- return;
- }
- int nItem = m_FurtherList.GetNextSelectedItem(pos);
-
-
- CString strStatus = m_FurtherList.GetItemText(nItem,4 + m_nAdd);
- if ( strStatus != _T("OK") )
- {
- AfxMessageBox(_T("此单未选片!"), MB_ICONINFORMATION);
- return;
- }
- strOrderNum = m_FurtherList.GetItemText(nItem, 0 + m_nAdd);
- strName1 = m_FurtherList.GetItemText(nItem, 1 + m_nAdd);
- strName2 = m_FurtherList.GetItemText(nItem, 2 + m_nAdd);
- if ( g_bAllBranch )
- {
-
- strBranch = m_FurtherList.GetItemText(nItem, 0);
- strDomain = GetDomainFromBranch(strBranch);
- }
- else
- {
- if(g_branchname != _T(""))
- {
- strBranch = g_branchname;
- strDomain = GetDomainFromBranch(g_branchname);
- }
- }
- }
- int BeautifySkinFrom2::GetImageWithGoods(
- IN CString &strBranch,
- IN CString &strDomain,
- IN CString &strOrderNum,
- OUT BOOL &bGrowth,
- OUT CString &strSelGrowth,
- OUT BOOL &bExportWithName,
- OUT CStringArray &strAryOfImagePath,
- OUT CStringArray &strAryOfEachImageOfGoods,
- OUT CArray<CStringArray, CStringArray> &sparray2)
- {
-
- CStringArray strAryOfScenery;
- IsGrowthTx growthtxdlg;
- growthtxdlg.m_mode = 1;
- growthtxdlg.m_pAryOfScenery = &strAryOfScenery;
- growthtxdlg.m_strOrderNumber = strOrderNum;
- growthtxdlg.DoModal();
- bGrowth = growthtxdlg.m_bGrowthTx;
- strSelGrowth = growthtxdlg.m_seltxname;
-
- CString strFilter = _T("");
- #ifdef CHILD_VERSION
- if ( !strSelGrowth.IsEmpty() && strSelGrowth != _T("全部") )
- {
- strFilter.Format(_T("id='%s' and growthtxname = '%s'; id='%s'; id='%s' and name <> '入册' and name <> '入底'"), strOrderNum, strSelGrowth, strOrderNum, strOrderNum);
- }
- else
- {
- strFilter.Format(_T("id='%s'; id='%s'; id='%s' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
- }
- #else
- strFilter.Format(_T("id='%s'; id='%s'; id='%s' and kind <> '2' and name <> '入册' and name <> '入底'"), strOrderNum, strOrderNum, strOrderNum);
- #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_pMainWnd->ProcessChatMessageRequest2(strFilter);
- }
- else
- {
- g_branchip = GetIP(strBranch);
- g_pMainWnd->OnDisconnect();
- g_branchname = strBranch;
- g_bBranchModify = 1;
- g_pMainWnd->ProcessChatMessageRequest2(strFilter);
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0;
- g_branchip = g_branchname = _T("");
- }
- if( !g_bSendOK )
- return -1;
- CArray<CStringArray, CStringArray> sparray;
-
- DataToArray( &sparray, &g_List1array, &sparray2 );
-
- CString strTemp;
- CStringArray strAryOfImageNum;
-
- int i = 0;
- int nSize = sparray.GetSize();
- for ( i = 0; i < nSize; i++)
- {
- strTemp = sparray.ElementAt(i).ElementAt(6);
-
- GetNo(strTemp, strAryOfImageNum);
- }
- if ( strAryOfImageNum.GetSize() == 0 )
- {
- AfxMessageBox(_T("此单未选片!"),MB_ICONINFORMATION);
- return -1;
- }
-
- strAryOfEachImageOfGoods.SetSize(strAryOfImageNum.GetSize());
- nSize = strAryOfImageNum.GetSize();
- for( int n = 0; n < nSize; n++)
- {
- strTemp = strAryOfImageNum.ElementAt(n);
-
- CString strspnames = GetSelName(strTemp, sparray);
-
- strAryOfEachImageOfGoods.SetAt(n, strspnames);
- }
- CStringArray strTempImageGoods;
- strTempImageGoods.Copy(strAryOfEachImageOfGoods);
- SelectPhotoDlg selectdlg;
- selectdlg.DoModal();
- bExportWithName = selectdlg.m_check1;
- int nPhotoType = selectdlg.m_mode;
-
- CStringArray imagePathArr;
- CStringArray imageNumArr;
- imageNumArr.Copy(strAryOfImageNum);
- if(nPhotoType == 0)
- {
-
- for(i=2; i>0; --i)
- {
- imagePathArr.RemoveAll();
-
- LoadExistsImagesEx(i, strDomain, strOrderNum, bGrowth, strSelGrowth, strAryOfScenery, imageNumArr, imagePathArr, strAryOfEachImageOfGoods);
- if(strAryOfImagePath.GetSize() == 0)
- strAryOfImagePath.Append(imagePathArr);
- else
- {
- int nSize = strAryOfImagePath.GetSize();
- for(int j=0; j<nSize; j++)
- {
-
- CString strName1 = strAryOfImagePath.ElementAt(j);
- strName1 = strName1.Right(strName1.GetLength() - strName1.ReverseFind('\\') - 1);
- for(int k=0; k<imagePathArr.GetSize(); k++)
- {
- CString strName2 = imagePathArr.ElementAt(k);
- strName2 = strName2.Right(strName2.GetLength() - strName2.ReverseFind('\\') - 1);
- if(strName1 == strName2)
- {
- imagePathArr.RemoveAt(k);
- break;
- }
- }
- }
- if(imagePathArr.GetSize() > 0)
- strAryOfImagePath.Append(imagePathArr);
- }
- }
- }
- else
- {
- LoadExistsImagesEx(nPhotoType, strDomain, strOrderNum, bGrowth, strSelGrowth, strAryOfScenery, imageNumArr, imagePathArr, strAryOfEachImageOfGoods);
- if(imagePathArr.GetSize() > 0)
- strAryOfImagePath.Copy(imagePathArr);
- }
- if ( strAryOfImagePath.GetSize() == 0 && nPhotoType == 2)
- {
- AfxMessageBox(_T("注意:此单未修片, 导出的是原片!"), MB_ICONINFORMATION);
- nPhotoType = 1;
- strAryOfImagePath.RemoveAll();
- strAryOfEachImageOfGoods.RemoveAll();
- strAryOfEachImageOfGoods.Copy(strTempImageGoods);
- LoadExistsImagesEx(nPhotoType,strDomain,strOrderNum,bGrowth,strSelGrowth,strAryOfScenery,imageNumArr,imagePathArr,strAryOfEachImageOfGoods);
-
- if(imagePathArr.GetSize() > 0)
- strAryOfImagePath.Append(imagePathArr);
- return strAryOfImagePath.GetSize() ? 3 : -1;
- }
-
- CStringArray tempPathArr;
- tempPathArr.Copy(strAryOfImagePath);
- strAryOfImagePath.RemoveAll();
- for(int j=0; j<imageNumArr.GetSize(); j++)
- {
- BOOL bExists = FALSE;
- CString strNum = imageNumArr.ElementAt(j);
- for(i=0; i<tempPathArr.GetSize(); i++)
- {
- CString strFile = tempPathArr.ElementAt(i);
- strFile = strFile.Mid(strFile.ReverseFind('\\')+1);
- int nPos = strFile.Find(_T("."));
- if(nPos == -1)
- continue;
-
- strFile = strFile.Left(nPos);
- if(strNum.CompareNoCase(strFile) == 0)
- {
- strAryOfImagePath.Add(tempPathArr.ElementAt(i));
- bExists = TRUE;
- break;
- }
- }
- if(!bExists)
- strAryOfImagePath.Add(_T(""));
- }
- return strAryOfImagePath.GetSize() ? selectdlg.m_mode : -1;
- }
- void BeautifySkinFrom2::LoadExistsImagesEx(IN const int &nPhotoType,
- IN LPCTSTR lpDomain,
- IN LPCTSTR lpOrderNum,
- IN BOOL bGrowTh,
- IN LPCTSTR lpSelectName,
- IN CStringArray &strAryOfScenery,
- IN CStringArray &strAryOfImageNum,
- OUT CStringArray &strAryOfImagePath,
- OUT CStringArray &strAryOfImageGoods)
- {
- CStringArray strTempNum;
- strTempNum.Copy(strAryOfImageNum);
- CStringArray strTempImagePath;
-
- CNetShareInfo::GetInstance()->LoadOrderBySelectedImages(nPhotoType, lpOrderNum, lpDomain, strTempNum, strTempImagePath);
- CString strScenery(lpSelectName);
- if ( bGrowTh && ( !strScenery.IsEmpty() && strScenery != _T("全部")) )
- {
-
- CString str;
- if ( nPhotoType == 1 )
- {
-
- for ( int i = 0; i < strTempImagePath.GetSize(); i++)
- {
- str = strTempImagePath.ElementAt(i);
- str = str.Mid(str.Find(lpOrderNum) + strlen(lpOrderNum) + 1);
- str = str.Left(str.Find('\\'));
- if ( str.CompareNoCase(strScenery) == 0 )
- {
- strAryOfImagePath.Add(strTempImagePath.ElementAt(i));
- }
- }
- }
- else
- {
-
- for ( int i = 0; i < strTempImagePath.GetSize(); i++)
- {
- str = strTempImagePath.ElementAt(i);
- int nIndex = str.Find(lpOrderNum);
- str.Insert(nIndex + strlen(lpOrderNum) + 1, strScenery + _T("\\"));
- if ( PathFileExists(str) )
- strAryOfImagePath.Add(strTempImagePath.ElementAt(i));
- }
- }
- }
- else
- {
-
- strAryOfImagePath.Copy(strTempImagePath);
- }
-
- }
- #endif
|