Merge remote-tracking branch 'origin/master'

master
bynt 1 year ago
commit 4738c8ffdf

@ -30,9 +30,14 @@ public class ExcellentCases implements Serializable {
@Column(name = "url")
@NotNull(groups = AddGroup.class)
@ApiModelProperty(value = "id")
@ApiModelProperty(value = "url")
private String url;
@ApiModelProperty(value = "录音的id")
@Column(name = "session_id")
@NotNull(groups = AddGroup.class)
private String sessionId;
@Column(name = "create_by")
private Long createBy;

@ -4,12 +4,12 @@ import com.baiye.http.CommonResponse;
import com.baiye.modules.platform.domain.ExcellentCases;
import com.baiye.modules.platform.service.ExcellentCasesService;
import com.baiye.modules.platform.service.dto.ExcellentCasesQueryCriteria;
import com.baiye.modules.platform.service.dto.ScriptOrganizeQueryCriteria;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
@ -25,7 +25,7 @@ public class ExcellentCasesController {
@PostMapping("/addCases")
@ApiOperation("新增案例")
public CommonResponse<Object> addExcellentCases(@RequestBody ExcellentCases excellentCases) {
public CommonResponse<Object> addExcellentCases(@RequestBody @Validated ExcellentCases excellentCases) {
excellentCasesService.addExcellentCases(excellentCases);
return CommonResponse.createBySuccess();
}

@ -1,9 +1,11 @@
package com.baiye.modules.platform.rest;
import com.baiye.annotation.Inner;
import com.baiye.http.CommonResponse;
import com.baiye.modules.platform.service.QualityScoreService;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -27,6 +29,7 @@ public class QualityScoreController {
@GetMapping("/insert")
@Inner(value = false)
public CommonResponse<Object> insert(@RequestParam("id") Long id) {
qualityScoreService.insert(id);
return CommonResponse.createBySuccess();

@ -1,6 +1,7 @@
package com.baiye.modules.platform.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import com.baiye.config.properties.FileProperties;
@ -14,7 +15,6 @@ import com.baiye.util.QueryHelp;
import com.baiye.util.SecurityUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
@ -37,24 +37,19 @@ public class ExcellentCasesServiceImpl implements ExcellentCasesService {
private final FileProperties fileProperties;
@Value("${ocean.engine.welcomeUrl}")
private String sysPath;
@Override
public void addExcellentCases(ExcellentCases excellentCases) {
excellentCases.setCreateBy(SecurityUtils.getCurrentUserId());
excellentCases.setCreateTime(DateUtil.date());
URL url1 = URLUtil.url(excellentCases.getUrl());
BufferedInputStream inputStream = null;
String url = null;
BufferedInputStream inputStream;
String url;
try {
inputStream = new BufferedInputStream(url1.openStream());
String s = url1.getPath();
String substring = s.substring(s.lastIndexOf("/") + 1);
String substring = DateUtil.format(DateUtil.date(), "MMdd") + RandomUtil.randomString(6) + ".wav";
File file = inputStreamToFile(inputStream, substring);
log.info("地址=={}", file.getPath());
url = sysPath + file.getPath();
url = "cases" + File.separator + substring;
} catch (Exception e) {
e.printStackTrace();
throw new BadRequestException("保存错误,获取录音错误");
@ -68,7 +63,7 @@ public class ExcellentCasesServiceImpl implements ExcellentCasesService {
public File inputStreamToFile(InputStream ins, String name) throws Exception {
String path = fileProperties.getPath().getPath();
File file = new File(path + File.separator + "record" + name);
File file = new File(path + File.separator + "cases" + File.separator + name);
if (file.exists()) {
return file;
}

@ -32,6 +32,8 @@ public class CallRecordDetailsDTO {
*/
@ExcelProperty(value = "跟进人", index = 1)
private String memberName;
private String sessionId;
/**
*
*/

@ -520,7 +520,7 @@ public class ClueJpa {
*/
@Transactional(rollbackOn = Exception.class)
public List<ClueTalkDTO> getReportCallInfo(String beginTime, String endTime, Long managerId) {
StringBuilder sql = new StringBuilder("select tcm.newest_call_time as newestCallTime,tcm.clue_call_status as clueCallStatus ,tc.create_by as managerId " +
StringBuilder sql = new StringBuilder("select tcm.newest_call_time as newestCallTime,tcm.clue_call_status as clueCallStatus ,tcm.member_status as memberStatus,tc.create_by as managerId " +
"from tb_clue_talk as tcm left join tb_clue as tc on tcm.clue_id =tc.id " +
" where tcm.newest_call_time between :beginTime and :endTime ");
if (managerId != null) {
@ -543,6 +543,7 @@ public class ClueJpa {
clueDto.setManagerId(id.longValue());
clueDto.setClueCallStatus((Integer) row.get("clueCallStatus"));
clueDto.setNewestCallTime((Date) row.get("newestCallTime"));
clueDto.setMemberStatus((Integer) row.get("memberStatus"));
clueDtoList.add(clueDto);
}
return clueDtoList;

@ -54,12 +54,14 @@ public interface ClueTalkRepository extends JpaRepository<ClueTalk, Long>, JpaSp
/**
* 线
*
* @param userId
* @return
*/
@Query(value = " select count(*) from tb_clue_talk as tcm left join tb_clue as tc on tcm.clue_id =tc.id" +
" where tc.create_by = ?1", nativeQuery = true)
Integer countAllByCreateBy(Long userId);
/**
*
*
@ -92,4 +94,16 @@ public interface ClueTalkRepository extends JpaRepository<ClueTalk, Long>, JpaSp
* ID
*/
void deleteByMemberId(Long userId);
/**
* 线
*
* @param userId
* @param startTime
* @param endTime
* @return
*/
@Query(value = " select count(*) from tb_clue_talk as tcm left join tb_clue as tc on tcm.clue_id =tc.id" +
" where tc.create_by = ?1 and tcm.create_time between ?2 and ?3", nativeQuery = true)
Integer countByCreateTime(Long userId, String startTime, String endTime);
}

@ -47,6 +47,10 @@ public class ReportTokerCall {
@Column(name = "turn_on_rate")
private Double turnOnRate;
@ApiModelProperty(value = "有效数")
@Column(name = "effective_num")
private Integer effectiveNum;
@ApiModelProperty(value = "业务管理员")
@Column(name = "manager_id")
@JsonSerialize(using = ToStringSerializer.class)

@ -14,4 +14,6 @@ public class ClueTalkDTO {
private Date newestCallTime;
private Integer clueCallStatus;
private Integer memberStatus;
}

@ -411,18 +411,17 @@ public class ReportTokerServiceImpl implements ReportTokerService {
reportTokerCalls.addAll(reportTokerCalls1);
}
Map<String, Object> map = new HashMap<>(4);
List<ClueTalk> clueTalks = clueTalkRepository.findClueTalkByCreateBy(SecurityUtils.getCurrentUserId());
int addTotal = clueTalkRepository.countByCreateTime(SecurityUtils.getCurrentUserId(), beginTime, endTime);
int usrNum = 0;
int turnOnNum = 0;
double turnOnRate = 0;
int totalNum = 0;
if (CollUtil.isNotEmpty(clueTalks)) {
totalNum = clueTalks.size();
}
int effectiveNum = 0;
double effectiveRate = 0;
if (CollUtil.isNotEmpty(reportTokerCalls)) {
for (ReportTokerCall reportTokerCall : reportTokerCalls) {
usrNum += reportTokerCall.getUsrNum();
turnOnNum += reportTokerCall.getTurnOnNum();
effectiveNum += reportTokerCall.getEffectiveNum();
}
}
map.put("usrNum", usrNum);
@ -430,8 +429,13 @@ public class ReportTokerServiceImpl implements ReportTokerService {
if (usrNum > 0) {
turnOnRate = NumberUtil.div(turnOnNum, usrNum, 2);
}
if (turnOnNum > 0) {
effectiveRate = NumberUtil.div(effectiveNum, turnOnNum, 2);
}
map.put("turnOnRate", turnOnRate);
map.put("totalNum", totalNum);
map.put("totalNum", addTotal);
map.put("effectiveNum", effectiveNum);
map.put("effectiveRate", effectiveRate);
return CommonResponse.createBySuccess(map);
}

@ -129,6 +129,9 @@ public class ReportSync {
talkReport.setTurnOnNum(talkReport.getTurnOnNum() + 1);
talkReport.setUsrNum(talkReport.getUsrNum() + 1);
}
if (clueTalk.getMemberStatus() == DefaultNumberConstants.FOUR_NUMBER) {
talkReport.setEffectiveNum(talkReport.getEffectiveNum() + 1);
}
}
rate(talkReport, totalNum);
talkReport.setManagerId(key);

Loading…
Cancel
Save