|
|
@@ -5,6 +5,7 @@ import (
|
|
|
"errors"
|
|
|
"lims_adapter/dao"
|
|
|
"log"
|
|
|
+ "strings"
|
|
|
|
|
|
"dashoo.cn/common_definition/admin/result_def"
|
|
|
"dashoo.cn/common_definition/comm_def"
|
|
|
@@ -126,3 +127,16 @@ func (s Service) DeleteResult(req comm_def.IdOnlyReq) error {
|
|
|
return nil
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+// 获取成果基本信息
|
|
|
+func (s Service) GetResultConsequent(req comm_def.IdOnlyReq) (result_def.ResultList, error) {
|
|
|
+ var result result_def.ResultList
|
|
|
+ query := s.ConsequentDao.M
|
|
|
+ query.Where("Id = ?", req.Id).Scan(&result)
|
|
|
+ mediaIds := strings.Split(result.MediaIds, ",")
|
|
|
+ fields := "Id, FileName as Name, Url"
|
|
|
+ if len(mediaIds) > 0 {
|
|
|
+ s.ConsequentDao.DB.Model("media").Where("Id IN (?)", mediaIds).Fields(fields).Scan(&result.Files)
|
|
|
+ }
|
|
|
+ return result, nil
|
|
|
+}
|