diff --git a/ad-platform-common/ad-platform-common-core/src/main/java/com/baiye/constant/ClueTypeConstants.java b/ad-platform-common/ad-platform-common-core/src/main/java/com/baiye/constant/ClueTypeConstants.java index 4cfea804..7fa3f48b 100644 --- a/ad-platform-common/ad-platform-common-core/src/main/java/com/baiye/constant/ClueTypeConstants.java +++ b/ad-platform-common/ad-platform-common-core/src/main/java/com/baiye/constant/ClueTypeConstants.java @@ -12,4 +12,5 @@ public class ClueTypeConstants { public static final Integer[] SCREEN_TYPE = new Integer[]{0, 1, 2, 3, 6, 7}; public static final Integer[] TOKER_TYPE = new Integer[]{4, 5}; public static final Integer[] CLUE_POOL = new Integer[]{0, 8, 1, 3}; + public static final Integer[] CRM_TOKER = new Integer[]{6, 7}; } 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 40931949..cc0ea95c 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 @@ -56,8 +56,8 @@ public class TelephoneCallController { DateTime time = (DateTime) o; long between = DateUtil.between(time, DateUtil.date(), DateUnit.MINUTE); long l = 60 - between; - if (l < 1) { - throw new BadRequestException("请1分钟后再次呼叫"); + if (l < DefaultNumberConstants.THREE_NUMBER) { + throw new BadRequestException("请3分钟后再次呼叫"); } throw new BadRequestException("请" + l + "分钟后再次呼叫"); } diff --git a/ad-platform-manage/ad-platform-management/src/main/java/com/baiye/modules/telemarkting/service/impl/ExtensionNumberServiceImpl.java b/ad-platform-manage/ad-platform-management/src/main/java/com/baiye/modules/telemarkting/service/impl/ExtensionNumberServiceImpl.java index 4b6cfbaa..301eebd8 100644 --- a/ad-platform-manage/ad-platform-management/src/main/java/com/baiye/modules/telemarkting/service/impl/ExtensionNumberServiceImpl.java +++ b/ad-platform-manage/ad-platform-management/src/main/java/com/baiye/modules/telemarkting/service/impl/ExtensionNumberServiceImpl.java @@ -140,7 +140,7 @@ public class ExtensionNumberServiceImpl implements ExtensionNumberService { List> read = reader.read(0, reader.getRowCount()); Company company = companyService.findById(companyId); for (List objects : read) { - String number = String.valueOf(objects.get(0)); + String number = String.valueOf(objects.get(0)).trim(); //去重 ExtensionNumber extensionNumber = extensionNumberRepository.findByNumber(Integer.valueOf(number)); if (ObjectUtil.isNotEmpty(extensionNumber) && extensionNumber.getNumber() != null) { diff --git a/ad-platform-pojo/src/main/java/com/baiye/model/dto/ClueDto.java b/ad-platform-pojo/src/main/java/com/baiye/model/dto/ClueDto.java index df51ffaf..d33e6726 100644 --- a/ad-platform-pojo/src/main/java/com/baiye/model/dto/ClueDto.java +++ b/ad-platform-pojo/src/main/java/com/baiye/model/dto/ClueDto.java @@ -129,4 +129,6 @@ public class ClueDto implements Serializable { private Integer isEncryption; @ApiModelProperty(value = "线索是否冻结 0:未冻结 1:冻结") private Boolean isFreeze; + @ApiModelProperty(value = "拓客投流线索的来源任务") + private String originTaskName; } diff --git a/ad-platform-services/ad-platform-source/src/main/java/com/baiye/module/dao/ClueTalkRepository.java b/ad-platform-services/ad-platform-source/src/main/java/com/baiye/module/dao/ClueTalkRepository.java index 2d9b3718..3ce674e7 100644 --- a/ad-platform-services/ad-platform-source/src/main/java/com/baiye/module/dao/ClueTalkRepository.java +++ b/ad-platform-services/ad-platform-source/src/main/java/com/baiye/module/dao/ClueTalkRepository.java @@ -114,4 +114,7 @@ public interface ClueTalkRepository extends JpaRepository, JpaSp @Modifying @Query(value = " update tb_clue_talk set clue_call_status = ?2 ,newest_call_time = ?3 where clue_id = ?1 ", nativeQuery = true) void updateCallStatus(Long clueId, Integer clueCallStatus, String time); + + @Query(value = " from ClueTalk where clueId in ?1 ") + List queryTaskIdByClueId(List clueIds); } diff --git a/ad-platform-services/ad-platform-source/src/main/java/com/baiye/module/service/impl/ClueServiceImpl.java b/ad-platform-services/ad-platform-source/src/main/java/com/baiye/module/service/impl/ClueServiceImpl.java index 4448dfd1..d0b3c058 100644 --- a/ad-platform-services/ad-platform-source/src/main/java/com/baiye/module/service/impl/ClueServiceImpl.java +++ b/ad-platform-services/ad-platform-source/src/main/java/com/baiye/module/service/impl/ClueServiceImpl.java @@ -1069,6 +1069,9 @@ public class ClueServiceImpl implements ClueService { List conductRecords = conductRecordRepository.findByClueIdInOrderByCreateTimeDesc(clueIdList); Map> map = conductRecords.stream().collect(Collectors.groupingBy(ConductRecord::getClueId)); + List collect = clueList.stream().filter(clueDto -> Arrays.asList(ClueTypeConstants.CRM_TOKER).contains(clueDto.getClueType())).map(ClueDto::getId).collect(Collectors.toList()); + Map originByTalkClue = getOriginByTalkClue(collect); + for (ClueDto clue : clueList) { //获取缓存中任务名称 clue.setTaskName(findTaskName(clue.getTaskId())); @@ -1082,10 +1085,24 @@ public class ClueServiceImpl implements ClueService { List recordList = map.get(clue.getId()); clue.setClueRecord(recordList.get(0).getRecordInfo()); } + if (Arrays.asList(ClueTypeConstants.CRM_TOKER).contains(clue.getClueType())) { + clue.setOriginTaskName(findTaskName(originByTalkClue.get(clue.getId()))); + } } return PageUtil.toPage(clueList, count); } + public Map getOriginByTalkClue(List clueIds) { + List clueTalks = clueTalkRepository.queryTaskIdByClueId(clueIds); + Map taskIdByClueId = new HashMap<>(); + clueTalks.forEach(clueTalk -> { + if (!taskIdByClueId.containsKey(clueTalk.getClueId())) { + taskIdByClueId.put(clueTalk.getClueId(), clueTalk.getTaskId()); + } + }); + return taskIdByClueId; + } + /** * 获取任务id集合 */