|
@@ -158,6 +158,8 @@ func (this *ActivityCoAntroller) ActivityList() {
|
|
|
}
|
|
|
}
|
|
|
permissionSqlStr = strings.TrimRight(permissionSqlStr, ",")
|
|
|
+ permissionSqlStr = strings.Replace(permissionSqlStr, "(主观)", "", -1)
|
|
|
+ permissionSqlStr = strings.Replace(permissionSqlStr, "(客观)", "", -1)
|
|
|
permissionSqlStr = ` AND art.chart_permission_name IN (` + permissionSqlStr + `)`
|
|
|
sqlExport = ` AND (art.customer_type_ids LIKE '%` + strconv.Itoa(userType) + `%' `
|
|
|
if userType == 2 {
|
|
@@ -574,6 +576,14 @@ func (this *ActivityCoAntroller) Detail() {
|
|
|
br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ //获取FICC销售信息 如果是FICC的客户类型,则默认他申请过
|
|
|
+ sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 1)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
if user.CompanyId <= 1 {
|
|
|
companyDetailStatus = ""
|
|
|
} else {
|
|
@@ -587,11 +597,28 @@ func (this *ActivityCoAntroller) Detail() {
|
|
|
if applyCount > 0 {
|
|
|
hasPermission = 4
|
|
|
} else {
|
|
|
- hasPermission = 3
|
|
|
+ if sellerItem != nil {
|
|
|
+ hasPermission = 5
|
|
|
+ } else {
|
|
|
+ //获取权益销售信息 如果是FICC的客户类型,则默认他申请过
|
|
|
+ sellerItemQy, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if sellerItemQy != nil {
|
|
|
+ hasPermission = 2
|
|
|
+ resp.SellerMobile = sellerItemQy.Mobile
|
|
|
+ resp.SellerName = sellerItemQy.RealName
|
|
|
+ } else {
|
|
|
+ hasPermission = 3
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
resp.HasPermission = hasPermission
|
|
|
resp.OperationMode = "Apply"
|
|
|
- resp.PopupMsg = "您暂无权限参加 【" + activityInfo.ChartPermissionName + "】行业活动,若想参加可以申请开通哦"
|
|
|
+ resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|
|
@@ -657,7 +684,8 @@ func (this *ActivityCoAntroller) Detail() {
|
|
|
//判断是否已经申请过
|
|
|
|
|
|
if user.CompanyId > 1 {
|
|
|
- permissionStr, err := models.GetCompanyPermission(user.CompanyId)
|
|
|
+ permissionStr, err := models.GetCompanyPermissionByUser(user.CompanyId)
|
|
|
+ fmt.Println(permissionStr)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "获取客户权限信息失败,Err:" + err.Error()
|
|
@@ -667,9 +695,31 @@ func (this *ActivityCoAntroller) Detail() {
|
|
|
//冻结客户
|
|
|
if err != nil {
|
|
|
if err.Error() == utils.ErrNoRow() {
|
|
|
- resp.HasPermission = 4
|
|
|
+ if applyCount > 0 {
|
|
|
+ hasPermission = 4
|
|
|
+ } else {
|
|
|
+ if sellerItem != nil {
|
|
|
+ hasPermission = 5
|
|
|
+ } else {
|
|
|
+ //获取权益销售信息 如果是FICC的客户类型,则默认他申请过
|
|
|
+ sellerItemQy, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if sellerItemQy != nil {
|
|
|
+ hasPermission = 2
|
|
|
+ resp.SellerMobile = sellerItemQy.Mobile
|
|
|
+ resp.SellerName = sellerItemQy.RealName
|
|
|
+ } else {
|
|
|
+ hasPermission = 3
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resp.HasPermission = hasPermission
|
|
|
resp.OperationMode = "Apply"
|
|
|
- resp.PopupMsg = "您暂无权限参加 【" + activityInfo.ChartPermissionName + "】行业活动"
|
|
|
+ resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|
|
@@ -687,25 +737,41 @@ func (this *ActivityCoAntroller) Detail() {
|
|
|
resp.HaqveJurisdiction = true
|
|
|
} else {
|
|
|
if permissionStr == "专家" {
|
|
|
- resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动"
|
|
|
+ resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
resp.MsgType = "Type"
|
|
|
} else {
|
|
|
- resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动"
|
|
|
+ //if strings.Contains("医药,消费,科技,智造", activityInfo.ChartPermissionName) {
|
|
|
+ // if activityInfo.ActivityTypeId == 1 || activityInfo.ActivityTypeId == 3 || activityInfo.ActivityTypeId == 5 || activityInfo.ActivityTypeId == 6 {
|
|
|
+ // activityInfo.ChartPermissionName += "(主观)"
|
|
|
+ // } else {
|
|
|
+ // activityInfo.ChartPermissionName += "(客观)"
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
resp.MsgType = "Industry"
|
|
|
}
|
|
|
- resp.SellerMobile = companyItem.Mobile
|
|
|
- resp.SellerName = companyItem.SellerName
|
|
|
- resp.OperationMode = "Call"
|
|
|
- hasPermission = 2
|
|
|
+ if companyItem.ProductId == 2 {
|
|
|
+ resp.SellerMobile = companyItem.Mobile
|
|
|
+ resp.SellerName = companyItem.SellerName
|
|
|
+ resp.OperationMode = "Call"
|
|
|
+ hasPermission = 2
|
|
|
+ } else {
|
|
|
+ hasPermission = 5
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
} else { //潜在客户
|
|
|
if applyCount > 0 {
|
|
|
hasPermission = 4
|
|
|
} else {
|
|
|
- hasPermission = 3
|
|
|
+ if sellerItem != nil {
|
|
|
+ hasPermission = 5
|
|
|
+ } else {
|
|
|
+ hasPermission = 3
|
|
|
+ }
|
|
|
}
|
|
|
resp.OperationMode = "Apply"
|
|
|
- resp.PopupMsg = "您暂无权限参加 【" + activityInfo.ChartPermissionName + "】行业活动,若想参加可以申请开通哦"
|
|
|
+ resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
}
|
|
|
if hasPermission == 1 {
|
|
|
//是否展示限免标签
|
|
@@ -777,6 +843,15 @@ func (this *ActivityCoAntroller) SignupAdd() {
|
|
|
br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ //获取FICC销售信息
|
|
|
+ sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 1)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "申请失败"
|
|
|
+ br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
activityInfo, errInfo := models.GetAddActivityInfoById(activityId)
|
|
|
if activityInfo == nil {
|
|
|
br.Msg = "操作失败"
|
|
@@ -804,11 +879,29 @@ func (this *ActivityCoAntroller) SignupAdd() {
|
|
|
if applyCount > 0 {
|
|
|
hasPermission = 4
|
|
|
} else {
|
|
|
- hasPermission = 3
|
|
|
+ if sellerItem != nil {
|
|
|
+ hasPermission = 5
|
|
|
+ } else {
|
|
|
+ //获取权益销售信息 如果是FICC的客户类型,则默认他申请过
|
|
|
+ sellerItemQy, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if sellerItemQy != nil {
|
|
|
+ hasPermission = 2
|
|
|
+ resp.SellerMobile = sellerItemQy.Mobile
|
|
|
+ resp.SellerName = sellerItemQy.RealName
|
|
|
+ } else {
|
|
|
+ hasPermission = 3
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
resp.HasPermission = hasPermission
|
|
|
+ resp.ActivityId = activityId
|
|
|
resp.OperationMode = "Apply"
|
|
|
- resp.PopupMsg = "您暂无权限参加 【" + activityInfo.ChartPermissionName + "】行业活动,若想参加可以申请开通哦"
|
|
|
+ resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|
|
@@ -848,9 +941,19 @@ func (this *ActivityCoAntroller) SignupAdd() {
|
|
|
//冻结客户
|
|
|
if err != nil {
|
|
|
if err.Error() == utils.ErrNoRow() {
|
|
|
- resp.HasPermission = 4
|
|
|
+ if applyCount > 0 {
|
|
|
+ hasPermission = 4
|
|
|
+ } else {
|
|
|
+ if sellerItem != nil {
|
|
|
+ hasPermission = 5
|
|
|
+ } else {
|
|
|
+ hasPermission = 3
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resp.ActivityId = activityId
|
|
|
+ resp.HasPermission = hasPermission
|
|
|
resp.OperationMode = "Apply"
|
|
|
- resp.PopupMsg = "您暂无权限参加 【" + activityInfo.ChartPermissionName + "】行业活动,若想参加可以申请开通哦"
|
|
|
+ resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|
|
@@ -1064,27 +1167,35 @@ func (this *ActivityCoAntroller) SignupAdd() {
|
|
|
resp.HaqveJurisdiction = true
|
|
|
}
|
|
|
} else {
|
|
|
- hasPermission = 2
|
|
|
- resp.SellerMobile = companyItem.Mobile
|
|
|
- resp.SellerName = companyItem.SellerName
|
|
|
- resp.MsgType = "Type"
|
|
|
- resp.OperationMode = "Call"
|
|
|
- if permissionStr == "专家" {
|
|
|
- resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
+ if companyItem.ProductId == 2 {
|
|
|
+ hasPermission = 2
|
|
|
+ resp.SellerMobile = companyItem.Mobile
|
|
|
+ resp.SellerName = companyItem.SellerName
|
|
|
resp.MsgType = "Type"
|
|
|
+ resp.OperationMode = "Call"
|
|
|
+ if permissionStr == "专家" {
|
|
|
+ resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
+ resp.MsgType = "Type"
|
|
|
+ } else {
|
|
|
+ resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
+ resp.MsgType = "Industry"
|
|
|
+ }
|
|
|
} else {
|
|
|
- resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
- resp.MsgType = "Industry"
|
|
|
+ hasPermission = 5
|
|
|
}
|
|
|
}
|
|
|
} else { //潜在客户
|
|
|
if applyCount > 0 {
|
|
|
hasPermission = 4
|
|
|
} else {
|
|
|
- hasPermission = 3
|
|
|
+ if sellerItem != nil {
|
|
|
+ hasPermission = 5
|
|
|
+ } else {
|
|
|
+ hasPermission = 3
|
|
|
+ }
|
|
|
}
|
|
|
resp.OperationMode = "Apply"
|
|
|
- resp.PopupMsg = "您暂无权限参加 【" + activityInfo.ChartPermissionName + "】行业活动,若想参加可以申请开通哦"
|
|
|
+ resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
}
|
|
|
if signupType == 1 && user.IsMsgOutboundMobile == 0 {
|
|
|
resp.GoOutboundMobile = true
|
|
@@ -1120,9 +1231,9 @@ func (this *ActivityCoAntroller) SignupAdd() {
|
|
|
resp.SignupType = signupType
|
|
|
resp.SignupStatus = signupStatus
|
|
|
resp.HasPermission = hasPermission
|
|
|
- if signupStatus == "Success" {
|
|
|
- resp.ActivityId = activityId
|
|
|
- }
|
|
|
+ //if signupStatus == "Success" {
|
|
|
+ resp.ActivityId = activityId
|
|
|
+ //}
|
|
|
total, err = models.GetUserSignupCount(user.UserId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
@@ -1387,6 +1498,15 @@ func (this *ActivityCoAntroller) MeetingReminderAdd() {
|
|
|
br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ //获取销售信息
|
|
|
+ sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 1)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "申请失败"
|
|
|
+ br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
//SignupStatus string `description:"报名状态:人数已满:FullStarffed、单机构超过两人:TwoPeople、爽约次数过多:BreakPromise、超时:Overtime 、成功:Success"`
|
|
|
item := new(models.CygxActivityMeetingReminder)
|
|
|
resp := new(models.SignupStatus)
|
|
@@ -1405,11 +1525,29 @@ func (this *ActivityCoAntroller) MeetingReminderAdd() {
|
|
|
if applyCount > 0 {
|
|
|
hasPermission = 4
|
|
|
} else {
|
|
|
- hasPermission = 3
|
|
|
+ if sellerItem != nil {
|
|
|
+ hasPermission = 5
|
|
|
+ } else {
|
|
|
+ //获取权益销售信息 如果是FICC的客户类型,则默认他申请过
|
|
|
+ sellerItemQy, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if sellerItemQy != nil {
|
|
|
+ hasPermission = 2
|
|
|
+ resp.SellerMobile = sellerItemQy.Mobile
|
|
|
+ resp.SellerName = sellerItemQy.RealName
|
|
|
+ } else {
|
|
|
+ hasPermission = 3
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ resp.ActivityId = activityId
|
|
|
resp.HasPermission = hasPermission
|
|
|
resp.OperationMode = "Apply"
|
|
|
- resp.PopupMsg = "您暂无权限参加 【" + activityInfo.ChartPermissionName + "】行业活动,若想参加可以申请开通哦"
|
|
|
+ resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|
|
@@ -1452,9 +1590,20 @@ func (this *ActivityCoAntroller) MeetingReminderAdd() {
|
|
|
//冻结客户
|
|
|
if err != nil {
|
|
|
if err.Error() == utils.ErrNoRow() {
|
|
|
- resp.HasPermission = 4
|
|
|
+ //如果是FICC的客户类型,则默认他申请过
|
|
|
+ if applyCount > 0 {
|
|
|
+ hasPermission = 4
|
|
|
+ } else {
|
|
|
+ if sellerItem != nil {
|
|
|
+ hasPermission = 5
|
|
|
+ } else {
|
|
|
+ hasPermission = 3
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resp.ActivityId = activityId
|
|
|
+ resp.HasPermission = hasPermission
|
|
|
resp.OperationMode = "Apply"
|
|
|
- resp.PopupMsg = "您暂无权限参加 【" + activityInfo.ChartPermissionName + "】行业活动,若想参加可以申请开通哦"
|
|
|
+ resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|
|
@@ -1501,27 +1650,35 @@ func (this *ActivityCoAntroller) MeetingReminderAdd() {
|
|
|
}
|
|
|
resp.HaqveJurisdiction = true
|
|
|
} else {
|
|
|
- hasPermission = 2
|
|
|
- resp.SellerMobile = companyItem.Mobile
|
|
|
- resp.SellerName = companyItem.SellerName
|
|
|
- resp.MsgType = "Type"
|
|
|
- resp.OperationMode = "Call"
|
|
|
- if permissionStr == "专家" {
|
|
|
- resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
+ if companyItem.ProductId == 2 {
|
|
|
+ hasPermission = 2
|
|
|
+ resp.SellerMobile = companyItem.Mobile
|
|
|
+ resp.SellerName = companyItem.SellerName
|
|
|
resp.MsgType = "Type"
|
|
|
+ resp.OperationMode = "Call"
|
|
|
+ if permissionStr == "专家" {
|
|
|
+ resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
+ resp.MsgType = "Type"
|
|
|
+ } else {
|
|
|
+ resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
+ resp.MsgType = "Industry"
|
|
|
+ }
|
|
|
} else {
|
|
|
- resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
- resp.MsgType = "Industry"
|
|
|
+ hasPermission = 5
|
|
|
}
|
|
|
}
|
|
|
} else { //潜在客户
|
|
|
if applyCount > 0 {
|
|
|
hasPermission = 4
|
|
|
} else {
|
|
|
- hasPermission = 3
|
|
|
+ if sellerItem != nil {
|
|
|
+ hasPermission = 5
|
|
|
+ } else {
|
|
|
+ hasPermission = 3
|
|
|
+ }
|
|
|
}
|
|
|
resp.OperationMode = "Apply"
|
|
|
- resp.PopupMsg = "您暂无权限参加 【" + activityInfo.ChartPermissionName + "】行业活动,若想参加可以申请开通哦"
|
|
|
+ resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
}
|
|
|
resp.HasPermission = hasPermission
|
|
|
resp.SignupStatus = signupStatus
|
|
@@ -1721,6 +1878,8 @@ func (this *ActivityCoAntroller) LabelList() {
|
|
|
}
|
|
|
}
|
|
|
permissionSqlStr = strings.TrimRight(permissionSqlStr, ",")
|
|
|
+ permissionSqlStr = strings.Replace(permissionSqlStr, "(主观)", "", -1)
|
|
|
+ permissionSqlStr = strings.Replace(permissionSqlStr, "(客观)", "", -1)
|
|
|
permissionSqlStr = ` AND art.chart_permission_name IN (` + permissionSqlStr + `)`
|
|
|
sqlExport = ` AND (art.customer_type_ids LIKE '%` + strconv.Itoa(userType) + `%' `
|
|
|
if userType == 2 {
|
|
@@ -1774,7 +1933,7 @@ func (this *ActivityCoAntroller) LabelList() {
|
|
|
}
|
|
|
}
|
|
|
resp.Label = label
|
|
|
- resp.ImgUrl = "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Ft-img.51f.com%2Fxf%2Fxw%2F6b0d6f76-650c-4550-b549-8b016709e3b1.JPEG&refer=http%3A%2F%2Ft-img.51f.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1640240724&t=1090d681d7d2351c563f2a101e6b842c"
|
|
|
+ resp.ImgUrl = ""
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|
|
@@ -2005,6 +2164,8 @@ func (this *ActivityCoAntroller) LabelTypeList() {
|
|
|
permissionNameStr += "'" + v + "',"
|
|
|
}
|
|
|
}
|
|
|
+ permissionNameStr = strings.Replace(permissionNameStr, "(主观)", "", -1)
|
|
|
+ permissionNameStr = strings.Replace(permissionNameStr, "(客观)", "", -1)
|
|
|
permissionNameStr = strings.TrimRight(permissionNameStr, ",")
|
|
|
list, err := models.GetActivityTypeHomeList()
|
|
|
if err != nil {
|
|
@@ -2189,6 +2350,8 @@ func (this *ActivityCoAntroller) LabelMoreList() {
|
|
|
}
|
|
|
}
|
|
|
permissionSqlStr = strings.TrimRight(permissionSqlStr, ",")
|
|
|
+ permissionSqlStr = strings.Replace(permissionSqlStr, "(主观)", "", -1)
|
|
|
+ permissionSqlStr = strings.Replace(permissionSqlStr, "(客观)", "", -1)
|
|
|
permissionSqlStr = ` AND art.chart_permission_name IN (` + permissionSqlStr + `)`
|
|
|
sqlExport = ` AND (art.customer_type_ids LIKE '%` + strconv.Itoa(userType) + `%' `
|
|
|
if userType == 2 {
|
|
@@ -2345,6 +2508,8 @@ func (this *ActivityCoAntroller) ActivityListNew() {
|
|
|
}
|
|
|
}
|
|
|
permissionSqlStr = strings.TrimRight(permissionSqlStr, ",")
|
|
|
+ permissionSqlStr = strings.Replace(permissionSqlStr, "(主观)", "", -1)
|
|
|
+ permissionSqlStr = strings.Replace(permissionSqlStr, "(客观)", "", -1)
|
|
|
permissionSqlStr = ` AND art.chart_permission_name IN (` + permissionSqlStr + `)`
|
|
|
sqlExport = ` AND (art.customer_type_ids LIKE '%` + strconv.Itoa(userType) + `%' `
|
|
|
if userType == 2 {
|
|
@@ -2573,6 +2738,8 @@ func (this *ActivityCoAntroller) LabelTypeListPc() {
|
|
|
permissionNameStr += "'" + v + "',"
|
|
|
}
|
|
|
}
|
|
|
+ permissionNameStr = strings.Replace(permissionNameStr, "(主观)", "", -1)
|
|
|
+ permissionNameStr = strings.Replace(permissionNameStr, "(客观)", "", -1)
|
|
|
permissionNameStr = strings.TrimRight(permissionNameStr, ",")
|
|
|
list, err := models.GetActivityTypeHomeListPc()
|
|
|
if err != nil {
|
|
@@ -2714,6 +2881,13 @@ func (this *ActivityCoAntroller) CheckAsk() {
|
|
|
br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ //获取销售信息
|
|
|
+ sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 1)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "申请失败"
|
|
|
+ br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
resp := new(models.SignupStatus)
|
|
|
hasPermission := 0
|
|
|
var companyDetailStatus string
|
|
@@ -2730,11 +2904,29 @@ func (this *ActivityCoAntroller) CheckAsk() {
|
|
|
if applyCount > 0 {
|
|
|
hasPermission = 4
|
|
|
} else {
|
|
|
- hasPermission = 3
|
|
|
+ if sellerItem != nil {
|
|
|
+ hasPermission = 5
|
|
|
+ } else {
|
|
|
+ //获取权益销售信息 如果是FICC的客户类型,则默认他申请过
|
|
|
+ sellerItemQy, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if sellerItemQy != nil {
|
|
|
+ hasPermission = 2
|
|
|
+ resp.SellerMobile = sellerItemQy.Mobile
|
|
|
+ resp.SellerName = sellerItemQy.RealName
|
|
|
+ } else {
|
|
|
+ hasPermission = 3
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ resp.ActivityId = activityId
|
|
|
resp.HasPermission = hasPermission
|
|
|
resp.OperationMode = "Apply"
|
|
|
- resp.PopupMsg = "您暂无权限参加 【" + activityInfo.ChartPermissionName + "】行业活动,若想参加可以申请开通哦"
|
|
|
+ resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|
|
@@ -2772,9 +2964,19 @@ func (this *ActivityCoAntroller) CheckAsk() {
|
|
|
//冻结客户
|
|
|
if err != nil {
|
|
|
if err.Error() == utils.ErrNoRow() {
|
|
|
- resp.HasPermission = 4
|
|
|
+ if applyCount > 0 {
|
|
|
+ hasPermission = 4
|
|
|
+ } else {
|
|
|
+ if sellerItem != nil {
|
|
|
+ hasPermission = 5
|
|
|
+ } else {
|
|
|
+ hasPermission = 3
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resp.ActivityId = activityId
|
|
|
+ resp.HasPermission = hasPermission
|
|
|
resp.OperationMode = "Apply"
|
|
|
- resp.PopupMsg = "您暂无权限参加 【" + activityInfo.ChartPermissionName + "】行业活动,若想参加可以申请开通哦"
|
|
|
+ resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|
|
@@ -2797,27 +2999,35 @@ func (this *ActivityCoAntroller) CheckAsk() {
|
|
|
signupStatus = "Success"
|
|
|
resp.HaqveJurisdiction = true
|
|
|
} else {
|
|
|
- hasPermission = 2
|
|
|
- resp.SellerMobile = companyItem.Mobile
|
|
|
- resp.SellerName = companyItem.SellerName
|
|
|
- resp.MsgType = "Type"
|
|
|
- resp.OperationMode = "Call"
|
|
|
- if permissionStr == "专家" {
|
|
|
- resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
+ if companyItem.ProductId == 2 {
|
|
|
+ hasPermission = 2
|
|
|
+ resp.SellerMobile = companyItem.Mobile
|
|
|
+ resp.SellerName = companyItem.SellerName
|
|
|
resp.MsgType = "Type"
|
|
|
+ resp.OperationMode = "Call"
|
|
|
+ if permissionStr == "专家" {
|
|
|
+ resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
+ resp.MsgType = "Type"
|
|
|
+ } else {
|
|
|
+ resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
+ resp.MsgType = "Industry"
|
|
|
+ }
|
|
|
} else {
|
|
|
- resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
- resp.MsgType = "Industry"
|
|
|
+ hasPermission = 5
|
|
|
}
|
|
|
}
|
|
|
} else { //潜在客户
|
|
|
if applyCount > 0 {
|
|
|
hasPermission = 4
|
|
|
} else {
|
|
|
- hasPermission = 3
|
|
|
+ if sellerItem != nil {
|
|
|
+ hasPermission = 5
|
|
|
+ } else {
|
|
|
+ hasPermission = 3
|
|
|
+ }
|
|
|
}
|
|
|
resp.OperationMode = "Apply"
|
|
|
- resp.PopupMsg = "您暂无权限参加 【" + activityInfo.ChartPermissionName + "】行业活动,若想参加可以申请开通哦"
|
|
|
+ resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
}
|
|
|
resp.HasPermission = hasPermission
|
|
|
resp.SignupStatus = signupStatus
|