Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
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
base_platform_enterprise
gic-store
Commits
2ac82a65
Commit
2ac82a65
authored
Mar 09, 2021
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
异常捕获
parent
2ecf9869
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
38 deletions
+41
-38
StoreController.java
...in/java/com/gic/store/web/controller/StoreController.java
+41
-38
No files found.
gic-store-web/src/main/java/com/gic/store/web/controller/StoreController.java
View file @
2ac82a65
...
...
@@ -553,49 +553,52 @@ public class StoreController extends DownloadUtils {
@RequestMapping
(
"store-qrcode-download"
)
public
RestResponse
storeQrcodeDownload
(
@RequestBody
QrcodeQO
qrcodeQO
){
setStoreWidgetId
(
qrcodeQO
.
getStoreSearchDTO
());
int
total
=
0
;
if
(
qrcodeQO
.
getIsAll
()
==
1
){
StoreSearchDTO
storeSearchDTO
=
qrcodeQO
.
getStoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
ServiceResponse
<
Long
>
serviceResponse
=
this
.
storeApiService
.
queryStoreCountFromEs
(
storeSearchDTO
);
total
=
serviceResponse
.
getResult
().
intValue
();
if
(
total
==
0
){
return
RestResponse
.
failure
(
ErrorCode
.
NOTEXISTS
.
getCode
(),
"没有门店下载二维码"
);
try
{
setStoreWidgetId
(
qrcodeQO
.
getStoreSearchDTO
());
int
total
=
0
;
if
(
qrcodeQO
.
getIsAll
()
==
1
){
StoreSearchDTO
storeSearchDTO
=
qrcodeQO
.
getStoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
ServiceResponse
<
Long
>
serviceResponse
=
this
.
storeApiService
.
queryStoreCountFromEs
(
storeSearchDTO
);
total
=
serviceResponse
.
getResult
().
intValue
();
if
(
total
==
0
){
return
RestResponse
.
failure
(
ErrorCode
.
NOTEXISTS
.
getCode
(),
"没有门店下载二维码"
);
}
}
else
{
total
=
qrcodeQO
.
getContent
().
size
();
}
}
else
{
total
=
qrcodeQO
.
getContent
().
size
();
}
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
new
QrcodeDownload
(){
@Override
public
List
<
QrcodeContent
>
getContent
(
int
pageNum
,
int
pageSize
){
if
(
qrcodeQO
.
getIsAll
()
==
1
){
StoreSearchDTO
storeSearchDTO
=
qrcodeQO
.
getStoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
ServiceResponse
<
Page
<
StoreDTO
>>
response
=
storeApiService
.
listStore
(
storeSearchDTO
,
pageNum
,
pageNum
);
if
(
response
.
isSuccess
()
&&
response
.
getResult
()
!=
null
){
Page
<
StoreDTO
>
result
=
response
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
result
.
getResult
())){
List
<
QrcodeContent
>
list
=
new
ArrayList
<>();
for
(
StoreDTO
dto
:
result
.
getResult
()){
QrcodeContent
qrcodeContent
=
new
QrcodeContent
();
qrcodeContent
.
setCustomParams
(
dto
.
getStoreInfoId
()+
""
);
qrcodeContent
.
setTitle
(
dto
.
getStoreName
());
qrcodeContent
.
setTitleTmp
(
dto
.
getStoreName
());
list
.
add
(
qrcodeContent
);
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
new
QrcodeDownload
(){
@Override
public
List
<
QrcodeContent
>
getContent
(
int
pageNum
,
int
pageSize
){
if
(
qrcodeQO
.
getIsAll
()
==
1
){
StoreSearchDTO
storeSearchDTO
=
qrcodeQO
.
getStoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
ServiceResponse
<
Page
<
StoreDTO
>>
response
=
storeApiService
.
listStore
(
storeSearchDTO
,
pageNum
,
pageNum
);
if
(
response
.
isSuccess
()
&&
response
.
getResult
()
!=
null
){
Page
<
StoreDTO
>
result
=
response
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
result
.
getResult
())){
List
<
QrcodeContent
>
list
=
new
ArrayList
<>();
for
(
StoreDTO
dto
:
result
.
getResult
()){
QrcodeContent
qrcodeContent
=
new
QrcodeContent
();
qrcodeContent
.
setCustomParams
(
dto
.
getStoreInfoId
()+
""
);
qrcodeContent
.
setTitle
(
dto
.
getStoreName
());
qrcodeContent
.
setTitleTmp
(
dto
.
getStoreName
());
list
.
add
(
qrcodeContent
);
}
return
list
;
}
return
list
;
}
}
else
{
return
EntityUtil
.
changeEntityListByJSON
(
QrcodeContent
.
class
,
qrcodeQO
.
getContent
());
}
}
else
{
return
EntityUtil
.
changeEntityListByJSON
(
QrcodeContent
.
class
,
qrcodeQO
.
getContent
());
return
null
;
}
return
null
;
}
}.
takeQrcode
(
EntityUtil
.
changeEntityByJSON
(
com
.
gic
.
download
.
qo
.
QrcodeQO
.
class
,
qrcodeQO
),
total
,
QrcodeTypeEnum
.
STORE
.
getType
(),
downloadReportApiService
,
weixinBaseFunService
,
weixinWxaFunService
,
qrCodeApiService
);
}.
takeQrcode
(
EntityUtil
.
changeEntityByJSON
(
com
.
gic
.
download
.
qo
.
QrcodeQO
.
class
,
qrcodeQO
),
total
,
QrcodeTypeEnum
.
STORE
.
getType
(),
downloadReportApiService
,
weixinBaseFunService
,
weixinWxaFunService
,
qrCodeApiService
);
}
catch
(
Exception
e
){
logger
.
warn
(
"异常"
,
e
);
}
return
RestResponse
.
success
();
}
...
...
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