ProcessAlarm.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742
  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 "NeroDlg.h"
  9. #include "ClientRequirement.h"
  10. #include "./helper/ffsco.h"
  11. #include "TakeMoney4.h"
  12. #include "AlarmDays.h"
  13. #ifdef _DEBUG
  14. #define new DEBUG_NEW
  15. #undef THIS_FILE
  16. static char THIS_FILE[] = __FILE__;
  17. #endif
  18. #pragma comment(lib, "Shlwapi.lib")
  19. /////////////////////////////////////////////////////////////////////////////
  20. // ProcessAlarm
  21. IMPLEMENT_DYNCREATE(ProcessAlarm, MyFormView)
  22. ProcessAlarm::ProcessAlarm()
  23. : MyFormView(ProcessAlarm::IDD)
  24. {
  25. //{{AFX_DATA_INIT(ProcessAlarm)
  26. m_filter = _T("");
  27. m_check1 = FALSE;
  28. m_check2 = FALSE;
  29. //}}AFX_DATA_INIT
  30. }
  31. ProcessAlarm::~ProcessAlarm()
  32. {
  33. }
  34. void ProcessAlarm::DoDataExchange(CDataExchange* pDX)
  35. {
  36. MyFormView::DoDataExchange(pDX);
  37. //{{AFX_DATA_MAP(ProcessAlarm)
  38. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  39. DDX_Control(pDX, IDC_LIST2, m_List1);
  40. DDX_Control(pDX, IDC_STATIC1, m_static1);
  41. DDX_CBString(pDX, IDC_COMBO1, m_filter);
  42. DDX_Check(pDX, IDC_CHECK1, m_check1);
  43. DDX_Check(pDX, IDC_CHECK2, m_check2);
  44. //}}AFX_DATA_MAP
  45. }
  46. BEGIN_MESSAGE_MAP(ProcessAlarm, MyFormView)
  47. //{{AFX_MSG_MAP(ProcessAlarm)
  48. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  49. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  50. ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  51. ON_WM_TIMER()
  52. ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
  53. ON_BN_CLICKED(IDC_BUTexportphoto, OnBUTexportphoto)
  54. ON_BN_CLICKED(IDC_BUTimportphoto, OnBUTimportphoto)
  55. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  56. ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
  57. ON_BN_CLICKED(IDC_BUTburncd, OnBUTProcessAlarm)
  58. ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
  59. ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
  60. ON_BN_CLICKED(IDC_BUTburncd2, OnBUTburncd2)
  61. ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
  62. ON_BN_CLICKED(IDC_CHECK2, OnCheck2)
  63. //}}AFX_MSG_MAP
  64. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST2, OnCustomdrawList)
  65. END_MESSAGE_MAP()
  66. /////////////////////////////////////////////////////////////////////////////
  67. // ProcessAlarm diagnostics
  68. #ifdef _DEBUG
  69. void ProcessAlarm::AssertValid() const
  70. {
  71. MyFormView::AssertValid();
  72. }
  73. void ProcessAlarm::Dump(CDumpContext& dc) const
  74. {
  75. MyFormView::Dump(dc);
  76. }
  77. #endif //_DEBUG
  78. /////////////////////////////////////////////////////////////////////////////
  79. // ProcessAlarm message handlers
  80. void ProcessAlarm::OnInitialUpdate()
  81. {
  82. MyFormView::OnInitialUpdate();
  83. // TODO: Add your specialized code here and/or call the base class
  84. CMyMdi Mdi;
  85. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  86. GetDlgItem(IDC_BUTburncd2)->EnableWindow(IsHasRights2new(49));
  87. // Here we create the outbar control using the splitter as its parent
  88. // and setting its id to the first pane.
  89. tmdoday = ::GetTmFromStr(g_date);
  90. //tmdt tmdindan
  91. CRect rc2;
  92. GetWindowRect(rc2);
  93. ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
  94. EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc, 0);
  95. m_static1.SetFont(&g_titlefont);
  96. #ifdef CHILD_VERSION
  97. m_List1.SetHeadings("订单号,109;家长姓名,85;宝宝姓名,85;门市,85;订单日期,86;拍照时间,86;选片时间,86;拍照,70;拍完,70;选片,50;看样,50;件齐,50;取走,50;手机,100;固定电话,100");
  98. #else
  99. m_List1.SetHeadings("订单号,109;男宾姓名,85;女宾姓名,85;门市,85;订单日期,86;拍照时间,86;选片时间,86;拍照,70;拍完,70;选片,50;看样,50;件齐,50;取走,50;男宾电话,100;女宾电话,100" );
  100. #endif
  101. m_List1.LoadColumnInfo(303);
  102. // 获取alarmview视图数据,并转换;
  103. g_sendhead.bsql = 0;
  104. g_sendhead.code[0] = 229; // alarmview需要重新设计;
  105. g_sendhead.tabcount = 1;
  106. g_pMainWnd->ProcessChatMessageRequest2(1);
  107. if (g_bSendOK == 0) return;
  108. DataToArray(&m_List1array);
  109. // 初始化列表框数据记录;
  110. FillGrid();
  111. m_combo1.GetWindowRect(rc2);
  112. ScreenToClient(rc2);
  113. rc2.bottom += 200;
  114. m_combo1.MoveWindow(rc2);
  115. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  116. SetComboHei(&m_combo1, rc2.Height());
  117. }
  118. void ProcessAlarm::FillGrid(BOOL bStatus)//对list列表框初始化数据记录;
  119. {
  120. HidePrice();
  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. void ProcessAlarm::GetSavePath(CString &path)
  260. {
  261. char lpszDisplayName[MAX_PATH], szFileName[MAX_PATH];
  262. LPITEMIDLIST pidlDesktop, pidlCurrent;
  263. if (SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidlDesktop) == NOERROR)
  264. {
  265. BROWSEINFO bi;
  266. bi.hwndOwner = this->m_hWnd;
  267. bi.pidlRoot = pidlDesktop;
  268. bi.pszDisplayName = lpszDisplayName;
  269. bi.lpszTitle = "\n文档保存的目录:";
  270. bi.ulFlags = BIF_STATUSTEXT&BIF_RETURNONLYFSDIRS;
  271. bi.lpfn = BrowseProc;
  272. bi.lParam = 0;
  273. bi.iImage = 0;
  274. pidlCurrent = SHBrowseForFolder(&bi);
  275. SHGetPathFromIDList(pidlCurrent, szFileName);
  276. path = szFileName;
  277. }
  278. }
  279. int ProcessAlarm::FindArray(CStringArray *pArray, CString Str)
  280. {
  281. for (int i = 0; i < pArray->GetSize(); i++)
  282. {
  283. if (pArray->ElementAt(i) == Str)
  284. return i;
  285. }
  286. return -1;
  287. }
  288. //-----------------------------------------------------------------
  289. // remark by Jeff 2014-12-12
  290. // 函数:GetNo
  291. // 描述:从str中解析出每个相片名,然后存入空的CStringArray中;
  292. // 参数:
  293. // str:选好的相片名串,如:"001,002,003" 后分隔符改为"|",结果应是"001|002|003"
  294. // array:空的数组,用来存放解析后的相片名;
  295. // 返回:
  296. // 注意:更换分隔符造成的问题,在该函数已解决;
  297. //-----------------------------------------------------------------
  298. void ProcessAlarm::GetNo(CString str, CStringArray &array)
  299. {
  300. if (!str.IsEmpty())
  301. {
  302. #ifdef USE_SEP_VEB
  303. int pos = str.Find(SEPS_VEB);
  304. #else
  305. int pos = str.Find(",");
  306. #endif
  307. while (pos != -1)
  308. {
  309. if (FindArray(&array, str.Left(pos)) == -1)
  310. array.Add(str.Left(pos));
  311. str = str.Right(str.GetLength() - pos - 1);
  312. #ifdef USE_SEP_VEB
  313. pos = str.Find(SEPS_VEB);
  314. #else
  315. pos = str.Find(",");
  316. #endif
  317. }
  318. if (FindArray(&array, str) == -1)
  319. array.Add(str);
  320. }
  321. }
  322. //-----------------------------------------------------------------
  323. // remark by Jeff 2014-12-12
  324. // 函数:GetSelName
  325. // 描述:
  326. // 参数:
  327. // name:由GetNo解析出来后的单个相片名,如:"001"
  328. // spnamearray:订单下的商品数组,case 50所得;
  329. // 返回:
  330. // 注意:更换分隔符造成的问题,在该函数已解决;
  331. //-----------------------------------------------------------------
  332. CString ProcessAlarm::GetSelName(CString name, CArray<CStringArray, CStringArray>&spnamearray)
  333. {
  334. CString ret;
  335. #ifdef USE_SEP_VEB
  336. name = SEPS_VEB + name + SEPS_VEB;
  337. #else
  338. name = "," + name + ",";
  339. #endif
  340. CString str;
  341. for (int i = 0; i < spnamearray.GetSize(); i++)
  342. {
  343. #ifdef USE_SEP_VEB
  344. str = SEPS_VEB + spnamearray.ElementAt(i).ElementAt(6) + SEPS_VEB;
  345. #else
  346. str = "," + spnamearray.ElementAt(i).ElementAt(6) + ",";
  347. #endif
  348. if (str.Find(name) != -1)
  349. {
  350. ret += spnamearray.ElementAt(i).ElementAt(5);
  351. ret += ";";
  352. }
  353. }
  354. ret.TrimRight(";");
  355. ret.Replace("*", "x");
  356. return ret;
  357. }
  358. void ProcessAlarm::OnBUTexportphoto()
  359. {
  360. }
  361. void ProcessAlarm::OnBUTimportphoto()
  362. {
  363. }
  364. void ProcessAlarm::OnBUTshowphoto()
  365. {
  366. }
  367. void ProcessAlarm::OnButton1()
  368. {
  369. UpdateData();
  370. m_filter.TrimLeft();
  371. m_filter.TrimRight();
  372. FillGrid();
  373. }
  374. void ProcessAlarm::OnButton2()
  375. {
  376. }
  377. void ProcessAlarm::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
  378. {
  379. NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
  380. *pResult = 0;
  381. }
  382. void ProcessAlarm::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
  383. {
  384. *pResult = 0;
  385. }
  386. void ProcessAlarm::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
  387. {
  388. POSITION pos;
  389. pos = m_List1.GetFirstSelectedItemPosition();
  390. if (pos == NULL)return;
  391. int iItem = m_List1.GetNextSelectedItem(pos);
  392. g_id = m_List1.GetItemText(iItem, 0);
  393. *pResult = 0;
  394. }
  395. void ProcessAlarm::HidePrice()
  396. {
  397. return;
  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. }