ProcessAlarm.cpp 21 KB

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