|
|
@ -87,28 +87,19 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<ReportResultDTO> reportList() { |
|
|
|
|
|
|
|
String authorization = EpmetRequestHolder.getHeader("Authorization"); |
|
|
|
|
|
|
|
// 自定义header传递
|
|
|
|
MultiValueMap<String, String> headers = new HttpHeaders(); |
|
|
|
headers.add("token", authorization); |
|
|
|
|
|
|
|
JiMuResult<JiMuPage<JiMuReportDetailResultDTO>> result = jiMuReportOpenFeignClient.getList(1, 10000, "", "datainfo", authorization, headers); |
|
|
|
|
|
|
|
// todo 下面的删掉吧
|
|
|
|
Result<String> url = getUrl(2, null); |
|
|
|
log.info("所有jm报表"+url); |
|
|
|
Map<String,Object> map = JSON.parseObject(url.getData(), Map.class); |
|
|
|
if (!map.containsValue(true)){ |
|
|
|
if (!result.isSuccess()){ |
|
|
|
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<Map<String,Object>> records = (List<Map<String,Object>>)result.getResult().getRecords(); |
|
|
|
List<JiMuReportResultDTO> allReports = new ArrayList<>(); |
|
|
|
map3.forEach(m -> { |
|
|
|
allReports.add(ConvertUtils.mapToEntity(m,JiMuReportResultDTO.class)); |
|
|
|
}); |
|
|
|
for (Map<String, Object> record : records) { |
|
|
|
allReports.add(ConvertUtils.mapToEntity(record,JiMuReportResultDTO.class)); |
|
|
|
} |
|
|
|
if (CollectionUtils.isEmpty(allReports)){ |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
@ -174,9 +165,9 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor |
|
|
|
} |
|
|
|
if (formDTO.getType().equals(CustomerFunctionConstant.REPORT_EDIT)){ |
|
|
|
// 单个编辑
|
|
|
|
baseDao.delCustomerReport(Arrays.asList(formDTO.getCustomerList().get(NumConstant.ZERO).getCustomerId())); |
|
|
|
baseDao.delCustomerReport(Arrays.asList(formDTO.getCustomerList().get(NumConstant.ZERO).getCustomerId()), formDTO.getReportId()); |
|
|
|
}else if (formDTO.getType().equals(CustomerFunctionConstant.REPORT_ADD)){ |
|
|
|
baseDao.delCustomerReport(null); |
|
|
|
baseDao.delCustomerReport(null, formDTO.getReportId()); |
|
|
|
} |
|
|
|
baseDao.delCustomerReportFun(reportIds); |
|
|
|
if (CollectionUtils.isNotEmpty(formDTO.getCustomerList())){ |
|
|
@ -218,6 +209,7 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor |
|
|
|
recordIds.forEach(r -> { |
|
|
|
JiMuReportFormDTO form = new JiMuReportFormDTO(); |
|
|
|
form.setId(r); |
|
|
|
JiMuResult<Map<String, Object>> report = jiMuReportOpenFeignClient.getReport(form); |
|
|
|
Result<String> url = getUrl(NumConstant.ONE, r); |
|
|
|
log.info("模板详情"+url); |
|
|
|
Map<String,Object> map = JSON.parseObject(url.getData(), Map.class); |
|
|
@ -254,8 +246,8 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor |
|
|
|
Result<String> result; |
|
|
|
try { |
|
|
|
InetAddress localHost = InetAddress.getLocalHost(); |
|
|
|
add = "http://"+localHost.getHostAddress()+":8118"; |
|
|
|
System.out.println(add); |
|
|
|
// add = "http://"+localHost.getHostAddress()+":8118";
|
|
|
|
add = "http://"+"192.168.1.141"+":8118"; |
|
|
|
}catch (Exception e){ |
|
|
|
log.warn("获取url失败"); |
|
|
|
} |
|
|
|