|
@@ -112,3 +112,72 @@ func AddCygxMorningMeetingReviewChapterHistory(user *models.WxUserItem, articleI
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// 通过晨会精华子ID,获取出参列表详情
|
|
|
+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(), "meetingreviewchaptIds:", meetingreviewchaptIds), 2)
|
|
|
+ }
|
|
|
+ }()
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+
|
|
|
+ pars = make([]interface{}, 0)
|
|
|
+ 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
|
|
|
+ for _, v := range listrMeet {
|
|
|
+ if v.IndustrialSubjectIds != "" {
|
|
|
+ slice := strings.Split(v.IndustrialSubjectIds, ",")
|
|
|
+ for _, vS := range slice {
|
|
|
+ subjectIds = append(subjectIds, vS)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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
|
|
|
+ }
|
|
|
+
|
|
|
+ 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
|
|
|
+}
|