MindWeightService.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef MINDWEIGHTSERVICE_H
  2. #define MINDWEIGHTSERVICE_H
  3. #include <QObject>
  4. class MindWeightInfo;
  5. class MindWeightService : public QObject
  6. {
  7. Q_OBJECT
  8. public:
  9. explicit MindWeightService(QObject *parent = nullptr);
  10. /// 保存权重数据
  11. /// 保存前先查询数据是否已存在, 是则更新数据
  12. /// 数据的唯一性由项目id,指标体系类型,数据来源,算法共同确定
  13. bool saveUniqueWeightData(int projId, int indexType, int dataSource, int algorithm, const QString &weight);
  14. ///
  15. /// \brief queryWeightData 查询权重数据
  16. /// \param info 存储权重数据
  17. /// \param projId 项目 id
  18. /// \param indexType 指标体系类型
  19. /// \param dataSource 数据来源
  20. /// \param algorithm 算法
  21. /// \return 成功 or 失败
  22. bool queryWeightData(MindWeightInfo *info, int projId, int indexType, int dataSource, int algorithm);
  23. ///
  24. /// \brief updateWeightData 更新权重数据
  25. /// \param id 主键
  26. /// \param weight 权重
  27. /// \return 成功 or 失败
  28. bool updateWeightData(int id, const QString &weight);
  29. private:
  30. /// 保存权重数据
  31. bool saveWeightData(MindWeightInfo *info);
  32. signals:
  33. };
  34. #endif // MINDWEIGHTSERVICE_H