Commit 483a36aa authored by haoyanbin's avatar haoyanbin

1

parent 44a625ac
...@@ -33,12 +33,11 @@ func GetCustomerUserList(c *gin.Context) { ...@@ -33,12 +33,11 @@ func GetCustomerUserList(c *gin.Context) {
func ExportMsgExcel(c *gin.Context) { func ExportMsgExcel(c *gin.Context) {
reqData := request.GetCustomerUserListReq{} reqData := request.GetCustomerUserListReq{}
_ = c.ShouldBindQuery(&reqData) _ = c.ShouldBindQuery(&reqData)
reqData.MocId = 1
fileName := "用户短链列表" + time.Now().Format("20060102") fileName := "用户短链列表" + time.Now().Format("20060102")
//region := []string{"广东", "福建", "江西", "安徽", "广西", "新疆", "天津", "山西", "贵州", "吉林", "北京", "上海", "黑龙江"} //region := []string{"广东", "福建", "江西", "安徽", "广西", "新疆", "天津", "山西", "贵州", "吉林", "北京", "上海", "黑龙江"}
regionIn := "'广东','福建','江西','安徽','广西','新疆','天津','山西','贵州','吉林','北京','上海','黑龙江'" //regionIn := "'湖北'"
f := excelize.NewFile() f := excelize.NewFile()
...@@ -46,8 +45,9 @@ func ExportMsgExcel(c *gin.Context) { ...@@ -46,8 +45,9 @@ func ExportMsgExcel(c *gin.Context) {
//for _, v := range region { //for _, v := range region {
req := request.GetCustomerUserListReq{} req := request.GetCustomerUserListReq{}
req.RegionIn = regionIn req.RegionIn = reqData.RegionIn
//req.UserType = 2 req.UserType = reqData.UserType
req.UserTypeIn = reqData.UserTypeIn
req.PageSize = 99999 req.PageSize = 99999
...@@ -71,7 +71,7 @@ func ExportMsgExcel(c *gin.Context) { ...@@ -71,7 +71,7 @@ func ExportMsgExcel(c *gin.Context) {
url := "" url := ""
code, ok := codeList[v.Id] code, ok := codeList[v.Id]
if ok == true { if ok == true {
url = global.GVA_CONFIG.Common.Url + "/" + code url = "dt.bk-pet.cn/" + code
} else { } else {
url = global.GVA_CONFIG.Common.Url + "/" + service.GetVcode(v.Id, req.MocId) url = global.GVA_CONFIG.Common.Url + "/" + service.GetVcode(v.Id, req.MocId)
} }
......
...@@ -137,25 +137,28 @@ func ExportSurveyUserExcel(c *gin.Context) { ...@@ -137,25 +137,28 @@ func ExportSurveyUserExcel(c *gin.Context) {
f.SetCellValue(fileName, "A2", "联系人") f.SetCellValue(fileName, "A2", "联系人")
f.SetCellValue(fileName, "B2", "联系电话") f.SetCellValue(fileName, "B2", "联系电话")
f.SetCellValue(fileName, "C2", "留资时间") f.SetCellValue(fileName, "C2", "省")
f.SetCellValue(fileName, "D2", "留资选配产品") f.SetCellValue(fileName, "D2", "市")
f.SetCellValue(fileName, "E2", "备注") f.SetCellValue(fileName, "E2", "区")
f.SetCellValue(fileName, "F2", "电话沟通") f.SetCellValue(fileName, "F2", "留资时间")
f.SetCellValue(fileName, "G2", "沟通日期") f.SetCellValue(fileName, "G2", "留资选配产品")
f.SetCellValue(fileName, "H2", "医院名称") f.SetCellValue(fileName, "H2", "备注")
f.SetCellValue(fileName, "I2", "医院状态") f.SetCellValue(fileName, "I2", "电话沟通")
f.SetCellValue(fileName, "J2", "开业时间") f.SetCellValue(fileName, "J2", "沟通日期")
f.SetCellValue(fileName, "K2", "所属省份") f.SetCellValue(fileName, "K2", "医院名称")
f.SetCellValue(fileName, "L2", "签单状态") f.SetCellValue(fileName, "L2", "医院状态")
f.SetCellValue(fileName, "M2", "转介绍渠道状态") f.SetCellValue(fileName, "M2", "开业时间")
f.SetCellValue(fileName, "N2", "签约金额") f.SetCellValue(fileName, "N2", "所属省份")
f.SetCellValue(fileName, "O2", "签约选配产品") f.SetCellValue(fileName, "O2", "签单状态")
f.SetCellValue(fileName, "P2", "电销人员") f.SetCellValue(fileName, "P2", "转介绍渠道状态")
f.SetCellValue(fileName, "Q2", "转介绍人") f.SetCellValue(fileName, "Q2", "签约金额")
f.SetCellValue(fileName, "R2", "转介绍人电话") f.SetCellValue(fileName, "R2", "签约选配产品")
f.SetCellValue(fileName, "S2", "渠道类型") f.SetCellValue(fileName, "S2", "电销人员")
f.SetCellValue(fileName, "T2", "渠道") f.SetCellValue(fileName, "T2", "转介绍人")
f.SetCellValue(fileName, "U2", "渠道链接") f.SetCellValue(fileName, "U2", "转介绍人电话")
f.SetCellValue(fileName, "V2", "渠道类型")
f.SetCellValue(fileName, "W2", "渠道")
f.SetCellValue(fileName, "X2", "渠道链接")
for k, v := range list { for k, v := range list {
...@@ -166,16 +169,26 @@ func ExportSurveyUserExcel(c *gin.Context) { ...@@ -166,16 +169,26 @@ func ExportSurveyUserExcel(c *gin.Context) {
optionData += v2.OptionValue + " * " + strconv.Itoa(v2.OptionNum) + "; " optionData += v2.OptionValue + " * " + strconv.Itoa(v2.OptionNum) + "; "
} }
region := v.CRegion
if region == "" {
region = v.Region
}
city := v.CCity
if city == "" {
city = v.City
}
url := global.GVA_CONFIG.Common.Url + "?" + v.Vcode url := global.GVA_CONFIG.Common.Url + "?" + v.Vcode
a := strconv.Itoa(k + 3) a := strconv.Itoa(k + 3)
f.SetCellValue(fileName, "A"+a, v.Contacts) f.SetCellValue(fileName, "A"+a, v.Contacts)
f.SetCellValue(fileName, "B"+a, v.ContactsMobile) f.SetCellValue(fileName, "B"+a, v.ContactsMobile)
f.SetCellValue(fileName, "C"+a, v.CreateTime) f.SetCellValue(fileName, "C"+a, region)
f.SetCellValue(fileName, "D"+a, optionData) f.SetCellValue(fileName, "D"+a, city)
f.SetCellValue(fileName, "E"+a, "") f.SetCellValue(fileName, "E"+a, v.CZone)
f.SetCellValue(fileName, "F"+a, "") f.SetCellValue(fileName, "F"+a, v.CreateTime)
f.SetCellValue(fileName, "G"+a, "") f.SetCellValue(fileName, "G"+a, optionData)
f.SetCellValue(fileName, "H"+a, "") f.SetCellValue(fileName, "H"+a, "")
f.SetCellValue(fileName, "I"+a, "") f.SetCellValue(fileName, "I"+a, "")
f.SetCellValue(fileName, "J"+a, "") f.SetCellValue(fileName, "J"+a, "")
...@@ -185,11 +198,14 @@ func ExportSurveyUserExcel(c *gin.Context) { ...@@ -185,11 +198,14 @@ func ExportSurveyUserExcel(c *gin.Context) {
f.SetCellValue(fileName, "N"+a, "") f.SetCellValue(fileName, "N"+a, "")
f.SetCellValue(fileName, "O"+a, "") f.SetCellValue(fileName, "O"+a, "")
f.SetCellValue(fileName, "P"+a, "") f.SetCellValue(fileName, "P"+a, "")
f.SetCellValue(fileName, "Q"+a, v.Reference) f.SetCellValue(fileName, "Q"+a, "")
f.SetCellValue(fileName, "R"+a, v.ReferenceMobile) f.SetCellValue(fileName, "R"+a, "")
f.SetCellValue(fileName, "S"+a, mocData[v.MocId]) f.SetCellValue(fileName, "S"+a, "")
f.SetCellValue(fileName, "T"+a, "短信") f.SetCellValue(fileName, "T"+a, v.Reference)
f.SetCellValue(fileName, "U"+a, url) f.SetCellValue(fileName, "U"+a, v.ReferenceMobile)
f.SetCellValue(fileName, "V"+a, mocData[v.MocId])
f.SetCellValue(fileName, "W"+a, "短信")
f.SetCellValue(fileName, "X"+a, url)
} }
// Set active sheet of the workbook. // Set active sheet of the workbook.
......
...@@ -2,21 +2,22 @@ package request ...@@ -2,21 +2,22 @@ package request
type GetCustomerUserListReq struct { type GetCustomerUserListReq struct {
PageInfo PageInfo
MocId int `gorm:"type:int(255)" json:"moc_id"` MocId int `gorm:"type:int(255)" json:"moc_id" form:"moc_id"`
UserName string `gorm:"type:string(255)" json:"user_name"` UserName string `gorm:"type:string(255)" json:"user_name" form:"user_name"`
Region string `gorm:"type:string(255)" json:"region"` Region string `gorm:"type:string(255)" json:"region" form:"region"`
RegionIn string `gorm:"type:string(255)" json:"region_in"` RegionIn string `gorm:"type:string(255)" json:"region_in" form:"region_in"`
City string `gorm:"type:string(255)" json:"city"` City string `gorm:"type:string(255)" json:"city"`
Zone string `gorm:"type:string(255)" json:"zone"` Zone string `gorm:"type:string(255)" json:"zone"`
Address string `gorm:"type:string(255)" json:"address"` Address string `gorm:"type:string(255)" json:"address"`
Contacts string `gorm:"type:string(255)" json:"contacts"` Contacts string `gorm:"type:string(255)" json:"contacts" form:"contacts"`
ContactsMobile string `gorm:"type:string(255)" json:"contacts_mobile"` ContactsMobile string `gorm:"type:string(255)" json:"contacts_mobile" form:"contacts_mobile"`
WorkerPosition string `gorm:"type:string(255)" json:"worker_position"` WorkerPosition string `gorm:"type:string(255)" json:"worker_position" form:"worker_position"`
WorkerName string `gorm:"type:string(255)" json:"worker_name"` WorkerName string `gorm:"type:string(255)" json:"worker_name" form:"worker_name"`
WorkerMobile string `gorm:"type:string(255)" json:"worker_mobile"` WorkerMobile string `gorm:"type:string(255)" json:"worker_mobile" form:"worker_mobile"`
UserSource string `gorm:"type:string(255)" json:"user_source"` UserSource string `gorm:"type:string(255)" json:"user_source"`
UserType int `gorm:"type:int(255)" json:"user_type"` UserType int `gorm:"type:int(255)" json:"user_type" form:"user_type"`
CreateTime string `gorm:"type:string(255)" json:"create_time"` UserTypeIn string `gorm:"type:int(255)" json:"user_type_in" form:"user_type_in"`
CreateTime string `gorm:"type:string(255)" json:"create_time" form:"create_time"`
} }
type GetCustomerUserListReply struct { type GetCustomerUserListReply struct {
......
...@@ -53,6 +53,11 @@ type GetSurveyUserList struct { ...@@ -53,6 +53,11 @@ type GetSurveyUserList struct {
CreateTime string `gorm:"type:string(255)" json:"create_time"` CreateTime string `gorm:"type:string(255)" json:"create_time"`
Vcode string `gorm:"type:string(255)" json:"vcode"` Vcode string `gorm:"type:string(255)" json:"vcode"`
Status int `gorm:"type:int(255)" json:"status"` Status int `gorm:"type:int(255)" json:"status"`
Region string `gorm:"type:string(255)" json:"region"`
City string `gorm:"type:string(255)" json:"city"`
CRegion string `gorm:"type:string(255)" json:"c_region"`
CCity string `gorm:"type:string(255)" json:"c_city"`
CZone string `gorm:"type:string(255)" json:"c_zone"`
} }
type GetSurveyLogListReq struct { type GetSurveyLogListReq struct {
......
...@@ -33,6 +33,10 @@ func GetCustomerUserList(req request.GetCustomerUserListReq) (error, []request.G ...@@ -33,6 +33,10 @@ func GetCustomerUserList(req request.GetCustomerUserListReq) (error, []request.G
conditions += " AND user_type = " + strconv.Itoa(req.UserType) conditions += " AND user_type = " + strconv.Itoa(req.UserType)
} }
if req.UserTypeIn != "" {
conditions += " AND user_type in (" + req.UserTypeIn + ")"
}
if req.UserName != "" { if req.UserName != "" {
conditions += " AND user_name like '%" + req.UserName + "%'" conditions += " AND user_name like '%" + req.UserName + "%'"
} }
......
...@@ -47,7 +47,7 @@ func GetSurveyUserList(req request.GetSurveyUserListReq) (error, []request.GetSu ...@@ -47,7 +47,7 @@ func GetSurveyUserList(req request.GetSurveyUserListReq) (error, []request.GetSu
field := " sur.id, sur.user_id, sur.moc_id, sur.code_mobile, sur.code, sur.contacts, sur.contacts_mobile" + field := " sur.id, sur.user_id, sur.moc_id, sur.code_mobile, sur.code, sur.contacts, sur.contacts_mobile" +
", sur.reference, sur.reference_mobile, sur.create_time" + ", sur.reference, sur.reference_mobile, sur.create_time" +
", sur.country, sur.area, sur.region, sur.city" + ", sur.country, sur.area, sur.region, sur.city" +
", cu.worker_name, cu.worker_mobile " + ", cu.worker_name, cu.worker_mobile, cu.region as c_region, cu.city as c_city, cu.zone as c_zone " +
", vc.code as vcode " ", vc.code as vcode "
conditions := "" conditions := ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment