From 373ae63bb1d5ad550d87613ada30a9aaa184d98e Mon Sep 17 00:00:00 2001 From: wjt Date: Fri, 10 Mar 2023 17:26:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=85=AC=E6=B5=B7=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/baiye/model/dto/PublicCluePoolQueryCriteria.java | 3 +++ .../src/main/java/com/baiye/module/dao/ClueJpa.java | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/ad-platform-pojo/src/main/java/com/baiye/model/dto/PublicCluePoolQueryCriteria.java b/ad-platform-pojo/src/main/java/com/baiye/model/dto/PublicCluePoolQueryCriteria.java index 5479da0d..bace6486 100644 --- a/ad-platform-pojo/src/main/java/com/baiye/model/dto/PublicCluePoolQueryCriteria.java +++ b/ad-platform-pojo/src/main/java/com/baiye/model/dto/PublicCluePoolQueryCriteria.java @@ -39,4 +39,7 @@ public class PublicCluePoolQueryCriteria { @ApiModelProperty(value = "线索最新通话时间") private List newestCallTime; + + @ApiModelProperty(value = "0-冷静期 1-可用") + private Integer status; } diff --git a/ad-platform-services/ad-platform-source/src/main/java/com/baiye/module/dao/ClueJpa.java b/ad-platform-services/ad-platform-source/src/main/java/com/baiye/module/dao/ClueJpa.java index d38bc695..b3805853 100644 --- a/ad-platform-services/ad-platform-source/src/main/java/com/baiye/module/dao/ClueJpa.java +++ b/ad-platform-services/ad-platform-source/src/main/java/com/baiye/module/dao/ClueJpa.java @@ -414,6 +414,9 @@ public class ClueJpa { Long companyId = clueQueryCriteria.getCompanyId(); sql.append(" and p.company_id = :companyId "); List 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() + "%"); } From a1ef32d99f80fc326da4bb410e62d6192d3ca0e4 Mon Sep 17 00:00:00 2001 From: wjt Date: Fri, 10 Mar 2023 17:51:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=99=90=E5=88=B6=E5=86=8D=E6=AC=A1?= =?UTF-8?q?=E6=8B=A8=E6=89=93=E7=94=B5=E8=AF=9D=E7=9A=84=E9=A2=91=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../telemarkting/api/TelephoneCallController.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ad-platform-manage/ad-platform-management/src/main/java/com/baiye/modules/telemarkting/api/TelephoneCallController.java b/ad-platform-manage/ad-platform-management/src/main/java/com/baiye/modules/telemarkting/api/TelephoneCallController.java index 8a990f82..bd052927 100644 --- a/ad-platform-manage/ad-platform-management/src/main/java/com/baiye/modules/telemarkting/api/TelephoneCallController.java +++ b/ad-platform-manage/ad-platform-management/src/main/java/com/baiye/modules/telemarkting/api/TelephoneCallController.java @@ -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 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 doubleCallStop(@RequestBody TelephoneCallStopDTO telephoneCallStopDTO) { return telephoneCallService.doubleCallStop(telephoneCallStopDTO); } + @PostMapping("/roll/stop") @ApiOperation("点呼挂断呼叫") public CommonResponse rollCallStop(@RequestBody TelephoneCallStopDTO telephoneCallStopDTO) {