|
|
@ -84,8 +84,11 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor |
|
|
|
public List<ReportResultDTO> reportList() { |
|
|
|
Result<String> list = jiMuReportOpenFeignClient.getList(1,10000,"datainfo", EpmetRequestHolder.getHeader("Authorization")); |
|
|
|
Result<String> url = getUrl(2, null); |
|
|
|
log.info(url.toString()); |
|
|
|
log.info("所有jm报表"+url); |
|
|
|
Map<String,Object> map = JSON.parseObject(url.getData(), Map.class); |
|
|
|
if (!map.containsValue(true)){ |
|
|
|
throw new EpmetException("获取所有jm报表失败"); |
|
|
|
} |
|
|
|
Map<String,Object> map2 = (Map<String,Object>)map.get("result"); |
|
|
|
List<Map<String,Object>> map3 = (List<Map<String,Object>>) map2.get("records"); |
|
|
|
List<JiMuReportResultDTO> allReports = new ArrayList<>(); |
|
|
@ -102,7 +105,7 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor |
|
|
|
dto.setReportName(r.getName()); |
|
|
|
allReportList.add(dto); |
|
|
|
}); |
|
|
|
List<ReportResultDTO> reportList = baseDao.reportList(null); |
|
|
|
List<ReportResultDTO> reportList = baseDao.reportList(null,null); |
|
|
|
if (CollectionUtils.isEmpty(reportList)){ |
|
|
|
return allReportList; |
|
|
|
} |
|
|
@ -192,7 +195,7 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<JiMuReportResultDTO> reportIdAndName(ReportListFormDTO formDTO) { |
|
|
|
List<ReportResultDTO> reportList = baseDao.reportList(formDTO.getCategoryKeys()); |
|
|
|
List<ReportResultDTO> reportList = baseDao.reportList(formDTO.getCategoryKeys(), formDTO.getCustomerId()); |
|
|
|
if (CollectionUtils.isEmpty(reportList)){ |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
@ -201,14 +204,17 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor |
|
|
|
recordIds.forEach(r -> { |
|
|
|
JiMuReportFormDTO form = new JiMuReportFormDTO(); |
|
|
|
form.setId(r); |
|
|
|
// Result<String> url = getUrl(NumConstant.ONE, r);
|
|
|
|
// if (!report.success()){
|
|
|
|
// throw new EpmetException("查询报表失败:"+r);
|
|
|
|
// }
|
|
|
|
// JiMuReportResultDTO data = report.getData();
|
|
|
|
// data.setReportId(data.getId());
|
|
|
|
// data.setReportName(data.getReportName());
|
|
|
|
// result.add(data);
|
|
|
|
Result<String> url = getUrl(NumConstant.ONE, r); |
|
|
|
log.info("模板详情"+url); |
|
|
|
Map<String,Object> map = JSON.parseObject(url.getData(), Map.class); |
|
|
|
if (!map.containsValue(true)){ |
|
|
|
throw new EpmetException("获取jm报表详情失败:"+r); |
|
|
|
} |
|
|
|
Map<String,Object> map2 = (Map<String,Object>)map.get("result"); |
|
|
|
JiMuReportResultDTO data = ConvertUtils.mapToEntity(map2, JiMuReportResultDTO.class); |
|
|
|
data.setReportId(data.getId()); |
|
|
|
data.setReportName(data.getName()); |
|
|
|
result.add(data); |
|
|
|
}); |
|
|
|
return result; |
|
|
|
} |
|
|
@ -234,8 +240,7 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor |
|
|
|
Result<String> result; |
|
|
|
try { |
|
|
|
InetAddress localHost = InetAddress.getLocalHost(); |
|
|
|
// add = localHost.getHostAddress();
|
|
|
|
add = "http://192.168.1.141:8118"; |
|
|
|
add = "http://"+localHost.getHostAddress()+":8118"; |
|
|
|
System.out.println(add); |
|
|
|
}catch (Exception e){ |
|
|
|
log.warn("获取url失败"); |
|
|
@ -255,12 +260,17 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor |
|
|
|
headers.put("Content-Type", "application/json;charset=utf-8"); |
|
|
|
result = HttpClientManager.getInstance().sendGet(add, params, headers); |
|
|
|
}else { |
|
|
|
add.concat("/jmreport/show"); |
|
|
|
add = add.concat("/jmreport/show"); |
|
|
|
Map<String,Object> params = new HashMap<>(16); |
|
|
|
params.put("id",id); |
|
|
|
params.put("apiUrl",""); |
|
|
|
params.put("params",""); |
|
|
|
Map<String,String> headers = new HashMap<>(16); |
|
|
|
headers.put("token", EpmetRequestHolder.getHeader("Authorization")); |
|
|
|
result = HttpClientManager.getInstance().sendPostAndHeader(add, params, headers); |
|
|
|
headers.put("X-Access-Token", EpmetRequestHolder.getHeader("Authorization")); |
|
|
|
headers.put("Accept", "application/json, text/plain, */*"); |
|
|
|
headers.put("Content-Type", "application/json;charset=utf-8"); |
|
|
|
result = HttpClientManager.getInstance().sendPostByJSONAndHeader(add, JSON.toJSONString(params), headers); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|