线索通话记录详情

master
wujingtao 2 years ago
parent d0c32c9c35
commit 2ef2b1358a

@ -82,4 +82,10 @@ public class ReportController {
public CommonResponse<Object> getTurnOnIds(@RequestBody List<Long> clueIds) {
return queryReportService.getTurnOnIds(clueIds);
}
@GetMapping("/report/details")
@ApiOperation("获取通话记录详情")
public CommonResponse<Object> getCallRecordDetails(@RequestParam(value = "clueId") Long clueId) {
return queryReportService.getCallRecordDetails(clueId);
}
}

@ -0,0 +1,45 @@
package com.baiye.modules.report.entity.dto;
import lombok.Data;
import java.util.Date;
/**
* @author wujingtao
* @date 2022/05/12
*/
@Data
public class CallRecordDetailsDTO {
/**
* 线id
*/
private Long clueId;
/**
* 线
*/
private String clueName;
/**
* id
*/
private Long memberId;
/**
*
*/
private String memberName;
/**
*
*/
private Integer duration;
/**
*
*/
private String recordFileDownloadUrl;
/**
*
*/
private Date creatTime;
/**
*
*/
private Integer status;
}

@ -76,8 +76,17 @@ public interface QueryReportService {
/**
* 线
*
* @param clueIds
* @return
*/
CommonResponse<Object> getTurnOnIds(List<Long> clueIds);
/**
* 线
*
* @param clueId
* @return
*/
CommonResponse<Object> getCallRecordDetails(Long clueId);
}

@ -2,6 +2,7 @@ package com.baiye.modules.report.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
@ -18,10 +19,12 @@ import com.baiye.modules.report.dao.TaskReportRepository;
import com.baiye.modules.report.dao.UserReportRepository;
import com.baiye.modules.report.entity.TaskReport;
import com.baiye.modules.report.entity.UserReport;
import com.baiye.modules.report.entity.dto.CallRecordDetailsDTO;
import com.baiye.modules.report.entity.dto.StatisticalReportDTO;
import com.baiye.modules.report.entity.dto.UploadTaskDTO;
import com.baiye.modules.report.entity.vo.MemberInfoVO;
import com.baiye.modules.report.service.QueryReportService;
import com.baiye.modules.system.domain.Clue;
import com.baiye.modules.system.domain.Organize;
import com.baiye.modules.system.domain.Task;
import com.baiye.modules.system.domain.User;
@ -81,6 +84,7 @@ public class QueryReportServiceImpl implements QueryReportService {
MemberInfoVO messageInfo = getMessageInfo(beginOfDay, endOfDay, callClueInfos);
return CommonResponse.createBySuccess(messageInfo);
}
/**
* id
*
@ -467,6 +471,33 @@ public class QueryReportServiceImpl implements QueryReportService {
return CommonResponse.createBySuccess(list);
}
@Override
public CommonResponse<Object> getCallRecordDetails(Long clueId) {
//查询线索的所有通话记录
List<AllCallInfo> allByClueId = allCallInfoRepository.findAllByClueId(clueId);
List<CallRecordDetailsDTO> listDto = Convert.toList(CallRecordDetailsDTO.class, allByClueId);
//资源信息
Clue clue = sourceClueClient.queryDetails(clueId).getBody();
String clueName = "";
if (clue != null) {
clueName = clue.getName();
}
List<Long> memberIds = allByClueId.stream().distinct().map(AllCallInfo::getMemberId).collect(Collectors.toList());
Map<Long, String> memberMap = new HashMap<>();
for (CallRecordDetailsDTO info : listDto) {
if (memberMap.containsKey(info.getMemberId())) {
info.setMemberName(memberMap.get(info.getMemberId()));
info.setClueName(clueName);
}
}
return CommonResponse.createBySuccess(listDto);
}
/**
*
*/

@ -81,4 +81,11 @@ public interface AllCallInfoRepository extends JpaRepository<AllCallInfo, Long>,
*/
@Query(value = "select clue_id from tb_call_info where clue_id in ?1 and status = ?2", nativeQuery = true)
List<Long> queryIdsByStatusAndClueId(List<Long> clueIds, Integer status);
/**
* 线
* @param clueId
* @return
*/
List<AllCallInfo> findAllByClueId(Long clueId);
}

Loading…
Cancel
Save