ProcessAlarm.cpp 21 KB

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