forbid_staff_down_mine.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // Created by Administrator on 2019/3/5.
  3. // 禁止制定人员下井
  4. //
  5. #ifndef WORKSPACE_FORBID_STAFF_DOWN_MINE_H
  6. #define WORKSPACE_FORBID_STAFF_DOWN_MINE_H
  7. #include "write-copy.h"
  8. #include <string>
  9. #include <map>
  10. #include <list>
  11. struct SForbidStaffInfo
  12. {
  13. int staff_id;
  14. time_t start_time;
  15. time_t end_time;
  16. int state; //状态 0 = 无效 1 = 有效
  17. SForbidStaffInfo()
  18. {
  19. staff_id = 0;
  20. start_time = 0;
  21. end_time = 0;
  22. state = 0;
  23. }
  24. };
  25. struct forbid_staff_down_mine
  26. :single_base<forbid_staff_down_mine,int,std::shared_ptr<SForbidStaffInfo>>
  27. {
  28. public:
  29. // 根据数据库中的自增长id
  30. void init_forbid_staff(int id = -1);
  31. // 根据数据库中的自增长id
  32. void del_forbid_data(int id);
  33. // 根据员工ID
  34. void del_forbid_staff(int staff_id);
  35. //是否禁止状态
  36. bool IsForbid(int staff_id,time_t cur_time);
  37. private:
  38. typedef std::map <int ,std::list<int>> ForbidStaffList;
  39. ForbidStaffList m_forbidlist;
  40. };
  41. #endif //WORKSPACE_FORBID_STAFF_DOWN_MINE_H