1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- //
- // Created by Administrator on 2019/3/5.
- // 禁止制定人员下井
- //
- #ifndef WORKSPACE_FORBID_STAFF_DOWN_MINE_H
- #define WORKSPACE_FORBID_STAFF_DOWN_MINE_H
- #include "write-copy.h"
- #include <string>
- #include <map>
- #include <list>
- #include "db_api/CDBResultSet.h"
- struct SForbidStaffInfo
- {
- int staff_id;
- int db_id;
- time_t start_time;
- time_t end_time;
- int state; //状态 0 = 无效 1 = 有效
- SForbidStaffInfo()
- {
- db_id = 0;
- staff_id = 0;
- start_time = 0;
- end_time = 0;
- state = 0;
- }
- };
- struct SForbidStaffList
- {
- int staff_id ;
- std::list<SForbidStaffInfo> forbidList;
- };
- struct forbid_staff_down_mine
- :single_base<forbid_staff_down_mine,int,std::shared_ptr<SForbidStaffList>>
- {
- public:
- // 根据数据库中的自增长id
- void init_forbid_staff(int id = -1);
- // 根据数据库中的自增长id
- void del_forbid_data(int id,int staff_id);
- // 根据员工ID
- void del_forbid_staff(int staff_id);
- //是否禁止状态
- bool IsForbid(int staff_id,time_t cur_time);
- //重新加载数据更新时间> m_updateTime
- void on_load_data();
- private:
- //更新数据
- void update_forbid_data(YADB::CDBResultSet & DBRes);
- void updatetime(const std::string & t);
- //数据中最新时间
- std::string m_updateTime = "";
- };
- #endif //WORKSPACE_FORBID_STAFF_DOWN_MINE_H
|