|
@@ -330,6 +330,43 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+func HandleIndustryListHzAndYx(list []*models.IndustrialManagement, user *models.WxUserItem, resource string) (items []*models.IndustrialManagement, err error) {
|
|
|
+ var listHz []*models.IndustrialManagement
|
|
|
+ var lisYx []*models.IndustrialManagement
|
|
|
+ for _, v := range list {
|
|
|
+ if v.ChartPermissionId == utils.CHART_PERMISSION_ID_YANXUAN {
|
|
|
+ lisYx = append(lisYx, v)
|
|
|
+ } else {
|
|
|
+ listHz = append(listHz, v)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ listHz, err = HandleIndustryList(listHz, user, "Hz")
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ lisYx, err = HandleIndustryList(lisYx, user, "Yx")
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ maplistHz := make(map[int]*models.IndustrialManagement)
|
|
|
+ maplistYx := make(map[int]*models.IndustrialManagement)
|
|
|
+ for _, v := range listHz {
|
|
|
+ maplistHz[v.IndustrialManagementId] = v
|
|
|
+ }
|
|
|
+ for _, v := range lisYx {
|
|
|
+ maplistYx[v.IndustrialManagementId] = v
|
|
|
+ }
|
|
|
+ for _, v := range list {
|
|
|
+ if maplistHz[v.IndustrialManagementId] != nil {
|
|
|
+ items = append(items, maplistHz[v.IndustrialManagementId])
|
|
|
+ }
|
|
|
+ if maplistYx[v.IndustrialManagementId] != nil {
|
|
|
+ items = append(items, maplistYx[v.IndustrialManagementId])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
// 通过文章ID获取文章所关联的产业
|
|
|
func GetArticleIndustrialByArticleId(articleIds []int) (itemMap map[int][]*models.IndustrialManagementResp, err error) {
|
|
|
lenarticleIds := len(articleIds)
|