ProcessAlarm.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. // ProcessAlarm.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "ProcessAlarm.h"
  6. #include "MyMdi.H"
  7. #include "ModifyDinDan.h"
  8. #include "InputPsw.h"
  9. #include "ImportPhoto.h"
  10. #include "ImportPhoto.h"
  11. #include "NeroDlg.h"
  12. #include "ClientRequirement.h"
  13. #include "ChoosePhotoSkin2.h"
  14. #include "./helper/ffsco.h"
  15. #include "TakeMoney4.h"
  16. #include "AlarmDays.h"
  17. #ifdef _DEBUG
  18. #define new DEBUG_NEW
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22. #pragma comment(lib, "Shlwapi.lib")
  23. /////////////////////////////////////////////////////////////////////////////
  24. // ProcessAlarm
  25. IMPLEMENT_DYNCREATE(ProcessAlarm, MyFormView)
  26. ProcessAlarm::ProcessAlarm()
  27. : MyFormView(ProcessAlarm::IDD)
  28. {
  29. //{{AFX_DATA_INIT(ProcessAlarm)
  30. m_filter = _T("");
  31. m_check1 = FALSE;
  32. m_check2 = FALSE;
  33. //}}AFX_DATA_INIT
  34. }
  35. ProcessAlarm::~ProcessAlarm()
  36. {
  37. }
  38. void ProcessAlarm::DoDataExchange(CDataExchange* pDX)
  39. {
  40. MyFormView::DoDataExchange(pDX);
  41. //{{AFX_DATA_MAP(ProcessAlarm)
  42. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  43. DDX_Control(pDX, IDC_LIST2, m_List1);
  44. DDX_Control(pDX, IDC_STATIC1, m_static1);
  45. DDX_CBString(pDX, IDC_COMBO1, m_filter);
  46. DDX_Check(pDX, IDC_CHECK1, m_check1);
  47. DDX_Check(pDX, IDC_CHECK2, m_check2);
  48. //}}AFX_DATA_MAP
  49. }
  50. BEGIN_MESSAGE_MAP(ProcessAlarm, MyFormView)
  51. //{{AFX_MSG_MAP(ProcessAlarm)
  52. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  53. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  54. ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  55. ON_WM_TIMER()
  56. ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
  57. ON_BN_CLICKED(IDC_BUTexportphoto, OnBUTexportphoto)
  58. ON_BN_CLICKED(IDC_BUTimportphoto, OnBUTimportphoto)
  59. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  60. ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
  61. ON_BN_CLICKED(IDC_BUTburncd, OnBUTProcessAlarm)
  62. ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
  63. ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
  64. ON_BN_CLICKED(IDC_BUTburncd2, OnBUTburncd2)
  65. ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
  66. ON_BN_CLICKED(IDC_CHECK2, OnCheck2)
  67. //}}AFX_MSG_MAP
  68. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST2, OnCustomdrawList)
  69. END_MESSAGE_MAP()
  70. /////////////////////////////////////////////////////////////////////////////
  71. // ProcessAlarm diagnostics
  72. #ifdef _DEBUG
  73. void ProcessAlarm::AssertValid() const
  74. {
  75. MyFormView::AssertValid();
  76. }
  77. void ProcessAlarm::Dump(CDumpContext& dc) const
  78. {
  79. MyFormView::Dump(dc);
  80. }
  81. #endif //_DEBUG
  82. /////////////////////////////////////////////////////////////////////////////
  83. // ProcessAlarm message handlers
  84. void ProcessAlarm::OnInitialUpdate()
  85. {
  86. MyFormView::OnInitialUpdate();
  87. // TODO: Add your specialized code here and/or call the base class
  88. CMyMdi Mdi;
  89. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  90. GetDlgItem(IDC_BUTburncd2)->EnableWindow(IsHasRights2new(49));
  91. // Here we create the outbar control using the splitter as its parent
  92. // and setting its id to the first pane.
  93. tmdoday = ::GetTmFromStr (g_date);
  94. //tmdt tmdindan
  95. CRect rc2;
  96. GetWindowRect(rc2);
  97. ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
  98. EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc,0);
  99. m_static1.SetFont (&g_titlefont);
  100. #ifdef CHILD_VERSION
  101. m_List1.SetHeadings("订单号,109;家长姓名,85;宝宝姓名,85;门市,85;订单日期,86;拍照时间,86;选片时间,86;拍照,70;拍完,70;选片,50;看样,50;件齐,50;取走,50;手机,100;固定电话,100" );
  102. #else
  103. m_List1.SetHeadings("订单号,109;男宾姓名,85;女宾姓名,85;门市,85;订单日期,86;拍照时间,86;选片时间,86;拍照,70;拍完,70;选片,50;看样,50;件齐,50;取走,50;男宾电话,100;女宾电话,100" );
  104. #endif
  105. m_List1.LoadColumnInfo(303);
  106. // 获取alarmview视图数据,并转换;
  107. g_sendhead.bsql=0;
  108. g_sendhead.code[0]=229; // alarmview需要重新设计;
  109. g_sendhead.tabcount=1;
  110. g_pMainWnd->ProcessChatMessageRequest2(1);
  111. if(g_bSendOK==0) return;
  112. DataToArray(&m_List1array);
  113. // 初始化列表框数据记录;
  114. FillGrid();
  115. m_combo1.GetWindowRect(rc2);
  116. ScreenToClient(rc2);
  117. rc2.bottom +=200;
  118. m_combo1.MoveWindow(rc2);
  119. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  120. SetComboHei(&m_combo1, rc2.Height());
  121. }
  122. void ProcessAlarm::FillGrid(BOOL bStatus)//对list列表框初始化数据记录;
  123. {
  124. m_List1.DeleteAllItems2();
  125. int ii=0;
  126. m_List1.m_arLabels.SetSize( m_List1array.GetSize(), 1 );
  127. //m_List1.m_arLabels.SetSize( m_List1array.GetSize()-2, 1 );
  128. int count=0;
  129. if(m_filter.IsEmpty())
  130. {
  131. for(ii=0; ii<m_List1.m_arLabels.GetSize(); ii++)
  132. {
  133. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  134. }
  135. }
  136. else
  137. {
  138. int type=GetType(m_filter);
  139. if(type==1)//电话
  140. {
  141. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  142. {
  143. if(m_List1array.ElementAt (ii).ElementAt (11).Find (m_filter)!=-1 || \
  144. m_List1array.ElementAt (ii).ElementAt (12).Find (m_filter)!=-1)
  145. {
  146. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  147. }
  148. }
  149. }
  150. else if(type==2)//拼音
  151. {
  152. m_filter.MakeUpper ();
  153. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  154. {
  155. if(m_List1array.ElementAt (ii).ElementAt (13).Find (m_filter)!=-1 || \
  156. m_List1array.ElementAt (ii).ElementAt (14).Find (m_filter)!=-1)
  157. {
  158. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  159. }
  160. }
  161. }
  162. else
  163. {
  164. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  165. {
  166. if(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
  167. m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || \
  168. m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 || \
  169. m_List1array.ElementAt (ii).ElementAt (3).Find (m_filter)!=-1|| \
  170. m_List1array.ElementAt (ii).ElementAt (14).Find (m_filter)!=-1 || \
  171. m_List1array.ElementAt (ii).ElementAt (11).Find (m_filter)!=-1 || \
  172. m_List1array.ElementAt (ii).ElementAt (12).Find (m_filter)!=-1 || \
  173. m_List1array.ElementAt (ii).ElementAt (13).Find (m_filter)!=-1 )
  174. {
  175. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  176. }
  177. }
  178. }
  179. }
  180. m_List1.m_arLabels.SetSize(count, 1);
  181. ii=count;
  182. m_List1.m_LabelCount=ii;
  183. m_List1.SetItemCountEx (ii);
  184. CString str;
  185. str.Format ("单数:%d", ii);
  186. SetDlgItemText(IDC_STATIC2, str);
  187. if(!g_id.IsEmpty ())
  188. {
  189. for(int i=0; i<m_List1.GetItemCount (); i++)
  190. {
  191. if(g_id==m_List1.GetItemText (i, 0))
  192. {
  193. m_List1.SetItemState(i,LVIS_SELECTED|LVIS_FOCUSED,LVIS_SELECTED|LVIS_FOCUSED);
  194. m_List1.EnsureVisible(i,FALSE);
  195. break;
  196. }
  197. }
  198. }
  199. }
  200. void ProcessAlarm::OnBUTclose()
  201. {
  202. GetParent()->SendMessage(WM_CLOSE);
  203. }
  204. void ProcessAlarm::OnSelchangeCombo1()
  205. {
  206. SetTimer(1, 100, NULL);
  207. }
  208. void ProcessAlarm::OnTimer(UINT nIDEvent)
  209. {
  210. KillTimer(nIDEvent);
  211. OnButton1();
  212. }
  213. BOOL ProcessAlarm::PreTranslateMessage(MSG* pMsg)
  214. {
  215. try
  216. {
  217. if(pMsg->message==WM_KEYDOWN)
  218. {
  219. switch (pMsg->wParam)
  220. {
  221. case VK_RETURN:
  222. OnButton1();
  223. return 1;
  224. case 0x43: // copy
  225. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  226. {
  227. GetFocus()->SendMessage(WM_COPY);
  228. return TRUE;
  229. }
  230. break;
  231. case 0x56: //Ctrl + V:
  232. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  233. {
  234. GetFocus()->SendMessage(WM_PASTE);
  235. return TRUE;
  236. }
  237. break;
  238. case 0x58: // cut
  239. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  240. {
  241. GetFocus()->SendMessage(WM_CUT);
  242. return TRUE;
  243. }
  244. break;
  245. case 0x5A: //undo
  246. case 0x59: //redo
  247. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  248. {
  249. GetFocus()->SendMessage(WM_UNDO);
  250. return TRUE;
  251. }
  252. break;
  253. }
  254. }
  255. return MyFormView::PreTranslateMessage(pMsg);
  256. }
  257. catch(...)
  258. {
  259. }
  260. }
  261. extern int CALLBACK BrowseProc(HWND hwnd, UINT msg, LPARAM lParam, LPARAM lpData);
  262. /*{
  263. switch(msg)
  264. {
  265. case BFFM_INITIALIZED:
  266. SendMessage(hwnd, BFFM_SETSELECTION, TRUE, NULL);
  267. break;
  268. case BFFM_SELCHANGED:
  269. {
  270. char szFileName[MAX_PATH];
  271. LPITEMIDLIST pidlCurrent = (LPITEMIDLIST)lParam;
  272. SHGetPathFromIDList(pidlCurrent, szFileName);
  273. SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM)szFileName);
  274. }
  275. break;
  276. }
  277. return 0;
  278. }*/
  279. void ProcessAlarm::GetSavePath(CString &path)
  280. {
  281. char lpszDisplayName[MAX_PATH], szFileName[MAX_PATH];
  282. LPITEMIDLIST pidlDesktop, pidlCurrent;
  283. if(SHGetSpecialFolderLocation(NULL,CSIDL_DESKTOP,&pidlDesktop) == NOERROR)
  284. {
  285. BROWSEINFO bi;
  286. bi.hwndOwner = this->m_hWnd;
  287. bi.pidlRoot = pidlDesktop;
  288. bi.pszDisplayName = lpszDisplayName;
  289. bi.lpszTitle = "\n文档保存的目录:";
  290. bi.ulFlags = BIF_STATUSTEXT&BIF_RETURNONLYFSDIRS ;
  291. bi.lpfn = BrowseProc;
  292. bi.lParam = 0;
  293. bi.iImage = 0;
  294. pidlCurrent = SHBrowseForFolder(&bi);
  295. SHGetPathFromIDList(pidlCurrent, szFileName);
  296. path = szFileName;
  297. }
  298. }
  299. int ProcessAlarm::FindArray(CStringArray *pArray, CString Str)
  300. {
  301. for(int i=0; i<pArray->GetSize (); i++)
  302. {
  303. if(pArray->ElementAt (i)==Str)
  304. return i;
  305. }
  306. return -1;
  307. }
  308. void ProcessAlarm::GetNo(CString str, CStringArray &array)
  309. {
  310. if(!str.IsEmpty ())
  311. {
  312. int pos=str.Find (",");
  313. while(pos!=-1)
  314. {
  315. if(FindArray(&array, str.Left (pos))==-1)
  316. array.Add (str.Left (pos));
  317. str=str.Right (str.GetLength ()-pos-1);
  318. pos=str.Find (",");
  319. }
  320. if(FindArray(&array, str)==-1)
  321. array.Add(str);
  322. }
  323. }
  324. CString ProcessAlarm::GetSelName(CString name, CArray<CStringArray, CStringArray>&spnamearray)
  325. {
  326. CString ret;
  327. name=","+name+",";
  328. CString str;
  329. for(int i=0; i<spnamearray.GetSize (); i++)
  330. {
  331. str=","+spnamearray.ElementAt (i).ElementAt (6)+",";
  332. if(str.Find (name)!=-1)
  333. {
  334. ret+=spnamearray.ElementAt (i).ElementAt (5);
  335. ret+=";";
  336. }
  337. }
  338. ret.TrimRight (";");
  339. ret.Replace ("*", "x");
  340. return ret;
  341. }
  342. void ProcessAlarm::OnBUTexportphoto()
  343. {
  344. }
  345. void ProcessAlarm::OnBUTimportphoto()
  346. {
  347. }
  348. void ProcessAlarm::OnBUTshowphoto()
  349. {
  350. }
  351. void ProcessAlarm::OnButton1()
  352. {
  353. UpdateData();
  354. m_filter.TrimLeft ();
  355. m_filter.TrimRight ();
  356. FillGrid();
  357. }
  358. void ProcessAlarm::OnButton2()
  359. {
  360. }
  361. void ProcessAlarm::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
  362. {
  363. NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
  364. *pResult = 0;
  365. }
  366. void ProcessAlarm::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
  367. {
  368. *pResult = 0;
  369. }
  370. void ProcessAlarm::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  371. {
  372. POSITION pos;
  373. pos=m_List1.GetFirstSelectedItemPosition();
  374. if(pos==NULL)return;
  375. int iItem=m_List1.GetNextSelectedItem(pos);
  376. g_id = m_List1.GetItemText (iItem, 0);
  377. *pResult = 0;
  378. }
  379. void ProcessAlarm::HidePrice()
  380. {
  381. }
  382. //lYFZ
  383. void ProcessAlarm::OnCheck1()
  384. {
  385. UpdateData();
  386. FillGrid();
  387. }
  388. void ProcessAlarm::OnCheck2()
  389. {
  390. OnCheck1();
  391. }
  392. void ProcessAlarm::OnCustomdrawList ( NMHDR* pNMHDR, LRESULT* pResult )
  393. {
  394. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  395. // Take the default processing unless we set this to something else below.
  396. *pResult = 0;
  397. // First thing - check the draw stage. If it's the control's prepaint
  398. // stage, then tell Windows we want messages for every item.
  399. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  400. {
  401. *pResult = CDRF_NOTIFYITEMDRAW;
  402. }
  403. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  404. {
  405. // This is the prepaint stage for an item. Here's where we set the
  406. // item's text color. Our return value will tell Windows to draw the
  407. // item itself, but it will use the new color we set here.
  408. // We'll cycle the colors through red, green, and light blue.
  409. *pResult = CDRF_NOTIFYSUBITEMDRAW;
  410. /* if(pLVCD->nmcd.dwItemSpec%2)
  411. pLVCD->clrTextBk = g_gridcol1;
  412. else
  413. pLVCD->clrTextBk = g_gridcol2;
  414. if(pLVCD->nmcd.dwItemSpec==0)pLVCD->clrTextBk = RGB(220,0,0);
  415. if(pLVCD->nmcd.dwItemSpec==2)pLVCD->clrTextBk = RGB(20,133,20);
  416. */
  417. }
  418. else if ( (CDDS_ITEMPREPAINT | CDDS_SUBITEM) == pLVCD->nmcd.dwDrawStage )
  419. {
  420. // This is the prepaint stage for a subitem. Here's where we set the
  421. // item's text and background colors. Our return value will tell
  422. // Windows to draw the subitem itself, but it will use the new colors
  423. // we set here.
  424. // The text color will cycle through red, green, and light blue.
  425. // The background color will be light blue for column 0, red for
  426. // column 1, and black for column 2.
  427. COLORREF crBkgnd;
  428. if (1 )
  429. {
  430. if(pLVCD->nmcd.dwItemSpec%2)
  431. crBkgnd = g_gridcol1;
  432. else
  433. crBkgnd = g_gridcol2;
  434. }
  435. #if 0
  436. static BOOL b1 = FALSE;
  437. static BOOL b2 = FALSE;
  438. static BOOL b3 = FALSE;
  439. static BOOL b4 = FALSE;
  440. static BOOL b5 = FALSE;
  441. if ( 7 == pLVCD->iSubItem ) // 拍照字段; **不修改对比时间
  442. {
  443. tmdindan= ::GetTmFromStr(m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(4));
  444. tmdt=tmdoday-tmdindan;
  445. if(tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(141)) && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(7)=="未拍")
  446. {
  447. b1 = FALSE;
  448. crBkgnd = RGB(220,0,0); // 红
  449. }
  450. else
  451. {
  452. b1 = TRUE;
  453. crBkgnd = RGB(20,133,20); // 绿
  454. }
  455. }
  456. else if ( 8 == pLVCD->iSubItem ) // 拍完字段; **不修改对比时间
  457. {
  458. tmdindan= ::GetTmFromStr(m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(4));
  459. tmdt=tmdoday-tmdindan;
  460. if(tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(142)) && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8)=="未拍完" || b1==FALSE)
  461. //if(tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(142)) && b1==FALSE)
  462. {
  463. b2 = FALSE;
  464. crBkgnd = RGB(220,0,0);
  465. }
  466. else
  467. {
  468. b2 = TRUE;
  469. crBkgnd = RGB(20,133,20);
  470. }
  471. }
  472. else if ( 9 == pLVCD->iSubItem ) // 选片字段; **对比拍完时间
  473. {
  474. tmdindan= ::GetTmFromStr(m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(5)); // (5).拍照时间 && 拍照状态=ok
  475. tmdt=tmdoday-tmdindan;
  476. //if(tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(143)) && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9)!="OK" || b2==FALSE/*&& m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8)=="未拍完"*/ )
  477. if(tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(143)) && b2==FALSE )
  478. {
  479. b3 = FALSE;
  480. crBkgnd = RGB(220,0,0);
  481. }
  482. else
  483. {
  484. b3 = TRUE;
  485. crBkgnd = RGB(20,133,20);
  486. }
  487. }
  488. else if ( 10 == pLVCD->iSubItem ) // 看样字段; **对比选完时间
  489. {
  490. tmdindan= ::GetTmFromStr(m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(6)); // (6).选片时间 && 选片状态=ok
  491. tmdt=tmdoday-tmdindan;
  492. //if(tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(144)) && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt (10)!="OK" || b3 == FALSE/* && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9)=="未选"*/)
  493. if(tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(144)) && b3 == FALSE)
  494. {
  495. b4 = FALSE;
  496. crBkgnd = RGB(220,0,0);
  497. }
  498. else
  499. {
  500. b4 = TRUE;
  501. crBkgnd = RGB(20,133,20);
  502. }
  503. }
  504. else if ( 11 == pLVCD->iSubItem ) // 件齐字段; **对比选完时间
  505. {
  506. tmdindan= ::GetTmFromStr(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt(6)); // (6).选片时间 && 选片状态=ok
  507. tmdt=tmdoday-tmdindan;
  508. //if(tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(145)) && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt (11)!="OK" || b4==FALSE/* && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9)=="未选"*/)
  509. if(tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(145)) && b4==FALSE)
  510. {
  511. b5 = FALSE;
  512. crBkgnd = RGB(220,0,0);
  513. }
  514. else
  515. {
  516. b5 = TRUE;
  517. crBkgnd = RGB(20,133,20);
  518. }
  519. }
  520. else if ( 12 == pLVCD->iSubItem ) // 取走字段; **对比选完时间
  521. {
  522. tmdindan= ::GetTmFromStr(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt(6)); // (6).选片时间 && 选片状态=ok
  523. tmdt=tmdoday-tmdindan;
  524. //if(tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(146)) && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt (12)=="未取" || b5==FALSE/*&& m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9)=="未选"*/)
  525. if(tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(146)) && b5==FALSE)
  526. crBkgnd = RGB(220,0,0);
  527. else
  528. crBkgnd = RGB(20,133,20);
  529. }
  530. #else
  531. static BOOL b1 = FALSE;
  532. static BOOL b2 = FALSE;
  533. static BOOL b3 = FALSE;
  534. switch(pLVCD->iSubItem)
  535. {
  536. case 7:// 拍照字段; **不修改对比时间
  537. tmdindan = ::GetTmFromStr(m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(4));
  538. tmdt=tmdoday-tmdindan;
  539. if(tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(141)) && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(7)=="未拍")
  540. {
  541. b1 = FALSE;
  542. crBkgnd = RGB(220,0,0); // 红
  543. }
  544. else
  545. {
  546. b1 = TRUE;
  547. crBkgnd = RGB(20,133,20); // 绿
  548. }
  549. break;
  550. case 8: // 拍完字段 red = !b1 && tmdt>(142) && 未拍完
  551. tmdindan= ::GetTmFromStr(m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(4));
  552. //printf("Jeff:订单号:%s,订单时间:%s\n\n",m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(1),m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(4));//Jeff Printf;
  553. //printf("Jeff:订单号;%s,订单时间:%s,订单后%s天\n\n",m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(1),m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(4),g_cominfoarray.ElementAt(0).ElementAt(142));//Jeff Printf;
  554. tmdt=tmdoday-tmdindan;
  555. //printf("Jeff:离订单时间后:%d天\n\n",tmdt.GetDays());// Jeff Printf;
  556. if( /*b1==FALSE ||*/ tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(142)) && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8)=="未拍完" )
  557. {
  558. b2 = FALSE;
  559. crBkgnd = RGB(220,0,0);
  560. }
  561. else
  562. {
  563. b2 = TRUE;
  564. crBkgnd = RGB(20,133,20);
  565. }
  566. break;
  567. case 9: // 选片字段
  568. if (m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(5) == "") // 拍照时间空;
  569. {
  570. crBkgnd = RGB(20,133,20);
  571. }else
  572. {
  573. tmdindan= ::GetTmFromStr(m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(5)); // (5).拍照时间 && 拍照状态=ok
  574. tmdt=tmdoday-tmdindan;
  575. if( b2==FALSE || tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(143)) && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9)!="OK" /*&& m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(8)=="未拍完"*/ )
  576. {
  577. b3 = FALSE;
  578. crBkgnd = RGB(220,0,0);
  579. }
  580. else
  581. {
  582. b3 = TRUE;
  583. crBkgnd = RGB(20,133,20);
  584. }
  585. }
  586. break;
  587. case 10: // 看样字段;
  588. if ( m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(6) == "") // 选片时间空;
  589. {
  590. //printf("Jeff:选片时间为空\n\n");//Jeff Printf;
  591. crBkgnd = RGB(20,133,20);
  592. }else
  593. {
  594. tmdindan= ::GetTmFromStr(m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(6)); // (6).选片时间 && 选片状态=ok // 若没有选片时间,该值为空;
  595. tmdt=tmdoday-tmdindan;
  596. if( b3==FALSE || tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(144)) && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt (10)!="OK" )
  597. {
  598. //b4 = FALSE;
  599. crBkgnd = RGB(220,0,0);
  600. }
  601. else
  602. {
  603. //b4 = TRUE;
  604. crBkgnd = RGB(20,133,20);
  605. }
  606. }
  607. break;
  608. case 11: // 件齐字段;
  609. if (m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(6) == "")
  610. {
  611. crBkgnd = RGB(20,133,20);
  612. }else
  613. {
  614. tmdindan= ::GetTmFromStr(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt(6)); // (6).选片时间 && 选片状态=ok
  615. tmdt=tmdoday-tmdindan;
  616. if(b3==FALSE || tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(145)) && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt (11)!="OK" /* && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9)=="未选"*/)
  617. {
  618. /*b5 = FALSE;*/
  619. crBkgnd = RGB(220,0,0);
  620. }
  621. else
  622. {
  623. //b5 = TRUE;
  624. crBkgnd = RGB(20,133,20);
  625. }
  626. }
  627. break;
  628. case 12: // 取走字段;
  629. if (m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(6) == "")
  630. {
  631. crBkgnd = RGB(20,133,20);
  632. }else
  633. {
  634. tmdindan= ::GetTmFromStr(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt(6)); // (6).选片时间 && 选片状态=ok
  635. tmdt=tmdoday-tmdindan;
  636. if(b3==FALSE || tmdt.GetDays()>=atoi(g_cominfoarray.ElementAt(0).ElementAt(146)) && m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt (12)=="未取" /*&& m_List1.m_arLabels.ElementAt(pLVCD->nmcd.dwItemSpec).ElementAt(9)=="未选"*/)
  637. crBkgnd = RGB(220,0,0);
  638. else
  639. crBkgnd = RGB(20,133,20);
  640. }
  641. break;
  642. default:
  643. break;
  644. }
  645. #endif
  646. // Store the colors back in the NMLVCUSTOMDRAW struct.
  647. pLVCD->clrText = RGB(0,0,0);
  648. pLVCD->clrTextBk = crBkgnd;
  649. // Tell Windows to paint the control itself.
  650. *pResult = CDRF_DODEFAULT;
  651. }
  652. }
  653. void ProcessAlarm::OnBUTProcessAlarm()
  654. {
  655. // TODO: Add your control notification handler code here
  656. AlarmDays dlg;
  657. if(IDOK==dlg.DoModal())
  658. OnButton1();
  659. }
  660. void ProcessAlarm::OnBUTburncd2()
  661. {
  662. ListToXLS(&m_List1, "c:\\客人流程.xls", 0);
  663. }