|
@@ -213,7 +213,7 @@ func (this *UserController) ChooseSubmit() {
|
|
|
}
|
|
|
var itemsFllow []*models.CygxIndustryFllow
|
|
|
var itemsCategory []*models.CygxXzsChooseCategory
|
|
|
-
|
|
|
+ industrialFllowNum := make(map[int]int) // 提交过来的不同行业的下对应的产业数量
|
|
|
//如果为1 则不做任何推送 ,主观客观默认改成0
|
|
|
if isRefuse == 1 {
|
|
|
isSubjective = 0
|
|
@@ -229,6 +229,7 @@ func (this *UserController) ChooseSubmit() {
|
|
|
} else {
|
|
|
categoryIds += v.IndustrialManagementIds + ","
|
|
|
}
|
|
|
+ industrialFllowNum[v.ChartPermissionId] = strings.Count(v.IndustrialManagementIds, ",") + 1
|
|
|
}
|
|
|
|
|
|
industrialManagementIds = strings.TrimRight(industrialManagementIds, ",")
|
|
@@ -273,6 +274,25 @@ func (this *UserController) ChooseSubmit() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //医药、消费、科技、智造、研选下的产业赛道
|
|
|
+ mapIndustrial := make(map[int][]*models.IndustrialManagementRep)
|
|
|
+ industrialList, err := models.GetindustrialManagement()
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取产业信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, v := range industrialList {
|
|
|
+ mapIndustrial[v.ChartPermissionId] = append(mapIndustrial[v.ChartPermissionId], v)
|
|
|
+ }
|
|
|
+ //策略下的产业赛道
|
|
|
+ celueList, err := models.GetReportMappingStrategyAll()
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取产业信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
mobile := user.Mobile
|
|
|
item := new(models.CygxXzsChooseSend)
|
|
|
item.UserId = user.UserId
|
|
@@ -286,6 +306,25 @@ func (this *UserController) ChooseSubmit() {
|
|
|
item.IsRefuse = req.IsRefuse
|
|
|
item.IsSubjective = isSubjective
|
|
|
item.IsObjective = isObjective
|
|
|
+
|
|
|
+ if industrialFllowNum[utils.YI_YAO_ID] == len(mapIndustrial[utils.YI_YAO_ID]) {
|
|
|
+ item.AllInYiYao = 1 //如果医药全选则设为1
|
|
|
+ }
|
|
|
+ if industrialFllowNum[utils.XIAO_FEI_ID] == len(mapIndustrial[utils.XIAO_FEI_ID]) {
|
|
|
+ item.AllInXiaoFei = 1 //如果消费全选则设为1
|
|
|
+ }
|
|
|
+ if industrialFllowNum[utils.KE_JI_ID] == len(mapIndustrial[utils.KE_JI_ID]) {
|
|
|
+ item.AllInKeJi = 1 //如果科技全选则设为1
|
|
|
+ }
|
|
|
+ if industrialFllowNum[utils.ZHI_ZAO_ID] == len(mapIndustrial[utils.ZHI_ZAO_ID]) {
|
|
|
+ item.AllInZhiZao = 1 //如果智造全选则设为1
|
|
|
+ }
|
|
|
+ if industrialFllowNum[utils.CHART_PERMISSION_ID_YANXUAN] == len(mapIndustrial[utils.CHART_PERMISSION_ID_YANXUAN]) {
|
|
|
+ item.AllInYanXuan = 1 //如果研选全选则设为1
|
|
|
+ }
|
|
|
+ if industrialFllowNum[utils.CE_LUE_ID] == len(celueList) {
|
|
|
+ item.AllInCeLue = 1 //如果策略全选则设为1
|
|
|
+ }
|
|
|
count, err := models.GetXzsChooseSendCountByMobile(mobile)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|