Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dt_analysis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoyanbin
dt_analysis
Commits
483a36aa
Commit
483a36aa
authored
Sep 11, 2023
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
44a625ac
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
46 deletions
+72
-46
customer_user.go
api/mobile/customer_user.go
+5
-5
survey.go
api/mobile/survey.go
+45
-29
customer_user.go
model/request/customer_user.go
+12
-11
survey.go
model/request/survey.go
+5
-0
customer_user.go
service/customer_user.go
+4
-0
survey.go
service/survey.go
+1
-1
No files found.
api/mobile/customer_user.go
View file @
483a36aa
...
...
@@ -33,12 +33,11 @@ func GetCustomerUserList(c *gin.Context) {
func
ExportMsgExcel
(
c
*
gin
.
Context
)
{
reqData
:=
request
.
GetCustomerUserListReq
{}
_
=
c
.
ShouldBindQuery
(
&
reqData
)
reqData
.
MocId
=
1
fileName
:=
"用户短链列表"
+
time
.
Now
()
.
Format
(
"20060102"
)
//region := []string{"广东", "福建", "江西", "安徽", "广西", "新疆", "天津", "山西", "贵州", "吉林", "北京", "上海", "黑龙江"}
regionIn
:=
"'广东','福建','江西','安徽','广西','新疆','天津','山西','贵州','吉林','北京','上海','黑龙江
'"
//regionIn := "'湖北
'"
f
:=
excelize
.
NewFile
()
...
...
@@ -46,8 +45,9 @@ func ExportMsgExcel(c *gin.Context) {
//for _, v := range region {
req
:=
request
.
GetCustomerUserListReq
{}
req
.
RegionIn
=
regionIn
//req.UserType = 2
req
.
RegionIn
=
reqData
.
RegionIn
req
.
UserType
=
reqData
.
UserType
req
.
UserTypeIn
=
reqData
.
UserTypeIn
req
.
PageSize
=
99999
...
...
@@ -71,7 +71,7 @@ func ExportMsgExcel(c *gin.Context) {
url
:=
""
code
,
ok
:=
codeList
[
v
.
Id
]
if
ok
==
true
{
url
=
global
.
GVA_CONFIG
.
Common
.
Url
+
"
/"
+
code
url
=
"dt.bk-pet.cn
/"
+
code
}
else
{
url
=
global
.
GVA_CONFIG
.
Common
.
Url
+
"/"
+
service
.
GetVcode
(
v
.
Id
,
req
.
MocId
)
}
...
...
api/mobile/survey.go
View file @
483a36aa
...
...
@@ -137,25 +137,28 @@ func ExportSurveyUserExcel(c *gin.Context) {
f
.
SetCellValue
(
fileName
,
"A2"
,
"联系人"
)
f
.
SetCellValue
(
fileName
,
"B2"
,
"联系电话"
)
f
.
SetCellValue
(
fileName
,
"C2"
,
"留资时间"
)
f
.
SetCellValue
(
fileName
,
"D2"
,
"留资选配产品"
)
f
.
SetCellValue
(
fileName
,
"E2"
,
"备注"
)
f
.
SetCellValue
(
fileName
,
"F2"
,
"电话沟通"
)
f
.
SetCellValue
(
fileName
,
"G2"
,
"沟通日期"
)
f
.
SetCellValue
(
fileName
,
"H2"
,
"医院名称"
)
f
.
SetCellValue
(
fileName
,
"I2"
,
"医院状态"
)
f
.
SetCellValue
(
fileName
,
"J2"
,
"开业时间"
)
f
.
SetCellValue
(
fileName
,
"K2"
,
"所属省份"
)
f
.
SetCellValue
(
fileName
,
"L2"
,
"签单状态"
)
f
.
SetCellValue
(
fileName
,
"M2"
,
"转介绍渠道状态"
)
f
.
SetCellValue
(
fileName
,
"N2"
,
"签约金额"
)
f
.
SetCellValue
(
fileName
,
"O2"
,
"签约选配产品"
)
f
.
SetCellValue
(
fileName
,
"P2"
,
"电销人员"
)
f
.
SetCellValue
(
fileName
,
"Q2"
,
"转介绍人"
)
f
.
SetCellValue
(
fileName
,
"R2"
,
"转介绍人电话"
)
f
.
SetCellValue
(
fileName
,
"S2"
,
"渠道类型"
)
f
.
SetCellValue
(
fileName
,
"T2"
,
"渠道"
)
f
.
SetCellValue
(
fileName
,
"U2"
,
"渠道链接"
)
f
.
SetCellValue
(
fileName
,
"C2"
,
"省"
)
f
.
SetCellValue
(
fileName
,
"D2"
,
"市"
)
f
.
SetCellValue
(
fileName
,
"E2"
,
"区"
)
f
.
SetCellValue
(
fileName
,
"F2"
,
"留资时间"
)
f
.
SetCellValue
(
fileName
,
"G2"
,
"留资选配产品"
)
f
.
SetCellValue
(
fileName
,
"H2"
,
"备注"
)
f
.
SetCellValue
(
fileName
,
"I2"
,
"电话沟通"
)
f
.
SetCellValue
(
fileName
,
"J2"
,
"沟通日期"
)
f
.
SetCellValue
(
fileName
,
"K2"
,
"医院名称"
)
f
.
SetCellValue
(
fileName
,
"L2"
,
"医院状态"
)
f
.
SetCellValue
(
fileName
,
"M2"
,
"开业时间"
)
f
.
SetCellValue
(
fileName
,
"N2"
,
"所属省份"
)
f
.
SetCellValue
(
fileName
,
"O2"
,
"签单状态"
)
f
.
SetCellValue
(
fileName
,
"P2"
,
"转介绍渠道状态"
)
f
.
SetCellValue
(
fileName
,
"Q2"
,
"签约金额"
)
f
.
SetCellValue
(
fileName
,
"R2"
,
"签约选配产品"
)
f
.
SetCellValue
(
fileName
,
"S2"
,
"电销人员"
)
f
.
SetCellValue
(
fileName
,
"T2"
,
"转介绍人"
)
f
.
SetCellValue
(
fileName
,
"U2"
,
"转介绍人电话"
)
f
.
SetCellValue
(
fileName
,
"V2"
,
"渠道类型"
)
f
.
SetCellValue
(
fileName
,
"W2"
,
"渠道"
)
f
.
SetCellValue
(
fileName
,
"X2"
,
"渠道链接"
)
for
k
,
v
:=
range
list
{
...
...
@@ -166,16 +169,26 @@ func ExportSurveyUserExcel(c *gin.Context) {
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
a
:=
strconv
.
Itoa
(
k
+
3
)
f
.
SetCellValue
(
fileName
,
"A"
+
a
,
v
.
Contacts
)
f
.
SetCellValue
(
fileName
,
"B"
+
a
,
v
.
ContactsMobile
)
f
.
SetCellValue
(
fileName
,
"C"
+
a
,
v
.
CreateTime
)
f
.
SetCellValue
(
fileName
,
"D"
+
a
,
optionData
)
f
.
SetCellValue
(
fileName
,
"E"
+
a
,
""
)
f
.
SetCellValue
(
fileName
,
"F"
+
a
,
""
)
f
.
SetCellValue
(
fileName
,
"G"
+
a
,
""
)
f
.
SetCellValue
(
fileName
,
"C"
+
a
,
region
)
f
.
SetCellValue
(
fileName
,
"D"
+
a
,
city
)
f
.
SetCellValue
(
fileName
,
"E"
+
a
,
v
.
CZone
)
f
.
SetCellValue
(
fileName
,
"F"
+
a
,
v
.
CreateTime
)
f
.
SetCellValue
(
fileName
,
"G"
+
a
,
optionData
)
f
.
SetCellValue
(
fileName
,
"H"
+
a
,
""
)
f
.
SetCellValue
(
fileName
,
"I"
+
a
,
""
)
f
.
SetCellValue
(
fileName
,
"J"
+
a
,
""
)
...
...
@@ -185,11 +198,14 @@ func ExportSurveyUserExcel(c *gin.Context) {
f
.
SetCellValue
(
fileName
,
"N"
+
a
,
""
)
f
.
SetCellValue
(
fileName
,
"O"
+
a
,
""
)
f
.
SetCellValue
(
fileName
,
"P"
+
a
,
""
)
f
.
SetCellValue
(
fileName
,
"Q"
+
a
,
v
.
Reference
)
f
.
SetCellValue
(
fileName
,
"R"
+
a
,
v
.
ReferenceMobile
)
f
.
SetCellValue
(
fileName
,
"S"
+
a
,
mocData
[
v
.
MocId
])
f
.
SetCellValue
(
fileName
,
"T"
+
a
,
"短信"
)
f
.
SetCellValue
(
fileName
,
"U"
+
a
,
url
)
f
.
SetCellValue
(
fileName
,
"Q"
+
a
,
""
)
f
.
SetCellValue
(
fileName
,
"R"
+
a
,
""
)
f
.
SetCellValue
(
fileName
,
"S"
+
a
,
""
)
f
.
SetCellValue
(
fileName
,
"T"
+
a
,
v
.
Reference
)
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.
...
...
model/request/customer_user.go
View file @
483a36aa
...
...
@@ -2,21 +2,22 @@ package request
type
GetCustomerUserListReq
struct
{
PageInfo
MocId
int
`gorm:"type:int(255)" json:"moc_id"`
UserName
string
`gorm:"type:string(255)" json:"user_name"`
Region
string
`gorm:"type:string(255)" json:"region"`
RegionIn
string
`gorm:"type:string(255)" json:"region_in"`
MocId
int
`gorm:"type:int(255)" json:"moc_id"
form:"moc_id"
`
UserName
string
`gorm:"type:string(255)" json:"user_name"
form:"user_name"
`
Region
string
`gorm:"type:string(255)" json:"region"
form:"region"
`
RegionIn
string
`gorm:"type:string(255)" json:"region_in"
form:"region_in"
`
City
string
`gorm:"type:string(255)" json:"city"`
Zone
string
`gorm:"type:string(255)" json:"zone"`
Address
string
`gorm:"type:string(255)" json:"address"`
Contacts
string
`gorm:"type:string(255)" json:"contacts"`
ContactsMobile
string
`gorm:"type:string(255)" json:"contacts_mobile"`
WorkerPosition
string
`gorm:"type:string(255)" json:"worker_position"`
WorkerName
string
`gorm:"type:string(255)" json:"worker_name"`
WorkerMobile
string
`gorm:"type:string(255)" json:"worker_mobile"`
Contacts
string
`gorm:"type:string(255)" json:"contacts"
form:"contacts"
`
ContactsMobile
string
`gorm:"type:string(255)" json:"contacts_mobile"
form:"contacts_mobile"
`
WorkerPosition
string
`gorm:"type:string(255)" json:"worker_position"
form:"worker_position"
`
WorkerName
string
`gorm:"type:string(255)" json:"worker_name"
form:"worker_name"
`
WorkerMobile
string
`gorm:"type:string(255)" json:"worker_mobile"
form:"worker_mobile"
`
UserSource
string
`gorm:"type:string(255)" json:"user_source"`
UserType
int
`gorm:"type:int(255)" json:"user_type"`
CreateTime
string
`gorm:"type:string(255)" json:"create_time"`
UserType
int
`gorm:"type:int(255)" json:"user_type" form:"user_type"`
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
{
...
...
model/request/survey.go
View file @
483a36aa
...
...
@@ -53,6 +53,11 @@ type GetSurveyUserList struct {
CreateTime
string
`gorm:"type:string(255)" json:"create_time"`
Vcode
string
`gorm:"type:string(255)" json:"vcode"`
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
{
...
...
service/customer_user.go
View file @
483a36aa
...
...
@@ -33,6 +33,10 @@ func GetCustomerUserList(req request.GetCustomerUserListReq) (error, []request.G
conditions
+=
" AND user_type = "
+
strconv
.
Itoa
(
req
.
UserType
)
}
if
req
.
UserTypeIn
!=
""
{
conditions
+=
" AND user_type in ("
+
req
.
UserTypeIn
+
")"
}
if
req
.
UserName
!=
""
{
conditions
+=
" AND user_name like '%"
+
req
.
UserName
+
"%'"
}
...
...
service/survey.go
View file @
483a36aa
...
...
@@ -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"
+
", sur.reference, sur.reference_mobile, sur.create_time"
+
", 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 "
conditions
:=
""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment