Commit 2ac82a65 by 陶光胜

异常捕获

parent 2ecf9869
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment