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
642e2c04
Commit
642e2c04
authored
Aug 08, 2023
by
guojx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-2023-07-data-api' into 'master'
Feature 2023 07 data api See merge request
!1381
parents
e21b11a7
a2c780b6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
177 additions
and
35 deletions
+177
-35
HmLinkController.java
...gic/haoban/manage/web/controller/hm/HmLinkController.java
+73
-22
HmQrcodeController.java
...c/haoban/manage/web/controller/hm/HmQrcodeController.java
+75
-13
GlobalExceptionHandler.java
...c/haoban/manage/web/exception/GlobalExceptionHandler.java
+29
-0
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/hm/HmLinkController.java
View file @
642e2c04
...
...
@@ -9,6 +9,8 @@ import java.util.List;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.web.common.utils.DataApiUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -46,7 +48,6 @@ import com.gic.haoban.manage.api.service.hm.HmPageApiService;
import
com.gic.haoban.manage.api.service.hm.HmQrcodeApiService
;
import
com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService
;
import
com.gic.haoban.manage.api.service.out.WelcomeApiService
;
import
com.gic.haoban.manage.api.util.DataHttpUtil
;
import
com.gic.haoban.manage.web.log.LogRecordUserServiceImpl
;
import
com.gic.haoban.manage.web.qo.hm.data.HmLinkChartQO
;
import
com.gic.haoban.manage.web.qo.hm.data.HmLinkClerkListQO
;
...
...
@@ -652,13 +653,13 @@ public class HmLinkController {
jsonObject
.
put
(
"linkType"
,
"1,2"
);
}
if
(
qdto
.
getStartDate
()
!=
null
)
{
jsonObject
.
put
(
"start
Tim
e"
,
DateUtil
.
datetimeToString19
(
qdto
.
getStartDate
()));
jsonObject
.
put
(
"start
Dat
e"
,
DateUtil
.
datetimeToString19
(
qdto
.
getStartDate
()));
}
if
(
qdto
.
getEndDate
()
!=
null
)
{
jsonObject
.
put
(
"end
Tim
e"
,
DateUtil
.
datetimeToString19
(
qdto
.
getEndDate
()));
jsonObject
.
put
(
"end
Dat
e"
,
DateUtil
.
datetimeToString19
(
qdto
.
getEndDate
()));
}
if
(
StringUtils
.
isNotBlank
(
qdto
.
getSearchParams
()))
{
jsonObject
.
put
(
"
linkSelect
"
,
qdto
.
getSearchParams
());
jsonObject
.
put
(
"
vagueQuery
"
,
qdto
.
getSearchParams
());
}
List
<
String
>
creatorIdList
=
CreatorUtils
.
getCreatorIdList
(
0
);
if
(
CollectionUtils
.
isNotEmpty
(
creatorIdList
))
{
...
...
@@ -670,13 +671,28 @@ public class HmLinkController {
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
(
DataHttpUtil
.
post
(
StatisticsApolloKeyConstant
.
data_haoban_link_list
,
param
));
if
(
page
==
null
)
{
return
RestResponse
.
successResult
();
}
jsonObject
.
put
(
"orderByType"
,
DataApiUtils
.
getOrderByType
(
qdto
.
getSortType
()));
Map
<
String
,
Integer
>
orderByFieldMap
=
new
HashMap
<
String
,
Integer
>(
8
){{
put
(
"createTime"
,
13
);
put
(
"addNumT"
,
6
);
put
(
"addNum"
,
7
);
put
(
"clickTimesT"
,
8
);
put
(
"clickTimes"
,
9
);
put
(
"clickNumT"
,
10
);
put
(
"clickNum"
,
11
);
}};
jsonObject
.
put
(
"orderByFields"
,
DataApiUtils
.
getOrderByFields
(
qdto
.
getSortColumn
(),
"createTime"
,
orderByFieldMap
));
// jsonObject.put("orderByField", qdto.getSortColumn() + " " + qdto.getSortType());
jsonObject
.
put
(
"pageNum"
,
basePageInfo
.
getPageNum
());
jsonObject
.
put
(
"pageSize"
,
basePageInfo
.
getPageSize
());
// Page page = DataStatisticsParamUtils
// .getPage(DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_link_list, param));
// if (page == null) {
// return RestResponse.successResult();
// }
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
jsonObject
.
toJSONString
(),
StatisticsApolloKeyConstant
.
data_haoban_link_list
);
Page
page
=
DataApiUtils
.
getPageData
(
res
);
Page
<
HmLinkListVO
>
retPage
=
EntityUtil
.
changeEntityByJSON
(
Page
.
class
,
page
);
if
(
CollectionUtils
.
isEmpty
(
page
.
getResult
()))
{
return
RestResponse
.
successResult
(
retPage
);
...
...
@@ -753,9 +769,10 @@ public class HmLinkController {
jsonObject
.
put
(
"enterpriseId"
,
loginUser
.
getEnterpriseId
());
jsonObject
.
put
(
"linkId"
,
qo
.
getLinkId
());
JSONObject
param
=
DataStatisticsParamUtils
.
getParamNoPage
(
jsonObject
);
// DataStatisticsParamUtils.responseOne(DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_link_overview, param));
// HmLinkStatisticsVO vo = new HmLinkStatisticsVO();
return
DataStatisticsParamUtils
.
responseOne
(
DataHttpUtil
.
post
(
StatisticsApolloKeyConstant
.
data_haoban_link_overview
,
param
));
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
jsonObject
.
toJSONString
(),
StatisticsApolloKeyConstant
.
data_haoban_link_overview
);
return
RestResponse
.
successResult
(
getDataOne
(
res
));
}
// 统计图表
...
...
@@ -773,8 +790,8 @@ public class HmLinkController {
jsonObject
.
put
(
"enterpriseId"
,
loginUser
.
getEnterpriseId
());
jsonObject
.
put
(
"linkId"
,
linkId
);
jsonObject
.
put
(
"start
Tim
e"
,
df
.
format
(
startTime
));
jsonObject
.
put
(
"end
Tim
e"
,
df
.
format
(
endTime
));
jsonObject
.
put
(
"start
Dat
e"
,
df
.
format
(
startTime
));
jsonObject
.
put
(
"end
Dat
e"
,
df
.
format
(
endTime
));
// 日期填充
List
<
String
>
dateList
=
DateUtils
.
getDateList
(
startTimeStr
,
endTimeStr
,
null
);
// 用于链接添加趋势图数据 企业+链接+日期
...
...
@@ -786,12 +803,17 @@ public class HmLinkController {
apolloKey
=
"data_haoban_link_add_trend_m"
;
clickApolloKey
=
"data_haoban_link_click_trend_m"
;
}
JSONObject
param
=
DataStatisticsParamUtils
.
getParamNoPage
(
jsonObject
);
StatisticsDTO
newDTO
=
DataHttpUtil
.
post
(
apolloKey
,
param
);
Map
<
String
,
JSONObject
>
newMap
=
getTrendMap
(
newDTO
);
// JSONObject param = DataStatisticsParamUtils.getParamNoPage(jsonObject);
// StatisticsDTO newDTO = DataHttpUtil.post(apolloKey, param);
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
jsonObject
.
toJSONString
(),
apolloKey
);
List
<
JSONObject
>
resList
=
DataApiUtils
.
getDataList
(
res
);
Map
<
String
,
JSONObject
>
newMap
=
getTrendMapNew
(
resList
);
//
StatisticsDTO
clickDTO
=
DataHttpUtil
.
post
(
clickApolloKey
,
param
);
Map
<
String
,
JSONObject
>
clickMap
=
getTrendMap
(
clickDTO
);
// StatisticsDTO clickDTO = DataHttpUtil.post(clickApolloKey, param);
Map
<
String
,
Object
>
clerkRes
=
DataApiUtils
.
http
(
jsonObject
.
toJSONString
(),
clickApolloKey
);
List
<
JSONObject
>
clerkResList
=
DataApiUtils
.
getDataList
(
clerkRes
);
Map
<
String
,
JSONObject
>
clickMap
=
getTrendMapNew
(
clerkResList
);
List
<
JSONObject
>
resultList
=
new
ArrayList
<>();
for
(
String
date
:
dateList
)
{
JSONObject
vo
=
new
JSONObject
();
...
...
@@ -820,8 +842,22 @@ public class HmLinkController {
public
RestResponse
<
Object
>
statisticsClerk
(
@RequestBody
HmLinkClerkListQO
qo
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
qo
.
getInFields
().
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
return
DataStatisticsParamUtils
.
responsePage
(
DataHttpUtil
.
post
(
StatisticsApolloKeyConstant
.
data_haoban_link_detail
,
qo
));
JSONObject
paramJson
=
(
JSONObject
)
JSON
.
toJSON
(
qo
.
getInFields
());
DataApiUtils
.
dealParamJson
(
paramJson
,
"linkSelect1"
,
"vagueQueryStore"
);
DataApiUtils
.
dealParamJson
(
paramJson
,
"linkSelect2"
,
"vagueQueryClerk"
);
DataApiUtils
.
dealParamJson
(
paramJson
,
"startTime"
,
"startDate"
);
DataApiUtils
.
dealParamJson
(
paramJson
,
"endTime"
,
"endDate"
);
Map
<
String
,
Integer
>
orderByFieldMap
=
new
HashMap
<
String
,
Integer
>(
8
){{
put
(
"addNumT"
,
8
);
put
(
"addNum"
,
9
);
}};
paramJson
.
put
(
"orderByType"
,
DataApiUtils
.
getOrderByType
(
qo
.
getInFields
().
getOrderByField
()));
paramJson
.
put
(
"orderByFields"
,
DataApiUtils
.
getOrderByFields
(
qo
.
getInFields
().
getOrderByField
(),
"addNum"
,
orderByFieldMap
));
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
paramJson
.
toJSONString
(),
StatisticsApolloKeyConstant
.
data_haoban_link_detail
);
return
RestResponse
.
successResult
(
DataApiUtils
.
getPageData
(
res
));
}
/**
...
...
@@ -851,4 +887,19 @@ public class HmLinkController {
return
newMap
;
}
private
static
Map
<
String
,
JSONObject
>
getTrendMapNew
(
List
<
JSONObject
>
list
)
{
Map
<
String
,
JSONObject
>
newMap
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
for
(
JSONObject
temp
:
list
)
{
newMap
.
put
(
temp
.
getString
(
"bizDate"
),
temp
);
}
}
return
newMap
;
}
public
static
JSONObject
getDataOne
(
Map
<
String
,
Object
>
res
)
{
List
<
JSONObject
>
list
=
DataApiUtils
.
getDataList
(
res
);
return
CollectionUtils
.
isNotEmpty
(
list
)
?
list
.
get
(
0
)
:
null
;
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/hm/HmQrcodeController.java
View file @
642e2c04
...
...
@@ -10,6 +10,9 @@ import java.util.Map;
import
java.util.TreeSet
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.haoban.manage.api.dto.statistics.StatisticsPage
;
import
com.gic.web.common.utils.DataApiUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -48,7 +51,6 @@ import com.gic.haoban.manage.api.service.hm.HmClerkRelationApiService;
import
com.gic.haoban.manage.api.service.hm.HmGroupApiService
;
import
com.gic.haoban.manage.api.service.hm.HmQrcodeApiService
;
import
com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService
;
import
com.gic.haoban.manage.api.util.DataHttpUtil
;
import
com.gic.haoban.manage.web.dto.HmOverviewDTO
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.hm.HmBatchModifyQO
;
...
...
@@ -57,7 +59,6 @@ import com.gic.haoban.manage.web.qo.hm.HmQrcodeUpdateQO;
import
com.gic.haoban.manage.web.qo.hm.data.HmDetailClerkListQO
;
import
com.gic.haoban.manage.web.qo.hm.data.HmQrcodeListQO
;
import
com.gic.haoban.manage.web.qo.hm.data.HmTrendQO
;
import
com.gic.haoban.manage.web.utils.statistics.DataStatisticsParamUtils
;
import
com.gic.haoban.manage.web.utils.statistics.DateUtils
;
import
com.gic.haoban.manage.web.vo.hm.HmDetailClerkListVO
;
import
com.gic.haoban.manage.web.vo.hm.HmTrendVO
;
...
...
@@ -196,8 +197,31 @@ public class HmQrcodeController {
hmIds
.
forEach
(
c
->
stringBuffer
.
append
(
c
).
append
(
","
));
hmQrcodeListQO
.
getInFields
().
setHmId
(
stringBuffer
.
toString
());
}
StatisticsDTO
statisticsDTO
=
DataHttpUtil
.
post
(
StatisticsApolloKeyConstant
.
data_haoban_hm_list
,
hmQrcodeListQO
);
List
<
HmQrcodeListDTO
>
data
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
statisticsDTO
.
getData
()),
HmQrcodeListDTO
.
class
);
// StatisticsDTO statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_list, hmQrcodeListQO);
// List<HmQrcodeListDTO> data = JSON.parseArray(JSON.toJSONString(statisticsDTO.getData()), HmQrcodeListDTO.class);
JSONObject
paramJson
=
(
JSONObject
)
JSON
.
toJSON
(
hmQrcodeListQO
.
getInFields
());
paramJson
.
put
(
"pageNum"
,
hmQrcodeListQO
.
getPageNo
());
paramJson
.
put
(
"pageSize"
,
hmQrcodeListQO
.
getPageSize
());
DataApiUtils
.
dealParamJson
(
paramJson
,
"startTime"
,
"startDate"
);
DataApiUtils
.
dealParamJson
(
paramJson
,
"endTime"
,
"endDate"
);
Map
<
String
,
Integer
>
orderByFieldMap
=
new
HashMap
<
String
,
Integer
>(
8
){{
put
(
"createTime"
,
15
);
put
(
"addNumT"
,
6
);
put
(
"addNum"
,
7
);
}};
paramJson
.
put
(
"orderByType"
,
DataApiUtils
.
getOrderByType
(
hmQrcodeListQO
.
getInFields
().
getOrderByField
()));
paramJson
.
put
(
"orderByFields"
,
DataApiUtils
.
getOrderByFields
(
hmQrcodeListQO
.
getInFields
().
getOrderByField
(),
"createTime"
,
orderByFieldMap
));
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
paramJson
.
toJSONString
(),
StatisticsApolloKeyConstant
.
data_haoban_hm_list
);
List
<
HmQrcodeListDTO
>
data
=
DataApiUtils
.
parsePageDataList
(
res
,
HmQrcodeListDTO
.
class
);
Page
resPage
=
DataApiUtils
.
getPageData
(
res
);
StatisticsDTO
statisticsDTO
=
new
StatisticsDTO
();
StatisticsPage
page
=
EntityUtil
.
changeEntityNew
(
StatisticsPage
.
class
,
resPage
);
statisticsDTO
.
setPage
(
page
);
statisticsDTO
.
setErrorCode
(
1
);
statisticsDTO
.
setSuccess
(
true
);
if
(
CollectionUtils
.
isNotEmpty
(
data
))
{
for
(
HmQrcodeListDTO
hmQrcodeListDTO
:
data
)
{
List
<
HmStoreDTO
>
storeDTOList
=
new
ArrayList
<>();
...
...
@@ -368,18 +392,34 @@ public class HmQrcodeController {
Integer
type
=
hmTrendQO
.
getInFields
().
getType
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
hmTrendQO
.
getInFields
().
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
StatisticsDTO
statisticsDTO
=
DataHttpUtil
.
post
(
StatisticsApolloKeyConstant
.
data_haoban_hm_overview
,
hmTrendQO
);
HmOverviewDTO
hmOverviewDTO
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
statisticsDTO
.
getOne
()),
HmOverviewDTO
.
class
);
// StatisticsDTO statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_overview, hmTrendQO);
// HmOverviewDTO hmOverviewDTO = JSON.parseObject(JSON.toJSONString(statisticsDTO.getOne()), HmOverviewDTO.class);
JSONObject
paramJson
=
(
JSONObject
)
JSON
.
toJSON
(
hmTrendQO
.
getInFields
());
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
paramJson
.
toJSONString
(),
StatisticsApolloKeyConstant
.
data_haoban_hm_overview
);
List
<
HmOverviewDTO
>
resList
=
DataApiUtils
.
parseDataList
(
res
,
HmOverviewDTO
.
class
);
HmOverviewDTO
hmOverviewDTO
=
CollectionUtils
.
isEmpty
(
resList
)
?
null
:
resList
.
get
(
0
);
HmTrendVO
hmTrendVO
=
EntityUtil
.
changeEntityNew
(
HmTrendVO
.
class
,
hmOverviewDTO
);
List
<
Map
>
list
=
new
ArrayList
<>();
Map
<
String
,
Object
>
trendRes
=
null
;
DataApiUtils
.
dealParamJson
(
paramJson
,
"startTime"
,
"startDate"
);
DataApiUtils
.
dealParamJson
(
paramJson
,
"endTime"
,
"endDate"
);
if
(
type
==
1
)
{
//天
StatisticsDTO
dto
=
DataHttpUtil
.
post
(
StatisticsApolloKeyConstant
.
data_haoban_hm_trend_d
,
hmTrendQO
);
list
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
dto
.
getData
()),
Map
.
class
);
// StatisticsDTO dto = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_trend_d, hmTrendQO);
trendRes
=
DataApiUtils
.
http
(
paramJson
.
toJSONString
(),
StatisticsApolloKeyConstant
.
data_haoban_hm_trend_d
);
}
else
if
(
type
==
2
)
{
//月
StatisticsDTO
dto
=
DataHttpUtil
.
post
(
StatisticsApolloKeyConstant
.
data_haoban_hm_trend_m
,
hmTrendQO
);
list
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
dto
.
getData
()),
Map
.
class
);
// StatisticsDTO dto = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_trend_m, hmTrendQO);
trendRes
=
DataApiUtils
.
http
(
paramJson
.
toJSONString
(),
StatisticsApolloKeyConstant
.
data_haoban_hm_trend_m
);
}
if
(
trendRes
!=
null
)
{
list
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
DataApiUtils
.
getDataList
(
trendRes
)),
Map
.
class
);
}
if
(
hmTrendVO
==
null
)
{
hmTrendVO
=
new
HmTrendVO
();
...
...
@@ -456,12 +496,34 @@ public class HmQrcodeController {
}
Integer
hmType
=
hmQrcodeDTO
.
getHmType
();
StatisticsDTO
statisticsDTO
=
null
;
JSONObject
paramJson
=
(
JSONObject
)
JSON
.
toJSON
(
hmDetailClerkListQO
.
getInFields
());
paramJson
.
put
(
"pageNum"
,
hmDetailClerkListQO
.
getPageNo
());
paramJson
.
put
(
"pageSize"
,
hmDetailClerkListQO
.
getPageSize
());
Map
<
String
,
Integer
>
orderByFieldMap
=
new
HashMap
<
String
,
Integer
>(
8
){{
put
(
"addNumT"
,
9
);
put
(
"addNum"
,
10
);
}};
DataApiUtils
.
dealParamJson
(
paramJson
,
"storeSelect"
,
"vagueQueryStore"
);
DataApiUtils
.
dealParamJson
(
paramJson
,
"clerkSelect"
,
"vagueQueryClerk"
);
DataApiUtils
.
dealParamJson
(
paramJson
,
"startTime"
,
"startDate"
);
DataApiUtils
.
dealParamJson
(
paramJson
,
"endTime"
,
"endDate"
);
paramJson
.
put
(
"orderByType"
,
DataApiUtils
.
getOrderByType
(
hmDetailClerkListQO
.
getInFields
().
getOrderByField
()));
paramJson
.
put
(
"orderByFields"
,
DataApiUtils
.
getOrderByFields
(
hmDetailClerkListQO
.
getInFields
().
getOrderByField
(),
"addNum"
,
orderByFieldMap
));
Map
<
String
,
Object
>
res
=
null
;
Page
page
=
new
Page
();
if
(
hmType
==
1
)
{
statisticsDTO
=
DataHttpUtil
.
post
(
StatisticsApolloKeyConstant
.
data_haoban_hm_single_detail
,
hmDetailClerkListQO
);
// statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_single_detail, hmDetailClerkListQO);
res
=
DataApiUtils
.
http
(
paramJson
.
toJSONString
(),
StatisticsApolloKeyConstant
.
data_haoban_hm_single_detail
);
page
.
setResult
(
DataApiUtils
.
getDataList
(
res
));
}
else
if
(
hmType
==
2
)
{
statisticsDTO
=
DataHttpUtil
.
post
(
StatisticsApolloKeyConstant
.
data_haoban_hm_many_detail
,
hmDetailClerkListQO
);
// statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_many_detail, hmDetailClerkListQO);
res
=
DataApiUtils
.
http
(
paramJson
.
toJSONString
(),
StatisticsApolloKeyConstant
.
data_haoban_hm_many_detail
);
page
=
DataApiUtils
.
getPageData
(
res
);
}
return
DataStatisticsParamUtils
.
responsePage
(
statisticsDTO
);
return
RestResponse
.
successResult
(
page
);
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/exception/GlobalExceptionHandler.java
View file @
642e2c04
package
com
.
gic
.
haoban
.
manage
.
web
.
exception
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.haoban.base.api.common.ShowFrontMessageException
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.web.controller.WebBaseController
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.marketing.api.exception.ErrmsgException
;
import
com.gic.web.common.exception.DataApiException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.validation.BindException
;
...
...
@@ -140,4 +143,30 @@ public class GlobalExceptionHandler extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
}
/**
* valid 异常告警
* @param response
* @param ex
* @return
*/
@ResponseBody
@ExceptionHandler
(
ErrmsgException
.
class
)
public
RestResponse
rrrmsgException
(
HttpServletResponse
response
,
ErrmsgException
ex
)
{
logger
.
info
(
"exceoprion:{}"
,
ex
);
return
RestResponse
.
failure
(
"-1"
,
ex
.
getMessage
());
}
/**
* 数据组API错误
* @param response
* @param ex
* @return
*/
@ResponseBody
@ExceptionHandler
(
DataApiException
.
class
)
public
RestResponse
dataApiException
(
HttpServletResponse
response
,
DataApiException
ex
)
{
logger
.
info
(
"DataApiException异常信息:{}"
,
ex
);
return
RestResponse
.
failure
(
ex
.
getCode
(),
ex
.
getMessage
());
}
}
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