|
@@ -7,8 +7,6 @@
|
|
|
#include "tool_time.h"
|
|
|
#include "db_api/CDBSingletonDefine.h"
|
|
|
|
|
|
-std::string forbid_staff_down_mine::m_updateTime = "";
|
|
|
-
|
|
|
void forbid_staff_down_mine::init_forbid_staff(int id /* = -1*/)
|
|
|
{
|
|
|
std::string sql = "select id,staff_id,start_time,end_time,status,oper_time,lastupdate from rt_person_forbid_down_mine ";
|
|
@@ -54,9 +52,6 @@ void forbid_staff_down_mine::update_forbid_data(YADB::CDBResultSet & DBRes,bool
|
|
|
DBRes.GetField("oper_time", create_time, Error);
|
|
|
std::string update_time;
|
|
|
DBRes.GetField("lastupdate", update_time, Error);
|
|
|
- forbid_staff_down_mine::updatetime(create_time);
|
|
|
- forbid_staff_down_mine::updatetime(update_time);
|
|
|
-
|
|
|
std::shared_ptr<SForbidStaffList> s = forbid_staff_down_mine::instance()->get(staff_id);
|
|
|
if (s != nullptr)
|
|
|
{
|
|
@@ -95,23 +90,6 @@ void forbid_staff_down_mine::update_forbid_data(YADB::CDBResultSet & DBRes,bool
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//重新加载数据更新时间> m_updateTime
|
|
|
-void forbid_staff_down_mine::on_load_data()
|
|
|
-{
|
|
|
- std::string sql = "select id,staff_id,start_time,end_time,status,oper_time,lastupdate from rt_person_forbid_down_mine";
|
|
|
- sql += " where status = 1 and (oper_time > '" + m_updateTime + "' or lastupdate > '" + m_updateTime + "') ;";
|
|
|
- std::string Error;
|
|
|
- YADB::CDBResultSet DBRes;
|
|
|
- sDBConnPool.Query(sql.c_str(),DBRes,Error);
|
|
|
- int nCount = DBRes.GetRecordCount( Error );
|
|
|
- if (nCount < 1)
|
|
|
- {
|
|
|
- return ;
|
|
|
- }
|
|
|
-
|
|
|
- forbid_staff_down_mine::instance()->update_forbid_data(DBRes,false);
|
|
|
-}
|
|
|
-
|
|
|
void forbid_staff_down_mine::del_forbid_staff(int staff_id)
|
|
|
{
|
|
|
forbid_staff_down_mine::instance()->remove(staff_id);
|
|
@@ -156,12 +134,3 @@ bool forbid_staff_down_mine::IsForbid(int staff_id,time_t cur_time)
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
-void forbid_staff_down_mine::updatetime(const std::string & t)
|
|
|
-{
|
|
|
- if (t.length() > 0 && t > m_updateTime)
|
|
|
- {
|
|
|
- log_info("forbid_staff_down_mine::updatetime :LastTime: %s -> t:%s ",t.c_str(),m_updateTime.c_str());
|
|
|
- m_updateTime = t;
|
|
|
- }
|
|
|
-}
|