|
@@ -1285,3 +1285,481 @@ func (this *CalendarController) OverseasCustomCalendarAdminList() {
|
|
|
br.Data = list
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// OverseasSellerReportList
|
|
|
+// @Title 海外客户销售路演统计
|
|
|
+// @Description 海外客户销售路演统计接口
|
|
|
+// @Param DataType query string true "枚举值:week、month、time_interval、online、offline"
|
|
|
+// @Param DimensionType query string true "维度枚举值:company_status、roadshow_type"
|
|
|
+// @Param StartDate query string true "开始日期,格式:2022-04-06"
|
|
|
+// @Param EndDate query string true "结束日期,格式:2022-04-06"
|
|
|
+// @Success 200 {object} roadshow.RsReportRecordResp
|
|
|
+// @router /overseas_custom/seller/list [get]
|
|
|
+func (this *CalendarController) OverseasSellerReportList() {
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ dataType := this.GetString("DataType")
|
|
|
+ dimensionType := this.GetString("DimensionType")
|
|
|
+ startDate := this.GetString("StartDate")
|
|
|
+ endDate := this.GetString("EndDate")
|
|
|
+
|
|
|
+ if dimensionType == "" {
|
|
|
+ dimensionType = "company_status"
|
|
|
+ }
|
|
|
+
|
|
|
+ var adminDataList []roadshowService.OverseasAdminDataMap
|
|
|
+ var err error
|
|
|
+ var firstDate time.Time
|
|
|
+ //获取列表
|
|
|
+ switch dataType {
|
|
|
+ case "week":
|
|
|
+ adminDataList, firstDate, err = roadshowService.GetOverseasWeekDataV2("seller", dimensionType, 6)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "数据异常"
|
|
|
+ br.ErrMsg = "数据异常,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ case "month":
|
|
|
+ adminDataList, firstDate, err = roadshowService.GetOverseasMonthDataV2("seller", dimensionType, 6)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "数据异常"
|
|
|
+ br.ErrMsg = "数据异常,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ case "time_interval":
|
|
|
+ if startDate == `` || endDate == `` {
|
|
|
+ br.Msg = "开始日期或结束日期不能为空"
|
|
|
+ br.ErrMsg = "开始日期或结束日期不能为空,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ adminDataList, firstDate, err = roadshowService.GetOverseasTimeIntervalData(startDate, endDate, "seller", dimensionType)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "数据异常"
|
|
|
+ br.ErrMsg = "数据异常,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ group, groupIdRelationMap, err := services.GetFiccSystemGroup()
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败!"
|
|
|
+ br.ErrMsg = "获取分组信息失败!Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ researcherList, err := services.GetFiccSeller(firstDate, groupIdRelationMap)
|
|
|
+ groupMap := make(map[int][]*roadshow.Researcher)
|
|
|
+ for _, v := range researcherList {
|
|
|
+ if v.RoleTypeCode == "ficc_admin" {
|
|
|
+ findItems := groupMap[1]
|
|
|
+ findItems = append(findItems, v)
|
|
|
+ groupMap[1] = findItems
|
|
|
+ } else {
|
|
|
+ if findItems, ok := groupMap[v.GroupId]; ok {
|
|
|
+ findItems = append(findItems, v)
|
|
|
+ groupMap[v.GroupId] = findItems
|
|
|
+ } else {
|
|
|
+ findItems = append(findItems, v)
|
|
|
+ groupMap[v.GroupId] = findItems
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ groupReportRecordList := make([]roadshow.OverseasGroupReportRecord, 0)
|
|
|
+ rsAllReportRecordNumList := make([]roadshow.RsOverseasReportRecordNum, 0)
|
|
|
+ RsReportRecordResp := roadshow.RsOverseasReportRecordResp{
|
|
|
+ List: groupReportRecordList,
|
|
|
+ RsReportRecordNumList: rsAllReportRecordNumList,
|
|
|
+ }
|
|
|
+
|
|
|
+ startDateIndexList := make(map[int]string) //开始时间间隔map
|
|
|
+ endDateIndexList := make(map[int]string) //结束时间间隔map
|
|
|
+
|
|
|
+ tmpAllTryOutNumMap := make(map[int]int)
|
|
|
+ tmpAllFormalNumMap := make(map[int]int)
|
|
|
+ tmpAllCloseNumMap := make(map[int]int)
|
|
|
+ tmpAllOnlineNumMap := make(map[int]int)
|
|
|
+ tmpAllOfflineNumMap := make(map[int]int)
|
|
|
+ for _, v := range group {
|
|
|
+ v.ResearcherList = groupMap[v.GroupId]
|
|
|
+ tmpGroupAdminReportRecord := make([]roadshow.OverseasAdminReportRecord, 0)
|
|
|
+ tmpGroupRsReportRecordNumList := make([]roadshow.RsOverseasReportRecordNum, 0)
|
|
|
+
|
|
|
+ tmpGroupTryOutNumMap := make(map[int]int)
|
|
|
+ tmpGroupFormalNumMap := make(map[int]int)
|
|
|
+ tmpGroupCloseNumMap := make(map[int]int)
|
|
|
+ tmpGroupOnlineNumMap := make(map[int]int)
|
|
|
+ tmpGroupOfflineNumMap := make(map[int]int)
|
|
|
+ for _, researcher := range groupMap[v.GroupId] {
|
|
|
+ //组内研究员数据
|
|
|
+
|
|
|
+ //每个区间的数据
|
|
|
+ tmpAdminRsReportRecordNumList := make([]roadshow.RsOverseasReportRecordNum, 0)
|
|
|
+ for index, adminData := range adminDataList {
|
|
|
+ startDateIndexList[index] = adminData.StartDate
|
|
|
+ endDateIndexList[index] = adminData.EndDate
|
|
|
+
|
|
|
+ var tmpTryOutNum, tmpFormalNum, tmpCloseNum, tmpOnlineNum, tmpOfflineNum int
|
|
|
+ if num, ok := adminData.TryOutMap[researcher.AdminId]; ok {
|
|
|
+ tmpTryOutNum = num
|
|
|
+ }
|
|
|
+ if num, ok := adminData.FormalMap[researcher.AdminId]; ok {
|
|
|
+ tmpFormalNum = num
|
|
|
+ }
|
|
|
+ if num, ok := adminData.CloseMap[researcher.AdminId]; ok {
|
|
|
+ tmpCloseNum = num
|
|
|
+ }
|
|
|
+ if num, ok := adminData.OnlineMap[researcher.AdminId]; ok {
|
|
|
+ tmpOnlineNum = num
|
|
|
+ }
|
|
|
+ if num, ok := adminData.OfflineMap[researcher.AdminId]; ok {
|
|
|
+ tmpOfflineNum = num
|
|
|
+ }
|
|
|
+ tmpAdminRsReportRecordNum := roadshow.RsOverseasReportRecordNum{
|
|
|
+ TryOutNum: tmpTryOutNum,
|
|
|
+ FormalNum: tmpFormalNum,
|
|
|
+ CloseNum: tmpCloseNum,
|
|
|
+ OnlineNum: tmpOnlineNum,
|
|
|
+ OfflineNum: tmpOfflineNum,
|
|
|
+ StartDate: adminData.StartDate,
|
|
|
+ EndDate: adminData.EndDate,
|
|
|
+ }
|
|
|
+ tmpAdminRsReportRecordNumList = append(tmpAdminRsReportRecordNumList, tmpAdminRsReportRecordNum)
|
|
|
+
|
|
|
+ //组内数据汇总
|
|
|
+ if _, ok := tmpGroupTryOutNumMap[index]; !ok {
|
|
|
+ tmpGroupTryOutNumMap[index] = 0
|
|
|
+ }
|
|
|
+ if _, ok := tmpGroupFormalNumMap[index]; !ok {
|
|
|
+ tmpGroupFormalNumMap[index] = 0
|
|
|
+ }
|
|
|
+ if _, ok := tmpGroupCloseNumMap[index]; !ok {
|
|
|
+ tmpGroupCloseNumMap[index] = 0
|
|
|
+ }
|
|
|
+ if _, ok := tmpGroupOnlineNumMap[index]; !ok {
|
|
|
+ tmpGroupOnlineNumMap[index] = 0
|
|
|
+ }
|
|
|
+ if _, ok := tmpGroupOfflineNumMap[index]; !ok {
|
|
|
+ tmpGroupOfflineNumMap[index] = 0
|
|
|
+ }
|
|
|
+ tmpGroupTryOutNumMap[index] += tmpTryOutNum
|
|
|
+ tmpGroupFormalNumMap[index] += tmpFormalNum
|
|
|
+ tmpGroupCloseNumMap[index] += tmpCloseNum
|
|
|
+ tmpGroupOnlineNumMap[index] += tmpOnlineNum
|
|
|
+ tmpGroupOfflineNumMap[index] += tmpOfflineNum
|
|
|
+
|
|
|
+ //总数据汇总
|
|
|
+ if _, ok := tmpAllTryOutNumMap[index]; !ok {
|
|
|
+ tmpAllTryOutNumMap[index] = 0
|
|
|
+ }
|
|
|
+ if _, ok := tmpAllFormalNumMap[index]; !ok {
|
|
|
+ tmpAllFormalNumMap[index] = 0
|
|
|
+ }
|
|
|
+ if _, ok := tmpAllCloseNumMap[index]; !ok {
|
|
|
+ tmpAllCloseNumMap[index] = 0
|
|
|
+ }
|
|
|
+ if _, ok := tmpAllOnlineNumMap[index]; !ok {
|
|
|
+ tmpAllOnlineNumMap[index] = 0
|
|
|
+ }
|
|
|
+ if _, ok := tmpAllOfflineNumMap[index]; !ok {
|
|
|
+ tmpAllOfflineNumMap[index] = 0
|
|
|
+ }
|
|
|
+ tmpAllTryOutNumMap[index] += tmpTryOutNum
|
|
|
+ tmpAllFormalNumMap[index] += tmpFormalNum
|
|
|
+ tmpAllCloseNumMap[index] += tmpCloseNum
|
|
|
+ tmpAllOnlineNumMap[index] += tmpOnlineNum
|
|
|
+ tmpAllOfflineNumMap[index] += tmpOfflineNum
|
|
|
+ }
|
|
|
+ tmpAdminReportRecord := roadshow.OverseasAdminReportRecord{
|
|
|
+ Name: researcher.RealName,
|
|
|
+ AdminId: researcher.AdminId,
|
|
|
+ RsReportRecordNumList: tmpAdminRsReportRecordNumList,
|
|
|
+ }
|
|
|
+ tmpGroupAdminReportRecord = append(tmpGroupAdminReportRecord, tmpAdminReportRecord)
|
|
|
+ }
|
|
|
+
|
|
|
+ for i := 0; i < len(tmpGroupCloseNumMap); i++ {
|
|
|
+ tmpGroupRsReportRecordNum := roadshow.RsOverseasReportRecordNum{
|
|
|
+ TryOutNum: tmpGroupTryOutNumMap[i],
|
|
|
+ FormalNum: tmpGroupFormalNumMap[i],
|
|
|
+ CloseNum: tmpGroupCloseNumMap[i],
|
|
|
+ OnlineNum: tmpGroupOnlineNumMap[i],
|
|
|
+ OfflineNum: tmpGroupOfflineNumMap[i],
|
|
|
+ StartDate: startDateIndexList[i],
|
|
|
+ EndDate: endDateIndexList[i],
|
|
|
+ }
|
|
|
+ tmpGroupRsReportRecordNumList = append(tmpGroupRsReportRecordNumList, tmpGroupRsReportRecordNum)
|
|
|
+ }
|
|
|
+ groupReportRecord := roadshow.OverseasGroupReportRecord{
|
|
|
+ Item: tmpGroupAdminReportRecord,
|
|
|
+ Name: v.GroupName,
|
|
|
+ GruopId: v.GroupId,
|
|
|
+ RsReportRecordNumList: tmpGroupRsReportRecordNumList,
|
|
|
+ }
|
|
|
+ groupReportRecordList = append(groupReportRecordList, groupReportRecord)
|
|
|
+ }
|
|
|
+
|
|
|
+ //总体汇总数据
|
|
|
+ for i := 0; i < len(tmpAllFormalNumMap); i++ {
|
|
|
+ tmpGroupRsReportRecordNum := roadshow.RsOverseasReportRecordNum{
|
|
|
+ TryOutNum: tmpAllTryOutNumMap[i],
|
|
|
+ FormalNum: tmpAllFormalNumMap[i],
|
|
|
+ CloseNum: tmpAllCloseNumMap[i],
|
|
|
+ OnlineNum: tmpAllOnlineNumMap[i],
|
|
|
+ OfflineNum: tmpAllOfflineNumMap[i],
|
|
|
+ StartDate: startDateIndexList[i],
|
|
|
+ EndDate: endDateIndexList[i],
|
|
|
+ }
|
|
|
+ rsAllReportRecordNumList = append(rsAllReportRecordNumList, tmpGroupRsReportRecordNum)
|
|
|
+ }
|
|
|
+ RsReportRecordResp.RsReportRecordNumList = rsAllReportRecordNumList
|
|
|
+
|
|
|
+ //tmpList := groupReportRecordList
|
|
|
+ //因为RoleTypeCode不一样,所以需要重新从数据库取数据
|
|
|
+ //adminInfo, _ := system.GetSysAdminById(sysUser.AdminId)
|
|
|
+ //adminGroupId := adminInfo.GroupId
|
|
|
+ //if tmpGroupId, ok := groupIdRelationMap[adminGroupId]; ok {
|
|
|
+ // adminGroupId = tmpGroupId
|
|
|
+ //}
|
|
|
+ //switch adminInfo.RoleTypeCode {
|
|
|
+ //case utils.ROLE_TYPE_CODE_FICC_GROUP, utils.ROLE_TYPE_CODE_FICC_TEAM:
|
|
|
+ // for index, v := range tmpList {
|
|
|
+ // //如果不是同一个分组,那么就移除该分组下的人员数据
|
|
|
+ // if v.GruopId != adminGroupId {
|
|
|
+ // tmpList[index].Item = make([]roadshow.AdminReportRecord, 0)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // RsReportRecordResp.List = tmpList
|
|
|
+ //case utils.ROLE_TYPE_CODE_FICC_ADMIN, utils.ROLE_TYPE_CODE_ADMIN:
|
|
|
+ // //管理员、超管看全部数据
|
|
|
+ // RsReportRecordResp.List = groupReportRecordList
|
|
|
+ //}
|
|
|
+
|
|
|
+ // 20230529-有权限查看该页面的用户权限同admin
|
|
|
+ RsReportRecordResp.List = groupReportRecordList
|
|
|
+
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = RsReportRecordResp
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+// OverseasResearcherReportList
|
|
|
+// @Title 研究员路演统计
|
|
|
+// @Description 研究员路演统计接口
|
|
|
+// @Param DataType query string true "枚举值:week、month、time_interval"
|
|
|
+// @Param StartDate query string true "开始日期,格式:2022-04-06"
|
|
|
+// @Param EndDate query string true "结束日期,格式:2022-04-06"
|
|
|
+// @Success 200 {object} roadshow.RsReportRecordResp
|
|
|
+// @router /overseas_custom/researcher/list [get]
|
|
|
+func (this *CalendarController) OverseasResearcherReportList() {
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ dataType := this.GetString("DataType")
|
|
|
+ startDate := this.GetString("StartDate")
|
|
|
+ endDate := this.GetString("EndDate")
|
|
|
+
|
|
|
+ var adminDataList []roadshowService.OverseasAdminDataMap
|
|
|
+ var err error
|
|
|
+ //var firstDate time.Time
|
|
|
+ //获取列表
|
|
|
+ switch dataType {
|
|
|
+ case "week":
|
|
|
+ adminDataList, _, err = roadshowService.GetOverseasWeekData("researcher", "company_status")
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "数据异常"
|
|
|
+ br.ErrMsg = "数据异常,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ case "month":
|
|
|
+ adminDataList, _, err = roadshowService.GetOverseasMonthData("researcher", "company_status")
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "数据异常"
|
|
|
+ br.ErrMsg = "数据异常,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ case "time_interval":
|
|
|
+ if startDate == `` || endDate == `` {
|
|
|
+ br.Msg = "开始日期或结束日期不能为空"
|
|
|
+ br.ErrMsg = "开始日期或结束日期不能为空,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ adminDataList, _, err = roadshowService.GetOverseasTimeIntervalData(startDate, endDate, "researcher", "company_status")
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "数据异常"
|
|
|
+ br.ErrMsg = "数据异常,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ group, err := roadshow.GetResearcherGroup()
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败!"
|
|
|
+ br.ErrMsg = "获取分组信息失败!Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ researcherList, err := roadshow.GetResearcherV2()
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败!"
|
|
|
+ br.ErrMsg = "获取分组信息失败!,GetResearcherV2 Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ groupMap := make(map[int][]*roadshow.Researcher)
|
|
|
+ for _, v := range researcherList {
|
|
|
+ //if v.RoleTypeCode == "ficc_admin" {
|
|
|
+ // findItems := groupMap[1]
|
|
|
+ // findItems = append(findItems, v)
|
|
|
+ // groupMap[1] = findItems
|
|
|
+ //} else {
|
|
|
+ if findItems, ok := groupMap[v.GroupId]; ok {
|
|
|
+ findItems = append(findItems, v)
|
|
|
+ groupMap[v.GroupId] = findItems
|
|
|
+ } else {
|
|
|
+ findItems = append(findItems, v)
|
|
|
+ groupMap[v.GroupId] = findItems
|
|
|
+ }
|
|
|
+ //}
|
|
|
+ }
|
|
|
+
|
|
|
+ groupReportRecordList := make([]roadshow.OverseasGroupReportRecord, 0)
|
|
|
+ rsAllReportRecordNumList := make([]roadshow.RsOverseasReportRecordNum, 0)
|
|
|
+ RsReportRecordResp := roadshow.RsOverseasReportRecordResp{
|
|
|
+ List: groupReportRecordList,
|
|
|
+ RsReportRecordNumList: rsAllReportRecordNumList,
|
|
|
+ }
|
|
|
+
|
|
|
+ startDateIndexList := make(map[int]string) //开始时间间隔map
|
|
|
+ endDateIndexList := make(map[int]string) //结束时间间隔map
|
|
|
+
|
|
|
+ tmpAllTryOutNumMap := make(map[int]int)
|
|
|
+ tmpAllFormalNumMap := make(map[int]int)
|
|
|
+ tmpAllMeetingNumMap := make(map[int]int)
|
|
|
+ for _, v := range group {
|
|
|
+ v.ResearcherList = groupMap[v.GroupId]
|
|
|
+ tmpGroupAdminReportRecord := make([]roadshow.OverseasAdminReportRecord, 0)
|
|
|
+ tmpGroupRsReportRecordNumList := make([]roadshow.RsOverseasReportRecordNum, 0)
|
|
|
+
|
|
|
+ tmpGroupTryOutNumMap := make(map[int]int)
|
|
|
+ tmpGroupFormalNumMap := make(map[int]int)
|
|
|
+ tmpGroupCloseNumMap := make(map[int]int)
|
|
|
+ for _, researcher := range groupMap[v.GroupId] {
|
|
|
+ //组内研究员数据
|
|
|
+
|
|
|
+ //每个区间的数据
|
|
|
+ tmpAdminRsReportRecordNumList := make([]roadshow.RsOverseasReportRecordNum, 0)
|
|
|
+ for index, adminData := range adminDataList {
|
|
|
+ startDateIndexList[index] = adminData.StartDate
|
|
|
+ endDateIndexList[index] = adminData.EndDate
|
|
|
+
|
|
|
+ var tmpTryOutNum, tmpFormalNum, tmpCloseNum int
|
|
|
+ if num, ok := adminData.TryOutMap[researcher.AdminId]; ok {
|
|
|
+ tmpTryOutNum = num
|
|
|
+ }
|
|
|
+ if num, ok := adminData.FormalMap[researcher.AdminId]; ok {
|
|
|
+ tmpFormalNum = num
|
|
|
+ }
|
|
|
+ if num, ok := adminData.CloseMap[researcher.AdminId]; ok {
|
|
|
+ tmpCloseNum = num
|
|
|
+ }
|
|
|
+ tmpAdminRsReportRecordNum := roadshow.RsOverseasReportRecordNum{
|
|
|
+ TryOutNum: tmpTryOutNum,
|
|
|
+ FormalNum: tmpFormalNum,
|
|
|
+ CloseNum: tmpCloseNum,
|
|
|
+ StartDate: adminData.StartDate,
|
|
|
+ EndDate: adminData.EndDate,
|
|
|
+ }
|
|
|
+ tmpAdminRsReportRecordNumList = append(tmpAdminRsReportRecordNumList, tmpAdminRsReportRecordNum)
|
|
|
+
|
|
|
+ //组内数据汇总
|
|
|
+ if _, ok := tmpGroupTryOutNumMap[index]; !ok {
|
|
|
+ tmpGroupTryOutNumMap[index] = 0
|
|
|
+ }
|
|
|
+ if _, ok := tmpGroupFormalNumMap[index]; !ok {
|
|
|
+ tmpGroupFormalNumMap[index] = 0
|
|
|
+ }
|
|
|
+ if _, ok := tmpGroupCloseNumMap[index]; !ok {
|
|
|
+ tmpGroupCloseNumMap[index] = 0
|
|
|
+ }
|
|
|
+ tmpGroupTryOutNumMap[index] += tmpTryOutNum
|
|
|
+ tmpGroupFormalNumMap[index] += tmpFormalNum
|
|
|
+ tmpGroupCloseNumMap[index] += tmpCloseNum
|
|
|
+
|
|
|
+ //总数据汇总
|
|
|
+ if _, ok := tmpAllTryOutNumMap[index]; !ok {
|
|
|
+ tmpAllTryOutNumMap[index] = 0
|
|
|
+ }
|
|
|
+ if _, ok := tmpAllFormalNumMap[index]; !ok {
|
|
|
+ tmpAllFormalNumMap[index] = 0
|
|
|
+ }
|
|
|
+ if _, ok := tmpAllMeetingNumMap[index]; !ok {
|
|
|
+ tmpAllMeetingNumMap[index] = 0
|
|
|
+ }
|
|
|
+ tmpAllTryOutNumMap[index] += tmpTryOutNum
|
|
|
+ tmpAllFormalNumMap[index] += tmpFormalNum
|
|
|
+ tmpAllMeetingNumMap[index] += tmpCloseNum
|
|
|
+ }
|
|
|
+ tmpAdminReportRecord := roadshow.OverseasAdminReportRecord{
|
|
|
+ Name: researcher.RealName,
|
|
|
+ AdminId: researcher.AdminId,
|
|
|
+ RsReportRecordNumList: tmpAdminRsReportRecordNumList,
|
|
|
+ }
|
|
|
+ tmpGroupAdminReportRecord = append(tmpGroupAdminReportRecord, tmpAdminReportRecord)
|
|
|
+ }
|
|
|
+
|
|
|
+ for i := 0; i < len(tmpGroupCloseNumMap); i++ {
|
|
|
+ tmpGroupRsReportRecordNum := roadshow.RsOverseasReportRecordNum{
|
|
|
+ TryOutNum: tmpGroupTryOutNumMap[i],
|
|
|
+ FormalNum: tmpGroupFormalNumMap[i],
|
|
|
+ CloseNum: tmpGroupCloseNumMap[i],
|
|
|
+ StartDate: startDateIndexList[i],
|
|
|
+ EndDate: endDateIndexList[i],
|
|
|
+ }
|
|
|
+ tmpGroupRsReportRecordNumList = append(tmpGroupRsReportRecordNumList, tmpGroupRsReportRecordNum)
|
|
|
+ }
|
|
|
+ groupReportRecord := roadshow.OverseasGroupReportRecord{
|
|
|
+ Item: tmpGroupAdminReportRecord,
|
|
|
+ Name: v.GroupName,
|
|
|
+ RsReportRecordNumList: tmpGroupRsReportRecordNumList,
|
|
|
+ }
|
|
|
+ RsReportRecordResp.List = append(RsReportRecordResp.List, groupReportRecord)
|
|
|
+ }
|
|
|
+
|
|
|
+ //总体汇总数据
|
|
|
+ for i := 0; i < len(tmpAllFormalNumMap); i++ {
|
|
|
+ tmpGroupRsReportRecordNum := roadshow.RsOverseasReportRecordNum{
|
|
|
+ TryOutNum: tmpAllTryOutNumMap[i],
|
|
|
+ FormalNum: tmpAllFormalNumMap[i],
|
|
|
+ CloseNum: tmpAllMeetingNumMap[i],
|
|
|
+ StartDate: startDateIndexList[i],
|
|
|
+ EndDate: endDateIndexList[i],
|
|
|
+ }
|
|
|
+ rsAllReportRecordNumList = append(rsAllReportRecordNumList, tmpGroupRsReportRecordNum)
|
|
|
+ }
|
|
|
+ RsReportRecordResp.RsReportRecordNumList = rsAllReportRecordNumList
|
|
|
+
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = RsReportRecordResp
|
|
|
+ return
|
|
|
+}
|