|
@@ -282,6 +282,12 @@ func (this *ActivitySignupCoAntroller) AppointmentList() {
|
|
|
br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ //根据公司ID获取对应销售
|
|
|
+ var companyIds []int
|
|
|
+ for _, v := range list {
|
|
|
+ companyIds = append(companyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+ sellNameMap := services.GetSellNameMapByCompanyIds(companyIds)
|
|
|
totalStr += " AND s.company_id != 16 "
|
|
|
total, errtotal := cygx.GetCygxAppointmentCount(activityId, totalStr)
|
|
|
if errtotal != nil {
|
|
@@ -296,7 +302,7 @@ func (this *ActivitySignupCoAntroller) AppointmentList() {
|
|
|
return
|
|
|
}
|
|
|
for k, v := range list {
|
|
|
- list[k].SellerName = v.PsellerName
|
|
|
+ list[k].SellerName = sellNameMap[v.CompanyId]
|
|
|
}
|
|
|
respList := new(cygx.GetAppointmentListRep)
|
|
|
//销售查看自己客户,销售组长查看组员
|
|
@@ -658,6 +664,12 @@ func (this *ActivitySignupCoAntroller) SalonFailSignupList() {
|
|
|
br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ //根据公司ID获取对应销售
|
|
|
+ var sellerCompanyIds []int
|
|
|
+ for _, v := range list {
|
|
|
+ sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+ sellNameMap := services.GetSellNameMapByCompanyIds(sellerCompanyIds)
|
|
|
sqlStrtotal := ` AND s.fail_type >0 `
|
|
|
total, errtotal := cygx.GetCygxAppointmentCount(activityId, sqlStrtotal)
|
|
|
if errtotal != nil {
|
|
@@ -706,6 +718,7 @@ func (this *ActivitySignupCoAntroller) SalonFailSignupList() {
|
|
|
}
|
|
|
}
|
|
|
for k, v := range list {
|
|
|
+ list[k].SellerName = sellNameMap[v.CompanyId]
|
|
|
if v.DoFailType == 0 {
|
|
|
list[k].SalonOperation = true
|
|
|
list[k].CallOperation = v.SignupType
|
|
@@ -1215,6 +1228,19 @@ func (this *ActivitySignupCoAntroller) CallExport() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ //根据公司ID获取对应销售
|
|
|
+ var sellerCompanyIds []int
|
|
|
+ for _, v := range list {
|
|
|
+ sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+ for _, v := range listReminder {
|
|
|
+ sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+ for _, v := range listSummary {
|
|
|
+ sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+ sellNameMap := services.GetSellNameMapByCompanyIds(sellerCompanyIds)
|
|
|
+
|
|
|
//创建excel
|
|
|
dir, err := os.Executable()
|
|
|
exPath := filepath.Dir(dir)
|
|
@@ -1292,7 +1318,7 @@ func (this *ActivitySignupCoAntroller) CallExport() {
|
|
|
cellE := row.AddCell()
|
|
|
cellE.Value = item.CompanyName
|
|
|
cellF := row.AddCell()
|
|
|
- cellF.Value = item.SellerName
|
|
|
+ cellF.Value = sellNameMap[item.CompanyId]
|
|
|
}
|
|
|
} else {
|
|
|
rowTitle := sheet.AddRow()
|
|
@@ -1321,7 +1347,7 @@ func (this *ActivitySignupCoAntroller) CallExport() {
|
|
|
cellD := row.AddCell()
|
|
|
cellD.Value = item.CompanyName
|
|
|
cellE := row.AddCell()
|
|
|
- cellE.Value = item.SellerName
|
|
|
+ cellE.Value = sellNameMap[item.CompanyId]
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -1339,7 +1365,7 @@ func (this *ActivitySignupCoAntroller) CallExport() {
|
|
|
cellB := row.AddCell()
|
|
|
cellB.Value = item.CompanyName
|
|
|
cellC := row.AddCell()
|
|
|
- cellC.Value = item.SellerName
|
|
|
+ cellC.Value = sellNameMap[item.CompanyId]
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1448,6 +1474,19 @@ func (this *ActivitySignupCoAntroller) SignupFailExport() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ //根据公司ID获取对应销售
|
|
|
+ var sellerCompanyIds []int
|
|
|
+ for _, v := range listReminder {
|
|
|
+ sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+ for _, v := range summaryList {
|
|
|
+ sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+ for _, v := range list {
|
|
|
+ sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+ sellNameMap := services.GetSellNameMapByCompanyIds(sellerCompanyIds)
|
|
|
+
|
|
|
//创建excel
|
|
|
dir, err := os.Executable()
|
|
|
exPath := filepath.Dir(dir)
|
|
@@ -1521,7 +1560,7 @@ func (this *ActivitySignupCoAntroller) SignupFailExport() {
|
|
|
cellE := row.AddCell()
|
|
|
cellE.Value = item.CompanyName
|
|
|
cellF := row.AddCell()
|
|
|
- cellF.Value = item.SellerName
|
|
|
+ cellF.Value = sellNameMap[item.CompanyId]
|
|
|
}
|
|
|
} else {
|
|
|
rowTitle := sheet.AddRow()
|
|
@@ -1539,7 +1578,7 @@ func (this *ActivitySignupCoAntroller) SignupFailExport() {
|
|
|
cellB := row.AddCell()
|
|
|
cellB.Value = item.CompanyName
|
|
|
cellC := row.AddCell()
|
|
|
- cellC.Value = item.SellerName
|
|
|
+ cellC.Value = sellNameMap[item.CompanyId]
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -1557,7 +1596,7 @@ func (this *ActivitySignupCoAntroller) SignupFailExport() {
|
|
|
cellB := row.AddCell()
|
|
|
cellB.Value = item.CompanyName
|
|
|
cellC := row.AddCell()
|
|
|
- cellC.Value = item.SellerName
|
|
|
+ cellC.Value = sellNameMap[item.CompanyId]
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2720,6 +2759,12 @@ func (this *ActivitySignupCoAntroller) ReminderList() {
|
|
|
br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ //根据公司ID获取对应销售
|
|
|
+ var sellerCompanyIds []int
|
|
|
+ for _, v := range list {
|
|
|
+ sellerCompanyIds = append(sellerCompanyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+ sellNameMap := services.GetSellNameMapByCompanyIds(sellerCompanyIds)
|
|
|
total, errtotal := cygx.GetCygxActivityMeetingReminderCount(activityId, totalStr)
|
|
|
if errtotal != nil {
|
|
|
br.Msg = "获取失败"
|
|
@@ -2734,7 +2779,7 @@ func (this *ActivitySignupCoAntroller) ReminderList() {
|
|
|
}
|
|
|
if len(list) > 0 {
|
|
|
for k, v := range list {
|
|
|
- list[k].SellerName = v.PsellerName
|
|
|
+ list[k].SellerName = sellNameMap[v.CompanyId]
|
|
|
}
|
|
|
} else {
|
|
|
list = make([]*cygx.CygxAppointmentList, 0)
|