1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216 |
- // BeautifySkinFrom.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "BeautifySkinFrom.h"
- #include "MyMdi.H"
- #include "ModifyDinDan.h"
- #include "InputPsw.h"
- #include "ImportPhoto.h"
- #include "ShowPic.h"
- #include "SelProvider.h"
- #include "CompressOption.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- //#pragma comment(lib, "Shlwapi.lib")
- /////////////////////////////////////////////////////////////////////////////
- // BeautifySkinFrom
- IMPLEMENT_DYNCREATE(BeautifySkinFrom, MyFormView)
- BeautifySkinFrom::BeautifySkinFrom()
- : MyFormView(BeautifySkinFrom::IDD)
- {
- //{{AFX_DATA_INIT(BeautifySkinFrom)
- m_filter = _T("");
- m_nAdd=0;
- //}}AFX_DATA_INIT
- if(g_bAllBranch)
- {
- m_nAdd=1;
- }
- }
- BeautifySkinFrom::~BeautifySkinFrom()
- {
- }
- void BeautifySkinFrom::DoDataExchange(CDataExchange* pDX)
- {
- MyFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(BeautifySkinFrom)
- 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);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(BeautifySkinFrom, MyFormView)
- //{{AFX_MSG_MAP(BeautifySkinFrom)
- 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)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // BeautifySkinFrom diagnostics
- #ifdef _DEBUG
- void BeautifySkinFrom::AssertValid() const
- {
- MyFormView::AssertValid();
- }
- void BeautifySkinFrom::Dump(CDumpContext& dc) const
- {
- MyFormView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // BeautifySkinFrom message handlers
- void BeautifySkinFrom::OnInitialUpdate()
- {
- MyFormView::OnInitialUpdate();
- // TODO: Add your specialized code here and/or call the base class
- CMyMdi Mdi;
- Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
- // Here we create the outbar control using the splitter as its parent
- // and setting its id to the first pane.
- 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_List1.SetHeadings("订单号,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" );
- #endif
- m_List1.LoadColumnInfo (118);
- }
- else
- {
- #ifdef CHILD_VERSION
- m_List1.SetHeadings("店名,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" );
- #endif
- m_List1.LoadColumnInfo (197);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(8));
- GetDlgItem(IDC_BUTexportphoto2)->EnableWindow(IsHasRights2new(9));
- }
- void BeautifySkinFrom::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!="")
- {
- if(m_List1array.ElementAt (ii).ElementAt (5+m_nAdd)<g_filterdate1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd)>g_filterdate2)
- continue;
- }
- if(g_waiter1!="")
- {
- if(m_List1array.ElementAt (ii).ElementAt (9+m_nAdd)!=g_waiter1)
- continue;
- }
- if(g_bAllBranch && g_filterbranch!="")
- {
- if(m_List1array.ElementAt (ii).ElementAt (0)!= g_filterbranch)
- continue;
- }
- if(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);
- }
- 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++)
- {
- if( (m_List1array.ElementAt (ii).ElementAt (3+m_nAdd)=="OK"||m_List1array.ElementAt (ii).ElementAt (3+m_nAdd)=="拍摄中") && m_List1array.ElementAt (ii).ElementAt (4+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++)
- {
- if((m_List1array.ElementAt (ii).ElementAt (3+m_nAdd)=="OK"||m_List1array.ElementAt (ii).ElementAt (3+m_nAdd)=="拍摄中")&&m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)!="OK" && (m_List1array.ElementAt (ii).ElementAt (13+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (14+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++)
- {
- if((m_List1array.ElementAt (ii).ElementAt (3+m_nAdd)=="OK"||m_List1array.ElementAt (ii).ElementAt (3+m_nAdd)=="拍摄中")&&m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)!="OK" &&(m_List1array.ElementAt (ii).ElementAt (15+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (16+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 (3+m_nAdd)=="拍摄中")&&m_List1array.ElementAt (ii).ElementAt (4+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 (8).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (9).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (10).Find (m_filter)!=-1|| \
- m_List1array.ElementAt (ii).ElementAt (11).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_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++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (13+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (14+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++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (15+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (16+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 (8).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (9).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (10).Find (m_filter)!=-1|| \
- m_List1array.ElementAt (ii).ElementAt (11).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_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 BeautifySkinFrom::OnBUTclose()
- {
- // TODO: Add your control notification handler code here
- GetParent()->SendMessage(WM_CLOSE);
- }
- void BeautifySkinFrom::OnSelchangeCombo1()
- {
- // TODO: Add your control notification handler code here
- SetTimer(1, 100, NULL);
- }
- void BeautifySkinFrom::OnTimer(UINT nIDEvent)
- {
- // TODO: Add your message handler code here and/or call default
- KillTimer(nIDEvent);
- OnButton1();
- }
- BOOL BeautifySkinFrom::PreTranslateMessage(MSG* pMsg)
- {
- // TODO: Add your specialized code here and/or call the base class
- 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;
- }
- }
- return MyFormView::PreTranslateMessage(pMsg);
- }
- catch(...)
- {
- }
- }
- BOOL GetFileNo2(CString dir, CString no)
- {
- int pos=no.Find("-");
- if(pos!=-1)no=no.Left(pos);
- CString path;
- CString path2;
- CString path3;
- CString path4;
- CString temp;
- CStringArray array;
- 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 (&array, temp)==-1)
- array.Add (temp);
- }
- for(int i=0; i<array.GetSize (); i++)
- {
- dir=array.ElementAt (i);
- path.Format ("%s%s.jpg", dir, no);
- path2.Format ("%s%s.raw", dir, no);
- path3.Format ("%s%s.cr2", dir, no);
- path4.Format ("%s%s.NEF", dir, no);
- if(PathFileExists (path) || PathFileExists (path2) || PathFileExists (path3) || PathFileExists (path4))
- {
- return 1;
- }
- }
- return 0;
- }
- void BeautifySkinFrom::OnBUTimportphoto() // 导入修好的片;
- {
- 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 oldstatus=m_List1.GetItemText (iItem, 4+m_nAdd);
- CString time8=m_List1.GetItemText (iItem, 5+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, 13+m_nAdd)+","+m_List1.GetItemText (iItem, 14+m_nAdd);
- phone.TrimLeft (",");
- phone.TrimRight (",");
- phone="电话:"+phone;
- if(g_path2.IsEmpty ())
- {
- AfxMessageBox("未设置已修片保存机器, 请通知系统管理员!", MB_ICONINFORMATION);
- return;
- }
- #ifdef ENTERPRISE_VERSION
- if(::CheckFolderFileExist (g_path2)==0)
- ::CreateDirectory (g_path2, NULL);
- #endif
- if(!::CheckFolderFileExist (g_path2))
- {
- AfxMessageBox("已修片保存机器目录未设置, 请通知系统管理员!", MB_ICONINFORMATION);
- return;
- }
- CString savepath;
- if(g_bAllBranch)
- {
- CString branchpath=GetBranchPhotoPath(branch);
- savepath=g_path2+branchpath+"\\";
- if(::CheckFolderFileExist (savepath)==0)
- ::CreateDirectory (savepath, NULL);
- }
- else
- savepath=g_path2+"\\";
- savepath+=id+"\\";
- if(::CheckFolderFileExist (savepath)==0)
- ::CreateDirectory (savepath, NULL);
- IsGrowthTx growthtxdlg;
- growthtxdlg.m_strOrderNumber=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);
- }
- CFileDialog fdlg(true, NULL,"openfile", OFN_ALLOWMULTISELECT,"jpg文件(*.jpg)|*.jpg||");
- TCHAR szBuffer[60000]={0};
- fdlg.m_ofn.lpstrFile = szBuffer;
- fdlg.m_ofn.nMaxFile = 60000;
- if(fdlg.DoModal ()!=IDOK)
- {
- CString status4;
- if(AfxMessageBox("客照是否全部修饰完毕?", MB_YESNO|MB_ICONINFORMATION)==IDYES)
- status4="OK";
- else
- status4="修片中";
- CString sql;
- if(time8.IsEmpty ())
- sql="update dindan set status4='"+status4+"',time8='"+g_date+"' where id='"+id+"'";
- else
- sql="update dindan set status4='"+status4+"' 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, status4);
- if(time8.IsEmpty ())
- m_List1array.ElementAt (i).SetAt (5+m_nAdd, g_date);
- // m_List1array.ElementAt (i).SetAt (9+m_nAdd, g_user.name);
- FillGrid();
- break;
- }
- }
- }
- return;
- }
- pos=fdlg.GetStartPosition ();
- CStringArray array;
- CString str,temp;
- CString savepath2;
- if(g_bAllBranch)
- {
- CString branchpath=GetBranchPhotoPath(branch);
- savepath2=g_path1+branchpath+"\\";
- }
- else
- savepath2=g_path1+"\\";
- savepath2+=id+"\\";
- if(!growthtxdlg.m_seltxname.IsEmpty ())
- {
- savepath2+=growthtxdlg.m_seltxname+"\\";
- }
- while(pos!=NULL)
- {
- str = fdlg.GetNextPathName(pos);
- array.Add(str);
- temp=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
- temp=temp.Left (temp.ReverseFind ('.'));
- if(CheckOK(temp)==0)
- {
- temp.Format ("%s.jpg\r\n照片必须从软件中'导出原片'处导出修片后再导入!", temp);
- AfxMessageBox(temp, MB_ICONSTOP);
- return;
- }
- if(0)//GetFileNo2(savepath2, temp)==0)
- {
- temp.Format ("%s.jpg\r\n原片中没有这张照片,照片必须从软件中'导出原片'处导出修片后再导入!", temp);
- AfxMessageBox(temp, MB_ICONSTOP);
- return;
- }
- }
- if(array.GetSize ()==0)return;
- if(oldstatus!="未修")
- {
- 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;
- }
- CCompressOption comoptdlg;
- comoptdlg.DoModal ();
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- // 导入修好的相片;
- ImportPhoto dlg;
- dlg.m_branch=branch; // 分店名;
- dlg.m_nphototype=1; // 未知;
- dlg.m_nOutputSize=comoptdlg.m_nsize; // 导入初修片时的尺寸???
- dlg.m_pArray=&array; // 被导入的相片路径;
- dlg.m_savepath =savepath; // 初修片保存的目录;
- #ifdef ENTERPRISE_VERSION
- // if(!g_branchname.IsEmpty ())
- {
- dlg.m_bSaveUploadTask=g_bSaveUploadTask2;
- dlg.m_sel=g_cominfoarraylocal.ElementAt(0).ElementAt(79);
- 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 status4;
- if(AfxMessageBox("客照是否全部修饰完毕?", MB_YESNO|MB_ICONINFORMATION)==IDYES)
- status4="OK";
- else
- status4="修片中";
- CString sql;
- if(time8.IsEmpty ())
- sql="update dindan set status4='"+status4+"',waiter5='"+g_user.name+"',time8='"+g_date+"' where id='"+id+"'";
- else
- sql="update dindan set status4='"+status4+"',waiter5='"+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, status4);
- if(time8.IsEmpty ())
- m_List1array.ElementAt (i).SetAt (5+m_nAdd, g_date);
- m_List1array.ElementAt (i).SetAt (9+m_nAdd, g_user.name);
- FillGrid();
- break;
- }
- }
- }
- }
- void BeautifySkinFrom::OnBUTshowphoto() // 查看修好的片;
- {
- // TODO: Add your control notification handler code here
- 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_mode=2;
- if(g_bAllBranch)
- {
- dlg.m_branch=branch;
- CString branchpath=GetBranchPhotoPath(branch);
- dlg.m_path=g_path2+branchpath+"\\";
- }
- else
- dlg.m_path=g_path2+"\\";
- dlg.m_path+=id;
- dlg.m_path +="\\";
- dlg.DoModal ();
- }
- void BeautifySkinFrom::OnBUTexportphoto() // 导出原片;
- {
- if(IsHasRights2new(8)==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_path1+branchpath+"\\";
- }
- else
- path=g_path1+"\\";
- path+=id;
- path +="\\";
- CString temp;
- CStringArray array; CStringArray dirarray;
- using namespace helper_coffs;
- IsGrowthTx growthtxdlg;
- growthtxdlg.m_mode=1;
- growthtxdlg.m_strOrderNumber=id;
- growthtxdlg.DoModal ();
- if(growthtxdlg.m_bReturnOK==0)
- return;
- if(growthtxdlg.m_bGrowthTx && growthtxdlg.m_seltxname.IsEmpty ())
- return;
- if(!growthtxdlg.m_seltxname.IsEmpty ())
- {
- if(growthtxdlg.m_seltxname!="全部")
- {
- path+=growthtxdlg.m_seltxname;
- path+="\\";
- }
- }
- else
- {
- // 1.查找原片目录下的所有子文件夹;
- 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 ++)
- {
- temp=(*it).c_str();
- if(::FindArray (&dirarray, temp)==-1 && temp!=path)
- {
- dirarray.Add (temp);
- }
- }
- if(dirarray.GetSize ())
- {
- SelProvider dlg;
- dlg.m_mode =1;
- dlg.m_pArray =&dirarray;
- if(dlg.DoModal ()!=IDOK)return;
- if(dlg.m_provider!="全部")
- {
- path+=dlg.m_provider;
- path+="\\";
- }
- }
- }
- // 1.查找原片目录下的所有文件;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin();coo.end() != it;it ++)
- {
- temp=(*it).c_str();
- if(temp.Find ("uploadtask")!=-1)continue;
- if(temp.GetAt (temp.ReverseFind ('\\')+1)!='s' && temp.GetAt (temp.ReverseFind ('\\')+1)!='m')
- {
- array.Add (temp);
- }
- }
- if(array.GetSize ()==0)
- {
- AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
- return;
- }
- 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;
- }
- name1.Replace("\"",""); // Jeff.add at 2014.07.30.去除姓名中存在非法的文件夹创建字符;
- name2.Replace("\"",""); // Jeff.add at 2014.07.30.去除姓名中存在非法的文件夹创建字符;
- dir+=name1;
- dir+=name2;
- dir+="原片";
- dir+="\\";
- ::CreateDirectory (dir, NULL);
- // 压缩选项对话框;
- CCompressOption comoptdlg;
- comoptdlg.DoModal();
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- // 从原片中导出相片制作初修片;
- ImportPhoto dlg;
- dlg.m_nOutputSize=comoptdlg.m_nsize; // 导出相片时的尺寸;
- dlg.m_bOrigin =1; // 未知;
- dlg.m_mode =1; // 未知;
- dlg.m_pArray=&array; // 被导出的相片路径集合;
- dlg.m_savepath =dir; // 导出相片存放的目录;
- dlg.DoModal ();
- AfxMessageBox("导片成功!", MB_ICONINFORMATION);
- CString str;
- str=" 导出原片 ";
- str+="客人:";
- str+=name1+name2+id;
- WriteLog(str);
- }
- void BeautifySkinFrom::OnBUTexportphoto2() // 导出修好的片;
- {
- if(IsHasRights2new(9)==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_path2+branchpath+"\\";
- }
- else
- path=g_path2+"\\";
- path+=id;
- path +="\\";
- CString temp;
- CStringArray array; CStringArray dirarray;
- using namespace helper_coffs;
- IsGrowthTx growthtxdlg;
- growthtxdlg.m_mode=1;
- growthtxdlg.m_strOrderNumber=id;
- growthtxdlg.DoModal ();
- if(growthtxdlg.m_bReturnOK==0)
- return;
- if(growthtxdlg.m_bGrowthTx && growthtxdlg.m_seltxname.IsEmpty ())
- return;
- if(!growthtxdlg.m_seltxname.IsEmpty ())
- {
- if(growthtxdlg.m_seltxname!="全部")
- {
- path+=growthtxdlg.m_seltxname;
- path+="\\";
- }
- }
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin();coo.end() != it;it ++)
- {
- temp=(*it).c_str();
- if(temp.Find ("uploadtask")!=-1)continue;
- if(temp.GetAt (temp.ReverseFind ('\\')+1)!='s' && temp.GetAt (temp.ReverseFind ('\\')+1)!='m')
- {
- array.Add (temp);
- }
- }
- if(array.GetSize ()==0)
- {
- AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
- return;
- }
- 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);
- CCompressOption comoptdlg;
- comoptdlg.DoModal ();
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- // 导出修好的片;
- //----------------------------------------------------------------------------------------------
- ImportPhoto dlg;
- dlg.m_nOutputSize=comoptdlg.m_nsize;
- dlg.m_mode =1;
- dlg.m_pArray=&array;
- dlg.m_savepath =dir;
- dlg.DoModal (); AfxMessageBox("导片成功!", MB_ICONINFORMATION);
- CString str;
- str=" 导出初修片 ";
- str+="客人:";
- str+=name1+name2+id;
- WriteLog(str);
- }
- void BeautifySkinFrom::OnButton1()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_filter.TrimLeft ();
- m_filter.TrimRight ();
- FillGrid();
- }
- void BeautifySkinFrom::OnButton2()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_filter.TrimLeft ();
- m_filter.TrimRight ();
- FillGrid(1);
- }
- void BeautifySkinFrom::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos=m_List1.GetFirstSelectedItemPosition();
- if(pos==NULL)
- {
- return;
- }
- int iItem=m_List1.GetNextSelectedItem(pos);
- if(IsHasRights2new(5) || IsHasRights2new(49))
- {
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
- }
- else
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
- *pResult = 0;
- }
- BOOL BeautifySkinFrom::CheckOK(CString name)
- {
- int pos=name.Find("-");
- if(pos!=-1)name=name.Left(pos);
- if(name.GetLength ()>4)return 0;
- for(int i=0; i<name.GetLength (); i++)
- {
- if(name.GetAt (i)<'0'||name.GetAt (i)>'9')return 0;
- }
- return 1;
- }
- void BeautifySkinFrom::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- 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 BeautifySkinFrom::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 (11+m_nAdd, "***");
- m_List1array.ElementAt (i).SetAt (12+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 (13+m_nAdd, "***");
- m_List1array.ElementAt (i).SetAt (14+m_nAdd, "***");
- }
- #endif
- }
- void BeautifySkinFrom::OnBtnsearchfilter()
- {
- // TODO: Add your control notification handler code here
- SearchFilter dlg;
- dlg.m_mode =1;
- if(dlg.DoModal ()==IDOK)FillGrid();
- g_bSearchFilter=0;
- }
- void BeautifySkinFrom::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]=184;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
- }
- else
- {
- g_sendhead.bsql=0;
- g_sendhead.code[0]=184;
- 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]=184;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)continue;
- }
- else
- {
- g_sendhead.bsql=0;
- g_sendhead.code[0]=184;
- 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 BeautifySkinFrom::OnBUTprint3()
- {
- // TODO: Add your control notification handler code here
- GetData();
- }
|