|
@@ -211,9 +211,15 @@ DWORD WINAPI _exec_sql(LPVOID lparam)
|
|
|
|
|
|
if(err > 0){
|
|
|
TRACE(_T("sql error \n"));
|
|
|
-
|
|
|
}
|
|
|
mysql_free_result(pRes);
|
|
|
+
|
|
|
+ ofstream out("SQL_S.log");
|
|
|
+ if (out.is_open())
|
|
|
+ {
|
|
|
+ out<<sql;
|
|
|
+ out.close();
|
|
|
+ }
|
|
|
//TRACE(_T("passed\n"));
|
|
|
delete[] sql;
|
|
|
sql = NULL;
|
|
@@ -3931,21 +3937,39 @@ void CYAServerDlg::store_data_card( Card* card, int tag )
|
|
|
// card->card_id.c_str(), _time, _time);
|
|
|
sprintf_s(sql, LENGTH_SQL,
|
|
|
"CALL add_att(%s, '%s', '%s');", card->card_id.c_str(), _time, _time);
|
|
|
+
|
|
|
+ CString str = _T("");
|
|
|
+ //str.Format(_T("%s"),sql);
|
|
|
+ CString strtmp = _T("");
|
|
|
+ strtmp.Format(_T("%d"),RPT_ATTEND_DOWN);
|
|
|
+ str = sql;
|
|
|
+ str += strtmp;
|
|
|
+ writeErrorLog(_T("SQL_S"),str,false);
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
case RPT_ATTEND_UP:
|
|
|
{
|
|
|
if(card->map_id != 0 && card->area_id != 0){
|
|
|
- TRACE(_T(" 6 "));
|
|
|
b_exec = true;
|
|
|
- localtime_s(&local_time_ex, &card->down_time);
|
|
|
- strftime(_time_ex, 30, "%Y-%m-%d %H:%M:%S", &local_time_ex);
|
|
|
+ //localtime_s(&local_time_ex, &card->down_time);
|
|
|
+ //strftime(_time_ex, 30, "%Y-%m-%d %H:%M:%S", &local_time_ex);
|
|
|
+
|
|
|
+ string str_down_time = CFunctions::time_t2string(card->down_time);
|
|
|
//sprintf_s(sql, LENGTH_SQL,
|
|
|
// "UPDATE rpt_attendance SET end_time = '%s' WHERE card_id = %s AND start_time = '%s';",
|
|
|
// _time, card->card_id.c_str(), _time_ex);
|
|
|
+ /*sprintf_s(sql, LENGTH_SQL,
|
|
|
+ "CALL add_att(%s, '%s', '%s');", card->card_id.c_str(), _time, _time_ex);*/
|
|
|
sprintf_s(sql, LENGTH_SQL,
|
|
|
- "CALL add_att(%s, '%s', '%s');", card->card_id.c_str(), _time, _time_ex);
|
|
|
+ "CALL add_att(%s, '%s', '%s');", card->card_id.c_str(), _time, str_down_time.c_str());
|
|
|
+
|
|
|
+ CString str = _T("");
|
|
|
+ CString strtmp = _T("");
|
|
|
+ strtmp.Format(_T("%d"),RPT_ATTEND_UP);
|
|
|
+ str = sql;
|
|
|
+ str += strtmp;
|
|
|
+ writeErrorLog(_T("SQL_S"),str,false);
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
@@ -4037,19 +4061,17 @@ void CYAServerDlg::store_data_card( Card* card, int tag )
|
|
|
}
|
|
|
catch (...)
|
|
|
{
|
|
|
- CString str = _T("");
|
|
|
- //str.Format(_T("%s\n"), CFunctions::c2wc(sql));
|
|
|
-
|
|
|
- wchar_t* p = CFunctions::c2wc(sql);
|
|
|
- str.Format(_T("%s\n"), p);
|
|
|
- writeErrorLog(_T("SQL_S"), str);
|
|
|
- //str = _T("");
|
|
|
- str.Empty();
|
|
|
-
|
|
|
- if(p){
|
|
|
- free(p);
|
|
|
- p = NULL;
|
|
|
- }
|
|
|
+ //CString str = _T("");
|
|
|
+ //wchar_t* p = CFunctions::c2wc(sql);
|
|
|
+ //str.Format(_T("%s\n"), p);
|
|
|
+ //writeErrorLog(_T("SQL_S"), str);
|
|
|
+ ////str = _T("");
|
|
|
+ //str.Empty();
|
|
|
+
|
|
|
+ //if(p){
|
|
|
+ // free(p);
|
|
|
+ // p = NULL;
|
|
|
+ //}
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -6183,7 +6205,7 @@ EnHandleResult CYAServerDlg::OnSend( ITcpServer* pSender, CONNID dwConnID, const
|
|
|
}
|
|
|
EnHandleResult CYAServerDlg::OnReceive( ITcpServer* pSender, CONNID dwConnID, const BYTE* pData, int iLength )
|
|
|
{
|
|
|
- TRACE(_T("OnReceive: %d, %d\n"), iLength, dwConnID);
|
|
|
+ //TRACE(_T("OnReceive: %d, %d\n"), iLength, dwConnID);
|
|
|
|
|
|
DWORD dw = ::GetTickCount();
|
|
|
|
|
@@ -7404,7 +7426,7 @@ void CYAServerDlg::parse_data_locate_card_his_tof_card( BYTE* DataBuffer, int nL
|
|
|
}
|
|
|
catch (...)
|
|
|
{
|
|
|
- CString str;
|
|
|
+ /*CString str;
|
|
|
wchar_t* p = CFunctions::c2wc(sql);
|
|
|
str.Format(_T("%s\n"), p);
|
|
|
writeErrorLog(_T("SQL_S"), str);
|
|
@@ -7413,7 +7435,7 @@ void CYAServerDlg::parse_data_locate_card_his_tof_card( BYTE* DataBuffer, int nL
|
|
|
if(p){
|
|
|
free(p);
|
|
|
p = NULL;
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -7518,7 +7540,7 @@ void CYAServerDlg::parse_data_locate_card_his_tdoa_card( BYTE* DataBuffer, int n
|
|
|
}
|
|
|
catch (...)
|
|
|
{
|
|
|
- CString str;
|
|
|
+ /*CString str;
|
|
|
wchar_t* p = CFunctions::c2wc(sql);
|
|
|
str.Format(_T("%s\n"), p);
|
|
|
writeErrorLog(_T("SQL_S"), str);
|
|
@@ -7527,7 +7549,7 @@ void CYAServerDlg::parse_data_locate_card_his_tdoa_card( BYTE* DataBuffer, int n
|
|
|
if(p){
|
|
|
free(p);
|
|
|
p = NULL;
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -7595,16 +7617,16 @@ void CYAServerDlg::parse_data_locate_card_his_sync_time( BYTE* DataBuffer, int n
|
|
|
}
|
|
|
catch (...)
|
|
|
{
|
|
|
- CString str;
|
|
|
+ /*CString str;
|
|
|
wchar_t* p = CFunctions::c2wc(sql);
|
|
|
str.Format(_T("%s\n"), p);
|
|
|
writeErrorLog(_T("SQL_S"), str);
|
|
|
str.Empty();
|
|
|
|
|
|
if(p){
|
|
|
- free(p);
|
|
|
- p = NULL;
|
|
|
- }
|
|
|
+ free(p);
|
|
|
+ p = NULL;
|
|
|
+ }*/
|
|
|
}
|
|
|
}
|
|
|
|