123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689 |
- #include <stdio.h>
- /////////////////////////////////////////////////////////////////////////////////////////////////
- // 重写导入设计片按钮函数;
- 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<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 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<CStringArray, CStringArray> Arydindan;
- CArray<CStringArray, CStringArray> Arydindansp;
- CArray<CStringArray, CStringArray> 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())
- {
-
- }
- }
|