checkperiodfunc.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef __CHECKPERIODWIDGET_H__
  2. #define __CHECKPERIODWIDGET_H__
  3. #include "GlobalVariable.h"
  4. #include <QList>
  5. /**
  6. * 这里是一些非成员函数
  7. *
  8. */
  9. /* 检查时间是否相等,前后冲突 */
  10. // bool checkStartEndTime(const OnePlan_t& plan);
  11. /**
  12. * @brief 周查重函数
  13. *
  14. * @param planList 需要查重的列表
  15. * @param plan 目标计划
  16. * @param isExcludeSelf 是否排除自身
  17. * @return true
  18. * @return false
  19. */
  20. bool isWeekPlanDuplicate(const QList<OnePlan_t>& planList, const OnePlan_t& plan);
  21. /* 查重函数重载,排除一个计划 */
  22. bool isWeekPlanDuplicate(const QList<OnePlan_t>& planList, const OnePlan_t& plan, const OnePlan_t& excludePlan);
  23. /**
  24. * @brief 日期查重函数
  25. *
  26. * @param planList
  27. * @param plan
  28. * @param isExcludeSelf
  29. * @return true
  30. * @return false
  31. */
  32. bool isDatePlanDuplicate(const QList<OnePlan_t>& planList, const OnePlan_t& plan);
  33. /* 日期查重,重载版,排除一个日期计划 */
  34. bool isDatePlanDuplicate(const QList<OnePlan_t>& planList, const OnePlan_t& plan, const OnePlan_t& excludePlan);
  35. /* 周时间1大于周时间2 */
  36. bool weekTimeIsGerater(const eWeekType& week1, const QTime& time1,
  37. const eWeekType& week2, const QTime& time2);
  38. /* 日期1大于日期2 */
  39. bool dateTimeIsGerater(const QDate& date1, const QTime& time1,
  40. const QDate& date2, const QTime& time2);
  41. #endif // __CHECKPERIODWIDGET_H__