ProjectManager.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef PROJECTMANAGER_H
  2. #define PROJECTMANAGER_H
  3. #include <QObject>
  4. class ProjectInfo;
  5. class ProjectManager : QObject
  6. {
  7. Q_OBJECT
  8. public:
  9. /// 指标体系类型
  10. /// @attention 枚举值与本地数据库关联,可以新增,但如无必要禁止修改,除非你知道自己在干什么
  11. enum IndexType
  12. {
  13. AbilityIndex = 0b1, // 能力重要度评估指标体系
  14. TechIndex = 0b1 << 1, // 技术措施重要度评估对象
  15. OptimalIndex = 0b1 << 2, // 方案评估指标体系
  16. EfficiencyIndex = 0b1 << 3, // 综合效能评估指标体系?
  17. };
  18. Q_ENUM(IndexType)
  19. static QString nameOfIndexType(IndexType t);
  20. /// 评估方案类型
  21. /// @attention 枚举值与本地数据库关联,可以新增,但如无必要禁止修改,除非你知道自己在干什么
  22. enum EvalType
  23. {
  24. None,
  25. DemandEval = AbilityIndex | TechIndex, // 需求分析评估
  26. OptimalEval = OptimalIndex, // 方案优选评估
  27. EfficiencyEval = EfficiencyIndex, // 综合效能评估
  28. };
  29. Q_ENUM(EvalType)
  30. Q_DECLARE_FLAGS(EvalTypes, EvalType)
  31. static QString nameOfEvalType(EvalType t);
  32. static QList<IndexType> indexListOfEvalTypes(EvalTypes flags);
  33. static EvalTypes evalTypes(ProjectInfo proj);
  34. static QList<EvalType> evalTypeList(EvalTypes types);
  35. static QList<EvalType> evalTypeList(ProjectInfo proj);
  36. static QList<IndexType> indexList(ProjectInfo proj);
  37. ///
  38. /// \brief queryProjects 查询全部项目
  39. /// \param projList 项目列表
  40. /// \return 错误码
  41. static int queryProjects(QList<ProjectInfo *> *projList);
  42. static int queryProjects(QList<ProjectInfo *> *list, int &total, int page, int pageSize, QString name);
  43. static int verifyProjectInfo(ProjectInfo proj);
  44. static int insertProject(ProjectInfo &proj);
  45. static int updateProject(ProjectInfo &proj);
  46. static int deleteProject(int id);
  47. };
  48. #endif // PROJECTMANAGER_H