Browse Source

去除多余的功能,禁止人员下井

chensongchao 6 years ago
parent
commit
ed9d332550
2 changed files with 0 additions and 36 deletions
  1. 0 31
      forbid_staff_down_mine.cpp
  2. 0 5
      forbid_staff_down_mine.h

+ 0 - 31
forbid_staff_down_mine.cpp

@@ -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;
-    }
-}

+ 0 - 5
forbid_staff_down_mine.h

@@ -50,15 +50,10 @@ public:
 
     //是否禁止状态
     bool IsForbid(int staff_id,time_t cur_time);
-    //重新加载数据更新时间> m_updateTime
-    void on_load_data();
 
 public:
     //更新数据
     void update_forbid_data(YADB::CDBResultSet & DBRes,bool bInsert);
-    static void updatetime(const std::string & t);
-    //数据中最新时间
-    static std::string m_updateTime;
 };