ProjectManager.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. static QString nameOfIndexType(IndexType t);
  19. /// 评估方案类型
  20. /// @attention 枚举值与本地数据库关联,可以新增,但如无必要禁止修改,除非你知道自己在干什么
  21. enum EvalType
  22. {
  23. None,
  24. DemandEval = AbilityIndex | TechIndex, // 需求分析评估
  25. OptimalEval = OptimalIndex, // 方案优选评估
  26. EfficiencyEval = EfficiencyIndex, // 综合效能评估
  27. };
  28. Q_ENUM(EvalType);
  29. Q_DECLARE_FLAGS(EvalTypes, EvalType)
  30. static QString nameOfEvalType(EvalType t);
  31. static QList<IndexType> indexListOfEvalTypes(EvalTypes flags);
  32. static EvalTypes evalTypes(ProjectInfo proj);
  33. static QList<EvalType> evalTypeList(EvalTypes types);
  34. static QList<EvalType> evalTypeList(ProjectInfo proj);
  35. static QList<IndexType> indexList(ProjectInfo proj);
  36. ///
  37. /// \brief queryProjects 查询全部项目
  38. /// \param projList 项目列表
  39. /// \return 错误码
  40. static int queryProjects(QList<ProjectInfo *> *projList);
  41. static int queryProjects(QList<ProjectInfo *> *list, int &total, int page, int pageSize, QString name);
  42. static int verifyProjectInfo(ProjectInfo proj);
  43. static int insertProject(ProjectInfo &proj);
  44. static int updateProject(ProjectInfo &proj);
  45. static int deleteProject(int id);
  46. };
  47. #endif // PROJECTMANAGER_H