|
|
@ -1870,13 +1870,38 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
|
d3.setClosedProjectCount(l.stream().collect(Collectors.summingInt(CustomerDataManageExcel::getClosedProjectCount))); |
|
|
|
d3.setPatrolPeopleCount(l.stream().collect(Collectors.summingInt(CustomerDataManageExcel::getPatrolPeopleCount))); |
|
|
|
d3.setPatrolCount(l.stream().collect(Collectors.summingInt(CustomerDataManageExcel::getPatrolCount))); |
|
|
|
d3.setPatrolDuration(""); |
|
|
|
d3.setPatrolDurationInteger(l.stream().collect(Collectors.summingInt(CustomerDataManageExcel::getPatrolDurationInteger))); |
|
|
|
d3.setPatrolDuration(getHm(d3.getPatrolDurationInteger())); |
|
|
|
l.add(d3); |
|
|
|
} |
|
|
|
String fileName = excelName(formDTO); |
|
|
|
ExcelUtils.exportExcelToTargetDisposeAll(response,fileName,l, CustomerDataManageExcel.class); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 秒转换时分 |
|
|
|
* @Param seconds |
|
|
|
* @author zxc |
|
|
|
* @date 2021/9/13 10:03 上午 |
|
|
|
*/ |
|
|
|
public String getHm(Integer seconds){ |
|
|
|
String result = "0分钟"; |
|
|
|
if (seconds >= NumConstant.SIXTY) { |
|
|
|
Integer hours = seconds / 3600; |
|
|
|
Integer minutes = seconds % 3600 / 60; |
|
|
|
result = (hours < NumConstant.ONE ? "" : hours + "小时") + (minutes < NumConstant.ONE ? "" : minutes + "分钟"); |
|
|
|
}else if (seconds < NumConstant.SIXTY && seconds > NumConstant.ZERO){ |
|
|
|
result = "1分钟"; |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 表头获取 |
|
|
|
* @Param formDTO |
|
|
|
* @author zxc |
|
|
|
* @date 2021/9/13 10:02 上午 |
|
|
|
*/ |
|
|
|
public String excelName(CustomerDataManageFormDTO formDTO){ |
|
|
|
StringBuffer s = new StringBuffer(); |
|
|
|
String agencyName = indexService.selectAgencyNameByAgencyId(formDTO.getAgencyId()); |
|
|
|