123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755 |
- /************************************************************************/
- /////////////////////////////////////////////////////////////////////////
- // 在项目的stdAfx.h头文件中声明下列代码:
- // stdAfx.h
- #include "basetype.h"
- #include "TblDef.h"
- #include "filekernel.h"
- #include "Imgkernel.h"
- extern ImgEnvInterface* CreateIMGProcess( );
- extern ImgEnvInterface *g_pIMSProcess;
- /////////////////////////////////////////////////////////////////////////
- // 在项目的stdAfx.cpp中,实现定义;
- // stdAfx.cpp
- typedef ImgEnvInterface* (*CREATEIMGPROCESS)( );
- ImgEnvInterface* CreateIMGProcess( )
- { //加载动态库
- HMODULE hKernelDll = ( HMODULE )LoadLibrary( _T("kernel.dll") );
- if ( hKernelDll )
- {
- //获取创建接口的函数
- CREATEIMGPROCESS pInstance = (CREATEIMGPROCESS)GetProcAddress( hKernelDll, "CreateIMGProcess" );
- if ( pInstance )
- {
- //创建接口
- ImgEnvInterface * pIMGProcess = pInstance( );
- //返回接口
- return pIMGProcess;
- }
- }
-
- return NULL;
- }
- ImgEnvInterface *g_pIMSProcess = NULL;
- /************************************************************************/
- /************************************************************************/
- /////////////////////////////////////////////////////////////////////////
- // 在项目Global.h头文件中,定义下列结构体;
- // Global.h
- // 2015-10-10
- typedef struct _STSceneryInfo_
- {
- BOOL bSelected; // 被选中;
- CString strScenery; // 景点;
- CString strStatus; // 拍照状态;
- CString strTime; // 拍照时间;
- CString strLensman; // 摄影师;
- CString strLensmanAssistant; // 摄影师助理;
- CString strBootDivision; // 引导师;
- CString strBootDivisionAssistant; // 引导师;
- _STSceneryInfo_()
- {
- bSelected = FALSE;
- }
- }STSceneryInfo;
- typedef struct _STOrederInfo_
- {
- CString strBranchId; // 域名;
- CString strOrderNumber; // 订单号;
- CString strImageNumber; // 相片编号;
- CString strName1; // 顾客1;
- CString strName2; // 顾客2;
- CString strClerk; // 接单人;
- CString strPhone; // 手机;
- CString strTelPhone; // 座机;
- std::vector<STSceneryInfo> vtOrderScenery; // 订单景点;
- }STOrederInfo;
- // 程序实例;
- HINSTANCE g_Instance = NULL;
- // 在Global.cpp中声明;
- extern HINSTANCE g_Instance;
- /************************************************************************/
- // 需要在BOOL CYLGLApp::InitInstance()中添加下列代码段;
- BOOL CYLGLApp::InitInstance()
- {
- ...
- //////////////////////////////////////////////////////////////////////////
- // 2015.11.07
- g_Instance = AfxGetResourceHandle();
- g_pIMSProcess = CreateIMGProcess();
- ...
- }
- // 在BOOL CYLGLApp::ExitInstance()中添加下列代码代码段;
- int CYLGLApp::ExitInstance()
- {
- ...
- g_pIMSProcess->Release();
- ...
- }
- void Login3::Init()
- {
- ……
- if (g_branchname == "")
- {
- #if USE_SHARE_FLORD
- // 清空数组,并重新获取NetShareInfo表;
- g_aryOfSharePathInfo.RemoveAll();
- g_pMainWnd->GetSharePathInfo();
- // 300行左右
- g_pIMSProcess->SetEnvInfoEx(g_server, g_domain, &g_cominfoarray, &g_brancharray, &g_aryOfSharePathInfo);
- }
- ……
- }
- // 拍照;
- /************************************************************************/
- /*
- 函数:GetSelectedOrderInfo
- 描述:获取选中的列表项的订单信息;
- 参数:
- [OUT] tagOrderInfo
- [OUT] nFirstItem 第一个景点项索引;
- [OUT] nEndofItem 最后一个景点项索引;
- 返回:空
- 注意:
- 要求:
- 示例:
- 修改:
- 日期:
- 内容:
- */
- /************************************************************************/
- INT TakeFrom::GetSelectedOrderInfo( OUT STOrederInfo &tagOrderInfo, OUT INT& nFirstItem, OUT INT& nEndofItem )
- {
- POSITION pos = m_List1.GetFirstSelectedItemPosition();
- if ( pos == NULL )
- {
- AfxMessageBox(_T("未选中要导入相片的订单!"),MB_ICONINFORMATION);
- return -1;
- }
- INT nItemCount = m_List1.GetItemCount();
- INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
- //INT nFirstItem = 0; // 记录第一个景点项索引;
- //INT nEndofItem = 0; // 记录最后一个景点项索引;
- INT nSceneryItem = nSelectedItem;
- if ( m_List1.GetItemText(nSelectedItem, 0 + m_nAdd) == _T("") )
- {
- STSceneryInfo tagSceneryInfo;
- tagSceneryInfo.bSelected = TRUE;
- tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
- tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
- tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
- tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
- tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
- tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
- tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
- tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
- // 查找所有下行;
- nSceneryItem++;
- if ( nSceneryItem < nItemCount )
- {
- while( m_List1.GetItemText(nSceneryItem, 0 + m_nAdd) == _T("") )
- {
- tagSceneryInfo.bSelected = FALSE;
- tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
- tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
- tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
- tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
- tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
- tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
- tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
- tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
- nSceneryItem++;
- if ( nSceneryItem >= nItemCount )
- break;
- }
- // 记录最后一个景点项索引;
- nEndofItem = nSceneryItem - 1;
- }
- // 查找所有上行;
- nSceneryItem = nSelectedItem - 1;
- if ( nSceneryItem >= 0)
- {
- while( m_List1.GetItemText(nSceneryItem, 0 + m_nAdd) == _T("") )
- {
- tagSceneryInfo.bSelected = FALSE;
- tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
- tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
- tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
- tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
- tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
- tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
- tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
- tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
- nSceneryItem--;
- if ( nSceneryItem < 0 )
- break;
- }
- }
- // 上行结束后,是头位置;
- if ( nSceneryItem >= 0 )
- {
- // 记录第一个景点项索引;
- nFirstItem = nSceneryItem;
- // 用头景点行初始化订单信息;
- if ( g_bAllBranch ) // 是否多店汇总;
- {
- tagOrderInfo.strBranchId = GetDomainFromBranch(m_List1.GetItemText(nSceneryItem, 0 ));
- }
- else
- {
- if ( g_branchname == _T(""))
- tagOrderInfo.strBranchId = g_domain;
- else
- tagOrderInfo.strBranchId = GetDomainFromBranch(g_branchname);
- }
- tagOrderInfo.strOrderNumber = m_List1.GetItemText(nSceneryItem, 0 + m_nAdd);
- tagOrderInfo.strName1 = m_List1.GetItemText(nSceneryItem, 1 + m_nAdd);
- tagOrderInfo.strName2 = m_List1.GetItemText(nSceneryItem, 2 + m_nAdd);
- tagOrderInfo.strImageNumber = m_List1.GetItemText(nSceneryItem, 3 + m_nAdd);
- tagOrderInfo.strClerk = m_List1.GetItemText(nSceneryItem, 11 + m_nAdd);
- // 如果用户权限不足,13和14显示的是"*"符号;
- #if 1
- tagOrderInfo.strPhone = m_List1.GetItemText(nSceneryItem, 14 + m_nAdd);
- tagOrderInfo.strTelPhone = m_List1.GetItemText(nSceneryItem, 15 + m_nAdd);
- #else
- if ( g_bAllBranch )
- {
- for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
- {
- if ( tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && tagOrderInfo.strBranchId == m_List1arrayBak.ElementAt(i).ElementAt(0) )
- {
- tagOrderInfo.strPhone = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
- tagOrderInfo.strTelPhone = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
- break;
- }
- }
- }
- else
- {
- for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
- {
- if ( tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0) )
- {
- tagOrderInfo.strPhone = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
- tagOrderInfo.strTelPhone = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
- break;
- }
- }
- }
- #endif
- // 同时push头景点;
- tagSceneryInfo.bSelected = FALSE;
- tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
- tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
- tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
- tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
- tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
- tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
- tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
- tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
- }
- }
- else
- {
- // 记录第一个景点项索引;
- nFirstItem = nSceneryItem;
- // 用头景点行初始化订单信息;
- if ( g_bAllBranch ) // 是否多店汇总;
- {
- tagOrderInfo.strBranchId = GetDomainFromBranch(m_List1.GetItemText(nSceneryItem, 0 ));
- }
- else
- {
- if ( g_branchname == _T(""))
- tagOrderInfo.strBranchId = g_domain;
- else
- tagOrderInfo.strBranchId = GetDomainFromBranch(g_branchname);
- }
- tagOrderInfo.strOrderNumber = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
- tagOrderInfo.strName1 = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd);
- tagOrderInfo.strName2 = m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
- tagOrderInfo.strImageNumber = m_List1.GetItemText(nSelectedItem, 3 + m_nAdd);
- tagOrderInfo.strClerk = m_List1.GetItemText(nSelectedItem, 11 + m_nAdd);
- tagOrderInfo.strPhone = m_List1.GetItemText(nSelectedItem, 14 + m_nAdd);
- tagOrderInfo.strTelPhone = m_List1.GetItemText(nSelectedItem, 15 + m_nAdd);
- // push头景点;
- STSceneryInfo tagSceneryInfo;
- tagSceneryInfo.bSelected = TRUE;
- tagSceneryInfo.strScenery = m_List1.GetItemText(nSelectedItem, 4 + m_nAdd);
- tagSceneryInfo.strStatus = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd);
- tagSceneryInfo.strTime = m_List1.GetItemText(nSelectedItem, 6 + m_nAdd);
- tagSceneryInfo.strLensman = m_List1.GetItemText(nSelectedItem, 7 + m_nAdd);
- tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSelectedItem, 8 + m_nAdd);
- tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSelectedItem, 9 + m_nAdd);
- tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSelectedItem, 10 + m_nAdd);
- tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
- // 读取下一行,看是否属于本订单的景点;
- nSceneryItem++;
- if ( nSceneryItem < nItemCount )
- {
- while( m_List1.GetItemText( nSceneryItem, 0 + m_nAdd ) == _T("") )
- {
- tagSceneryInfo.bSelected = FALSE;
- tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
- tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
- tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
- tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
- tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
- tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
- tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
- tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
- nSceneryItem++;
- if ( nSceneryItem >= nItemCount )
- break;
- }
- // 记录最后一个景点项索引;
- nEndofItem = nSceneryItem - 1;
- }
- }
- return nSelectedItem;
- }
- void TakeFrom::OnBUTimportphoto() // 导入原片按钮;
- {
- INT nFirstItem = 0;
- INT nEndofItem = 0;
- STOrederInfo tagOrderInfo;
- INT nSelectedItem = GetSelectedOrderInfo(tagOrderInfo, nFirstItem, nEndofItem);
- // 有多少拍照OK的景点;
- INT nOKSize = 0;
- vector<STSceneryInfo>::iterator it = NULL;
- for ( it = tagOrderInfo.vtOrderScenery.begin(); it != tagOrderInfo.vtOrderScenery.end(); it++ )
- {
- if ( it->strStatus == _T("OK") )
- nOKSize++;
- }
- CSetOrderInfo dlg;
- for ( it = tagOrderInfo.vtOrderScenery.begin(); it != tagOrderInfo.vtOrderScenery.end(); it++ )
- {
- // 当前选中的景点列;
- if ( it->bSelected == TRUE )
- {
- dlg.waiter1 = it->strLensman;
- dlg.waiter12 = it->strLensmanAssistant;
- dlg.waiter2 = it->strBootDivision;
- dlg.waiter22 = it->strBootDivisionAssistant;
- // 让对话窗口弹出时,显示当前景点的拍照状态;
- if(it->strStatus == _T("OK"))
- dlg.m_nStatus = 0;
- else if( it->strStatus == _T("拍照中") )
- dlg.m_nStatus = 1;
- else if( it->strStatus == _T("未拍") )
- dlg.m_nStatus = 2;
- break;
- }
- }
- if ( dlg.DoModal() == IDOK )
- {
- it->strLensman = dlg.waiter1;
- it->strLensmanAssistant = dlg.waiter12;
- it->strBootDivision = dlg.waiter2;
- it->strBootDivisionAssistant = dlg.waiter22;
- // m_nStatus:
- // 0:此景点拍照OK; 1:此景点拍照中; 2:此景点未拍照; 3:全部景点拍照OK;
- if ( dlg.m_nStatus == 0 )
- {// 所选景点设置OK,nOKSize加;
- if ( it->strStatus != _T("OK"))
- nOKSize++;
- it->strStatus = _T("OK");
- }
- else if ( dlg.m_nStatus == 1 )
- {// 所选景点设置拍照中; 若原本景点OK,nOKSize减;
- if ( it->strStatus == _T("OK"))
- nOKSize--;
- it->strStatus = _T("拍照中");
- }
- else if ( dlg.m_nStatus == 2 )
- {// 所选景点设置未拍照;若原本景点OK,nOKSize加;
- if ( it->strStatus == _T("OK"))
- nOKSize--;
- it->strStatus = _T("未拍");
- }
- else if ( dlg.m_nStatus == 3 )
- {// 全部景点设置OK;
- nOKSize = tagOrderInfo.vtOrderScenery.size();
- it->strStatus = _T("OK");
- }
- //////////////////////////////////////////////////////////////////////////
- // SQL语句;
- CString strSQL = _T("");
- CString strSQL2 = _T("");
- if ( nOKSize == 0 )
- {// 全部景点未拍照;
- //strSQL.Format(_T("update dindan set [status] = '未拍' where id = '%s'"), tagOrderInfo.strOrderNumber);
- strSQL.Format(_T("update dindan set [status] = case when status <> 'OK' then '未拍' else status end where id = '%s'"), tagOrderInfo.strOrderNumber);
- }
- else if ( nOKSize == tagOrderInfo.vtOrderScenery.size() )
- {// 全部景点都OK,设置所有dindanjd表的订单景点拍照状态OK;
- strSQL.Format(_T("update dindan set [status] = 'OK' where id = '%s'"), tagOrderInfo.strOrderNumber);
- strSQL2.Format(_T("***update dindanjd set [status] = 'OK' where id = '%s'"),tagOrderInfo.strOrderNumber);
- strSQL += strSQL2;
- //////////////////////////////////////////////////////////////////////////
- // 全部景点拍照OK时,判断是否需要生成短信;
- if ( atoi(g_cominfoarray.ElementAt(0).ElementAt(101)) )
- {
- CString strTimeStamp = _T("msgtimestamp");
- CString strSMSContent = CString(g_cominfoarray.ElementAt(0).ElementAt(105));
- // 获取用户手机号码;
- CString strPhone1 = tagOrderInfo.strPhone;
- CString strPhone2 = tagOrderInfo.strTelPhone;
- if ( strPhone1.Find(_T("***")) != -1 )
- {//若用户权限不足以获取手机号码,重新获取;
- CString strBranchName = GetBranchNamebyId(tagOrderInfo.strBranchId);
- if ( g_bAllBranch )
- {
- for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
- {
- if (tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && strBranchName == m_List1arrayBak.ElementAt(i).ElementAt(0))
- {
- strPhone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
- strPhone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
- break;
- }
- }
- }
- else
- {
- for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
- {
- if (tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0))
- {
- strPhone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
- strPhone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
- break;
- }
- }
- }
- }
- // 生成短信内容;
- CString strtemp = _T("");
- #ifdef CHILD_VERSION
- if ( !tagOrderInfo.strName1.IsEmpty() )
- strtemp = tagOrderInfo.strName1 + _T(",");
- strtemp += tagOrderInfo.strName2;
- strtemp.TrimRight(_T(","));
- if( !strtemp.IsEmpty() && CheckPhoneType(strPhone1) != -1 && CheckBadWords(strtemp,0) )
- {
- strtemp += strSMSContent;
- strtemp.Replace(_T("xxx小朋友"), _T(""));
- int nCount = GetLengthEx(strtemp)/MSG_LENGTH;
- if( GetLengthEx(strtemp)%MSG_LENGTH )
- nCount++;
- strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, strTimeStamp, nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
- strSQL += _T("***") + strSQL2;
- }
- #else
- if ( strSMSContent.Find(_T("xxx先生/女士")) != -1 )
- {
- int nCount = 0;
- // 男士短信;
- if ( !tagOrderInfo.strName1.IsEmpty() && CheckPhoneType(strPhone1) != -1 && CheckBadWords(tagOrderInfo.strName1, 0) )
- {
- strtemp = strSMSContent;
- strtemp.Replace(_T("xxx先生/女士"), tagOrderInfo.strName1 + _T("先生"));
- nCount = GetLengthEx(strtemp) / MSG_LENGTH;
- if ( GetLengthEx(strtemp) % MSG_LENGTH )
- nCount++;
- strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, strTimeStamp, nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
- strSQL += _T("***") + strSQL2;
- }
- // 女士短信;
- if ( !tagOrderInfo.strName2.IsEmpty() && CheckPhoneType(strPhone2) != -1 && CheckBadWords(tagOrderInfo.strName2, 0) )
- {
- strtemp = strSMSContent;
- strtemp.Replace(_T("xxx先生/女士"), tagOrderInfo.strName1 + _T("先生"));
- nCount = GetLengthEx(strtemp) / MSG_LENGTH;
- if ( GetLengthEx(strtemp) % MSG_LENGTH )
- nCount++;
- strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, _T("msgtimexxstamp"), nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
- strSQL += _T("***") + strSQL2;
- }
- }
- #endif
- }
- }
- else
- {// 部分景点拍照;拍照中;
- //strSQL.Format(_T("update dindan set [status] = '拍照中' where id = '%s'"), tagOrderInfo.strOrderNumber);
- strSQL.Format(_T("update dindan set [status] = case when status <> 'OK' then '拍照中' else status end where id = '%s'"), tagOrderInfo.strOrderNumber);
- }
- // 最多4个景点,4组摄影师+化妆师;
- if ( nSelectedItem == nFirstItem )
- {
- strSQL2.Format(_T("***update dindan set waiter1 = '%s', waiter2 = '%s' where id = '%s'"),
- it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
- }
- else if ( nSelectedItem == nFirstItem + 1)
- {
- strSQL2.Format(_T("***update dindan set waiter12 = '%s', waiter22 = '%s' where id = '%s'"),
- it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
- }
- else if ( nSelectedItem == nFirstItem + 2)
- {
- strSQL2.Format(_T("***update dindan set waiter13 = '%s', waiter23 = '%s' where id = '%s'"),
- it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
- }
- else if ( nSelectedItem == nFirstItem + 3)
- {
- strSQL2.Format(_T("***update dindan set waiter14 = '%s', waiter24 = '%s' where id = '%s'"),
- it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
- }
- strSQL += strSQL2;
- strSQL2.Format(_T("***update dindanjd set [date]= '%s', [status] = '%s', [waiter1] = '%s', [waiter12] = '%s', [waiter2] = '%s',[waiter22] ='%s' where id = '%s' and [name] = '%s' "),
- g_date, it->strStatus, it->strLensman, it->strLensmanAssistant, it->strBootDivision, it->strBootDivisionAssistant, tagOrderInfo.strOrderNumber, it->strScenery);
- strSQL += strSQL2;
- strSQL2.Format(_T("***gentakecontent:"),tagOrderInfo.strOrderNumber);//拍照OK时记录客人预定内容
- strSQL += strSQL2;
- //////////////////////////////////////////////////////////////////////////
- // 构建发送给服务器的包;
- g_sendhead.bsql = TRUE;
- if ( g_bAllBranch )
- {
- // 多店汇总;
- g_branchip = GetIP(tagOrderInfo.strBranchId);
- g_pMainWnd->OnDisconnect();
- g_branchname = tagOrderInfo.strBranchId;
- g_bBranchModify = TRUE;
- g_pMainWnd->ProcessChatMessageRequest2(strSQL);
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = FALSE;
- g_branchip = g_branchname = _T("");
- }
- else
- {
- g_pMainWnd->ProcessChatMessageRequest2(strSQL);
- }
- //////////////////////////////////////////////////////////////////////////
- // 接收服务器返回的数据;
- if (g_bSendOK == 0)
- {
- OutputDebugString(_T("\n服务器返回数据失败!\n"));
- return;
- }
- if (g_bAllBranch == 0)
- {// 连接本店或分店时;
- GetData();
- }
- else
- {// 多店汇总时;
- BOOL bFind = 0;
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- if (bFind && m_List1array.ElementAt(i).ElementAt(1) != _T(""))break;
- if (tagOrderInfo.strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && tagOrderInfo.strBranchId == m_List1array.ElementAt(i).ElementAt(0))
- {
- bFind = 1;
- }
- if (bFind && it->strScenery == m_List1array.ElementAt(i).ElementAt(4))
- {
- m_List1array.ElementAt(i).SetAt(7 + m_nAdd, it->strLensman);
- m_List1array.ElementAt(i).SetAt(8 + m_nAdd, it->strLensmanAssistant);
- m_List1array.ElementAt(i).SetAt(9 + m_nAdd, it->strBootDivision);
- m_List1array.ElementAt(i).SetAt(10 + m_nAdd, it->strBootDivisionAssistant);
- m_List1array.ElementAt(i).SetAt(5 + m_nAdd, it->strStatus);
- m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
- //m_List1array.ElementAt(i).SetAt(3 + m_nAdd, sbeginno);
- FillGrid();
- break;
- }
- }
- }
- }
- //////////////////////////////////////////////////////////////////////////
- INT nImgNum = atoi(tagOrderInfo.strImageNumber);
- if ( nImgNum <= 0)
- nImgNum = 1;
- else
- ++nImgNum;
- ImgImportInterface *pImport = NULL;
- g_pIMSProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
- if ( pImport )
- {
- pImport->ImportOriginalImg(
- TRUE, // 文件夹形式打开源或多选文件形式;
- TRUE, // 相片是否需要重命名;
- nImgNum, // 相片数字编号;
- tagOrderInfo.strBranchId, // 分店域名;
- tagOrderInfo.strOrderNumber, // 订单号;
- tagOrderInfo.strName1 + _T(",") + tagOrderInfo.strName2, // 顾客信息,可任意组合;
- TRUE, // 导入时,是否生成景点名文件夹;
- it->strScenery, // 导入时,景点名;
- _T("*.jpg|*.jpeg"), // 导入时,主扩展名相片;
- INVALID_COPY_PIX, // 导入时,主扩展名相片的压缩像素;
- _T("*.nef|*.cr2|*.raw"), // 导入时,附加的扩展名相片;
- TRUE, // 导入时,是否生成缩略图;
- SET_PIX(100,100), // 导入时,生成的缩略图像素大小;
- FALSE // 导入时,文件存在时是否覆盖;
- );
- g_pIMSProcess->Release();
- }
- // 结束;
- }
- void BeautifySkinFrom::OnBUTexportphoto() // 导出原片;
- {
- // 判断登陆用户是否有导出原片的权限;
- if ( !IsHasRights2new(8) )
- {
- AfxMessageBox(_T("您无权限导出原片!"),MB_ICONINFORMATION);
- return;
- }
- // 获取列表信息:域名、订单号、景点名、顾客信息;
- POSITION pos = m_List1.GetFirstSelectedItemPosition();
- if ( pos == NULL )
- {
- AfxMessageBox(_T("请选中您要导出原片的订单!"), MB_ICONINFORMATION);
- return;
- }
- INT nItemCount = m_List1.GetItemCount();
- INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
- CString strBranchId = _T("");
- CString strOrderNum = _T("");
- // 初修列表不支持景点名,需要从其他地方获取;
- CString strScenery = _T("");
- CString strCustomerInfo = _T("");
- // 获取域名;
- if ( g_bAllBranch )
- {// 多店汇总时;
- strBranchId = GetDomainFromBranch( m_List1.GetItemText(nSelectedItem, 0) );
- }
- else
- {
- if ( g_branchname.IsEmpty() )
- {// 连接本店时;
- strBranchId = g_domain;
- }
- else
- {// 连接分店时;
- strBranchId = GetDomainFromBranch( g_branchname );
- }
- }
- // 获取订单号;
- strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
- // 获取顾客信息;
- strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
- // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
- IsGrowthTx IsGrowthtxdlg;
- IsGrowthtxdlg.m_mode = 1;
- IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
- IsGrowthtxdlg.DoModal();
- if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
- {
- return;
- }
- if ( IsGrowthtxdlg.m_bGrowthTx )
- {
- // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
- strScenery = IsGrowthtxdlg.m_seltxname;
- if ( strScenery == _T("全部") )
- {
- strScenery.Empty();
- }
- }
- // 导出原片时,是否压缩导出;
- DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素;
- /////////////////////////////////////////////////////////////////////////////////////////////////
- // 获取完信息,开始导出原片;
- ImgExportInterface *pExport = NULL;
- g_pIMSProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
- if ( pExport )
- {
- pExport->ExportOriginalImg(
- TRUE,
- strBranchId,
- strOrderNum,
- strCustomerInfo,
- !strScenery.IsEmpty(),
- strScenery,
- _T("*.jpg|*.jpeg"),
- dwExportPix,
- _T("*.nef|*.cr2|*.raw|*.ra2"),
- FALSE,
- FALSE
- );
- }
- g_pIMSProcess->Release();
- // 结束;
- }
|