#include ///////////////////////////////////////////////////////////////////////////////////////////////// // 重写导入设计片按钮函数; void CDesignFrom::OnBUTimportphoto() // 导入设计版 按钮; { // 获取列表信息; POSITION pos = m_List1.GetFirstSelectedItemPosition(); if ( pos == NULL ) { AfxMessageBox(_T("请选中您要导片的订单号!"), MB_ICONINFORMATION); return; } INT nItemCount = m_List1.GetItemCount(); INT nSelectedItem = m_List1.GetNextSelectedItem(pos); // 订单的设计信息店名、域名、订单号、景点名、顾客信息、设计状态、设计日期、设计师; CString strBranchName = _T(""); CString strBranchId = _T(""); CString strOrderNum = _T(""); CString strScenery = _T(""); CString strCustomerInfo = _T(""); CString strDesignState = _T(""); CString strDesignDate = _T(""); CString strDesigner = _T(""); // 获取域名; if ( g_bAllBranch ) {// 多店汇总时; strBranchName = m_List1.GetItemText(nSelectedItem, 0); strBranchId = GetDomainFromBranch( strBranchName ); } else { if ( g_branchname.IsEmpty() ) {// 连接本店时; strBranchName = _T(""); strBranchId = g_domain; } else {// 连接分店时; strBranchName = g_branchname; strBranchId = GetDomainFromBranch( g_branchname ); } } // 获取订单号; strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd); // 获取设计师; strDesigner = m_List1.GetItemText(nSelectedItem, 14 + m_nAdd); // 获取设计状态; strDesignState = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd); // 获取设计日期; strDesignDate = m_List1.GetItemText(nSelectedItem, 6 + m_nAdd); // 获取顾客信息; strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd); CDlgChuXiuInfo xpdlg; xpdlg.m_strOrderNumber = strOrderNum; xpdlg.m_strXiupianRen = strDesigner; if ( strDesignState == _T("OK") ) xpdlg.m_nXiupianStatus = 0; else if ( strDesignState == _T("设计中")) xpdlg.m_nXiupianStatus = 1; else if ( strDesignState == _T("未设计")) xpdlg.m_nXiupianStatus = 2; CString strSQL = _T(""); if( xpdlg.Domodal() == IDOK ) { if ( xpdlg.m_bGrowthTx ) strScenery = xpdlg.m_strScenery; if ( xpdlg.m_nXiupianStatus == 0 ) strDesignState = _T("OK"); else if ( xpdlg.m_nXiupianStatus == 1) strDesignState = _T("设计中"); else if ( xpdlg.m_nXiupianStatus == 2 ) strDesignState = _T("未设计"); strDesigner = xpdlg.m_strXiupianRen; if (strDesignDate.IsEmpty()) strSQL.Format(_T("update dindan set waiter4 = '%s', status5 = '%s', time10 = '%s' where id = '%s'"), strDesigner, strDesignState, g_date, strOrderNum); else strSQL.Format(_T("update dindan set waiter4 = '%s', status5 = '%s' where id = '%s'"), strDesigner, strDesignState, strOrderNum); ///////////////////////////////////////////////////////////////////////////////////////////////// // 构建数据包; g_sendhead.bsql = TRUE; if ( g_bAllBranch ) {// 多店汇总时; g_branchip = GetBranchIPbyId(strBranchId); g_pMainWnd->OnDisconnect(); g_branchname = strBranchName; g_bBranchModify = TRUE; g_pMainWnd->ProcessChatMessageRequest2(strSQL); g_pMainWnd->OnDisconnect(); g_bBranchModify = FALSE; g_branchip = g_branchname = _T(""); } else {// 连接本店或分店时; g_pMainWnd->ProcessChatMessageRequest2(strSQL); } // 刷新界面数据; if (g_bSendOK == 0) { OutputDebugString(_T("接收服务器数据失败!\n")); return; } if (g_bAllBranch == 0) {// 连接本店或分店时; GetData(); } else {// 多店汇总时; for (int i = 0; i < m_List1array.GetSize(); i++) { if (strOrderNum == m_List1array.ElementAt(i).ElementAt(1) && strBranchName == m_List1array.ElementAt(i).ElementAt(0)) { m_List1array.ElementAt(i).SetAt(5 + m_nAdd, strDesignState); if (strDesignDate.IsEmpty()) m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date); m_List1array.ElementAt(i).SetAt(14 + m_nAdd, strDesigner); FillGrid(); break; } } } } } ///////////////////////////////////////////////////////////////////////////////////////////////// // 重写拍照导入原片按钮函数; // 1.更新dindan表或dindanjd表; // 2.导入相片; // 3.生成上传任务; // 4.写入增量备份信息; // 5.删除ok文件(ok作用:用来判断是否需要生成缩略图。多目录下,这个意义不大。直接在导入时生成。); // 6.发送拍照完成短信; void TakeFrom::OnBUTimportphoto() { INT nFirstItem = 0; INT nEndofItem = 0; STOrederInfo tagOrderInfo; INT nSelectedItem = GetSelectedOrderInfo(tagOrderInfo, nFirstItem, nEndofItem); // 有多少拍照OK的景点; INT nOKSize = 0; vector::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 TakeFrom::GetSelectedOrderInfo( OUT STOrederInfo &tagOrderInfo ) { POSITION pos = m_List1.GetFirstSelectedItemPosition(); if ( pos == NULL ) { AfxMessageBox(_T("未选中要导入相片的订单!",MB_ICONINFORMATION)); return; } INT nItemCount = m_List1.GetItemCount(); INT nSelectedItem = m_List1.GetNextSelectedItem(pos); 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; } } // 查找所有上行; 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 ) { // 用头景点行初始化订单信息; if ( g_bAllBranch ) {// 多店汇总; tagOrderInfo.strBranchId = GetDomainFromBranch(m_List1.GetItemText(nSceneryItem, 0 )); } else { if ( g_branchname.IsEmpty() ) {// 连接本店; 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 { // 用头景点行初始化订单信息; if ( g_bAllBranch ) {// 多店汇总; tagOrderInfo.strBranchId = GetDomainFromBranch(m_List1.GetItemText(nSceneryItem, 0 )); } else { if ( g_branchname.IsEmpty() ) {// 连接本店; 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; } } } } ///////////////////////////////////////////////////////////////////////////////////////////////// // 重写拍照查看原片按钮函数; // 1.首先加载大图; // 2.其实加载有大图的小图; void TakeFrom::OnBUTshowphoto() { POSITION pos = m_List.GetFirstSelectedItemPosition(); if ( pos == NULL ) { AfxMessageBox(_T("请选中您要查看的订单!"), MB_ICONINFORMATION); return; } INT nItemCount = m_List.GetItemCount(); INT nSelectedItem = m_List.GetNextSelectedItem(pos); // 获取域名、订单号、顾客姓名、景点名; CString strBranchId = _T(""); CString strOrderNum = _T(""); CString strScenery = _T(""); CString strCustomerInfo = _T(""); strScenery = m_List.GetItemText(nSelectedItem, 4 + m_nAdd); // 获取订单行(所选行的订单号为空时,表示选中的是景点); if ( m_List.GetItemText(nSelectedItem, 0 + m_nAdd) == _T("") ) { do { --nSelectedItem; if ( nSelectedItem == -1) break; } while ( m_List.GetItemText(nSelectedItem, 0 + m_nAdd) == _T("") ); if ( nSelectedItem == -1 ) { OutputDebugString(_T("获取订单列时出错!\n")); return; } } // 获取域名; if ( g_bAllBranch ) {// 多店汇总时; strBranchId = GetDomainFromBranch( m_List.GetItemText(nSelectedItem, 0) ); } else { if ( g_branchname.IsEmpty() ) {// 连接本店; strBranchId = g_domain; } else {// 连接分店时; strBranchId = GetDomainFromBranch( g_branchname ); } } // 获取订单号; strOrderNum = m_List.GetItemText(nSelectedItem, 0 + m_nAdd); // 顾客信息; strCustomerInfo = m_List.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List.GetItemText(nSelectedItem, 2 + m_nAdd); // 判断是否按下CTRL键或Shift键; if ( !g_pMainWnd->IsCtrlDown() && !g_pMainWnd->IsShiftDown() ) { // 重置景点名为空,查看整个订单的相片; strScenery.Empty(); } ////////////////////////////////////////////////////////////////////////// // 传参给缩略图对话框; ShowPic dlg; dlg.m_id = strOrderNum; dlg.m_name = strCustomerInfo; dlg.m_mode = 1; // 原片; dlg.m_branch = strBranchId; // 在ShowPic内部使用kernel模块查找出指定相片路径; dlg.DoModal(); // 刷新拍照列表; if ( dlg.m_bdelall ) { for (int i = 0; i < m_List1array.GetSize(); i++ ) { if ( g_bAllBranch ) {// 多店汇总时; if ( strOrderNum == m_List1array.ElementAt(i).ElementAt(1) && strBranchId == m_List1array.ElementAt(i).ElementAt(0)) { m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "0"); FillGrid(); break; } } else {// 连接本店或分店; if ( strOrderNum == m_List1array.ElementAt(i).ElementAt(0)) { m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "0"); FillGrid(); break; } } } } // end; } ///////////////////////////////////////////////////////////////////////////////////////////////// // 重写初修导入修片按钮函数; // 1.更新数据,dindan表; // 2.导入相片; // 3.生成上传任务; // 4.写入增量备份信息; // 5.删除ok文件; void BeautifySkinFrom::OnBUTimportphoto() { POSITION pos = m_List1.GetFirstSelectedItemPosition(); if ( pos == NULL ) { AfxMessageBox(_T("请选中您要导入初修片的订单!"),MB_ICONINFORMATION); return; } INT nItemCount = m_List1.GetItemCount(); INT nSelectedItem = m_List1.GetNextSelectedItem(pos); // 获取列表订单信息:域名、订单号、景点名、顾客信息…… CString strBranchName = _T(""); CString strBranchId = _T(""); CString strOrderNum = _T(""); CString strScenery = _T(""); CString strCustomerInfo = _T(""); // 顾客信息; CString strXiupianDate = _T(""); // 修片日期; CString strXiupianRen = _T(""); // 修片人; CString strPhone = _T(""); // 顾客手机; CString strXiupianStatus = _T(""); // 初修状态; // 获取域名; if ( g_bAllBranch ) {// 多店汇总时: strBranchName = m_List1.GetItemText( nSelectedItem, 0); strBranchId = GetDomainFromBranch( strBranchName ); } else { if ( g_branchname.IsEmpty() ) {// 连接本店时; strBranchName = _T(""); strBranchId = g_domain; } else {// 连接分店时; strBranchName = g_branchname; strBranchId = GetDomainFromBranch( g_branchname ); } } // 获取订单号; strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd); // 获取修片状态; strXiupianStatus = m_List1.GetItemText(nSelectedItem, 4 + m_nAdd); // 获取修片人; strXiupianRen = m_List1.GetItemText(nSelectedItem, 9 + m_nAdd); // 获取顾客信息; strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd); CDlgChuXiuInfo xpdlg; xpdlg.m_strOrderNumber = strOrderNum; xpdlg.m_strXiupianRen = strXiupianRen; if ( strXiupianStatus == _T("OK") ) xpdlg.m_nXiupianStatus = 0; else if ( strXiupianStatus == _T("修片中")) xpdlg.m_nXiupianStatus = 1; else if ( strXiupianStatus == _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 ) strXiupianStatus = _T("OK"); else if ( xpdlg.m_nXiupianStatus == 1) strXiupianStatus = _T("修片中"); else if ( xpdlg.m_nXiupianStatus == 2 ) strXiupianStatus = _T("未修"); strXiupianRen = xpdlg.m_strXiupianRen; if (strXiupianDate.IsEmpty()) strSQL.Format(_T("update dindan set waiter5 = '%s', status4 = '%s', time8 = '%s' where id = '%s'"), strXiupianRen, strXiupianStatus, g_date, strOrderNum); else strSQL.Format(_T("update dindan set waiter5 = '%s', status4 = '%s' where id = '%s'"), strXiupianRen, strXiupianStatus, 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_bBranchModify = FALSE; g_branchip = g_branchname = _T(""); } else {// 连接分店或本店时; g_pMainWnd->ProcessChatMessageRequest2(strSQL); } if( !g_bSendOK ) { OutputDebugString(_T("连接服务器失败!\n")); return; } if( !g_bAllBranch ) { 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(4 + m_nAdd, strXiupianStatus); if(strXiupianDate.IsEmpty()) m_List1array.ElementAt(i).SetAt(5 + m_nAdd, g_date); m_List1array.ElementAt(i).SetAt( 9 + m_nAdd, strXiupianRen); FillGrid(); break; } } } } ///////////////////////////////////////////////////////////////////////////////////////////////// // 获取完信息,开始导入初修片; ImgImportInterface *pImport = NULL; g_pIMSProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport); if ( pImport ) { pImport->ImportSecondaryImg( TRUE, strBranchId, strOrderNum, strCustomerInfo, !strScenery.IsEmpty(), strScenery, _T("*.jpg|*.jpeg"), INVALID_COPY_PIX, _T("*.nef|*.cr2|*.raw|*.ra2"), FALSE, INVALID_COPY_PIX, FALSE ); } // 结束; } ///////////////////////////////////////////////////////////////////////////////////////////////// // 重写初修导出原片按钮函数; void BeautifySkinFrom::OnBUTexportphoto() { // 1.判断登陆用户是否有导出原片的权限; if ( !IsHasRights2new(8) ) { AfxMessageBox(_T("您无权限导出原片!"),MB_ICONINFORMATION); return; } // 获取列表信息:域名、订单号、景点名、顾客信息; POSITION pos = m_List.GetFirstSelectedItemPosition(); if ( pos == NULL ) { AfxMessageBox(_T("请选中您要导出原片的订单!"), MB_ICONINFORMATION); return; } INT nItemCount = m_List.GetItemCount(); INT nSelectedItem = m_List.GetNextSelectedItem(pos); CString strBranchId = _T(""); CString strOrderNum = _T(""); // 初修列表不支持景点名,需要从其他地方获取; CString strScenery = _T(""); CString strCustomerInfo = _T(""); // 获取域名; if ( g_bAllBranch ) {// 多店汇总时; strBranchId = GetDomainFromBranch( m_List.GetItemText(nSelectedItem, 0) ); } else { if ( g_branchname.IsEmpty() ) {// 连接本店时; strBranchId = g_domain; } else {// 连接分店时; strBranchId = GetDomainFromBranch( g_branchname ); } } // 获取订单号; strOrderNum = m_List.GetItemText(nSelectedItem, 0 + m_nAdd); // 获取顾客信息; strCustomerInfo = m_List.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List.GetItemText(nSelectedItem, 2 + m_nAdd); // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单; if ( _T("若dindan表字段 txtype== '成长套系'") ) { // 读取dindanjd表里的成长套系名,并返回选中的成长套系名; strScenery = _T("选中的成长套系名"); if ( strScenery == _T("全部") ) { strScenery.IsEmpty(); } } // 导出原片时,是否压缩导出; DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素; ///////////////////////////////////////////////////////////////////////////////////////////////// // 获取完信息,开始导出原片; ImgExportInterface *pExport = NULL; g_pIEPtr->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 ); } // 结束; } ///////////////////////////////////////////////////////////////////////////////////////////////// // 重写初修导出修片按钮函数; void BeautifySkinFrom::OnBUTexportphoto2() { // 判断登陆用户是否有导出原片的权限; if ( !IsHasRights2new(9) ) { AfxMessageBox(_T("您无权限导出初修片!"),MB_ICONINFORMATION); return; } // 获取列表信息:域名、订单号、景点名、顾客信息; POSITION pos = m_List.GetFirstSelectedItemPosition(); if ( pos == NULL ) { AfxMessageBox(_T("请选中您要导出初修片的订单!"), MB_ICONINFORMATION); return; } INT nItemCount = m_List.GetItemCount(); INT nSelectedItem = m_List.GetNextSelectedItem(pos); CString strBranchId = _T(""); CString strOrderNum = _T(""); // 初修列表不支持景点名,需要从其他地方获取; CString strScenery = _T(""); CString strCustomerInfo = _T(""); // 获取域名; if ( g_bAllBranch ) {// 多店汇总时; strBranchId = GetDomainFromBranch( m_List.GetItemText(nSelectedItem, 0) ); } else { if ( g_branchname.IsEmpty() ) {// 连接本店时; strBranchId = g_domain; } else {// 连接分店时; strBranchId = GetDomainFromBranch( g_branchname ); } } // 获取订单号; strOrderNum = m_List.GetItemText(nSelectedItem, 0 + m_nAdd); // 获取顾客信息; strCustomerInfo = m_List.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List.GetItemText(nSelectedItem, 2 + m_nAdd); // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单; if ( _T("若dindan表字段 txtype== '成长套系'") ) { // 读取dindanjd表里的成长套系名,并返回选中的成长套系名; strScenery = _T("选中的成长套系名"); if ( strScenery == _T("全部") ) { strScenery.IsEmpty(); } } // 导出原片时,是否压缩导出; DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素; ///////////////////////////////////////////////////////////////////////////////////////////////// // 获取完信息,开始导出原片; ImgExportInterface *pExport = NULL; g_pIEPtr->QueryInterface(IID_ImgExportInterface, (void**)&pExport); if ( pExport ) { pExport->ExportSecondaryImg( TRUE, strBranchId, strOrderNum, strCustomerInfo, !strScenery.IsEmpty(), strScenery, _T("*.jpg|*.jpeg"), dwExportPix, _T("*.nef|*.cr2|*.raw|*.ra2"), FALSE, FALSE ); } // 结束; } ///////////////////////////////////////////////////////////////////////////////////////////////// // 重写查看初修片按钮函数; void BeautifySkinFrom::OnBUTshowphoto() { POSITION pos = m_List.GetFirstSelectedItemPosition(); if ( pos == NULL ) { AfxMessageBox(_T("请选中您要查看的订单!"), MB_ICONINFORMATION); return; } INT nItemCount = m_List.GetItemCount(); INT nSelectedItem = m_List.GetNextSelectedItem(pos); // 获取域名、订单号、顾客姓名、景点名; CString strBranchId = _T(""); CString strOrderNum = _T(""); CString strScenery = _T(""); CString strCustomerInfo = _T(""); // 获取域名; if ( g_bAllBranch ) {// 多店汇总时; strBranchId = GetDomainFromBranch( m_List.GetItemText(nSelectedItem, 0) ); } else { if ( g_branchname.IsEmpty() ) {// 连接本店时; strBranchId = g_domain; } else {// 连接分店时; strBranchId = GetDomainFromBranch( g_branchname ); } } // 获取订单号; strOrderNum = m_List.GetItemText(nSelectedItem, 0 + m_nAdd); // 顾客信息; strCustomerInfo = m_List.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List.GetItemText(nSelectedItem, 2 + m_nAdd); // 获取景点名; strScenery = _T("如果需要,则返回景点名,只查看某个景点,但只限于儿童成长套系!"); if ( strScenery == _T("全部") ) { // 重置景点名为空,查看整个订单的相片; strScenery.Empty(); } ////////////////////////////////////////////////////////////////////////// // 传参给缩略图对话框; ShowPic dlg; dlg.m_id = strOrderNum; dlg.m_name = strCustomerInfo; dlg.m_mode = 2; // 初修片; dlg.m_branch = strBranchId; // 在ShowPic内部使用kernel模块查找出指定相片路径; dlg.DoModal(); // end; } ///////////////////////////////////////////////////////////////////////////////////////////////// // 重写精修导入精修片按钮函数; void BeautifySkinFrom2::OnBUTimportphoto() { 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 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, 11 + 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(11 + m_nAdd, strJingxiuRen); FillGrid(); break; } } } } ImgImportInterface *pImport = NULL; g_pIMSProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport); if ( pImport ) { pImport->ImportFurtherImg( FALSE, // 文件夹形式打开源或多选文件形式; strBranchId, // 分店域名; strOrderNum, // 订单号; strCustomerInfo, // 顾客信息,可任意组合; FALSE, // 导入时,是否生成景点名文件夹; NULL, // 导入时,景点名; _T("*.jpg|*.jpeg"), // 导入时,主扩展名相片; INVALID_COPY_PIX, // 导入时,主扩展名相片的压缩像素; _T("*.nef|*.cr2"), // 导入时,附加的扩展名相片; TRUE, // 导入时,是否生成缩略图; SET_PIX(100,100), // 导入时,生成的缩略图像素大小; FALSE // 导入时,文件存在时是否覆盖; ); } // 结束; } ///////////////////////////////////////////////////////////////////////////////////////////////// // 重写查看精修片按钮函数; void BeautifySkinFrom2::OnBUTshowphoto() { POSITION pos = m_List.GetFirstSelectedItemPosition(); if ( pos == NULL ) { AfxMessageBox(_T("请选中您要查看的订单!"), MB_ICONINFORMATION); return; } INT nItemCount = m_List.GetItemCount(); INT nSelectedItem = m_List.GetNextSelectedItem(pos); // 获取域名、订单号、顾客姓名、景点名; CString strBranchId = _T(""); CString strOrderNum = _T(""); CString strScenery = _T(""); CString strCustomerInfo = _T(""); // 获取域名; if ( g_bAllBranch ) {// 多店汇总时; strBranchId = GetDomainFromBranch( m_List.GetItemText(nSelectedItem, 0) ); } else { if ( g_branchname.IsEmpty() ) {// 连接本店时; strBranchId = g_domain; } else {// 连接分店时; strBranchId = GetDomainFromBranch( g_branchname ); } } // 获取订单号; strOrderNum = m_List.GetItemText(nSelectedItem, 0 + m_nAdd); // 顾客信息; strCustomerInfo = m_List.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List.GetItemText(nSelectedItem, 2 + m_nAdd); // 获取景点名; strScenery = _T("如果需要,则返回景点名,只查看某个景点,但只限于儿童成长套系!"); if ( strScenery == _T("全部") ) { // 重置景点名为空,查看整个订单的相片; strScenery.Empty(); } ////////////////////////////////////////////////////////////////////////// // 传参给缩略图对话框; ShowPic dlg; dlg.m_id = strOrderNum; dlg.m_name = strCustomerInfo; dlg.m_mode = 2; // 初修片; dlg.m_branch = strBranchId; // 在ShowPic内部使用kernel模块查找出指定相片路径; dlg.DoModal(); // end; } ///////////////////////////////////////////////////////////////////////////////////////////////// // 重写精修导出精修片按钮函数; void BeautifySkinFrom2::OnBUTexportphoto2() { // 判断登陆用户是否有导出精修片的权限; 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); // 获取景点名,需要读取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->ExportFurtherImg( TRUE, strBranchId, strOrderNum, strCustomerInfo, !strScenery.IsEmpty(), strScenery, _T("*.jpg|*.jpeg"), dwExportPix, _T("*.nef|*.cr2|*.raw|*.ra2"), FALSE, FALSE ); } g_pIMSProcess->Release(); // 结束; } ///////////////////////////////////////////////////////////////////////////////////////////////// // 重写精修导出选好的片按钮函数; // 未完! void BeautifySkinFrom2::OnBUTexportphoto() // 导出选好的片 按钮; { // 判断用户是否有权限导出选好的片; 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 ); } } // 获取景点名,需要读取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(); } } ///////////////////////////////////////////////////////////////////////////////////////////////// // 与服务器通信获取指定条件的订单商品信息; 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//CHILD_VERSION g_sendhead.bsql = FALSE; g_sendhead.code[0] = 50; // dindansp; g_sendhead.code[1] = 11; // dindan; g_sendhead.code[2] = 56; // dindansp; g_sendhead.tabcount = 3; if( g_bAllBranch ) {//多店汇总时; g_branchip = GetBranchIPbyId(strBranchId); g_pMainWnd->OnDisconnect(); g_branchname = strBranchName; g_bBranchModify = TRUE; g_pMainWnd->ProcessChatMessageRequest2(strSQL); g_pMainWnd->OnDisconnect(); g_bBranchModify = FALSE; g_branchip = g_branchname = _T(""); } else {// 连接本店或分店时; g_pMainWnd->ProcessChatMessageRequest2(strSQL); } if( !g_bSendOK ) return ; CArray Arydindan; CArray Arydindansp; CArray Arydindansp2; DataToArray( &Arydindansp, &Arydindan, &Arydindansp2 ); CString strTemp = _T(""); CStringArray AryImgNums; CStringArray AryPerImgGoods; // 获取所有dindansp记录no字段中的相片编号; int i = 0; int nSize = Arydindansp.GetSize(); for ( i = 0; i < nSize; i++) { strTemp = Arydindansp.ElementAt(i).ElementAt(6); // dindansp表中的no字段; GetNo(strTemp, AryImgNums); } // 获取每张相片编号对应的商品,每个商品间用分号隔开; nSize = AryImgNums.GetSize(); AryPerImgGoods.SetSize(nSize); for ( i = 0; i < nSize; i++ ) { strTemp = AryImgNums.ElementAt(i); AryPerImgGoods.SetAt(i, GetSelName(strTemp, Arydindansp)); } // 由于VC6.0传CStringArray给VC9.0DLL 时,会产生无法避免的兼容性问题,故使用CString传; CString strImgNums = _T(""); for ( i = 0; i < AryImgNums.GetSize(); i++ ) { strImgNums += AryImgNums.ElementAt(i); strImgNums += _T("?|?"); } CString strPerImgGoods = _T(""); for ( i = 0; i < AryPerImgGoods.GetSize(); i++ ) {// 商品名称,应该禁止包含非法字符; strPerImgGoods += AryPerImgGoods.ElementAt(i); strPerImgGoods += _T("?|?"); } // 再选择导出的是初修片、原片、初修+原片,并且是否按产品生成文件夹分类相片或者相片名后带产品名; SelectPhotoDlg selectdlg; selectdlg.DoModal(); BOOL bExportWithName = selectdlg.m_check1; INT bExportMode = selectdlg.m_mode; // 0 原片+初修, 1 原片, 2 初修; ImgExportInterface *pExport = NULL; g_pIMSProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport); if ( pExport ) {// 导出选好的片; INT nCount = 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) ); OutputDebugString(_T("导出选好的片!\n")); } pExport->Release(); // 读取出选片的客户要求; CString strCustomerRequire = _T(""); if ( Arydindan.GetSize()) { } }