Merge remote-tracking branch 'origin/master'

master
bynt 2 years ago
commit 7d3ca20a73

@ -1,7 +1,9 @@
package com.baiye.modules.telemarkting.api;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.baiye.constant.DefaultNumberConstants;
@ -15,6 +17,7 @@ import com.baiye.modules.platform.service.OrganizeService;
import com.baiye.modules.system.service.UserService;
import com.baiye.modules.telemarkting.entity.dto.*;
import com.baiye.modules.telemarkting.service.TelephoneCallService;
import com.baiye.util.RedisUtils;
import com.baiye.util.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -47,10 +50,16 @@ public class TelephoneCallController {
private final CompanyService companyService;
private final UserService userService;
private final RedisUtils redisUtils;
@PostMapping("/telephone/req")
@ApiOperation("拨打电话")
public CommonResponse<TelephoneCallStopDTO> doubleCallReq(@Validated @RequestBody TelephoneCallReqDTO telephoneCallReqDTO) {
String key = "tele:" + telephoneCallReqDTO.getUserData();
if (redisUtils.get(key) != null) {
return CommonResponse.createByErrorMessage("请三分钟后再拨打此线索");
}
if (ObjectUtil.isEmpty(telephoneCallReqDTO)) {
return CommonResponse.createByError();
}
@ -97,6 +106,9 @@ public class TelephoneCallController {
}
}
}
redisUtils.set(key, RandomUtil.randomString(4), 180);
return CommonResponse.createByError();
}
@ -141,6 +153,7 @@ public class TelephoneCallController {
public CommonResponse<Object> doubleCallStop(@RequestBody TelephoneCallStopDTO telephoneCallStopDTO) {
return telephoneCallService.doubleCallStop(telephoneCallStopDTO);
}
@PostMapping("/roll/stop")
@ApiOperation("点呼挂断呼叫")
public CommonResponse<Object> rollCallStop(@RequestBody TelephoneCallStopDTO telephoneCallStopDTO) {

@ -39,4 +39,7 @@ public class PublicCluePoolQueryCriteria {
@ApiModelProperty(value = "线索最新通话时间")
private List<Timestamp> newestCallTime;
@ApiModelProperty(value = "0-冷静期 1-可用")
private Integer status;
}

@ -414,6 +414,9 @@ public class ClueJpa {
Long companyId = clueQueryCriteria.getCompanyId();
sql.append(" and p.company_id = :companyId ");
List<Timestamp> newestCallTimeList = clueQueryCriteria.getNewestCallTime();
if (clueQueryCriteria.getStatus() != null) {
sql.append("and p.status = :status ");
}
if (StringUtils.isNotBlank(clueQueryCriteria.getName())) {
sql.append("and c.name like :name ");
}
@ -446,6 +449,9 @@ public class ClueJpa {
query.setParameter("number", pageable.getPageNumber() * pageable.getPageSize());
query.setParameter("size", pageable.getPageSize());
}
if (clueQueryCriteria.getStatus() != null) {
query.setParameter("status", clueQueryCriteria.getStatus());
}
if (StringUtils.isNotBlank(clueQueryCriteria.getName())) {
query.setParameter("name", "%" + clueQueryCriteria.getName() + "%");
}

Loading…
Cancel
Save