Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
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
haoban3.0
haoban-manage3.0
Commits
dfd1df1c
Commit
dfd1df1c
authored
Sep 09, 2021
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor:删除无效代码
parent
5564a1ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
189 additions
and
198 deletions
+189
-198
MaidianDataController.java
...c/haoban/manage/web/controller/MaidianDataController.java
+189
-198
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/MaidianDataController.java
View file @
dfd1df1c
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.gic.cloud.common.api.base.Page
;
import
com.gic.cloud.common.api.base.Page
;
import
com.gic.cloud.data.api.dto.AdsGicLogHaobanStoreIntervalLoginDDTO
;
import
com.gic.cloud.data.api.dto.*
;
import
com.gic.cloud.data.api.dto.AdsGicLogHaobanStoreLoginDDTO
;
import
com.gic.cloud.data.api.dto.AreaLoginDTO
;
import
com.gic.cloud.data.api.dto.HaobanClerkLoginDTO
;
import
com.gic.cloud.data.api.dto.HaobanLoginInfoDTO
;
import
com.gic.cloud.data.api.dto.MemberAnalyzeParamsDTO
;
import
com.gic.cloud.data.api.service.MaidianDataService
;
import
com.gic.cloud.data.api.service.MaidianDataService
;
import
com.gic.cloud.web.service.api.dto.CloudStoreGroupDTO
;
import
com.gic.cloud.web.service.api.dto.CloudStoreGroupDTO
;
import
com.gic.cloud.web.service.api.service.CloudStoreGroupService
;
import
com.gic.cloud.web.service.api.service.CloudStoreGroupService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.common.utils.ExcelUtils
;
import
com.gic.haoban.common.utils.ExcelUtils
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
@RestController
@RestController
@RequestMapping
(
"web"
)
@RequestMapping
(
"web"
)
public
class
MaidianDataController
extends
WebBaseController
{
public
class
MaidianDataController
extends
WebBaseController
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
MaidianDataController
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
MaidianDataController
.
class
);
@Autowired
@Autowired
private
MaidianDataService
maidianDataService
;
private
MaidianDataService
maidianDataService
;
@Autowired
@Autowired
private
CloudStoreGroupService
cloudStoreGroupService
;
private
CloudStoreGroupService
cloudStoreGroupService
;
@Autowired
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
//首页-分组列表
//首页-分组列表
@RequestMapping
(
"/use-haoban3-service"
)
@RequestMapping
(
"/use-haoban3-service"
)
public
HaobanResponse
useHaoban3Service
(
String
wxEnterpriseId
)
{
public
HaobanResponse
useHaoban3Service
(
String
wxEnterpriseId
)
{
Object
o
=
RedisUtil
.
getCache
(
"usesMaidianWxEnterpriseId"
);
Object
o
=
RedisUtil
.
getCache
(
"usesMaidianWxEnterpriseId"
);
boolean
b
=
false
;
boolean
b
=
false
;
if
(
o
==
null
){
if
(
o
!=
null
)
{
}
else
{
String
wxEnterpriseIds
=
o
.
toString
();
String
wxEnterpriseIds
=
o
.
toString
();
if
(
wxEnterpriseIds
.
contains
(
wxEnterpriseId
)
||
"-1"
.
equals
(
wxEnterpriseIds
))
{
if
(
wxEnterpriseIds
.
contains
(
wxEnterpriseId
)||
"-1"
.
equals
(
wxEnterpriseIds
)){
b
=
true
;
b
=
true
;
}
}
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
b
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
b
);
}
}
//首页-分组列表
//首页-分组列表
@RequestMapping
(
"/cloud-grouplist-pid"
)
@RequestMapping
(
"/cloud-grouplist-pid"
)
public
HaobanResponse
cloudGrouplistPid
(
String
enterpriseId
)
{
public
HaobanResponse
cloudGrouplistPid
(
String
enterpriseId
)
{
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
List
<
CloudStoreGroupDTO
>
list
=
cloudStoreGroupService
.
queryAllStoreGroupByStoreGroupId
(
enterpriseId
);
List
<
CloudStoreGroupDTO
>
list
=
cloudStoreGroupService
.
queryAllStoreGroupByStoreGroupId
(
enterpriseId
);
if
(
CollectionUtil
.
isEmpty
(
list
))
{
if
(
CollectionUtil
.
isEmpty
(
list
))
{
list
=
new
ArrayList
<>();
list
=
new
ArrayList
<>();
}
}
returnMap
.
put
(
"list"
,
list
);
returnMap
.
put
(
"list"
,
list
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
}
}
//首页-企业概况
//首页-企业概况
@RequestMapping
(
"/total-activation-data"
)
@RequestMapping
(
"/total-activation-data"
)
public
HaobanResponse
totalActivationData
(
MemberAnalyzeParamsDTO
paramsDTO
)
{
public
HaobanResponse
totalActivationData
(
MemberAnalyzeParamsDTO
paramsDTO
)
{
paramsDTO
.
setWebFlag
(
1
);
paramsDTO
.
setWebFlag
(
1
);
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
AdsGicLogHaobanStoreLoginDDTO
dto
=
maidianDataService
.
totalActivationData
(
paramsDTO
);
AdsGicLogHaobanStoreLoginDDTO
dto
=
maidianDataService
.
totalActivationData
(
paramsDTO
);
if
(
dto
==
null
)
{
if
(
dto
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
}
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
paramsDTO
.
setStartDate
(
sdf
.
format
(
new
Date
()));
paramsDTO
.
setStartDate
(
sdf
.
format
(
new
Date
()));
AdsGicLogHaobanStoreLoginDDTO
today
=
maidianDataService
.
totalActivationData
(
paramsDTO
);
AdsGicLogHaobanStoreLoginDDTO
today
=
maidianDataService
.
totalActivationData
(
paramsDTO
);
if
(
today
==
null
)
{
if
(
today
==
null
)
{
today
=
new
AdsGicLogHaobanStoreLoginDDTO
();
today
=
new
AdsGicLogHaobanStoreLoginDDTO
();
}
}
returnMap
.
put
(
"loginClerkCnt"
,
dto
.
getLoginClerkCnt
())
;
returnMap
.
put
(
"loginClerkCnt"
,
dto
.
getLoginClerkCnt
());
returnMap
.
put
(
"activeClerkCnt"
,
dto
.
getActiveClerkCnt
())
;
returnMap
.
put
(
"activeClerkCnt"
,
dto
.
getActiveClerkCnt
());
returnMap
.
put
(
"loginClerkTimes"
,
dto
.
getLoginClerkTimes
())
;
returnMap
.
put
(
"loginClerkTimes"
,
dto
.
getLoginClerkTimes
());
returnMap
.
put
(
"notActiveClerkCnt"
,
dto
.
getNotActiveClerkCnt
())
;
returnMap
.
put
(
"notActiveClerkCnt"
,
dto
.
getNotActiveClerkCnt
());
returnMap
.
put
(
"totalClerkCnt"
,
dto
.
getTotalClerkCnt
())
;
returnMap
.
put
(
"totalClerkCnt"
,
dto
.
getTotalClerkCnt
());
returnMap
.
put
(
"notLoginClerkCnt"
,
dto
.
getNotLoginClerkCnt
())
;
returnMap
.
put
(
"notLoginClerkCnt"
,
dto
.
getNotLoginClerkCnt
());
if
(
dto
.
getLoginClerkCnt
()
==
null
||
dto
.
getLoginClerkCnt
()==
0
)
{
if
(
dto
.
getLoginClerkCnt
()
==
null
||
dto
.
getLoginClerkCnt
()
==
0
)
{
returnMap
.
put
(
"avgLoginTimes"
,
0
)
;
returnMap
.
put
(
"avgLoginTimes"
,
0
)
;
returnMap
.
put
(
"avgVisitTime"
,
0
)
;
returnMap
.
put
(
"avgVisitTime"
,
0
)
;
}
else
{
}
else
{
returnMap
.
put
(
"avgLoginTimes"
,
dto
.
getLoginClerkTimes
()
/
dto
.
getLoginClerkCnt
())
;
returnMap
.
put
(
"avgLoginTimes"
,
dto
.
getLoginClerkTimes
()
/
dto
.
getLoginClerkCnt
())
;
returnMap
.
put
(
"avgVisitTime"
,
dto
.
getStayTime
()
/
dto
.
getLoginClerkCnt
())
;
returnMap
.
put
(
"avgVisitTime"
,
dto
.
getStayTime
()
/
dto
.
getLoginClerkCnt
())
;
}
}
returnMap
.
put
(
"toDayLoginClerkCnt"
,
today
.
getLoginClerkCnt
())
;
returnMap
.
put
(
"toDayLoginClerkCnt"
,
today
.
getLoginClerkCnt
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
}
}
//首页-好办登陆信息总人数概况
//首页-好办登陆信息总人数概况
@RequestMapping
(
"/total-login-data"
)
@RequestMapping
(
"/total-login-data"
)
public
HaobanResponse
totalLoginData
(
MemberAnalyzeParamsDTO
paramsDTO
,
int
datesType
)
{
public
HaobanResponse
totalLoginData
(
MemberAnalyzeParamsDTO
paramsDTO
,
int
datesType
)
{
paramsDTO
.
setWebFlag
(
1
);
paramsDTO
.
setWebFlag
(
1
);
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
List
<
HaobanLoginInfoDTO
>
resultList
=
new
ArrayList
<
HaobanLoginInfoDTO
>();
List
<
HaobanLoginInfoDTO
>
resultList
=
new
ArrayList
<
HaobanLoginInfoDTO
>();
if
(
datesType
==
1
)
{
if
(
datesType
==
1
)
{
//近7日
//近7日
List
<
AdsGicLogHaobanStoreLoginDDTO
>
list
=
maidianDataService
.
totalLoginData
(
paramsDTO
);
List
<
AdsGicLogHaobanStoreLoginDDTO
>
list
=
maidianDataService
.
totalLoginData
(
paramsDTO
);
resultList
=
EntityUtil
.
changeEntityListByJSON
(
HaobanLoginInfoDTO
.
class
,
list
);
resultList
=
EntityUtil
.
changeEntityListByJSON
(
HaobanLoginInfoDTO
.
class
,
list
);
}
else
{
}
else
{
//当日
//当日
List
<
AdsGicLogHaobanStoreIntervalLoginDDTO
>
list
=
maidianDataService
.
totalLoginInternalData
(
paramsDTO
);
List
<
AdsGicLogHaobanStoreIntervalLoginDDTO
>
list
=
maidianDataService
.
totalLoginInternalData
(
paramsDTO
);
resultList
=
EntityUtil
.
changeEntityListByJSON
(
HaobanLoginInfoDTO
.
class
,
list
);
resultList
=
EntityUtil
.
changeEntityListByJSON
(
HaobanLoginInfoDTO
.
class
,
list
);
}
}
for
(
HaobanLoginInfoDTO
dto
:
resultList
)
{
for
(
HaobanLoginInfoDTO
dto
:
resultList
)
{
if
(
dto
.
getLoginClerkCnt
()
==
0
)
{
if
(
dto
.
getLoginClerkCnt
()
==
0
)
{
dto
.
setAvgVisitTime
(
"0"
);
dto
.
setAvgVisitTime
(
"0"
);
dto
.
setAvgLoginTimes
(
"0"
);
dto
.
setAvgLoginTimes
(
"0"
);
}
else
{
}
else
{
dto
.
setAvgVisitTime
((
double
)
dto
.
getStayTime
()/
dto
.
getLoginClerkCnt
()+
""
);
dto
.
setAvgVisitTime
((
double
)
dto
.
getStayTime
()
/
dto
.
getLoginClerkCnt
()
+
""
);
dto
.
setAvgLoginTimes
(
dto
.
getLoginClerkTimes
()/
dto
.
getLoginClerkCnt
()+
""
);
dto
.
setAvgLoginTimes
(
dto
.
getLoginClerkTimes
()
/
dto
.
getLoginClerkCnt
()
+
""
);
}
}
}
}
if
(
CollectionUtil
.
isEmpty
(
resultList
))
{
if
(
CollectionUtil
.
isEmpty
(
resultList
))
{
resultList
=
new
ArrayList
<>();
resultList
=
new
ArrayList
<>();
}
}
returnMap
.
put
(
"result"
,
resultList
)
;
returnMap
.
put
(
"result"
,
resultList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
}
}
//首页-区域排行
//首页-区域排行
@RequestMapping
(
"/area-login-ranking"
)
@RequestMapping
(
"/area-login-ranking"
)
public
HaobanResponse
areaLoginRanking
(
MemberAnalyzeParamsDTO
paramsDTO
)
{
public
HaobanResponse
areaLoginRanking
(
MemberAnalyzeParamsDTO
paramsDTO
)
{
paramsDTO
.
setWebFlag
(
1
);
paramsDTO
.
setWebFlag
(
1
);
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
List
<
AreaLoginDTO
>
list
=
maidianDataService
.
areaLoginRanking
(
paramsDTO
);
List
<
AreaLoginDTO
>
list
=
maidianDataService
.
areaLoginRanking
(
paramsDTO
);
if
(
CollectionUtil
.
isEmpty
(
list
))
{
if
(
CollectionUtil
.
isEmpty
(
list
))
{
list
=
new
ArrayList
<>();
list
=
new
ArrayList
<>();
}
}
returnMap
.
put
(
"result"
,
list
)
;
returnMap
.
put
(
"result"
,
list
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
}
}
//激活明细-激活趋势图
//激活明细-激活趋势图
@RequestMapping
(
"/activite-date"
)
@RequestMapping
(
"/activite-date"
)
public
HaobanResponse
activiteDate
(
MemberAnalyzeParamsDTO
paramsDTO
)
{
public
HaobanResponse
activiteDate
(
MemberAnalyzeParamsDTO
paramsDTO
)
{
paramsDTO
.
setWebFlag
(
1
);
paramsDTO
.
setWebFlag
(
1
);
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
List
<
HaobanLoginInfoDTO
>
resultList
=
new
ArrayList
<
HaobanLoginInfoDTO
>();
List
<
HaobanLoginInfoDTO
>
resultList
=
new
ArrayList
<
HaobanLoginInfoDTO
>();
//近7日
//近7日
List
<
AdsGicLogHaobanStoreLoginDDTO
>
list
=
maidianDataService
.
totalLoginData
(
paramsDTO
);
List
<
AdsGicLogHaobanStoreLoginDDTO
>
list
=
maidianDataService
.
totalLoginData
(
paramsDTO
);
resultList
=
EntityUtil
.
changeEntityListByJSON
(
HaobanLoginInfoDTO
.
class
,
list
);
resultList
=
EntityUtil
.
changeEntityListByJSON
(
HaobanLoginInfoDTO
.
class
,
list
);
if
(
CollectionUtil
.
isEmpty
(
resultList
))
{
if
(
CollectionUtil
.
isEmpty
(
resultList
))
{
resultList
=
new
ArrayList
<>();
resultList
=
new
ArrayList
<>();
}
}
returnMap
.
put
(
"result"
,
resultList
)
;
returnMap
.
put
(
"result"
,
resultList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
}
}
//激活明细-激活列表
//激活明细-激活列表
@RequestMapping
(
"/activite-list"
)
@RequestMapping
(
"/activite-list"
)
public
HaobanResponse
activiteList
(
MemberAnalyzeParamsDTO
paramsDTO
)
{
public
HaobanResponse
activiteList
(
MemberAnalyzeParamsDTO
paramsDTO
)
{
paramsDTO
.
setWebFlag
(
1
);
paramsDTO
.
setWebFlag
(
1
);
Page
<
HaobanClerkLoginDTO
>
page
=
maidianDataService
.
pageActiviteList
(
paramsDTO
);
Page
<
HaobanClerkLoginDTO
>
page
=
maidianDataService
.
pageActiviteList
(
paramsDTO
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
page
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
page
);
}
}
//导出-激活明细-激活列表
//导出-激活明细-激活列表
@RequestMapping
(
"/export-activite-list"
)
@RequestMapping
(
"/export-activite-list"
)
public
HaobanResponse
exportActiviteList
(
HttpServletRequest
request
,
HttpServletResponse
response
,
MemberAnalyzeParamsDTO
paramsDTO
)
{
public
HaobanResponse
exportActiviteList
(
HttpServletRequest
request
,
HttpServletResponse
response
,
MemberAnalyzeParamsDTO
paramsDTO
)
{
paramsDTO
.
setWebFlag
(
1
);
paramsDTO
.
setWebFlag
(
1
);
paramsDTO
.
setCurrentPage
(
1
);
paramsDTO
.
setCurrentPage
(
1
);
paramsDTO
.
setPageSize
(
Integer
.
MAX_VALUE
);
paramsDTO
.
setPageSize
(
Integer
.
MAX_VALUE
);
Page
<
HaobanClerkLoginDTO
>
page
=
maidianDataService
.
pageActiviteList
(
paramsDTO
);
Page
<
HaobanClerkLoginDTO
>
page
=
maidianDataService
.
pageActiviteList
(
paramsDTO
);
List
<
String
>
titleList
=
Arrays
.
asList
(
"导购姓名"
,
"导购代码"
,
"归属门店"
,
"最后登录时间"
,
"活跃状态"
);
List
<
String
>
titleList
=
Arrays
.
asList
(
"导购姓名"
,
"导购代码"
,
"归属门店"
,
"最后登录时间"
,
"活跃状态"
);
List
<
String
>
fileList
=
Arrays
.
asList
(
"clerkName"
,
"clerkCode"
,
"storeName"
,
"lastLoginTime"
,
"activationStatus"
);
List
<
String
>
fileList
=
Arrays
.
asList
(
"clerkName"
,
"clerkCode"
,
"storeName"
,
"lastLoginTime"
,
"activationStatus"
);
try
{
try
{
ExcelUtils
.
xls
(
response
,
request
,
"详情报表"
,
page
.
getList
(),
fileList
,
titleList
);
ExcelUtils
.
xls
(
response
,
request
,
"详情报表"
,
page
.
getList
(),
fileList
,
titleList
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
info
(
e
.
getMessage
(),
e
);
logger
.
info
(
e
.
getMessage
(),
e
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
//导出-登陆明细-明细列表
//导出-登陆明细-明细列表
@RequestMapping
(
"/export-login-detail-list"
)
@RequestMapping
(
"/export-login-detail-list"
)
public
HaobanResponse
exportLoginDetailList
(
HttpServletRequest
request
,
HttpServletResponse
response
,
MemberAnalyzeParamsDTO
paramsDTO
)
{
public
HaobanResponse
exportLoginDetailList
(
HttpServletRequest
request
,
HttpServletResponse
response
,
MemberAnalyzeParamsDTO
paramsDTO
)
{
paramsDTO
.
setWebFlag
(
1
);
paramsDTO
.
setWebFlag
(
1
);
//默认排序
//默认排序
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortColumn
()))
{
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortColumn
()))
{
paramsDTO
.
setSortColumn
(
"lastLoginTime"
);
paramsDTO
.
setSortColumn
(
"lastLoginTime"
);
}
}
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortType
()))
{
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortType
()))
{
paramsDTO
.
setSortType
(
"desc"
);
paramsDTO
.
setSortType
(
"desc"
);
}
}
paramsDTO
.
setCurrentPage
(
1
);
paramsDTO
.
setCurrentPage
(
1
);
paramsDTO
.
setPageSize
(
Integer
.
MAX_VALUE
);
paramsDTO
.
setPageSize
(
Integer
.
MAX_VALUE
);
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
Page
<
HaobanClerkLoginDTO
>
page
=
maidianDataService
.
pageClerkLogin
(
paramsDTO
);
Page
<
HaobanClerkLoginDTO
>
page
=
maidianDataService
.
pageClerkLogin
(
paramsDTO
);
if
(
paramsDTO
.
getLoginStatus
()
==
1
)
{
if
(
paramsDTO
.
getLoginStatus
()
==
1
)
{
//已登陆
//已登陆
try
{
try
{
List
<
String
>
titleList
=
Arrays
.
asList
(
"导购姓名"
,
"导购代码"
,
"归属门店"
,
"最后登录时间"
,
"登录次数"
,
"平均访问总时长"
);
List
<
String
>
titleList
=
Arrays
.
asList
(
"导购姓名"
,
"导购代码"
,
"归属门店"
,
"最后登录时间"
,
"登录次数"
,
"平均访问总时长"
);
List
<
String
>
fileList
=
Arrays
.
asList
(
"clerkName"
,
"clerkCode"
,
"storeName"
,
"lastLoginTime"
,
"loginTimes"
,
"avgVisitTimeString"
);
List
<
String
>
fileList
=
Arrays
.
asList
(
"clerkName"
,
"clerkCode"
,
"storeName"
,
"lastLoginTime"
,
"loginTimes"
,
"avgVisitTimeString"
);
ExcelUtils
.
xls
(
response
,
request
,
"详情报表"
,
page
.
getList
(),
fileList
,
titleList
);
ExcelUtils
.
xls
(
response
,
request
,
"详情报表"
,
page
.
getList
(),
fileList
,
titleList
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
info
(
e
.
getMessage
(),
e
);
logger
.
info
(
e
.
getMessage
(),
e
);
}
}
}
else
{
}
else
{
//未登陆
//未登陆
try
{
try
{
List
<
String
>
titleList
=
Arrays
.
asList
(
"导购姓名"
,
"导购代码"
,
"归属门店"
,
"最后登录时间"
);
List
<
String
>
titleList
=
Arrays
.
asList
(
"导购姓名"
,
"导购代码"
,
"归属门店"
,
"最后登录时间"
);
List
<
String
>
fileList
=
Arrays
.
asList
(
"clerkName"
,
"clerkCode"
,
"storeName"
,
"lastLoginTime"
);
List
<
String
>
fileList
=
Arrays
.
asList
(
"clerkName"
,
"clerkCode"
,
"storeName"
,
"lastLoginTime"
);
ExcelUtils
.
xls
(
response
,
request
,
"详情报表"
,
page
.
getList
(),
fileList
,
titleList
);
ExcelUtils
.
xls
(
response
,
request
,
"详情报表"
,
page
.
getList
(),
fileList
,
titleList
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
info
(
e
.
getMessage
(),
e
);
logger
.
info
(
e
.
getMessage
(),
e
);
}
}
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
//登陆明细-明细列表
//登陆明细-明细列表
@RequestMapping
(
"/login-detail-list"
)
@RequestMapping
(
"/login-detail-list"
)
public
HaobanResponse
loginDetailList
(
MemberAnalyzeParamsDTO
paramsDTO
)
{
public
HaobanResponse
loginDetailList
(
MemberAnalyzeParamsDTO
paramsDTO
)
{
paramsDTO
.
setWebFlag
(
1
);
paramsDTO
.
setWebFlag
(
1
);
//默认排序
//默认排序
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortColumn
()))
{
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortColumn
()))
{
paramsDTO
.
setSortColumn
(
"lastLoginTime"
);
paramsDTO
.
setSortColumn
(
"lastLoginTime"
);
}
}
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortType
()))
{
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortType
()))
{
paramsDTO
.
setSortType
(
"desc"
);
paramsDTO
.
setSortType
(
"desc"
);
}
}
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
Page
<
HaobanClerkLoginDTO
>
page
=
maidianDataService
.
pageClerkLogin
(
paramsDTO
);
Page
<
HaobanClerkLoginDTO
>
page
=
maidianDataService
.
pageClerkLogin
(
paramsDTO
);
returnMap
.
put
(
"result"
,
page
)
;
returnMap
.
put
(
"result"
,
page
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
}
}
//区域排行-区域图表
//区域排行-区域图表
@RequestMapping
(
"area-ranking-date"
)
@RequestMapping
(
"area-ranking-date"
)
public
HaobanResponse
areaRankingDate
(
MemberAnalyzeParamsDTO
paramsDTO
)
{
public
HaobanResponse
areaRankingDate
(
MemberAnalyzeParamsDTO
paramsDTO
)
{
paramsDTO
.
setWebFlag
(
1
);
paramsDTO
.
setWebFlag
(
1
);
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
List
<
AreaLoginDTO
>
list
=
maidianDataService
.
areaRankingDate
(
paramsDTO
);
List
<
AreaLoginDTO
>
list
=
maidianDataService
.
areaRankingDate
(
paramsDTO
);
returnMap
.
put
(
"result"
,
list
)
;
returnMap
.
put
(
"result"
,
list
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
}
}
//区域排行-区域列表
//区域排行-区域列表
@RequestMapping
(
"/area-ranking-list"
)
@RequestMapping
(
"/area-ranking-list"
)
public
HaobanResponse
areaRankingList
(
MemberAnalyzeParamsDTO
paramsDTO
)
{
public
HaobanResponse
areaRankingList
(
MemberAnalyzeParamsDTO
paramsDTO
)
{
paramsDTO
.
setWebFlag
(
1
);
paramsDTO
.
setWebFlag
(
1
);
//默认排序
//默认排序
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortColumn
()))
{
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortColumn
()))
{
paramsDTO
.
setSortColumn
(
"loginRate"
);
paramsDTO
.
setSortColumn
(
"loginRate"
);
}
}
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortType
()))
{
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortType
()))
{
paramsDTO
.
setSortType
(
"desc"
);
paramsDTO
.
setSortType
(
"desc"
);
}
}
paramsDTO
.
setAreaType
(
"store"
);
paramsDTO
.
setAreaType
(
"store"
);
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
returnMap
=
new
HashMap
<
String
,
Object
>();
Page
<
AreaLoginDTO
>
page
=
maidianDataService
.
areaRankingList
(
paramsDTO
);
Page
<
AreaLoginDTO
>
page
=
maidianDataService
.
areaRankingList
(
paramsDTO
);
returnMap
.
put
(
"result"
,
page
)
;
returnMap
.
put
(
"result"
,
page
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
returnMap
);
}
}
//导出-区域排行-区域列表
//导出-区域排行-区域列表
@RequestMapping
(
"/export-area-ranking-list"
)
@RequestMapping
(
"/export-area-ranking-list"
)
public
HaobanResponse
exportAreaRankingList
(
HttpServletRequest
request
,
HttpServletResponse
response
,
MemberAnalyzeParamsDTO
paramsDTO
)
{
public
HaobanResponse
exportAreaRankingList
(
HttpServletRequest
request
,
HttpServletResponse
response
,
MemberAnalyzeParamsDTO
paramsDTO
)
{
paramsDTO
.
setWebFlag
(
1
);
paramsDTO
.
setWebFlag
(
1
);
//默认排序
//默认排序
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortColumn
()))
{
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortColumn
()))
{
paramsDTO
.
setSortColumn
(
"loginRate"
);
paramsDTO
.
setSortColumn
(
"loginRate"
);
}
}
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortType
()))
{
if
(
StringUtils
.
isEmpty
(
paramsDTO
.
getSortType
()))
{
paramsDTO
.
setSortType
(
"desc"
);
paramsDTO
.
setSortType
(
"desc"
);
}
}
paramsDTO
.
setAreaType
(
"store"
);
paramsDTO
.
setAreaType
(
"store"
);
paramsDTO
.
setCurrentPage
(
1
);
paramsDTO
.
setCurrentPage
(
1
);
paramsDTO
.
setPageSize
(
Integer
.
MAX_VALUE
);
paramsDTO
.
setPageSize
(
Integer
.
MAX_VALUE
);
Page
<
AreaLoginDTO
>
page
=
maidianDataService
.
areaRankingList
(
paramsDTO
);
Page
<
AreaLoginDTO
>
page
=
maidianDataService
.
areaRankingList
(
paramsDTO
);
List
<
String
>
titleList
=
Arrays
.
asList
(
"门店名称"
,
"门店code"
,
"分组名称"
,
"登录率"
,
"登录人数"
);
List
<
String
>
titleList
=
Arrays
.
asList
(
"门店名称"
,
"门店code"
,
"分组名称"
,
"登录率"
,
"登录人数"
);
List
<
String
>
fileList
=
Arrays
.
asList
(
"exportName"
,
"storeCode"
,
"storeGroupName"
,
"loginRateString"
,
"loginClerkCnt"
);
List
<
String
>
fileList
=
Arrays
.
asList
(
"exportName"
,
"storeCode"
,
"storeGroupName"
,
"loginRateString"
,
"loginClerkCnt"
);
try
{
try
{
ExcelUtils
.
xls
(
response
,
request
,
"详情报表"
,
page
.
getList
(),
fileList
,
titleList
);
ExcelUtils
.
xls
(
response
,
request
,
"详情报表"
,
page
.
getList
(),
fileList
,
titleList
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
info
(
e
.
getMessage
(),
e
);
logger
.
info
(
e
.
getMessage
(),
e
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
}
}
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