diff --git a/ad-platform-pojo/src/main/java/com/baiye/model/vo/ResSourceLabel.java b/ad-platform-pojo/src/main/java/com/baiye/model/vo/ResSourceLabel.java index f8415068..464ad5f6 100644 --- a/ad-platform-pojo/src/main/java/com/baiye/model/vo/ResSourceLabel.java +++ b/ad-platform-pojo/src/main/java/com/baiye/model/vo/ResSourceLabel.java @@ -11,5 +11,5 @@ public class ResSourceLabel { private Long clueId; - private String remark; + private String remark; } diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/report/api/ReportController.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/report/api/ReportController.java index 6afca5b8..3a4fdc1f 100644 --- a/manage/ad-platform-management/src/main/java/com/baiye/modules/report/api/ReportController.java +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/report/api/ReportController.java @@ -53,7 +53,7 @@ public class ReportController { } @GetMapping("/report/single/task") - @ApiOperation("导出单个任务的线索统计信息") + @ApiOperation("查单个任务的线索统计信息") public CommonResponse reportTaskReport(Long id) { return reportService.reportSingleTaskReport(id); } diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/report/service/impl/ReportServiceImpl.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/report/service/impl/ReportServiceImpl.java index de55fc64..86976a75 100644 --- a/manage/ad-platform-management/src/main/java/com/baiye/modules/report/service/impl/ReportServiceImpl.java +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/report/service/impl/ReportServiceImpl.java @@ -135,11 +135,11 @@ public class ReportServiceImpl implements ReportService { //获取线索名 String clueName = null; List label = new ArrayList<>(); - String remark =null; + String remark = null; if (clueMap.containsKey(key)) { ResSourceLabel resSourceLabel = clueMap.get(key); clueName = resSourceLabel.getName(); - remark =resSourceLabel.getRemark(); + remark = resSourceLabel.getRemark(); label = JSONUtil.toList(JSONUtil.parseArray(resSourceLabel.getSourceLabel()), String.class); } @@ -422,7 +422,6 @@ public class ReportServiceImpl implements ReportService { s.setUserId(userId); if (CollUtil.isEmpty(ids)) { ids = new ArrayList<>(); - log.debug("==================== the userId as {} ====================", userId); getTaskId(ids, userId); s.setIds(ids); } @@ -562,12 +561,10 @@ public class ReportServiceImpl implements ReportService { for (Task info : tasks) { taskInfos.put(info.getId(), info); } - log.debug("================== the map size as {} ==================", mapByTask.size()); for (Long key : mapByTask.keySet()) { HashMap mapVo = new HashMap(16); //按时间分 HashMap> 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(); String taskName = taskInfos.get(key).getTaskName(); @@ -660,18 +657,23 @@ public class ReportServiceImpl implements ReportService { //统计通话时长 int doubleClueTime = 0; if (CollUtil.isNotEmpty(doubleCallInfo)) { - doubleClueTime = doubleCallInfo.stream().mapToInt(AllCallInfo::getDuration).sum(); - if (doubleClueTime > 0) { - //有通话时长 说明电话打通 - turnOnNum++; + for(AllCallInfo ai:doubleCallInfo){ + if(ai.getStatus() == DefaultNumberConstants.TWO_NUMBER){ + turnOnNum++; + doubleClueTime+=ai.getDuration(); + } } +// doubleClueTime = doubleCallInfo.stream().mapToInt(AllCallInfo::getDuration).sum(); +// if (doubleClueTime > 0) { +// //有通话时长 说明电话打通 +// turnOnNum++; +// } } breatheTotalDuration += doubleClueTime; } breatheAverageDuration = NumberUtil.div(breatheTotalDuration, callClueInfos.size(), 2); } - //这里使用数和接通数是分开的,真实的使用数 为 这里的使用数+接通数 - usrNum += turnOnNum; + if (usrNum != 0) { //接通率=接通数/使用数 turnOnRate = NumberUtil.div(turnOnNum, usrNum, 2); diff --git a/services/ad-platform-source/src/main/java/com/baiye/module/dao/ClueJpa.java b/services/ad-platform-source/src/main/java/com/baiye/module/dao/ClueJpa.java index 831bf53d..d3baecaa 100644 --- a/services/ad-platform-source/src/main/java/com/baiye/module/dao/ClueJpa.java +++ b/services/ad-platform-source/src/main/java/com/baiye/module/dao/ClueJpa.java @@ -157,14 +157,14 @@ public class ClueJpa { return clueDtoList; } - public List findSourceLabel(List clueIds){ + public List findSourceLabel(List clueIds) { 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 "); - if (clueIds != null && clueIds.size() >0) { + 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) { sql.append("AND tcm.clue_id IN (:clueIds) "); } Query query = entityManager.createNativeQuery(sql.toString()); - if (clueIds != null && clueIds.size() >0) { + if (clueIds != null && clueIds.size() > 0) { query.setParameter("clueIds", clueIds); } query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP); @@ -177,7 +177,7 @@ public class ClueJpa { resSourceLabel.setName((String) row.get("name")); BigInteger clueId = (BigInteger) row.get("clueId"); resSourceLabel.setClueId(clueId.longValue()); - resSourceLabel.setSourceLabel((String) row.get("remark")); + resSourceLabel.setRemark((String) row.get("remark")); list.add(resSourceLabel); } return list;