修改呼叫导出文件

master
wujingtao 3 years ago
parent 5429e953a9
commit 62b6e3fff1

@ -53,7 +53,7 @@ public class ReportController {
} }
@GetMapping("/report/single/task") @GetMapping("/report/single/task")
@ApiOperation("导出单个任务的线索统计信息") @ApiOperation("单个任务的线索统计信息")
public CommonResponse<Object> reportTaskReport(Long id) { public CommonResponse<Object> reportTaskReport(Long id) {
return reportService.reportSingleTaskReport(id); return reportService.reportSingleTaskReport(id);
} }

@ -422,7 +422,6 @@ public class ReportServiceImpl implements ReportService {
s.setUserId(userId); s.setUserId(userId);
if (CollUtil.isEmpty(ids)) { if (CollUtil.isEmpty(ids)) {
ids = new ArrayList<>(); ids = new ArrayList<>();
log.debug("==================== the userId as {} ====================", userId);
getTaskId(ids, userId); getTaskId(ids, userId);
s.setIds(ids); s.setIds(ids);
} }
@ -562,12 +561,10 @@ public class ReportServiceImpl implements ReportService {
for (Task info : tasks) { for (Task info : tasks) {
taskInfos.put(info.getId(), info); taskInfos.put(info.getId(), info);
} }
log.debug("================== the map size as {} ==================", mapByTask.size());
for (Long key : mapByTask.keySet()) { for (Long key : mapByTask.keySet()) {
HashMap<String, Object> mapVo = new HashMap<String, Object>(16); HashMap<String, Object> mapVo = new HashMap<String, Object>(16);
//按时间分 //按时间分
HashMap<String, List<CallClueInfo>> mapByTime = getGroupByTime(s.getBeginTime(), s.getEndTime(), mapByTask.get(key), s.getType()); HashMap<String, List<CallClueInfo>> mapByTime = getGroupByTime(s.getBeginTime(), s.getEndTime(), mapByTask.get(key), s.getType());
log.debug("================== the task json as {} ==================", JSONUtil.toJsonStr(taskInfos.get(key)));
int total = taskInfos.get(key).getTotalNumber(); int total = taskInfos.get(key).getTotalNumber();
String taskName = taskInfos.get(key).getTaskName(); String taskName = taskInfos.get(key).getTaskName();
@ -660,18 +657,23 @@ public class ReportServiceImpl implements ReportService {
//统计通话时长 //统计通话时长
int doubleClueTime = 0; int doubleClueTime = 0;
if (CollUtil.isNotEmpty(doubleCallInfo)) { if (CollUtil.isNotEmpty(doubleCallInfo)) {
doubleClueTime = doubleCallInfo.stream().mapToInt(AllCallInfo::getDuration).sum(); for(AllCallInfo ai:doubleCallInfo){
if (doubleClueTime > 0) { if(ai.getStatus() == DefaultNumberConstants.TWO_NUMBER){
//有通话时长 说明电话打通
turnOnNum++; turnOnNum++;
doubleClueTime+=ai.getDuration();
} }
} }
// doubleClueTime = doubleCallInfo.stream().mapToInt(AllCallInfo::getDuration).sum();
// if (doubleClueTime > 0) {
// //有通话时长 说明电话打通
// turnOnNum++;
// }
}
breatheTotalDuration += doubleClueTime; breatheTotalDuration += doubleClueTime;
} }
breatheAverageDuration = NumberUtil.div(breatheTotalDuration, callClueInfos.size(), 2); breatheAverageDuration = NumberUtil.div(breatheTotalDuration, callClueInfos.size(), 2);
} }
//这里使用数和接通数是分开的,真实的使用数 为 这里的使用数+接通数
usrNum += turnOnNum;
if (usrNum != 0) { if (usrNum != 0) {
//接通率=接通数/使用数 //接通率=接通数/使用数
turnOnRate = NumberUtil.div(turnOnNum, usrNum, 2); turnOnRate = NumberUtil.div(turnOnNum, usrNum, 2);

@ -159,7 +159,7 @@ public class ClueJpa {
public List<ResSourceLabel> findSourceLabel(List<Long> clueIds) { public List<ResSourceLabel> findSourceLabel(List<Long> clueIds) {
StringBuilder sql = new StringBuilder(); StringBuilder sql = new StringBuilder();
sql.append("select tcm.source_label sourceLabel, clue_id as clueId,tc.name as name,tcm.remark as remark from tb_clue_middle tcm LEFT JOIN tb_clue tc on tcm.clue_id = tc.id where 1=1 "); sql.append("select tcm.source_label as sourceLabel, clue_id as clueId,tc.name as name,tcm.remark as remark from tb_clue_middle tcm LEFT JOIN tb_clue tc on tcm.clue_id = tc.id where 1=1 ");
if (clueIds != null && clueIds.size() > 0) { if (clueIds != null && clueIds.size() > 0) {
sql.append("AND tcm.clue_id IN (:clueIds) "); sql.append("AND tcm.clue_id IN (:clueIds) ");
} }
@ -177,7 +177,7 @@ public class ClueJpa {
resSourceLabel.setName((String) row.get("name")); resSourceLabel.setName((String) row.get("name"));
BigInteger clueId = (BigInteger) row.get("clueId"); BigInteger clueId = (BigInteger) row.get("clueId");
resSourceLabel.setClueId(clueId.longValue()); resSourceLabel.setClueId(clueId.longValue());
resSourceLabel.setSourceLabel((String) row.get("remark")); resSourceLabel.setRemark((String) row.get("remark"));
list.add(resSourceLabel); list.add(resSourceLabel);
} }
return list; return list;

Loading…
Cancel
Save