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
8fe65855
Commit
8fe65855
authored
Jul 13, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
46662f37
e8dddca6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
237 additions
and
21 deletions
+237
-21
HmLinkSearchQDTO.java
...m/gic/haoban/manage/api/dto/qdto/hm/HmLinkSearchQDTO.java
+20
-0
HmLinkController.java
...gic/haoban/manage/web/controller/hm/HmLinkController.java
+107
-21
DataStatisticsParamUtils.java
...manage/web/utils/statistics/DataStatisticsParamUtils.java
+107
-0
dubbo-haoban-manage-web.xml
...3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
+3
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/qdto/hm/HmLinkSearchQDTO.java
View file @
8fe65855
...
@@ -18,6 +18,8 @@ public class HmLinkSearchQDTO implements Serializable {
...
@@ -18,6 +18,8 @@ public class HmLinkSearchQDTO implements Serializable {
private
Integer
linkType
;
private
Integer
linkType
;
private
String
sortColumn
;
private
String
sortColumn
;
private
String
sortType
;
private
String
sortType
;
private
Long
linkId
;
private
String
storeId
;
public
String
getSortColumn
()
{
public
String
getSortColumn
()
{
return
sortColumn
;
return
sortColumn
;
...
@@ -82,4 +84,22 @@ public class HmLinkSearchQDTO implements Serializable {
...
@@ -82,4 +84,22 @@ public class HmLinkSearchQDTO implements Serializable {
public
void
setLinkType
(
Integer
linkType
)
{
public
void
setLinkType
(
Integer
linkType
)
{
this
.
linkType
=
linkType
;
this
.
linkType
=
linkType
;
}
}
public
Long
getLinkId
()
{
return
linkId
;
}
public
HmLinkSearchQDTO
setLinkId
(
Long
linkId
)
{
this
.
linkId
=
linkId
;
return
this
;
}
public
String
getStoreId
()
{
return
storeId
;
}
public
HmLinkSearchQDTO
setStoreId
(
String
storeId
)
{
this
.
storeId
=
storeId
;
return
this
;
}
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/hm/HmLinkController.java
View file @
8fe65855
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
hm
;
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
hm
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.haoban.manage.api.service.statistics.DataStatisticsApiService
;
import
com.gic.haoban.manage.web.utils.statistics.DataStatisticsParamUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -74,6 +73,8 @@ public class HmLinkController {
...
@@ -74,6 +73,8 @@ public class HmLinkController {
private
MemberTagApiService
memberTagApiService
;
private
MemberTagApiService
memberTagApiService
;
@Autowired
@Autowired
private
WxUserAddLogApiService
wxUserAddLogApiService
;
private
WxUserAddLogApiService
wxUserAddLogApiService
;
@Autowired
private
DataStatisticsApiService
dataStatisticsApiService
;
@RequestMapping
(
"add"
)
@RequestMapping
(
"add"
)
@GicLogRecord
(
value
=
"${#logValue}"
,
category
=
GicLogRecordCategoryEnum
.
RECHAGE_CENTER
,
optType
=
GicLogRecordOptTypeEnum
.
RECHAGE_MODIFY_OPT
,
userFunc
=
LogRecordUserService
.
class
,
optPage
=
"活码"
)
@GicLogRecord
(
value
=
"${#logValue}"
,
category
=
GicLogRecordCategoryEnum
.
RECHAGE_CENTER
,
optType
=
GicLogRecordOptTypeEnum
.
RECHAGE_MODIFY_OPT
,
userFunc
=
LogRecordUserService
.
class
,
optPage
=
"活码"
)
...
@@ -499,12 +500,45 @@ public class HmLinkController {
...
@@ -499,12 +500,45 @@ public class HmLinkController {
@RequestMapping
(
"page"
)
@RequestMapping
(
"page"
)
public
RestResponse
<
Object
>
page
(
HmLinkSearchQDTO
qdto
,
BasePageInfo
basePageInfo
)
{
public
RestResponse
<
Object
>
page
(
HmLinkSearchQDTO
qdto
,
BasePageInfo
basePageInfo
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
qdto
.
setWxEnterpriseId
(
loginUser
.
getWxEnterpriseId
());
qdto
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
JSONObject
jsonObject
=
new
JSONObject
();
ServiceResponse
<
Page
<
HmLinkDTO
>>
resp
=
this
.
hmLinkApiService
.
listPage
(
qdto
,
basePageInfo
);
jsonObject
.
put
(
"enterpriseId"
,
loginUser
.
getEnterpriseId
());
Page
<
HmLinkDTO
>
page
=
resp
.
getResult
();
if
(
qdto
.
getLinkId
()
!=
null
)
{
jsonObject
.
put
(
"linkId"
,
qdto
.
getLinkId
());
}
if
(
StringUtils
.
isNotBlank
(
qdto
.
getStoreId
()))
{
jsonObject
.
put
(
"storeId"
,
qdto
.
getStoreId
());
}
if
(
qdto
.
getLinkType
()
!=
null
)
{
jsonObject
.
put
(
"linkType"
,
qdto
.
getLinkType
());
}
if
(
qdto
.
getStartDate
()
!=
null
)
{
jsonObject
.
put
(
"startTime"
,
DateUtil
.
getStartTimeOfDay
(
qdto
.
getStartDate
()));
}
if
(
qdto
.
getEndDate
()
!=
null
)
{
jsonObject
.
put
(
"endTime"
,
DateUtil
.
getEndTimeOfDay
(
qdto
.
getEndDate
()));
}
if
(
StringUtils
.
isNotBlank
(
qdto
.
getSearchParams
()))
{
jsonObject
.
put
(
"linkSelect"
,
qdto
.
getSearchParams
());
}
if
(
StringUtils
.
isBlank
(
qdto
.
getSortColumn
()))
{
qdto
.
setSortColumn
(
"createTime"
);
}
if
(
StringUtils
.
isBlank
(
qdto
.
getSortType
()))
{
qdto
.
setSortType
(
"desc"
);
}
jsonObject
.
put
(
"orderByField"
,
qdto
.
getSortColumn
()
+
" "
+
qdto
.
getSortType
());
//用于好办链接列表数据 企业+链接
JSONObject
param
=
DataStatisticsParamUtils
.
getParam
(
basePageInfo
,
jsonObject
);
Page
page
=
DataStatisticsParamUtils
.
getPage
(
dataStatisticsApiService
.
post
(
"data_haoban_link_list"
,
param
));
if
(
page
==
null
)
{
return
RestResponse
.
successResult
();
}
Page
<
HmLinkListVO
>
retPage
=
EntityUtil
.
changeEntityByJSON
(
Page
.
class
,
page
);
Page
<
HmLinkListVO
>
retPage
=
EntityUtil
.
changeEntityByJSON
(
Page
.
class
,
page
);
List
<
HmLinkListVO
>
list
=
EntityUtil
.
changeEntityListByJSON
(
HmLinkListVO
.
class
,
page
.
getResult
());
List
<
HmLinkListVO
>
list
=
EntityUtil
.
changeEntityListByJSON
(
HmLinkListVO
.
class
,
page
.
getResult
());
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
RestResponse
.
successResult
(
retPage
);
}
ServiceResponse
<
String
>
urlResp
=
this
.
hmLinkApiService
.
getHmLinkUrl
();
ServiceResponse
<
String
>
urlResp
=
this
.
hmLinkApiService
.
getHmLinkUrl
();
list
.
forEach
(
item
->
{
list
.
forEach
(
item
->
{
item
.
setLinkUrl
(
urlResp
.
getResult
()
+
item
.
getShortCode
());
item
.
setLinkUrl
(
urlResp
.
getResult
()
+
item
.
getShortCode
());
...
@@ -555,28 +589,80 @@ public class HmLinkController {
...
@@ -555,28 +589,80 @@ public class HmLinkController {
// 链接统计
// 链接统计
@RequestMapping
(
"statistics/total"
)
@RequestMapping
(
"statistics/total"
)
public
RestResponse
<
Object
>
statistics
(
Long
linkId
)
{
public
RestResponse
<
Object
>
statistics
(
Long
linkId
)
{
HmLinkStatisticsVO
vo
=
new
HmLinkStatisticsVO
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
return
RestResponse
.
successResult
(
vo
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"enterpriseId"
,
loginUser
.
getEnterpriseId
());
jsonObject
.
put
(
"linkId"
,
linkId
);
JSONObject
param
=
DataStatisticsParamUtils
.
getParamNoPage
(
jsonObject
);
//HmLinkStatisticsVO vo = new HmLinkStatisticsVO();
//用于好办链接概览数据 企业+链接
return
DataStatisticsParamUtils
.
responseOne
(
dataStatisticsApiService
.
post
(
"data_haoban_link_overview"
,
param
));
}
}
// 统计图表
// 统计图表
@RequestMapping
(
"statistics/chart"
)
@RequestMapping
(
"statistics/chart"
)
public
RestResponse
<
Object
>
statisticsChart
(
Long
linkId
,
Date
startTime
,
Date
endTime
)
{
public
RestResponse
<
Object
>
statisticsChart
(
Long
linkId
,
Date
startTime
,
Date
endTime
)
{
HmLinkStatisticsVO
vo
=
new
HmLinkStatisticsVO
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
List
<
HmLinkStatisticsVO
>
list
=
new
ArrayList
<>();
list
.
add
(
vo
);
JSONObject
jsonObject
=
new
JSONObject
();
return
RestResponse
.
successResult
(
list
);
jsonObject
.
put
(
"enterpriseId"
,
loginUser
.
getEnterpriseId
());
jsonObject
.
put
(
"linkId"
,
linkId
);
if
(
startTime
==
null
)
{
//过去7天
Calendar
cl
=
Calendar
.
getInstance
();
cl
.
add
(
Calendar
.
DATE
,
-
7
);
startTime
=
cl
.
getTime
();
}
startTime
=
DateUtil
.
getStartTimeOfDay
(
startTime
);
jsonObject
.
put
(
"startTime"
,
startTime
);
if
(
endTime
==
null
)
{
endTime
=
new
Date
();
}
endTime
=
DateUtil
.
getEndTimeOfDay
(
endTime
);
jsonObject
.
put
(
"endTime"
,
endTime
);
//用于链接添加趋势图数据 企业+链接+日期
String
apolloKey
=
"data_haoban_link_add_trend_d"
;
//如果天数大于60,调用月接口
if
(
DateUtil
.
daysBetween
(
startTime
,
endTime
)
>
60
)
{
apolloKey
=
"data_haoban_link_add_trend_m"
;
}
JSONObject
param
=
DataStatisticsParamUtils
.
getParamNoPage
(
jsonObject
);
return
DataStatisticsParamUtils
.
response
(
dataStatisticsApiService
.
post
(
apolloKey
,
param
));
}
}
// 导购统计
// 导购统计
@RequestMapping
(
"statistics/clerk"
)
@RequestMapping
(
"statistics/clerk"
)
public
RestResponse
<
Object
>
statisticsClerk
(
Long
linkId
,
String
storeSearchParams
,
String
clerkSearchParams
,
public
RestResponse
<
Object
>
statisticsClerk
(
Long
linkId
,
String
storeSearchParams
,
String
clerkSearchParams
,
Date
startTime
,
Date
endTime
,
BasePageInfo
basePageInfo
)
{
Date
startTime
,
Date
endTime
,
BasePageInfo
basePageInfo
,
String
sortColumn
,
String
sortType
)
{
List
<
HmLinkStatisticsClerkVO
>
list
=
new
ArrayList
<>();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
list
.
add
(
new
HmLinkStatisticsClerkVO
());
Page
<
HmLinkStatisticsClerkVO
>
page
=
new
Page
<>();
JSONObject
jsonObject
=
new
JSONObject
();
page
.
setResult
(
list
);
jsonObject
.
put
(
"enterpriseId"
,
loginUser
.
getEnterpriseId
());
return
RestResponse
.
successResult
(
page
);
jsonObject
.
put
(
"linkId"
,
linkId
);
if
(
startTime
!=
null
)
{
jsonObject
.
put
(
"startTime"
,
DateUtil
.
getStartTimeOfDay
(
startTime
));
}
if
(
endTime
!=
null
)
{
jsonObject
.
put
(
"endTime"
,
DateUtil
.
getEndTimeOfDay
(
endTime
));
}
if
(
StringUtils
.
isNotBlank
(
storeSearchParams
))
{
jsonObject
.
put
(
"linkSelect1"
,
storeSearchParams
);
}
if
(
StringUtils
.
isNotBlank
(
clerkSearchParams
))
{
jsonObject
.
put
(
"linkSelect2"
,
clerkSearchParams
);
}
if
(
StringUtils
.
isBlank
(
sortColumn
))
{
//今日新增人数
sortColumn
=
"addNum"
;
}
if
(
StringUtils
.
isBlank
(
sortType
))
{
sortType
=
"desc"
;
}
jsonObject
.
put
(
"orderByField"
,
sortColumn
+
" "
+
sortType
);
JSONObject
param
=
DataStatisticsParamUtils
.
getParam
(
basePageInfo
,
jsonObject
);
//用于链接明细导购数据 企业+链接+导购
return
DataStatisticsParamUtils
.
responsePage
(
dataStatisticsApiService
.
post
(
"data_haoban_link_detail"
,
param
));
}
}
// 加好友列表
// 加好友列表
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/utils/statistics/DataStatisticsParamUtils.java
0 → 100644
View file @
8fe65855
package
com
.
gic
.
haoban
.
manage
.
web
.
utils
.
statistics
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.web.qo.PageQo
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.haoban.manage.api.dto.statistics.StatisticsDTO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
/**
* 数据接口参数拼接工具
* @Author guojx
* @Date 2022/7/13 10:49
*/
public
class
DataStatisticsParamUtils
{
private
static
final
Logger
LOGGER
=
LogManager
.
getLogger
(
DataStatisticsParamUtils
.
class
);
public
static
JSONObject
getParam
(
BasePageInfo
basePageInfo
,
JSONObject
objParam
)
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"pageNo"
,
basePageInfo
.
getPageNum
());
jsonObject
.
put
(
"pageSize"
,
basePageInfo
.
getPageSize
());
if
(
objParam
!=
null
)
{
if
(
objParam
.
containsKey
(
"storeId"
))
{
Object
storeId
=
objParam
.
get
(
"storeId"
);
if
(
storeId
==
null
||
StringUtils
.
isBlank
(
storeId
.
toString
()))
{
objParam
.
remove
(
"storeId"
);
}
}
}
jsonObject
.
put
(
"inFields"
,
objParam
);
return
jsonObject
;
}
public
static
JSONObject
getParamNoPage
(
JSONObject
objParam
)
{
JSONObject
jsonObject
=
new
JSONObject
();
if
(
objParam
!=
null
)
{
if
(
objParam
.
containsKey
(
"storeId"
))
{
Object
storeId
=
objParam
.
get
(
"storeId"
);
if
(
storeId
==
null
||
StringUtils
.
isBlank
(
storeId
.
toString
()))
{
objParam
.
remove
(
"storeId"
);
}
}
}
jsonObject
.
put
(
"inFields"
,
objParam
);
return
jsonObject
;
}
public
static
RestResponse
response
(
ServiceResponse
<
StatisticsDTO
>
res
)
{
if
(
res
.
isSuccess
())
{
StatisticsDTO
statisticsDTO
=
res
.
getResult
();
if
(
statisticsDTO
==
null
)
{
return
RestResponse
.
successResult
();
}
return
RestResponse
.
successResult
(
statisticsDTO
.
getData
());
}
return
RestResponse
.
failure
(
res
.
getCode
(),
res
.
getMessage
());
}
public
static
RestResponse
responseOne
(
ServiceResponse
<
StatisticsDTO
>
res
)
{
if
(
res
.
isSuccess
())
{
StatisticsDTO
statisticsDTO
=
res
.
getResult
();
if
(
statisticsDTO
==
null
)
{
return
RestResponse
.
successResult
();
}
if
(
CollectionUtils
.
isNotEmpty
(
statisticsDTO
.
getData
()))
{
return
RestResponse
.
successResult
(
statisticsDTO
.
getData
().
get
(
0
));
}
return
RestResponse
.
successResult
();
}
return
RestResponse
.
failure
(
res
.
getCode
(),
res
.
getMessage
());
}
public
static
RestResponse
responsePage
(
ServiceResponse
<
StatisticsDTO
>
res
)
{
if
(
res
.
isSuccess
())
{
StatisticsDTO
statisticsDTO
=
res
.
getResult
();
if
(
statisticsDTO
==
null
)
{
return
RestResponse
.
successResult
();
}
Page
page
=
new
Page
();
page
.
setResult
(
statisticsDTO
.
getData
());
page
.
setPageSize
(
statisticsDTO
.
getPage
().
getPageSize
());
page
.
setCurrentPage
(
statisticsDTO
.
getPage
().
getCurrentPage
());
page
.
setTotalPage
(
statisticsDTO
.
getPage
().
getTotalPage
());
page
.
setTotalCount
(
statisticsDTO
.
getPage
().
getTotalCount
());
return
RestResponse
.
successResult
(
page
);
}
return
RestResponse
.
failure
(
res
.
getCode
(),
res
.
getMessage
());
}
public
static
Page
getPage
(
ServiceResponse
<
StatisticsDTO
>
res
)
{
RestResponse
response
=
responsePage
(
res
);
if
(
"0"
.
equals
(
response
.
getCode
()))
{
Page
page
=
(
Page
)
response
.
getResult
();
return
page
;
}
return
null
;
}
}
haoban-manage3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
View file @
8fe65855
...
@@ -113,4 +113,7 @@
...
@@ -113,4 +113,7 @@
timeout=
"10000"
retries=
"0"
check=
"false"
/>
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"hmQrcodeApiService"
interface=
"com.gic.haoban.manage.api.service.hm.HmQrcodeApiService"
<dubbo:reference
id=
"hmQrcodeApiService"
interface=
"com.gic.haoban.manage.api.service.hm.HmQrcodeApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"dataStatisticsApiService"
interface=
"com.gic.haoban.manage.api.service.statistics.DataStatisticsApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
</beans>
</beans>
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