|
@@ -114,14 +114,14 @@ func AddCygxMorningMeetingReviewChapterHistory(user *models.WxUserItem, articleI
|
|
|
}
|
|
|
|
|
|
// 通过晨会精华子ID,获取出参列表详情
|
|
|
-func GetCygxMorningMeetingReviewChapterListByIds(meetingreviewchaptIds []int) (err error) {
|
|
|
+func GetCygxMorningMeetingReviewChapterListByIds(meetingreviewchaptIds []int) (items []*models.CygxMorningMeetingGatherDetailListResp, err error) {
|
|
|
lenArr := len(meetingreviewchaptIds)
|
|
|
if lenArr == 0 {
|
|
|
return
|
|
|
}
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
- go utils.SendAlarmMsg(fmt.Sprint("通过晨会精华子ID,获取出参列表详情失败 ,GetCygxMorningMeetingReviewChapterListByIds err"+err.Error(), "通过晨会精华子ID,获取出参列表详情:", "meetingreviewchaptIds:", meetingreviewchaptIds), 2)
|
|
|
+ go utils.SendAlarmMsg(fmt.Sprint("通过晨会精华子ID,获取出参列表详情失败 ,GetCygxMorningMeetingReviewChapterListByIds err"+err.Error(), "meetingreviewchaptIds:", meetingreviewchaptIds), 2)
|
|
|
}
|
|
|
}()
|
|
|
var condition string
|
|
@@ -131,42 +131,53 @@ func GetCygxMorningMeetingReviewChapterListByIds(meetingreviewchaptIds []int) (e
|
|
|
condition = ` AND c.id IN (` + utils.GetOrmInReplace(lenArr) + `)`
|
|
|
pars = append(pars, meetingreviewchaptIds)
|
|
|
|
|
|
+ //查询晨会
|
|
|
listrMeet, e := models.GetCygxMorningMeetingReviewChapterList(condition, pars)
|
|
|
if e != nil {
|
|
|
err = errors.New("GetCygxMorningMeetingReviewChapterList, Err: " + e.Error())
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ //获取晨会相关的标的
|
|
|
var subjectIds []string
|
|
|
- var subjectIdsMap = make(map[int][]string) // 晨会ID与标的ID字符串的map映射
|
|
|
for _, v := range listrMeet {
|
|
|
if v.IndustrialSubjectIds != "" {
|
|
|
slice := strings.Split(v.IndustrialSubjectIds, ",")
|
|
|
- subjectIdsMap[v.Id] = slice
|
|
|
- for _, v := range slice {
|
|
|
- subjectIds = append(subjectIds, v)
|
|
|
+ for _, vS := range slice {
|
|
|
+ subjectIds = append(subjectIds, vS)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //lensubjectIds := len(subjectIds)
|
|
|
+ lensubjectIds := len(subjectIds)
|
|
|
+ if lensubjectIds > 0 {
|
|
|
+ //获取标的信息
|
|
|
+ pars = make([]interface{}, 0)
|
|
|
+ condition = ` AND industrial_subject_id IN (` + utils.GetOrmInReplace(lensubjectIds) + `)`
|
|
|
+ pars = append(pars, subjectIds)
|
|
|
+ listsubject, e := models.GetCygxIndustrialSubjectListCondition(condition, pars)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetCygxIndustrialSubjectListCondition, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
- //if lensubjectIds > 0 {
|
|
|
- // pars = make([]interface{}, 0)
|
|
|
- // condition = ` AND industrial_subject_id IN (` + utils.GetOrmInReplace(lensubjectIds) + `)`
|
|
|
- //
|
|
|
- // listsubject, e := models.GetCygxIndustrialSubjectListCondition(condition, pars)
|
|
|
- // if e != nil {
|
|
|
- // err = errors.New("GetCygxIndustrialSubjectListCondition, Err: " + e.Error())
|
|
|
- // return
|
|
|
- // }
|
|
|
- //
|
|
|
- // var meetSubjectItems = make(map[int][]*models.CygxIndustrialSubject)
|
|
|
- //
|
|
|
- // for _,v:= range listsubject{
|
|
|
- // if utils.InArrayByStr()
|
|
|
- // }
|
|
|
- //}
|
|
|
+ var meetSubjectItems = make(map[string]*models.CygxIndustrialSubject)
|
|
|
+ for _, v := range listsubject {
|
|
|
+ meetSubjectItems[strconv.Itoa(v.IndustrialSubjectId)] = v
|
|
|
+ }
|
|
|
|
|
|
+ //建立标的与晨会的映射关系
|
|
|
+ for _, v := range listrMeet {
|
|
|
+ if v.IndustrialSubjectIds != "" {
|
|
|
+ slice := strings.Split(v.IndustrialSubjectIds, ",")
|
|
|
+ for _, vS := range slice {
|
|
|
+ if meetSubjectItems[vS] != nil {
|
|
|
+ v.ListSubject = append(v.ListSubject, meetSubjectItems[vS])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ items = listrMeet
|
|
|
return
|
|
|
}
|