|
@@ -1604,3 +1604,102 @@ func (this *CalendarController) OverseasResearcherReportList() {
|
|
br.Data = RsReportRecordResp
|
|
br.Data = RsReportRecordResp
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// OverseasCalendarList
|
|
|
|
+// @Title 海外客户路演详情列表
|
|
|
|
+// @Description 海外客户路演详情列表接口
|
|
|
|
+// @Param AdminType query string true "枚举值:researcher、seller、 special:专项路演"
|
|
|
|
+// @Param DataType query string true "枚举值:try_out、formal、meeting、online、offline"
|
|
|
|
+// @Param AdminIds query string true "用户ids"
|
|
|
|
+// @Param StartDate query string true "开始日期,格式:2022-04-06"
|
|
|
|
+// @Param EndDate query string true "结束日期,格式:2022-04-06"
|
|
|
|
+// @Success 200 {object} []roadshow.RsReportRecordList
|
|
|
|
+// @router /report/calendar/list [get]
|
|
|
|
+func (this *CalendarController) OverseasCalendarList() {
|
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
|
+ defer func() {
|
|
|
|
+ this.Data["json"] = br
|
|
|
|
+ this.ServeJSON()
|
|
|
|
+ }()
|
|
|
|
+ sysUser := this.SysUser
|
|
|
|
+ if sysUser == nil {
|
|
|
|
+ br.Msg = "请登录"
|
|
|
|
+ br.ErrMsg = "请登录,SysUser Is Empty"
|
|
|
|
+ br.Ret = 408
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ adminType := this.GetString("AdminType")
|
|
|
|
+ dataType := this.GetString("DataType")
|
|
|
|
+ startDate := this.GetString("StartDate")
|
|
|
|
+ endDate := this.GetString("EndDate")
|
|
|
|
+ adminIds := this.GetString("AdminIds")
|
|
|
|
+ if adminIds == "" {
|
|
|
|
+ br.Msg = "请传入对应的人员"
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ adminIdsArr := make([]int, 0)
|
|
|
|
+ adminIdSlice := strings.Split(adminIds, ",")
|
|
|
|
+ for _, v := range adminIdSlice {
|
|
|
|
+ id,_ := strconv.Atoi(v)
|
|
|
|
+ adminIdsArr = append(adminIdsArr, id)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //正式客户
|
|
|
|
+ var condition string
|
|
|
|
+ var pars []interface{}
|
|
|
|
+ condition = ` and a.start_date >= ? and a.end_date <= ? `
|
|
|
|
+ pars = append(pars, startDate, endDate)
|
|
|
|
+
|
|
|
|
+ //选择的人员类型(发起人还是被发起人)
|
|
|
|
+ if adminType == "seller" {
|
|
|
|
+ condition += ` and a.seller_id IN (` + utils.GetOrmInReplace(len(adminIdsArr)) + `)`
|
|
|
|
+ } else if adminType == "special" {
|
|
|
|
+ condition += ` and a.seller_id (` + utils.GetOrmInReplace(len(adminIdsArr)) + `)`
|
|
|
|
+ detail, err := company.GetConfigDetailByCode("choice_researcher_adminid")
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取研究员信息失败!"
|
|
|
|
+ br.ErrMsg = "选择研究员失败,Err:" + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ condition += ` and a.researcher_id IN (` + detail.ConfigValue + `) `
|
|
|
|
+ } else {
|
|
|
|
+ condition += ` and a.researcher_id (` + utils.GetOrmInReplace(len(adminIdsArr)) + `)`
|
|
|
|
+ }
|
|
|
|
+ pars = append(pars, adminIdsArr)
|
|
|
|
+
|
|
|
|
+ //获取列表
|
|
|
|
+ switch dataType {
|
|
|
|
+ case "try_out":
|
|
|
|
+ condition += ` and a.company_status = ? `
|
|
|
|
+ pars = append(pars, "试用")
|
|
|
|
+ case "formal":
|
|
|
|
+ condition += ` and a.company_status = ? `
|
|
|
|
+ pars = append(pars, "正式")
|
|
|
|
+ case "meeting":
|
|
|
|
+ condition += ` and a.activity_type = ? `
|
|
|
|
+ pars = append(pars, "公开会议")
|
|
|
|
+ case "online":
|
|
|
|
+ condition += ` and a.roadshow_type = ? `
|
|
|
|
+ pars = append(pars, "线上")
|
|
|
|
+ case "offline":
|
|
|
|
+ condition += ` and a.roadshow_type = ? `
|
|
|
|
+ pars = append(pars, "线下")
|
|
|
|
+ default:
|
|
|
|
+ br.Msg = "请传入类型"
|
|
|
|
+ br.ErrMsg = "请传入类型DataType"
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ list, err := roadshow.GetRsReportRecordList(condition, pars)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取失败"
|
|
|
|
+ br.ErrMsg = "获取失败,ERR:" + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ br.Ret = 200
|
|
|
|
+ br.Success = true
|
|
|
|
+ br.Msg = "获取成功"
|
|
|
|
+ br.Data = list
|
|
|
|
+ return
|
|
|
|
+}
|