|
@@ -6,6 +6,7 @@ import (
|
|
|
"github.com/tealeg/xlsx"
|
|
|
"hongze/hz_crm_api/controllers"
|
|
|
"hongze/hz_crm_api/models"
|
|
|
+ "hongze/hz_crm_api/models/company"
|
|
|
"hongze/hz_crm_api/models/cygx"
|
|
|
cygxService "hongze/hz_crm_api/services/cygx"
|
|
|
"hongze/hz_crm_api/services/elastic"
|
|
@@ -561,6 +562,22 @@ func (this *YanxuanSpecialController) ListPv() {
|
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ var companyIds []int
|
|
|
+ for _, v := range list {
|
|
|
+ companyIds = append(companyIds, v.CompanyId)
|
|
|
+ }
|
|
|
+
|
|
|
+ listCompanyProduct, err := company.GetCompanyProductListByCompanyIds(companyIds, 2)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取销售列表失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mapsCompanyStatus := make(map[int]string)
|
|
|
+ for _, v := range listCompanyProduct {
|
|
|
+ mapsCompanyStatus[v.CompanyId] = v.Status
|
|
|
+ }
|
|
|
//创建excel
|
|
|
dir, err := os.Executable()
|
|
|
exPath := filepath.Dir(dir)
|
|
@@ -588,8 +605,12 @@ func (this *YanxuanSpecialController) ListPv() {
|
|
|
rowTitle := sheet.AddRow()
|
|
|
cellA := rowTitle.AddCell()
|
|
|
cellA.Value = "姓名"
|
|
|
+ cellMobile := rowTitle.AddCell()
|
|
|
+ cellMobile.Value = "手机号"
|
|
|
cellB := rowTitle.AddCell()
|
|
|
cellB.Value = "公司名称"
|
|
|
+ cellCompanyStatus := rowTitle.AddCell()
|
|
|
+ cellCompanyStatus.Value = "客户状态"
|
|
|
cellC := rowTitle.AddCell()
|
|
|
cellC.Value = "所属权益销售"
|
|
|
cellD := rowTitle.AddCell()
|
|
@@ -601,8 +622,12 @@ func (this *YanxuanSpecialController) ListPv() {
|
|
|
row := sheet.AddRow()
|
|
|
cellA := row.AddCell()
|
|
|
cellA.Value = item.RealName
|
|
|
+ cellMobile := row.AddCell()
|
|
|
+ cellMobile.Value = item.Mobile
|
|
|
cellB := row.AddCell()
|
|
|
cellB.Value = item.CompanyName
|
|
|
+ cellCompanyStatus := row.AddCell()
|
|
|
+ cellCompanyStatus.Value = mapsCompanyStatus[item.CompanyId]
|
|
|
cellC := row.AddCell()
|
|
|
cellC.Value = item.SellerName
|
|
|
cellD := row.AddCell()
|