Merge branch 'dev/feat/partner1.3_20230828' into hxd/feat/labelAndlLine

# Conflicts:
#	coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java
#	coolstore-partner-service/pom.xml
This commit is contained in:
xiaodong.hu
2023-08-14 15:10:31 +08:00
110 changed files with 4559 additions and 135 deletions

View File

@@ -26,6 +26,8 @@ public class CommonConstants {
public static final int NORMAL_LOCK_TIMES = 60 * 1000; public static final int NORMAL_LOCK_TIMES = 60 * 1000;
public static final int AN_HOUR_SECONDS = 3600;
/** /**
* 企业开通锁存活时间 * 企业开通锁存活时间
*/ */
@@ -101,6 +103,7 @@ public class CommonConstants {
public static final int EIGHTY = 80; public static final int EIGHTY = 80;
public static final int NINETY = 90; public static final int NINETY = 90;
public static final int HUNDRED = 100; public static final int HUNDRED = 100;
public static final int ONE_THOUSAND = 1000;
public static final String ONE_STR = "1"; public static final String ONE_STR = "1";
@@ -126,4 +129,8 @@ public class CommonConstants {
// 短信模版-资质审核通过 // 短信模版-资质审核通过
public static final String SMS_TEMPLATE_CODE_VERIFY = "SMS_461980876"; public static final String SMS_TEMPLATE_CODE_VERIFY = "SMS_461980876";
public static final String DAY_END_TIME_SUFFIX = " 23:59:59";
public static final String DAY_START_TIME_SUFFIX = " 00:00:00";
} }

View File

@@ -0,0 +1,17 @@
package com.cool.store.constants;
/**
* @author zhangchenbiao
* @FileName: MessageConstants
* @Description:通知消息常量
* @date 2023-08-14 14:41
*/
public class MessageConstants {
public static final String FOLLOW_TASK_MESSAGE_TITLE = "线索跟进任务";
public static final String FOLLOW_TASK_MESSAGE_CONTENT = "您有一个线索跟进任务将于{0}截止 ,线索信息{1}手机号{2},请及时跟进";
public static final String FOLLOW_TASK_MESSAGE_CONTENT_1 = "您有{0}个线索跟进任务将于今日截止,及{1}个跟进任务已逾期,请及时跟进";
public static final String FOLLOW_TASK_MESSAGE_CONTENT_2 = "您有{0}个跟进任务已逾期,请及时跟进";
public static final String FOLLOW_TASK_MESSAGE_CONTENT_3 = "您有{1}个线索跟进任务将于今日截止,请及时跟进";
}

View File

@@ -0,0 +1,25 @@
package com.cool.store.enums;
public enum CallStatusEnum {
PENDING_CALL(0, "待呼叫"),
CALL_ANSWERED(1, "呼叫接听"),
CALL_MISSED(2, "呼叫未接听"),
CALL_FAILED(3, "呼叫失败");
private final int code;
private final String message;
CallStatusEnum(int code, String message) {
this.code = code;
this.message = message;
}
public int getCode() {
return code;
}
public String getMessage() {
return message;
}
}

View File

@@ -61,6 +61,9 @@ public enum ErrorCodeEnum {
INTENT_AREA_NOT_BING_ZONE(500007, "意向区域没有绑定战区 分配招商经理失败!", null), INTENT_AREA_NOT_BING_ZONE(500007, "意向区域没有绑定战区 分配招商经理失败!", null),
PUBLIC_LINE_NOT_OPERATE(500008, "公海线索不允许操作!", null), PUBLIC_LINE_NOT_OPERATE(500008, "公海线索不允许操作!", null),
PARTNER_BASE_INFO_NOT_EXIST(500009, "加盟商信息不存在!", null), PARTNER_BASE_INFO_NOT_EXIST(500009, "加盟商信息不存在!", null),
LINE_STATUS_NOT_ALLOW_OPERATE(500010, "当前线索状态不允许该操作!", null),
TASK_STATUS_NOT_ALLOW_OPERATE(500011, "当前任务状态不允许该操作!", null),
DATELINE_BEFORE_NOW(500012, "截止时间不能早于当前时间!", null),
PARTNER_MOBILE_EXIST(500010, "手机号码已存在,请核实!", null), PARTNER_MOBILE_EXIST(500010, "手机号码已存在,请核实!", null),
INTERVIEW_ENTER_FAIL(1021101, "进入面试间失败", null), INTERVIEW_ENTER_FAIL(1021101, "进入面试间失败", null),

View File

@@ -0,0 +1,34 @@
package com.cool.store.enums;
/**
* @author zhangchenbiao
* @FileName: FollowTaskStatusEnum
* @Description:
* @date 2023-08-10 10:47
*/
public enum FollowTaskStatusEnum {
TODO(0, "待完成"),
FINISHED(1, "已完成"),
OVERDUE(2, "已逾期"),
CANCELLED(3, "作废"),
;
//任务状态:0:待完成、1:已完成、2:已逾期、3:作废
private Integer code;
private String remark;
FollowTaskStatusEnum(Integer code, String remark) {
this.code = code;
this.remark = remark;
}
public Integer getCode() {
return code;
}
public String getRemark() {
return remark;
}
}

View File

@@ -46,6 +46,8 @@ public enum OperateLogFieldValueEnum {
BEFORE_CLERK_INFO_UPDATE("beforeClerkUpdate", "修改前的意向书员工信息"), BEFORE_CLERK_INFO_UPDATE("beforeClerkUpdate", "修改前的意向书员工信息"),
AFTER_CLERK_INFO_UPDATE("afterClerkUpdate", "修改后的意向书员工信息"), AFTER_CLERK_INFO_UPDATE("afterClerkUpdate", "修改后的意向书员工信息"),
FOLLOW_LOG("followLog", "跟进日志"),
FOLLOW_TASK_ID("followTaskId", "跟进任务id")
; ;

View File

@@ -35,6 +35,8 @@ public enum OperateTypeEnum {
INTENT_INFO_SUBMIT("intent_info_submit", "提交意向申请书", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, AFTER_BASE_INFO_UPDATE, AFTER_INTENT_INFO_UPDATE, AFTER_CLERK_INFO_UPDATE)), INTENT_INFO_SUBMIT("intent_info_submit", "提交意向申请书", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, AFTER_BASE_INFO_UPDATE, AFTER_INTENT_INFO_UPDATE, AFTER_CLERK_INFO_UPDATE)),
INTENT_INFO_UPDATE("intent_info_update", "修改意向申请书", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_BASE_INFO_UPDATE, AFTER_BASE_INFO_UPDATE, BEFORE_INTENT_INFO_UPDATE, AFTER_INTENT_INFO_UPDATE, BEFORE_CLERK_INFO_UPDATE, AFTER_CLERK_INFO_UPDATE)), INTENT_INFO_UPDATE("intent_info_update", "修改意向申请书", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_BASE_INFO_UPDATE, AFTER_BASE_INFO_UPDATE, BEFORE_INTENT_INFO_UPDATE, AFTER_INTENT_INFO_UPDATE, BEFORE_CLERK_INFO_UPDATE, AFTER_CLERK_INFO_UPDATE)),
ADD_TAGS("add_tags", "修改意向申请书", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME)), ADD_TAGS("add_tags", "修改意向申请书", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME)),
ADD_FOLLOW_LOG("add_follow_log", "新增根据日志", Arrays.asList(FOLLOW_LOG)),
ADD_FOLLOW_TASK("add_follow_task", "新增跟进任务", Arrays.asList(FOLLOW_TASK_ID))
; ;
private String code; private String code;

View File

@@ -1,12 +1,9 @@
package com.cool.store.utils; package com.cool.store.utils;
import cn.hutool.core.date.DateUtil;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.*; import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;

View File

@@ -50,6 +50,11 @@
<version>1.3.7</version> <version>1.3.7</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper</artifactId>
<version>4.1.4</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -0,0 +1,143 @@
package com.cool.store.dao;
import com.cool.store.entity.HyFollowTaskDO;
import com.cool.store.enums.FollowTaskStatusEnum;
import com.cool.store.mapper.HyFollowTaskMapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
/**
* @author zhangchenbiao
* @FileName: HyFollowTaskDAO
* @Description:
* @date 2023-08-10 10:35
*/
@Repository
public class HyFollowTaskDAO {
@Resource
private HyFollowTaskMapper hyFollowTaskMapper;
/**
* 获取跟进任务想去
* @param followTaskId
* @return
*/
public HyFollowTaskDO getFollowTask(Long followTaskId){
if(Objects.isNull(followTaskId)){
return null;
}
return hyFollowTaskMapper.getFollowTask(followTaskId);
}
/**
* 新增跟进任务
* @param request
* @return
*/
public Long addFollowTask(HyFollowTaskDO request){
if(StringUtils.isBlank(request.getFollowUserId()) || Objects.isNull(request.getPartnerLineId())){
return null;
}
hyFollowTaskMapper.insertSelective(request);
return request.getId();
}
/**
* 更新跟进任务
* @param request
* @return
*/
public Integer updateFollowTask(HyFollowTaskDO request){
if(Objects.isNull(request.getId())){
return null;
}
return hyFollowTaskMapper.updateByPrimaryKeySelective(request);
}
/**
* 完成更近任务
* @param followTaskId
* @return
*/
public Integer finishFollowTask(Long followTaskId){
HyFollowTaskDO update = new HyFollowTaskDO();
update.setId(followTaskId);
update.setTaskStatus(FollowTaskStatusEnum.FINISHED.getCode());
return updateFollowTask(update);
}
/**
* 取消跟进任务
* @param followTaskId
* @return
*/
public Integer cancelFollowTask(Long followTaskId){
HyFollowTaskDO update = new HyFollowTaskDO();
update.setId(followTaskId);
update.setTaskStatus(FollowTaskStatusEnum.CANCELLED.getCode());
return updateFollowTask(update);
}
/**
* 获取线索的所有任务
* @param partnerLineId
* @return
*/
public List<HyFollowTaskDO> getTaskListByLineId(Long partnerLineId){
if(Objects.isNull(partnerLineId)){
return Lists.newArrayList();
}
return hyFollowTaskMapper.getTaskListByLineId(partnerLineId);
}
/**
* 分页获取任务
* @param followUserId
* @param taskStatus
* @param deadlineStartTIme
* @param deadlineEndTIme
* @param pageNum
* @param pageSize
* @return
*/
public Page<HyFollowTaskDO> getTaskPage(String followUserId, Integer taskStatus, String deadlineStartTIme, String deadlineEndTIme, Integer pageNum, Integer pageSize){
if(StringUtils.isBlank(followUserId)){
return new Page<>();
}
PageHelper.startPage(pageNum, pageSize);
return hyFollowTaskMapper.getTaskPage(followUserId, taskStatus, deadlineStartTIme, deadlineEndTIme);
}
/**
* 更新未完成的任务跟进人
* @param partnerLineId
* @param userId
*/
public void updateUndoTaskFollowUserId(Long partnerLineId, String userId){
if(Objects.isNull(partnerLineId) || StringUtils.isNotBlank(userId)){
return;
}
hyFollowTaskMapper.updateUndoTaskFollowUserId(partnerLineId, userId);
}
/**
* 作废待完成&已逾期的任务
* @param partnerLineId
*/
public void cancelUndoFollowTask(Long partnerLineId){
if(Objects.isNull(partnerLineId)){
return;
}
hyFollowTaskMapper.cancelUndoFollowTask(partnerLineId);
}
}

View File

@@ -5,6 +5,7 @@ import com.cool.store.entity.HyPartnerIntentInfoDO;
import com.cool.store.mapper.HyPartnerIntentInfoMapper; import com.cool.store.mapper.HyPartnerIntentInfoMapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.annotation.Resource; import javax.annotation.Resource;
@@ -40,11 +41,12 @@ public class HyPartnerIntentInfoDAO {
} }
public List<PartnerIntentApplyInfoDTO> selectPartnerIntentApplyInfoList(String userId, String workflowStage, String workflowStatus){ public List<PartnerIntentApplyInfoDTO> selectPartnerIntentApplyInfoList(String userId, String workflowStage, String workflowStatus, String keyword, Integer callStatus,
List<String> userPortraitIdList, String lastFollowStartTime, String lastFollowEndTime, String userChannelIdList){
if (StringUtils.isEmpty(userId)){ if (StringUtils.isEmpty(userId)){
return new ArrayList<>(); return new ArrayList<>();
} }
return hyPartnerIntentInfoMapper.selectPartnerIntentApplyInfoList(userId,workflowStage,workflowStatus); return hyPartnerIntentInfoMapper.selectPartnerIntentApplyInfoList(userId,workflowStage,workflowStatus,keyword,callStatus,userPortraitIdList,lastFollowStartTime,lastFollowEndTime,userChannelIdList);
} }

View File

@@ -1,5 +1,7 @@
package com.cool.store.dao; package com.cool.store.dao;
import cn.hutool.core.map.MapUtil;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dto.partner.PartnerBlackListDTO; import com.cool.store.dto.partner.PartnerBlackListDTO;
import com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO; import com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO;
import com.cool.store.dto.partner.StageCountDTO; import com.cool.store.dto.partner.StageCountDTO;
@@ -8,13 +10,15 @@ import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.mapper.HyPartnerLineInfoMapper; import com.cool.store.mapper.HyPartnerLineInfoMapper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.Date; import java.util.function.Function;
import java.util.List; import java.util.stream.Collectors;
/** /**
* @Author suzhuhong * @Author suzhuhong
@@ -180,4 +184,25 @@ public class HyPartnerLineInfoDAO {
return hyPartnerLineInfoMapper.getLineFollowHistoryList(partnerId); return hyPartnerLineInfoMapper.getLineFollowHistoryList(partnerId);
} }
/**
* 获取线索加盟商简要信息
* @param partnerLineIds
* @return
*/
public Map<Long, PartnerSimpleInfoDTO> getPartnerSimpleInfoByLineIds(List<Long> partnerLineIds){
if(CollectionUtils.isEmpty(partnerLineIds)){
return MapUtil.newHashMap();
}
List<PartnerSimpleInfoDTO> partnerList = hyPartnerLineInfoMapper.getPartnerSimpleInfoByLineIds(partnerLineIds);
return ListUtils.emptyIfNull(partnerList).stream().collect(Collectors.toMap(k->k.getPartnerLineId(), Function.identity(), (k1, k2)->k1));
}
public PartnerSimpleInfoDTO getPartnerSimpleInfoByLineId(Long partnerLineId){
if(Objects.isNull(partnerLineId)){
return null;
}
List<PartnerSimpleInfoDTO> partnerList = hyPartnerLineInfoMapper.getPartnerSimpleInfoByLineIds(Arrays.asList(partnerLineId));
return CollectionUtils.isEmpty(partnerList) ? null : partnerList.get(CommonConstants.ZERO);
}
} }

View File

@@ -0,0 +1,29 @@
package com.cool.store.mapper;
import com.cool.store.entity.CallRecordDO;
import org.apache.ibatis.annotations.Param;
/**
* @author zhangchenbiao
* @date 2023-08-11 01:03
*/
public interface CallRecordMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-08-11 01:03
*/
int insertSelective(CallRecordDO record);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-08-11 01:03
*/
int updateByPrimaryKeySelective(CallRecordDO record);
int updateByTransNoSelective(CallRecordDO record);
CallRecordDO selectByTransNo(String transNo);
}

View File

@@ -0,0 +1,66 @@
package com.cool.store.mapper;
import com.cool.store.entity.HyFollowTaskDO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-08-10 10:10
*/
public interface HyFollowTaskMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-08-10 10:10
*/
int insertSelective(@Param("record") HyFollowTaskDO record);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-08-10 10:10
*/
int updateByPrimaryKeySelective(@Param("record") HyFollowTaskDO record);
/**
* 根据线索获取任务列表
* @param partnerLineId
* @return
*/
List<HyFollowTaskDO> getTaskListByLineId(@Param("partnerLineId")Long partnerLineId);
/**
* 获取任务列表
* @param followUserId
* @param taskStatus
* @param deadlineStartTIme
* @param deadlineEndTIme
* @return
*/
Page<HyFollowTaskDO> getTaskPage(@Param("followUserId")String followUserId, @Param("taskStatus")Integer taskStatus, @Param("deadlineStartTIme")String deadlineStartTIme, @Param("deadlineEndTIme")String deadlineEndTIme);
/**
* 获取跟进任务详情
* @param followTaskId
* @return
*/
HyFollowTaskDO getFollowTask(@Param("followTaskId") Long followTaskId);
/**
* 更新任务跟进人
* @param partnerLineId
* @param followUserId
*/
Integer updateUndoTaskFollowUserId(@Param("partnerLineId") Long partnerLineId, @Param("followUserId") String followUserId);
/**
* 作废未完成的跟进任务
* @param partnerLineId
* @return
*/
Integer cancelUndoFollowTask(@Param("partnerLineId") Long partnerLineId);
}

View File

@@ -0,0 +1,39 @@
package com.cool.store.mapper;
import com.cool.store.dto.outbound.OutboundListDTO;
import com.cool.store.entity.HyOutboundMobileDO;
import com.cool.store.vo.HyOutboundVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author Fun Li
* @date 2023/08/09
*/
public interface HyOutboundMobileMapper {
int deleteByPrimaryKey(Long id);
int insert(HyOutboundMobileDO record);
int insertSelective(HyOutboundMobileDO record);
HyOutboundMobileDO selectByPrimaryKey(Long id);
List<HyOutboundMobileDO> selectByPrimarySelective(HyOutboundMobileDO hyOutboundMobileDO);
int updateByPrimaryKeySelective(HyOutboundMobileDO record);
int updateByPrimaryKey(HyOutboundMobileDO record);
/**
* 获取呼出手机号列表
*
* @param dto
* @param userId
* @return
*/
List<HyOutboundVo> getOutboundNumberList(@Param("dto") OutboundListDTO dto, @Param("userId") String userId);
}

View File

@@ -38,8 +38,14 @@ public interface HyPartnerIntentInfoMapper {
* @return * @return
*/ */
List<PartnerIntentApplyInfoDTO> selectPartnerIntentApplyInfoList(@Param("userId") String userId, List<PartnerIntentApplyInfoDTO> selectPartnerIntentApplyInfoList(@Param("userId") String userId,
@Param("workflowStage") String workflowStage , @Param("workflowStage") String workflowStage ,
@Param("workflowStatus") String workflowStatus); @Param("workflowStatus") String workflowStatus,
@Param("keyword") String keyword,
@Param("callStatus") Integer callStatus,
@Param("userPortraitIdList") List<String> userPortraitIdList,
@Param("lastFollowStartTime") String lastFollowStartTime,
@Param("lastFollowEndTime") String lastFollowEndTime,
@Param("userChannelIdList") String userChannelIdList);
/** /**
* 根据线索ID查询数据 * 根据线索ID查询数据

View File

@@ -0,0 +1,32 @@
package com.cool.store.mapper;
import com.cool.store.entity.HyPartnerLabelGroupDO;
import com.cool.store.vo.LabelGroupListVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author Fun Li 2023/8/10 13:25
* @version 1.0
*/
@Mapper
public interface HyPartnerLabelGroupMapper {
int deleteByPrimaryKey(Long id);
int insert(HyPartnerLabelGroupDO record);
int insertSelective(HyPartnerLabelGroupDO record);
HyPartnerLabelGroupDO selectByPrimaryKey(Long id);
List<HyPartnerLabelGroupDO> selectSelective(HyPartnerLabelGroupDO record);
List<LabelGroupListVo> getLabelGroupList(HyPartnerLabelGroupDO record);
int updateByPrimaryKeySelective(HyPartnerLabelGroupDO record);
int updateByPrimaryKey(HyPartnerLabelGroupDO record);
}

View File

@@ -0,0 +1,38 @@
package com.cool.store.mapper;
import com.cool.store.dto.label.LabelListDTO;
import com.cool.store.entity.HyPartnerLabelDO;
import com.cool.store.vo.LabelListVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author Fun Li
* @date 2023-08-10
*/
public interface HyPartnerLabelMapper {
int deleteByPrimaryKey(Long id);
int insert(HyPartnerLabelDO record);
int insertSelective(HyPartnerLabelDO record);
HyPartnerLabelDO selectByPrimaryKey(Long id);
List<HyPartnerLabelDO> selectSelective(HyPartnerLabelDO labelDO);
int updateByPrimaryKeySelective(HyPartnerLabelDO record);
int updateByPrimaryKey(HyPartnerLabelDO record);
List<LabelListVo> getLabelList(LabelListDTO dto);
/**
* 某个标签组内是否有未删除的标签
* @param labelGroupId 标签组 id
*/
Boolean whetherGroupInUse(@Param("labelGroupId") Long labelGroupId);
List<HyPartnerLabelDO> getLabelListByIds(@Param("labelIds") List<Long> labelIds);
}

View File

@@ -225,4 +225,12 @@ public interface HyPartnerLineInfoMapper {
@Param("endTime") Date endTime); @Param("endTime") Date endTime);
void batchUpdateStatusByLineIds(@Param("lineIds") List<Long> lineIds, @Param("status")Integer status); void batchUpdateStatusByLineIds(@Param("lineIds") List<Long> lineIds, @Param("status")Integer status);
/**
* 获取线索简要信息
* @param partnerLineIds
* @return
*/
List<PartnerSimpleInfoDTO> getPartnerSimpleInfoByLineIds(@Param("partnerLineIds") List<Long> partnerLineIds);
} }

View File

@@ -4,6 +4,8 @@ import com.cool.store.entity.HyPartnerUserChannelDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface HyPartnerUserChannelMapper { public interface HyPartnerUserChannelMapper {
@@ -22,4 +24,8 @@ public interface HyPartnerUserChannelMapper {
HyPartnerUserChannelDO selectByChannelId(@Param("channelId") Long id); HyPartnerUserChannelDO selectByChannelId(@Param("channelId") Long id);
HyPartnerUserChannelDO selectByChannelName(@Param("channelName") String channelName); HyPartnerUserChannelDO selectByChannelName(@Param("channelName") String channelName);
List<HyPartnerUserChannelDO> getAllUserChannel();
List<HyPartnerUserChannelDO> getUserChannelByIds(List<Integer> userChannelIds);
} }

View File

@@ -0,0 +1,242 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.CallRecordMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.CallRecordDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="partner_line_id" jdbcType="BIGINT" property="partnerLineId" />
<result column="trans_no" jdbcType="VARCHAR" property="transNo" />
<result column="outgoing_mobile" jdbcType="VARCHAR" property="outgoingMobile" />
<result column="outgoing_user_id" jdbcType="VARCHAR" property="outgoingUserId" />
<result column="incoming_mobile" jdbcType="VARCHAR" property="incomingMobile" />
<result column="incoming_user_id" jdbcType="VARCHAR" property="incomingUserId" />
<result column="call_start_time" jdbcType="TIMESTAMP" property="callStartTime" />
<result column="call_end_time" jdbcType="TIMESTAMP" property="callEndTime" />
<result column="record_url" jdbcType="VARCHAR" property="recordUrl" />
<result column="call_status" jdbcType="TINYINT" property="callStatus" />
<result column="fail_reason" jdbcType="VARCHAR" property="failReason" />
<result column="creater" jdbcType="VARCHAR" property="creater" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="updater" jdbcType="VARCHAR" property="updater" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
id, partner_line_id, trans_no, outgoing_mobile, outgoing_user_id, incoming_mobile,
incoming_user_id, call_start_time, call_end_time, record_url, call_status, fail_reason,
creater, create_time, updater, update_time, remark
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
insert into call_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="partnerLineId != null">
partner_line_id,
</if>
<if test="transNo != null">
trans_no,
</if>
<if test="outgoingMobile != null">
outgoing_mobile,
</if>
<if test="outgoingUserId != null">
outgoing_user_id,
</if>
<if test="incomingMobile != null">
incoming_mobile,
</if>
<if test="incomingUserId != null">
incoming_user_id,
</if>
<if test="callStartTime != null">
call_start_time,
</if>
<if test="callEndTime != null">
call_end_time,
</if>
<if test="recordUrl != null">
record_url,
</if>
<if test="callStatus != null">
call_status,
</if>
<if test="failReason != null">
fail_reason,
</if>
<if test="creater != null">
creater,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updater != null">
updater,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="partnerLineId != null">
#{partnerLineId},
</if>
<if test="transNo != null">
#{transNo},
</if>
<if test="outgoingMobile != null">
#{outgoingMobile},
</if>
<if test="outgoingUserId != null">
#{outgoingUserId},
</if>
<if test="incomingMobile != null">
#{incomingMobile},
</if>
<if test="incomingUserId != null">
#{incomingUserId},
</if>
<if test="callStartTime != null">
#{callStartTime},
</if>
<if test="callEndTime != null">
#{callEndTime},
</if>
<if test="recordUrl != null">
#{recordUrl},
</if>
<if test="callStatus != null">
#{callStatus},
</if>
<if test="failReason != null">
#{failReason},
</if>
<if test="creater != null">
#{creater},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updater != null">
#{updater},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="remark != null">
#{remark},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update call_record
<set>
<if test="partnerLineId != null">
partner_line_id = #{partnerLineId},
</if>
<if test="transNo != null">
trans_no = #{transNo},
</if>
<if test="outgoingMobile != null">
outgoing_mobile = #{outgoingMobile},
</if>
<if test="outgoingUserId != null">
outgoing_user_id = #{outgoingUserId},
</if>
<if test="incomingMobile != null">
incoming_mobile = #{incomingMobile},
</if>
<if test="incomingUserId != null">
incoming_user_id = #{incomingUserId},
</if>
<if test="callStartTime != null">
call_start_time = #{callStartTime},
</if>
<if test="callEndTime != null">
call_end_time = #{callEndTime},
</if>
<if test="recordUrl != null">
record_url = #{recordUrl},
</if>
<if test="callStatus != null">
call_status = #{callStatus},
</if>
<if test="failReason != null">
fail_reason = #{failReason},
</if>
<if test="creater != null">
creater = #{creater},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updater != null">
updater = #{updater},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="remark != null">
remark = #{remark},
</if>
</set>
where id = #{id}
</update>
<update id="updateByTransNoSelective">
update call_record
<set>
<if test="partnerLineId != null">
partner_line_id = #{partnerLineId},
</if>
<if test="outgoingMobile != null">
outgoing_mobile = #{outgoingMobile},
</if>
<if test="outgoingUserId != null">
outgoing_user_id = #{outgoingUserId},
</if>
<if test="incomingMobile != null">
incoming_mobile = #{incomingMobile},
</if>
<if test="incomingUserId != null">
incoming_user_id = #{incomingUserId},
</if>
<if test="callStartTime != null">
call_start_time = #{callStartTime},
</if>
<if test="callEndTime != null">
call_end_time = #{callEndTime},
</if>
<if test="recordUrl != null">
record_url = #{recordUrl},
</if>
<if test="callStatus != null">
call_status = #{callStatus},
</if>
<if test="failReason != null">
fail_reason = #{failReason},
</if>
<if test="creater != null">
creater = #{creater},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updater != null">
updater = #{updater},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="remark != null">
remark = #{remark},
</if>
</set>
where trans_no = #{transNo}
</update>
<select id="selectByTransNo" resultType="com.cool.store.entity.CallRecordDO">
select
<include refid="Base_Column_List" />
from call_record
where trans_no = #{transNo}
</select>
</mapper>

View File

@@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.HyFollowTaskMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyFollowTaskDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="partner_line_id" jdbcType="BIGINT" property="partnerLineId"/>
<result column="follow_user_id" jdbcType="VARCHAR" property="followUserId"/>
<result column="task_title" jdbcType="VARCHAR" property="taskTitle"/>
<result column="communication_type" jdbcType="TINYINT" property="communicationType"/>
<result column="deadline" jdbcType="TIMESTAMP" property="deadline"/>
<result column="communication_content" jdbcType="VARCHAR" property="communicationContent"/>
<result column="task_status" jdbcType="TINYINT" property="taskStatus"/>
<result column="deleted" jdbcType="BIT" property="deleted"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, partner_line_id, follow_user_id, task_title, communication_type, deadline, communication_content,
task_status, deleted, create_time, update_time
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_follow_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerLineId != null">
partner_line_id,
</if>
<if test="record.followUserId != null">
follow_user_id,
</if>
<if test="record.taskTitle != null">
task_title,
</if>
<if test="record.communicationType != null">
communication_type,
</if>
<if test="record.deadline != null">
deadline,
</if>
<if test="record.communicationContent != null">
communication_content,
</if>
<if test="record.taskStatus != null">
task_status,
</if>
<if test="record.deleted != null">
deleted,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.partnerLineId != null">
#{record.partnerLineId},
</if>
<if test="record.followUserId != null">
#{record.followUserId},
</if>
<if test="record.taskTitle != null">
#{record.taskTitle},
</if>
<if test="record.communicationType != null">
#{record.communicationType},
</if>
<if test="record.deadline != null">
#{record.deadline},
</if>
<if test="record.communicationContent != null">
#{record.communicationContent},
</if>
<if test="record.taskStatus != null">
#{record.taskStatus},
</if>
<if test="record.deleted != null">
#{record.deleted},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update hy_follow_task
<set>
<if test="record.partnerLineId != null">
partner_line_id = #{record.partnerLineId},
</if>
<if test="record.followUserId != null">
follow_user_id = #{record.followUserId},
</if>
<if test="record.taskTitle != null">
task_title = #{record.taskTitle},
</if>
<if test="record.communicationType != null">
communication_type = #{record.communicationType},
</if>
<if test="record.deadline != null">
deadline = #{record.deadline},
</if>
<if test="record.communicationContent != null">
communication_content = #{record.communicationContent},
</if>
<if test="record.taskStatus != null">
task_status = #{record.taskStatus},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
</set>
where id = #{record.id}
</update>
<select id="getTaskListByLineId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
hy_follow_task
where
deleted = '0' and partner_line_id = #{partnerLineId}
</select>
<select id="getTaskPage" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
hy_follow_task
where
deleted = '0' and follow_user_id = #{followUserId}
<if test="taskStatus != null">
and task_status = #{taskStatus}
</if>
<if test="deadlineStartTIme != null">
and deadline >= #{deadlineStartTIme}
</if>
<if test="deadlineEndTIme != null">
<![CDATA[ and deadline <= #{deadlineEndTIme}]]>
</if>
</select>
<select id="getFollowTask" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
hy_follow_task
where
deleted = '0' and id = #{followTaskId}
</select>
<update id="updateUndoTaskFollowUserId">
update hy_follow_task set follow_user_id = #{followUserId} where partner_line_id = #{partnerLineId}
</update>
<update id="cancelUndoFollowTask">
update hy_follow_task set task_status = '3' where partner_line_id = #{partnerLineId} and task_status in ('0', '2')
</update>
</mapper>

View File

@@ -0,0 +1,179 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.HyOutboundMobileMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyOutboundMobileDO">
<id column="id" property="id" />
<result column="mobile" property="mobile" />
<result column="remark" property="remark" />
<result column="edit_user_id" property="editUserId" />
<result column="create_user_id" property="createUserId" />
<result column="update_user_id" property="updateUserId" />
<result column="deleted" property="deleted" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, mobile, remark, edit_user_id, create_user_id, update_user_id, deleted, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hy_outbound_mobile
where id = #{id}
</select>
<select id="selectByPrimarySelective" resultType="com.cool.store.entity.HyOutboundMobileDO">
select <include refid="Base_Column_List" />
from hy_outbound_mobile
where deleted = 0
<if test="id != null">
id = #{id}
</if>
<if test="mobile != null and mobile != ''">
and mobile = #{mobile}
</if>
<if test="editUserId != null and editUserId != ''">
and edit_user_id = #{editUserId}
</if>
<if test="remark != null and remark != ''">
and remark = #{remark}
</if>
<if test="createUserId != null">
and create_user_id = #{createUserId}
</if>
<if test="updateUserId != null">
and update_user_id = #{updateUserId}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from hy_outbound_mobile
where id = #{id}
</delete>
<insert id="insert" parameterType="com.cool.store.entity.HyOutboundMobileDO">
insert into hy_outbound_mobile (id, mobile, edit_user_id, remark,
create_user_id, update_user_id, deleted,
create_time, update_time)
values (#{id}, #{mobile}, #{editUserId}, #{remark},
#{createUserId}, #{updateUserId}, #{deleted},
#{createTime}, #{updateTime})
</insert>
<insert id="insertSelective" parameterType="com.cool.store.entity.HyOutboundMobileDO">
insert into hy_outbound_mobile
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="mobile != null and mobile != ''">
mobile,
</if>
<if test="editUserId != null and editUserId != ''">
edit_user_id,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
<if test="createUserId != null">
create_user_id,
</if>
<if test="updateUserId != null">
update_user_id,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="mobile != null and mobile != ''">
#{mobile},
</if>
<if test="remark != null and remark != ''">
#{remark},
</if>
<if test="editUserId != null and editUserId != ''">
#{editUserId},
</if>
<if test="createUserId != null">
#{createUserId},
</if>
<if test="updateUserId != null">
#{updateUserId},
</if>
<if test="deleted != null">
#{deleted},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyOutboundMobileDO">
update hy_outbound_mobile
<set>
<if test="mobile != null and mobile != ''">
mobile = #{mobile},
</if>
<if test="remark != null and remark != ''">
remark = #{remark},
</if>
<if test="editUserId != null and editUserId != ''">
edit_user_id = #{editUserId},
</if>
<if test="createUserId != null">
create_user_id = #{createUserId},
</if>
<if test="updateUserId != null">
update_user_id = #{updateUserId},
</if>
<if test="deleted != null">
deleted = #{deleted},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
</set>
where id = #{id}
</update>
<update id="updateByPrimaryKey" parameterType="com.cool.store.entity.HyOutboundMobileDO">
update hy_outbound_mobile
set mobile = #{mobile},
edit_user_id = #{editUserId},
remark = #{remark},
create_user_id = #{createUserId},
update_user_id = #{updateUserId},
deleted = #{deleted},
create_time = #{createTime},
update_time = #{updateTime}
where id = #{id}
</update>
<!-- 获取呼出手机号列表 -->
<select id="getOutboundNumberList" resultType="com.cool.store.vo.HyOutboundVo">
SELECT t1.id, t1.mobile as outboundNumber, t2.name as updaterName, t2.mobile as updaterMobile, t1.update_time as update_time
FROM hy_outbound_mobile t1
LEFT JOIN enterprise_user t2 ON t1.edit_user_id = t2.user_id
WHERE t2.deleted = 0 AND t1.deleted = 0
AND t1.edit_user_id = #{userId}
</select>
</mapper>

View File

@@ -261,13 +261,47 @@
b.id as id, b.id as id,
b.create_time as partnerSubmitTime, b.create_time as partnerSubmitTime,
b.deadline as deadline, b.deadline as deadline,
bi.user_portrait as userPortrait,
hpuinfo.mobile as mobile,
hpuinfo.username as partnerUserName,
hpuinfo.user_channel_id as userChannelId,
hpuinfo.live_area as liveArea, hpuinfo.live_area as liveArea,
hpuinfo.want_shop_area as wantShopArea, hpuinfo.want_shop_area as wantShopArea,
hpuinfo.accept_adjust_type as acceptAdjustType hpuinfo.accept_adjust_type as acceptAdjustType,
cr.create_time as lastFollowTime,
cr.call_status as callStatus
from hy_partner_line_info a from hy_partner_line_info a
left join hy_partner_intent_info b on a.id = b.partner_line_id left join hy_partner_intent_info b on a.id = b.partner_line_id
left join hy_partner_base_info bi on a.id = bi.partner_line_id
LEFT JOIN hy_partner_user_info hpuinfo ON a.partner_id = hpuinfo.partner_id LEFT JOIN hy_partner_user_info hpuinfo ON a.partner_id = hpuinfo.partner_id
LEFT join call_record cr on a.id = cr.partner_line_id
where deleted = 0 and line_status!=3 where deleted = 0 and line_status!=3
and (cr.id in (
select max(id) maxId
from call_record group by partner_line_id) or cr.id is null)
<if test="keyword!=null and keyword!=''">
and (hpuinfo.mobile like concat('%',#{keyword},'%') or hpuinfo.username like concat('%',#{keyword},'%'))
</if>
<if test="callStatus!=null and callStatus==1">
and cr.call_status = #{callStatus}
</if>
<if test="callStatus!=null and callStatus==0">
and cr.call_status != 1
</if>
<if test="lastFollowStartTime!=null and lastFollowEndTime!=null">
and cr.create_time>#{lastFollowStartTime} and cr.create_time <![CDATA[<]]> #{lastFollowEndTime}
</if>
<if test="userChannelIdList!=null and userChannelIdList.size>0">
<foreach collection="userChannelIdList" open="and hpuinfo.user_channel_id in (" close=")" separator="," item="userChannelId">
#{userChannelId}
</foreach>
</if>
<if test="userPortraitIdList!=null and userPortraitIdList.size>0">
and
<foreach collection="userPortraitIdList" separator="or" open="(" close=")" item="userPortraitId">
bi.user_portrait like concat("%,", #{userPortraitId}, ",%")
</foreach>
</if>
<if test="userId!=null and userId!=''"> <if test="userId!=null and userId!=''">
and a.investment_manager = #{userId} and a.investment_manager = #{userId}
</if> </if>

View File

@@ -302,6 +302,9 @@
hpli.partner_id as partnerId, hpli.partner_id as partnerId,
hpli.deadline as deadline, hpli.deadline as deadline,
hpli.workflow_status as status, hpli.workflow_status as status,
cr.create_time as lastFollowTime,
cr.call_status as callStatus,
bi.user_portrait as userPortrait,
a.id as interviewId, a.id as interviewId,
a.auth_code as authCode, a.auth_code as authCode,
a.approve_time as approveTime, a.approve_time as approveTime,
@@ -315,24 +318,26 @@
hpci.intention_contract_no as intentionContractNo hpci.intention_contract_no as intentionContractNo
from hy_partner_line_info hpli from hy_partner_line_info hpli
left join hy_partner_interview a on hpli.id = a.partner_line_id left join hy_partner_interview a on hpli.id = a.partner_line_id
left join hy_partner_base_info bi on hpli.id = bi.partner_line_id
left join hy_partner_interview_plan b on a.interview_plan_id = b.id left join hy_partner_interview_plan b on a.interview_plan_id = b.id
left join hy_partner_certification_info hpci on hpci.partner_interview_id = a.id left join hy_partner_certification_info hpci on hpci.partner_interview_id = a.id
<where> LEFT join call_record cr on hpli.id = cr.partner_line_id
and hpli.deleted = 0 and hpli.line_status!=3 where hpli.deleted = 0 and hpli.line_status!=3
<if test="filter"> and (cr.id in (
and b.deleted = 0 select max(id) maxId
</if> from call_record group by partner_line_id) or cr.id is null)
<if test="workflowStage!=null and workflowStage!=''"> <if test="filter">
and hpli.workflow_stage = #{workflowStage} and b.deleted = 0
</if> </if>
<if test="workflowStatus!=null and workflowStatus!=''"> <if test="workflowStage!=null and workflowStage!=''">
and hpli.workflow_status = #{workflowStatus} and hpli.workflow_stage = #{workflowStage}
</if> </if>
<if test="userId!=null and userId!=''"> <if test="workflowStatus!=null and workflowStatus!=''">
and hpli.investment_manager = #{userId} and hpli.workflow_status = #{workflowStatus}
</if> </if>
</where> <if test="userId!=null and userId!=''">
and hpli.investment_manager = #{userId}
</if>
</select> </select>
<select id="getInterviewList" resultType="com.cool.store.vo.interview.InterviewVO"> <select id="getInterviewList" resultType="com.cool.store.vo.interview.InterviewVO">

View File

@@ -0,0 +1,226 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.HyPartnerLabelGroupMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyPartnerLabelGroupDO">
<id column="id" property="id" />
<result column="label_group_name" property="labelGroupName" />
<result column="deleted" property="deleted" />
<result column="edit_user_id" property="editUserId" />
<result column="edit_date" property="editDate" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="create_user_id" property="createUserId" />
<result column="update_user_id" property="updateUserId" />
<result column="remark" property="remark" />
</resultMap>
<sql id="Base_Column_List">
id, label_group_name, deleted, edit_user_id, edit_date, create_time, update_time,
create_user_id, update_user_id, remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hy_partner_label_group
where id = #{id}
order by create_time
</select>
<select id="selectSelective" resultType="com.cool.store.entity.HyPartnerLabelGroupDO">
select <include refid="Base_Column_List"></include>
from hy_partner_label_group
where deleted = 0
<if test="labelGroupName != null and labelGroupName != ''">
and label_group_name = #{labelGroupName}
</if>
<if test="editUserId != null">
and edit_user_id = #{editUserId}
</if>
<if test="editDate != null">
and edit_date = #{editDate}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time =#{updateTime}
</if>
<if test="createUserId != null">
and create_user_id = #{createUserId}
</if>
<if test="updateUserId != null">
and update_user_id = #{updateUserId}
</if>
<if test="remark != null and remark != ''">
and remark like concat('%', #{remark}, '%')
</if>
order by create_time
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from hy_partner_label_group
where id = #{id}
<if test="id != null">
and id = #{id}
</if>
<if test="labelGroupName != null and labelGroupName != ''">
and label_group_name like concat('%', #{labelGroupName}, '%')
</if>
<if test="editUserId != null">
and edit_user_id = #{editUserId}
</if>
<if test="editDate != null">
and edit_date = #{editDate}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time =#{updateTime}
</if>
<if test="createUserId != null">
and create_user_id = #{createUserId}
</if>
<if test="updateUserId != null">
and update_user_id = #{updateUserId}
</if>
<if test="remark != null and remark != ''">
and remark like concat('%', #{remark}, '%')
</if>
</delete>
<insert id="insert" parameterType="com.cool.store.entity.HyPartnerLabelGroupDO">
insert into hy_partner_label_group (id, label_group_name, deleted,
edit_user_id, edit_date, create_time,
update_time, create_user_id, update_user_id,
remark)
values (#{id}, #{labelGroupName}, #{deleted},
#{editUserId}, #{editDate}, #{createTime},
#{updateTime}, #{createUserId}, #{updateUserId},
#{remark})
</insert>
<insert id="insertSelective" parameterType="com.cool.store.entity.HyPartnerLabelGroupDO">
insert into hy_partner_label_group
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="labelGroupName != null and labelGroupName != ''">
label_group_name,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="editUserId != null">
edit_user_id,
</if>
<if test="editDate != null">
edit_date,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createUserId != null">
create_user_id,
</if>
<if test="updateUserId != null">
update_user_id,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="labelGroupName != null">
#{labelGroupName},
</if>
<if test="deleted != null">
#{deleted},
</if>
<if test="editUserId != null">
#{editUserId},
</if>
<if test="editDate != null">
#{editDate},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="createUserId != null">
#{createUserId},
</if>
<if test="updateUserId != null">
#{updateUserId},
</if>
<if test="remark != null">
#{remark},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyPartnerLabelGroupDO">
update hy_partner_label_group
<set>
<if test="labelGroupName != null">
label_group_name = #{labelGroupName},
</if>
<if test="deleted != null">
deleted = #{deleted},
</if>
<if test="editUserId != null">
edit_user_id = #{editUserId},
</if>
<if test="editDate != null">
edit_date = #{editDate},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="createUserId != null">
create_user_id = #{createUserId},
</if>
<if test="updateUserId != null">
update_user_id = #{updateUserId},
</if>
<if test="remark != null">
remark = #{remark},
</if>
</set>
where id = #{id}
</update>
<update id="updateByPrimaryKey" parameterType="com.cool.store.entity.HyPartnerLabelGroupDO">
update hy_partner_label_group
set label_group_name = #{labelGroupName},
deleted = #{deleted},
edit_user_id = #{editUserId},
edit_date = #{editDate},
create_time = #{createTime},
update_time = #{updateTime},
create_user_id = #{createUserId},
update_user_id = #{updateUserId},
remark = #{remark}
where id = #{id}
</update>
<!-- 获取标签分组信息列表 -->
<select id="getLabelGroupList" resultType="com.cool.store.vo.LabelGroupListVo">
SELECT t1.id, t1.label_group_name, t2.`name` AS editName, t2.mobile AS editMobile, t1.edit_date
FROM hy_partner_label_group t1
LEFT JOIN enterprise_user t2 ON t1.edit_user_id = t2.user_id
WHERE t1.deleted = 0
<if test="labelGroupName != null and labelGroupName != ''">
AND t1.label_group_name LIKE CONCAT('%', #{labelGroupName}, '%')
</if>
ORDER BY t1.create_time DESC
</select>
</mapper>

View File

@@ -0,0 +1,234 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.HyPartnerLabelMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyPartnerLabelDO">
<id column="id" property="id" />
<result column="label_group_id" property="labelGroupId" />
<result column="label_name" property="labelName" />
<result column="edit_user_id" property="editUserId" />
<result column="edit_date" property="editDate" />
<result column="deleted" property="deleted" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="create_user_id" property="createUserId" />
<result column="update_user_id" property="updateUserId" />
<result column="remark" property="remark" />
</resultMap>
<sql id="Base_Column_List">
id, label_group_id, label_name, edit_user_id, edit_date, deleted, create_time, update_time,
create_user_id, update_user_id, remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hy_partner_label
where deleted = 0
and id = #{id}
order by create_time desc
</select>
<select id="selectSelective" resultType="com.cool.store.entity.HyPartnerLabelDO">
select <include refid="Base_Column_List"></include>
from hy_partner_label
where deleted = 0
<if test="labelGroupId != null">
and label_group_id = #{labelGroupId}
</if>
<if test="labelName != null and labelName != ''">
and label_name = #{labelName}
</if>
<if test="editUserId != null">
and edit_user_id = #{editUserId}
</if>
<if test="editDate != null">
and edit_date = #{editDate}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="createUserId != null">
and create_user_id = #{createUserId}
</if>
<if test="updateUserId != null">
and update_user_id = #{updateUserId}
</if>
<if test="remark != null">
and remark = #{remark}
</if>
order by create_time desc
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from hy_partner_label
where id = #{id}
</delete>
<insert id="insert" parameterType="com.cool.store.entity.HyPartnerLabelDO">
insert into hy_partner_label (id, label_group_id, label_name,
edit_user_id, edit_date, deleted,
create_time, update_time, create_user_id,
update_user_id, remark)
values (#{id}, #{labelGroupId}, #{labelName},
#{editUserId}, #{editDate}, #{deleted},
#{createTime}, #{updateTime}, #{createUserId},
#{updateUserId}, #{remark})
</insert>
<insert id="insertSelective" parameterType="com.cool.store.entity.HyPartnerLabelDO">
insert into hy_partner_label
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="labelGroupId != null">
label_group_id,
</if>
<if test="labelName != null">
label_name,
</if>
<if test="editUserId != null">
edit_user_id,
</if>
<if test="editDate != null">
edit_date,
</if>
<if test="deleted != null">
deleted,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createUserId != null">
create_user_id,
</if>
<if test="updateUserId != null">
update_user_id,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="labelGroupId != null">
#{labelGroupId},
</if>
<if test="labelName != null">
#{labelName},
</if>
<if test="editUserId != null">
#{editUserId},
</if>
<if test="editDate != null">
#{editDate},
</if>
<if test="deleted != null">
#{deleted},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="createUserId != null">
#{createUserId},
</if>
<if test="updateUserId != null">
#{updateUserId},
</if>
<if test="remark != null">
#{remark},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyPartnerLabelDO">
update hy_partner_label
<set>
<if test="labelGroupId != null">
label_group_id = #{labelGroupId},
</if>
<if test="labelName != null and labelName != ''">
label_name = #{labelName},
</if>
<if test="editUserId != null">
edit_user_id = #{editUserId},
</if>
<if test="editDate != null">
edit_date = #{editDate},
</if>
<if test="deleted != null">
deleted = #{deleted},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="createUserId != null">
create_user_id = #{createUserId},
</if>
<if test="updateUserId != null">
update_user_id = #{updateUserId},
</if>
<if test="remark != null">
remark = #{remark},
</if>
</set>
where deleted = 0
and id = #{id}
</update>
<update id="updateByPrimaryKey" parameterType="com.cool.store.entity.HyPartnerLabelDO">
update hy_partner_label
set label_group_id = #{labelGroupId},
label_name = #{labelName},
edit_user_id = #{editUserId},
edit_date = #{editDate},
deleted = #{deleted},
create_time = #{createTime},
update_time = #{updateTime},
create_user_id = #{createUserId},
update_user_id = #{updateUserId},
remark = #{remark}
where id = #{id}
</update>
<select id="getLabelList" resultType="com.cool.store.vo.LabelListVo">
SELECT t1.id, t2.id AS labelGroupId, t1.label_name, t2.label_group_name, t3.`name` AS editName, t3.mobile AS editMobile, t1.edit_date
FROM hy_partner_label t1
LEFT JOIN hy_partner_label_group t2 ON t1.label_group_id = t2.id
LEFT JOIN enterprise_user t3 ON t1.edit_user_id = t3.user_id
WHERE t1.deleted = 0 AND t2.deleted = 0
<if test="labelName != null and labelName != ''">
AND t1.label_name LIKE CONCAT('%', #{labelName} ,'%')
</if>
<if test="labelGroupId != null">
AND t2.id = #{labelGroupId}
</if>
ORDER BY t1.create_time DESC
</select>
<select id="whetherGroupInUse" resultType="java.lang.Boolean">
SELECT COUNT(*)
FROM hy_partner_label
WHERE deleted = 0
AND label_group_id = #{labelGroupId}
</select>
<select id="getLabelListByIds" resultMap="BaseResultMap">
select * from hy_partner_label where deleted = 0
<if test="labelIds!=null and labelIds.size>0">
<foreach collection="labelIds" item="labelId" open="and id in (" close=")" separator=",">
#{labelId}
</foreach>
</if>
</select>
</mapper>

View File

@@ -441,12 +441,15 @@
a.update_time as updateTime, a.update_time as updateTime,
b.partner_id as partner_id, b.partner_id as partner_id,
b.mobile as mobile, b.mobile as mobile,
b.user_channel_id as userChannelId,
b.username as userName, b.username as userName,
b.want_shop_area as wantShopArea, b.want_shop_area as wantShopArea,
b.accept_adjust_type as acceptAdjustType, b.accept_adjust_type as acceptAdjustType,
bi.user_portrait as userPortrait,
hpl.phone_address as phoneAddress hpl.phone_address as phoneAddress
FROM hy_partner_line_info a FROM hy_partner_line_info a
inner JOIN hy_partner_user_info b on a.partner_id = b.partner_id inner JOIN hy_partner_user_info b on a.partner_id = b.partner_id
left join hy_partner_base_info bi on hpli.id = bi.partner_line_id
LEFT JOIN hy_open_area_info hoai ON hoai.id = b.want_shop_area LEFT JOIN hy_open_area_info hoai ON hoai.id = b.want_shop_area
LEFT JOIN hy_phone_location hpl ON hpl.phone_number = b.mobile LEFT JOIN hy_phone_location hpl ON hpl.phone_number = b.mobile
where a.line_status = 0 and a.deleted = 0 where a.line_status = 0 and a.deleted = 0
@@ -485,6 +488,7 @@
hpli.development_manager as developmentManager, hpli.development_manager as developmentManager,
hpli.line_status as lineStatus, hpli.line_status as lineStatus,
hpli.update_time as updateTime, hpli.update_time as updateTime,
hpuinfo.user_channel_id as userChannelId,
hpuinfo.want_shop_area as wantShopArea, hpuinfo.want_shop_area as wantShopArea,
hpuinfo.accept_adjust_type as acceptAdjustType, hpuinfo.accept_adjust_type as acceptAdjustType,
hpuinfo.username as partnerUserName, hpuinfo.username as partnerUserName,
@@ -493,11 +497,13 @@
hpuinfo.shop_name as storeName, hpuinfo.shop_name as storeName,
hpuinfo.recommend_partner_name as recommendPartnerName, hpuinfo.recommend_partner_name as recommendPartnerName,
hpuinfo.recommend_partner_mobile as recommendPartnerMobile, hpuinfo.recommend_partner_mobile as recommendPartnerMobile,
bi.user_portrait as userPortrait,
eu.name as investmentManagerName, eu.name as investmentManagerName,
eu.mobile as investmentManagerMobile eu.mobile as investmentManagerMobile
FROM FROM
hy_partner_line_info hpli hy_partner_line_info hpli
LEFT JOIN hy_partner_intent_info hpii ON hpli.id = hpii.partner_line_id LEFT JOIN hy_partner_intent_info hpii ON hpli.id = hpii.partner_line_id
left join hy_partner_base_info bi on hpli.id = bi.partner_line_id
LEFT JOIN hy_partner_user_info hpuinfo ON hpli.partner_id = hpuinfo.partner_id LEFT JOIN hy_partner_user_info hpuinfo ON hpli.partner_id = hpuinfo.partner_id
LEFT JOIN enterprise_user eu ON hpli.investment_manager = eu.user_id LEFT JOIN enterprise_user eu ON hpli.investment_manager = eu.user_id
LEFT JOIN hy_open_area_info hoai ON hoai.id = hpuinfo.want_shop_area LEFT JOIN hy_open_area_info hoai ON hoai.id = hpuinfo.want_shop_area
@@ -660,4 +666,18 @@
</foreach> </foreach>
</update> </update>
<select id="getPartnerSimpleInfoByLineIds" resultType="com.cool.store.dto.partner.PartnerSimpleInfoDTO">
select
a.id as partnerLineId,
a.partner_id as partnerId,
a.workflow_stage as workflowStage,
a.line_status as lineStatus,
b.username as username,
b.mobile as mobile
from
hy_partner_line_info a inner join hy_partner_user_info b on a.partner_id = b.partner_id and a.deleted = '0'
where
a.id in <foreach collection="partnerLineIds" open="(" close=")" separator="," item="lineId">#{lineId}</foreach>
</select>
</mapper> </mapper>

View File

@@ -90,4 +90,19 @@
update_time = #{updateTime,jdbcType=TIMESTAMP} update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<select id="getAllUserChannel" resultMap="BaseResultMap">
select * from hy_partner_user_channel
</select>
<select id="getUserChannelByIds" resultMap="BaseResultMap">
select * from hy_partner_user_channel
<where>
<if test="userChannelIds!=null and userChannelIds.size>0">
<foreach collection="userChannelIds" item="userChannelId" open="channel_id in (" close=")" separator=",">
#{userChannelId}
</foreach>
</if>
</where>
</select>
</mapper> </mapper>

View File

@@ -1,5 +1,6 @@
package generator.defined; package generator.defined;
import org.apache.commons.lang3.StringUtils;
import org.mybatis.generator.api.CommentGenerator; import org.mybatis.generator.api.CommentGenerator;
import org.mybatis.generator.api.IntrospectedColumn; import org.mybatis.generator.api.IntrospectedColumn;
import org.mybatis.generator.api.IntrospectedTable; import org.mybatis.generator.api.IntrospectedTable;
@@ -63,6 +64,8 @@ public class MyCommentGenerator extends DefaultCommentGenerator implements Comme
topLevelClass.addJavaDocLine(" * @author " + author); topLevelClass.addJavaDocLine(" * @author " + author);
topLevelClass.addJavaDocLine(" * @date " + currentDateStr); topLevelClass.addJavaDocLine(" * @date " + currentDateStr);
topLevelClass.addJavaDocLine(" */"); topLevelClass.addJavaDocLine(" */");
String tableName = "\"" +introspectedTable.getFullyQualifiedTableNameAtRuntime()+"\"";
topLevelClass.addAnnotation("@Table(name = "+tableName+")");
} }
@Override @Override

View File

@@ -20,10 +20,13 @@ import org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.InsertSelective
import org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.UpdateByPrimaryKeySelectiveElementGenerator; import org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.UpdateByPrimaryKeySelectiveElementGenerator;
import org.mybatis.generator.config.GeneratedKey; import org.mybatis.generator.config.GeneratedKey;
import org.mybatis.generator.config.PropertyRegistry; import org.mybatis.generator.config.PropertyRegistry;
import org.mybatis.generator.internal.rules.Rules;
import org.mybatis.generator.internal.util.JavaBeansUtil; import org.mybatis.generator.internal.util.JavaBeansUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import static org.mybatis.generator.internal.util.StringUtility.stringHasValue; import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
import static org.mybatis.generator.internal.util.messages.Messages.getString; import static org.mybatis.generator.internal.util.messages.Messages.getString;
@@ -67,17 +70,6 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
return JavaBeansUtil.getCamelCaseString(tableName,true); return JavaBeansUtil.getCamelCaseString(tableName,true);
} }
private boolean isConfigTable() {
String tableName = this.getTableConfiguration().getTableName();
String tableSuffix = tableName.substring(tableName.lastIndexOf("_") + 1);
if(StringUtils.isNotBlank(tableSuffix) && tableSuffix.length() == 32){
//企业库
return false;
}
//平台库
return true;
}
@Override @Override
protected String calculateMyBatis3XmlMapperFileName() { protected String calculateMyBatis3XmlMapperFileName() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@@ -93,12 +85,6 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
} }
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(calculateJavaClientImplementationPackage());
sb.append('.');
sb.append(getTableNameFromConfigFile());
sb.append("DAOImpl"); //$NON-NLS-1$
setDAOImplementationType(sb.toString());
sb.setLength(0); sb.setLength(0);
sb.append(calculateJavaClientInterfacePackage()); sb.append(calculateJavaClientInterfacePackage());
sb.append('.'); sb.append('.');
@@ -204,12 +190,17 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
context.getCommentGenerator().addRootComment(answer); context.getCommentGenerator().addRootComment(answer);
addResultMapWithoutBLOBsElement(answer); addResultMapWithoutBLOBsElement(answer);
addResultMapWithBLOBsElement(answer); addResultMapWithBLOBsElement(answer);
addExampleWhereClauseElement(answer);
addMyBatis3UpdateByExampleWhereClauseElement(answer);
addBaseColumnListElement(answer); addBaseColumnListElement(answer);
addBlobColumnListElement(answer); addBlobColumnListElement(answer);
addInsertSelectiveElement(answer); /*addInsertSelectiveElement(answer);
addUpdateByPrimaryKeySelectiveElement(answer); addUpdateByPrimaryKeySelectiveElement(answer);
addMyBatis3UpdateByExampleWhereClauseElement(answer);
addExampleWhereClauseElement(answer);
addSelectByExampleWithBLOBsElement(answer);
addSelectByExampleWithoutBLOBsElement(answer);
addUpdateByExampleWithBLOBsElement(answer);
addUpdateByExampleWithoutBLOBsElement(answer);
addUpdateByExampleSelectiveElement(answer);*/
return answer; return answer;
} }
@@ -244,7 +235,6 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
@Override @Override
public List<CompilationUnit> getCompilationUnits() { public List<CompilationUnit> getCompilationUnits() {
boolean isConfig = isConfigTable();
progressCallback.startTask(getString("Progress.17", //$NON-NLS-1$ progressCallback.startTask(getString("Progress.17", //$NON-NLS-1$
introspectedTable.getFullyQualifiedTable().toString())); introspectedTable.getFullyQualifiedTable().toString()));
CommentGenerator commentGenerator = context.getCommentGenerator(); CommentGenerator commentGenerator = context.getCommentGenerator();
@@ -268,30 +258,25 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
interfaze.addSuperInterface(fqjt); interfaze.addSuperInterface(fqjt);
interfaze.addImportedType(fqjt); interfaze.addImportedType(fqjt);
} }
if(!isConfig){ interfaze.addSuperInterface(new FullyQualifiedJavaType("tk.mybatis.mapper.common.Mapper<"+getTableNameFromConfigFile()+"DO>"));
interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Param")); interfaze.addImportedType(new FullyQualifiedJavaType("tk.mybatis.mapper.common.Mapper"));
} interfaze.addImportedType(new FullyQualifiedJavaType(calculateJavaModelPackage() + "."+getTableNameFromConfigFile()+"DO"));
addInsertSelectiveMethod(interfaze); //addInsertSelectiveMethod(interfaze);
addUpdateByPrimaryKeySelectiveMethod(interfaze); //addUpdateByPrimaryKeySelectiveMethod(interfaze);
List<Method> methods = interfaze.getMethods(); List<Method> methods = interfaze.getMethods();
for (Method method : methods) { for (Method method : methods) {
List<Parameter> parameters = method.getParameters(); List<Parameter> parameters = method.getParameters();
for (Parameter parameter : parameters) { for (Parameter parameter : parameters) {
if(!isConfig){ String name = parameter.getName();
String name = parameter.getName(); parameter.addAnnotation("@Param(\""+ name+"\")");
parameter.addAnnotation("@Param(\""+ name+"\")");
}
}
if(!isConfig){
Parameter enterpriseId = new Parameter(FullyQualifiedJavaType.getStringInstance(), "enterpriseId");
enterpriseId.addAnnotation("@Param(\"enterpriseId\")");
method.addParameter(enterpriseId);
} }
} }
/*addSelectByExampleWithBLOBsMethod(interfaze);
addSelectByExampleWithoutBLOBsMethod(interfaze);
addUpdateByExampleSelectiveMethod(interfaze);
addUpdateByExampleWithoutBLOBsMethod(interfaze);*/
List<CompilationUnit> answer = new ArrayList<CompilationUnit>(); List<CompilationUnit> answer = new ArrayList<CompilationUnit>();
if (context.getPlugins().clientGenerated(interfaze, null, if (context.getPlugins().clientGenerated(interfaze, null, introspectedTable)) {
introspectedTable)) {
answer.add(interfaze); answer.add(interfaze);
} }
@@ -312,7 +297,6 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
@Override @Override
public void addElements(XmlElement parentElement) { public void addElements(XmlElement parentElement) {
boolean isConfig = isConfigTable();
XmlElement answer = new XmlElement("insert"); //$NON-NLS-1$ XmlElement answer = new XmlElement("insert"); //$NON-NLS-1$
answer.addAttribute(new Attribute( answer.addAttribute(new Attribute(
@@ -383,9 +367,7 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
} }
sb.setLength(0); sb.setLength(0);
if(!isConfig){ sb.append("record.");
sb.append("record.");
}
sb.append(introspectedColumn.getJavaProperty()); sb.append(introspectedColumn.getJavaProperty());
sb.append(" != null"); //$NON-NLS-1$ sb.append(" != null"); //$NON-NLS-1$
XmlElement insertNotNullElement = new XmlElement("if"); //$NON-NLS-1$ XmlElement insertNotNullElement = new XmlElement("if"); //$NON-NLS-1$
@@ -400,9 +382,7 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
insertTrimElement.addElement(insertNotNullElement); insertTrimElement.addElement(insertNotNullElement);
sb.setLength(0); sb.setLength(0);
if(!isConfig){ sb.append("record.");
sb.append("record.");
}
sb.append(introspectedColumn.getJavaProperty()); sb.append(introspectedColumn.getJavaProperty());
sb.append(" != null"); //$NON-NLS-1$ sb.append(" != null"); //$NON-NLS-1$
XmlElement valuesNotNullElement = new XmlElement("if"); //$NON-NLS-1$ XmlElement valuesNotNullElement = new XmlElement("if"); //$NON-NLS-1$
@@ -410,11 +390,7 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
"test", sb.toString())); //$NON-NLS-1$ "test", sb.toString())); //$NON-NLS-1$
sb.setLength(0); sb.setLength(0);
if(isConfig){ sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
sb.append("#{"+introspectedColumn.getJavaProperty() + "}");
}else{
sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
}
sb.append(','); sb.append(',');
valuesNotNullElement.addElement(new TextElement(sb.toString())); valuesNotNullElement.addElement(new TextElement(sb.toString()));
valuesTrimElement.addElement(valuesNotNullElement); valuesTrimElement.addElement(valuesNotNullElement);
@@ -433,7 +409,6 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
@Override @Override
public void addElements(XmlElement parentElement) { public void addElements(XmlElement parentElement) {
boolean isConfig = isConfigTable();
XmlElement answer = new XmlElement("update"); //$NON-NLS-1$ XmlElement answer = new XmlElement("update"); //$NON-NLS-1$
answer.addAttribute(new Attribute( answer.addAttribute(new Attribute(
@@ -446,10 +421,6 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
} else { } else {
parameterType = introspectedTable.getBaseRecordType(); parameterType = introspectedTable.getBaseRecordType();
} }
/*answer.addAttribute(new Attribute("parameterType", //$NON-NLS-1$
parameterType));*/
context.getCommentGenerator().addComment(answer); context.getCommentGenerator().addComment(answer);
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@@ -463,9 +434,7 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
for (IntrospectedColumn introspectedColumn : ListUtilities.removeGeneratedAlwaysColumns(introspectedTable.getNonPrimaryKeyColumns())) { for (IntrospectedColumn introspectedColumn : ListUtilities.removeGeneratedAlwaysColumns(introspectedTable.getNonPrimaryKeyColumns())) {
sb.setLength(0); sb.setLength(0);
if(!isConfig){ sb.append("record.");
sb.append("record.");
}
sb.append(introspectedColumn.getJavaProperty()); sb.append(introspectedColumn.getJavaProperty());
sb.append(" != null"); //$NON-NLS-1$ sb.append(" != null"); //$NON-NLS-1$
XmlElement isNotNullElement = new XmlElement("if"); //$NON-NLS-1$ XmlElement isNotNullElement = new XmlElement("if"); //$NON-NLS-1$
@@ -476,11 +445,7 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
sb.append(MyBatis3FormattingUtilities sb.append(MyBatis3FormattingUtilities
.getEscapedColumnName(introspectedColumn)); .getEscapedColumnName(introspectedColumn));
sb.append(" = "); sb.append(" = ");
if(!isConfig){ sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
}else{
sb.append("#{"+introspectedColumn.getJavaProperty() + "}");
}
sb.append(','); sb.append(',');
isNotNullElement.addElement(new TextElement(sb.toString())); isNotNullElement.addElement(new TextElement(sb.toString()));
@@ -499,11 +464,7 @@ public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Im
sb.append(MyBatis3FormattingUtilities sb.append(MyBatis3FormattingUtilities
.getEscapedColumnName(introspectedColumn)); .getEscapedColumnName(introspectedColumn));
sb.append(" = "); sb.append(" = ");
if(isConfig){ sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
sb.append("#{"+introspectedColumn.getJavaProperty() + "}");
}else{
sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
}
answer.addElement(new TextElement(sb.toString())); answer.addElement(new TextElement(sb.toString()));
} }

View File

@@ -42,6 +42,7 @@ public class MyPluginAdapter extends PluginAdapter {
topLevelClass.addImportedType("lombok.NoArgsConstructor"); topLevelClass.addImportedType("lombok.NoArgsConstructor");
topLevelClass.addImportedType("lombok.AllArgsConstructor"); topLevelClass.addImportedType("lombok.AllArgsConstructor");
topLevelClass.addImportedType("io.swagger.annotations.ApiModelProperty"); topLevelClass.addImportedType("io.swagger.annotations.ApiModelProperty");
topLevelClass.addImportedType("javax.persistence.Table");
topLevelClass.addAnnotation("@Data"); topLevelClass.addAnnotation("@Data");
topLevelClass.addAnnotation("@Builder"); topLevelClass.addAnnotation("@Builder");
topLevelClass.addAnnotation("@NoArgsConstructor"); topLevelClass.addAnnotation("@NoArgsConstructor");

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<properties resource="mybatis-generator.properties" />
<context id="Mysql" targetRuntime="MyBatis3Simple" defaultModelType="flat">
<plugin type="tk.mybatis.mapper.generator.MapperPlugin">
<property name="mappers" value="tk.mybatis.mapper.common.Mapper" />
<!-- caseSensitive默认false当数据库表名区分大小写时可以将该属性设置为true -->
<property name="caseSensitive" value="true" />
</plugin>
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver" connectionURL="${jdbc.url}" userId="${jdbc.user}" password="${jdbc.password}">
<property name="nullCatalogMeansCurrent" value="true" />
</jdbcConnection>
<!-- targetProject:生成PO类的位置 -->
<javaModelGenerator targetPackage="com.cool.store.entity" targetProject="coolstore-partner-model/src/main/java">
<property name="enableSubPackages" value="true"/>
</javaModelGenerator>
<!-- targetProject:mapperXML映射文件生成的位置 -->
<sqlMapGenerator targetPackage="mapper" targetProject="coolstore-partner-dao/src/main/resources" />
<!-- targetPackagemapper接口生成的位置 -->
<javaClientGenerator targetPackage="com.cool.store.mapper" targetProject="coolstore-partner-dao/src/main/java" type="XMLMAPPER" />
<table tableName="${table.name}" enableCountByExample="false" enableUpdateByExample="true" enableDeleteByExample="false"
enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" type=""/>
</table>
</context>
</generatorConfiguration>

View File

@@ -3,4 +3,4 @@ jdbc.url = jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcoll
jdbc.user= coolstore jdbc.user= coolstore
jdbc.password = CSCErYcXniNYm7bT jdbc.password = CSCErYcXniNYm7bT
table.name = hy_inspection_setting_mapping table.name = sys_menu_copy1

View File

@@ -25,6 +25,12 @@
<groupId>com.github.xiaoymin</groupId> <groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId> <artifactId>knife4j-spring-boot-starter</artifactId>
</dependency> </dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -0,0 +1,16 @@
package com.cool.store.dto.call;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: young.yu
* @Date: 2023-08-11 15:24
* @Description:
*/
@Data
public class CallUpDTO {
private String transNo;
private String outgoingMobile;
private String incomingMobile;
}

View File

@@ -0,0 +1,19 @@
package com.cool.store.dto.label;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Fun Li 2023/8/10 15:55
* @version 1.0
*/
@Data
public class LabelAddDTO {
@ApiModelProperty(value = "标签名称", required = true)
private String labelName;
@ApiModelProperty(value = "标签组id", required = true)
private Long labelGroupId;
}

View File

@@ -0,0 +1,16 @@
package com.cool.store.dto.label;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Fun Li 2023/8/10 16:43
* @version 1.0
*/
@Data
public class LabelDeleteDTO {
@ApiModelProperty(value = "标签id", required = true)
private Long id;
}

View File

@@ -0,0 +1,19 @@
package com.cool.store.dto.label;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @author Fun Li 2023/8/10 13:28
* @version 1.0
*/
@Data
public class LabelGroupAddDTO {
@ApiModelProperty(value = "标签组名称", required = true)
private @NotBlank(message = "镖标签组名称不能为空")
String labelGroupName;
}

View File

@@ -0,0 +1,16 @@
package com.cool.store.dto.label;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Fun Li 2023/8/10 13:29
* @version 1.0
*/
@Data
public class LabelGroupDeleteDTO {
@ApiModelProperty("id")
private Long id;
}

View File

@@ -0,0 +1,19 @@
package com.cool.store.dto.label;
import com.cool.store.common.PageBasicInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author Fun Li 2023/8/10 13:29
* @version 1.0
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class LabelGroupListDTO extends PageBasicInfo {
@ApiModelProperty(value = "标签组名称", required = false)
private String labelGroupName;
}

View File

@@ -0,0 +1,22 @@
package com.cool.store.dto.label;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @author Fun Li 2023/8/10 13:30
* @version 1.0
*/
@Data
public class LabelGroupUpdateDTO {
@ApiModelProperty(value = "id", required = true)
private Long id;
@ApiModelProperty(value = "标签组名称", required = true)
private @NotBlank(message = "标签组名称不能为空")
String labelGroupName;
}

View File

@@ -0,0 +1,22 @@
package com.cool.store.dto.label;
import com.cool.store.common.PageBasicInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author Fun Li 2023/8/10 14:46
* @version 1.0
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class LabelListDTO extends PageBasicInfo {
@ApiModelProperty(value = "标签名称")
private String labelName;
@ApiModelProperty(value = "标签组id")
private Long labelGroupId;
}

View File

@@ -0,0 +1,22 @@
package com.cool.store.dto.label;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Fun Li 2023/8/10 16:03
* @version 1.0
*/
@Data
public class LabelUpdateDTO {
@ApiModelProperty(value = "标签id", required = true)
private Long id;
@ApiModelProperty(value = "标签名称", required = true)
private String labelName;
@ApiModelProperty(value = "标签组id", required = true)
private Long labelGroupId;
}

View File

@@ -0,0 +1,16 @@
package com.cool.store.dto.outbound;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Fun Li 2023/8/9 17:44
* @version 1.0
*/
@Data
public class AddNumberDTO {
@ApiModelProperty("11位外呼号码")
private String outboundNumber;
}

View File

@@ -0,0 +1,16 @@
package com.cool.store.dto.outbound;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Fun Li 2023/8/9 18:38
* @version 1.0
*/
@Data
public class DeleteNumberDTO {
@ApiModelProperty("id")
private Long id;
}

View File

@@ -0,0 +1,14 @@
package com.cool.store.dto.outbound;
import com.cool.store.common.PageBasicInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author Fun Li 2023/8/9 15:49
* @version 1.0
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class OutboundListDTO extends PageBasicInfo {
}

View File

@@ -0,0 +1,19 @@
package com.cool.store.dto.outbound;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Fun Li 2023/8/9 18:05
* @version 1.0
*/
@Data
public class UpdateNumberDTO {
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("11位外呼号码")
private String newOutboundNumber;
}

View File

@@ -19,6 +19,8 @@ public class PartnerIntentApplyInfoDTO {
@ApiModelProperty("加盟商用户名称") @ApiModelProperty("加盟商用户名称")
private String partnerUserName; private String partnerUserName;
private String mobile;
@ApiModelProperty("hy_partner_user_info.partner_id") @ApiModelProperty("hy_partner_user_info.partner_id")
private String partnerId; private String partnerId;
@@ -46,4 +48,17 @@ public class PartnerIntentApplyInfoDTO {
@ApiModelProperty("子流程状态") @ApiModelProperty("子流程状态")
private String workflowStatus; private String workflowStatus;
@ApiModelProperty("上次跟进时间")
private String lastFollowTime;
@ApiModelProperty("接通状态")
private Integer callStatus;
@ApiModelProperty("来源名称")
private String userChannelName;
private Integer userChannelId;
private String userPortrait;
} }

View File

@@ -61,4 +61,12 @@ public class PartnerInterviewInfoDTO {
@ApiModelProperty("过程信息") @ApiModelProperty("过程信息")
private String processInfo; private String processInfo;
@ApiModelProperty("上次跟进时间")
private Date lastFollowTime;
@ApiModelProperty("接通状态")
private Integer callStatus;
private String userPortrait;
} }

View File

@@ -0,0 +1,33 @@
package com.cool.store.dto.partner;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: PartnerSimpleInfoDTO
* @Description:
* @date 2023-08-10 14:04
*/
@Data
public class PartnerSimpleInfoDTO {
@ApiModelProperty("线索id")
private Long partnerLineId;
@ApiModelProperty("加盟商姓名")
private String username;
@ApiModelProperty("加盟商手机号")
private String mobile;
@ApiModelProperty("加盟商id")
private String partnerId;
@ApiModelProperty("线索阶段")
private String workflowStage;
@ApiModelProperty("线索状态")
private Integer lineStatus;
}

View File

@@ -77,4 +77,8 @@ public class PrivateSeaLineDTO {
private String recommendPartnerMobile; private String recommendPartnerMobile;
private Integer userChannelId;
private String userPortrait;
} }

View File

@@ -29,4 +29,8 @@ public class PublicSeaLineDTO {
private Date updateTime; private Date updateTime;
private String phoneAddress; private String phoneAddress;
private Integer userChannelId;
private String userPortrait;
} }

View File

@@ -0,0 +1,17 @@
package com.cool.store.dto.partner;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/8/10 11:12
* @Version 1.0
*/
@Data
public class UserChannelDTO {
private Long userChannelId;
private String userChannelName;
}

View File

@@ -0,0 +1,71 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @author zhangchenbiao
* @date 2023-08-11 01:03
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CallRecordDO implements Serializable {
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("线索id")
private Long partnerLineId;
@ApiModelProperty("请求编号")
private String transNo;
@ApiModelProperty("呼出人手机号")
private String outgoingMobile;
@ApiModelProperty("呼出人用户id")
private String outgoingUserId;
@ApiModelProperty("接听人手机号")
private String incomingMobile;
@ApiModelProperty("接听人用户id")
private String incomingUserId;
@ApiModelProperty("通话开始时间")
private Date callStartTime;
@ApiModelProperty("通话结束时间")
private Date callEndTime;
@ApiModelProperty("录音地址")
private String recordUrl;
@ApiModelProperty("0.待呼叫1.呼叫接听2.呼叫未接听3.呼叫失败")
private Integer callStatus;
@ApiModelProperty("失败原因")
private String failReason;
@ApiModelProperty("创建人")
private String creater;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("更新人")
private String updater;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("备注")
private String remark;
}

View File

@@ -0,0 +1,53 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @author zhangchenbiao
* @date 2023-08-10 10:10
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class HyFollowTaskDO implements Serializable {
@ApiModelProperty("")
private Long id;
@ApiModelProperty("hy_partner_line_info.id")
private Long partnerLineId;
@ApiModelProperty("任务跟进人id")
private String followUserId;
@ApiModelProperty("任务标题")
private String taskTitle;
@ApiModelProperty("沟通方式: 0:电话、1:短信、2:微信、3:QQ、4:邮件、5:拜访、6:提醒")
private Integer communicationType;
@ApiModelProperty("任务截止时间")
private Date deadline;
@ApiModelProperty("计划沟通内容")
private String communicationContent;
@ApiModelProperty("任务状态:0:待完成、1:已完成、2:已逾期、3:作废")
private Integer taskStatus;
@ApiModelProperty("删除标识")
private Boolean deleted;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("更新时间")
private Date updateTime;
}

View File

@@ -0,0 +1,48 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
;
/**
* @author Fun Li
* @date 2023/08/09
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class HyOutboundMobileDO {
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("")
private String mobile;
@ApiModelProperty("编辑人user_identerprise_user.user_id")
private String editUserId;
@ApiModelProperty("备注(保留字段)")
private String remark;
@ApiModelProperty("创建人user_identerprise_user.user_id")
private String createUserId;
@ApiModelProperty("修改人user_identerprise_user.user_id")
private String updateUserId;
@ApiModelProperty("是否删除0表示未删除")
private Boolean deleted;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
@ApiModelProperty("更新时间")
private LocalDateTime updateTime;
}

View File

@@ -0,0 +1,52 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @author Fun Li
* @date 2023/08/10
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class HyPartnerLabelDO {
@ApiModelProperty("")
private Long id;
@ApiModelProperty("标签组id hy_partner_label_group.id")
private Long labelGroupId;
@ApiModelProperty("标签名")
private String labelName;
@ApiModelProperty("编辑人user_identerprise_user.user_id")
private String editUserId;
@ApiModelProperty("编辑时间")
private Date editDate;
@ApiModelProperty("删除标识")
private Boolean deleted;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("创建人")
private String createUserId;
@ApiModelProperty("更新人")
private String updateUserId;
@ApiModelProperty("备注")
private String remark;
}

View File

@@ -0,0 +1,52 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @author Fun Li 2023/8/10 13:31
* @version 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class HyPartnerLabelGroupDO {
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("标签组名称")
private String labelGroupName;
@ApiModelProperty("删除标识")
private Boolean deleted;
@ApiModelProperty("编辑人user_identerprise_user.user_id")
private String editUserId;
@ApiModelProperty("编辑时间")
private Date editDate;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("创建人enterprise_user.user_id")
private String createUserId;
@ApiModelProperty("更新人enterprise_user.user_id")
private String updateUserId;
@ApiModelProperty("备注")
private String remark;
}

View File

@@ -3,6 +3,8 @@ package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;

View File

@@ -18,5 +18,5 @@ public class AddTagsRequest {
@ApiModelProperty("加盟申请基本信息ID") @ApiModelProperty("加盟申请基本信息ID")
private Long partnerBaseInfoId; private Long partnerBaseInfoId;
@ApiModelProperty("标签列表") @ApiModelProperty("标签列表")
private List<String> Tags; private List<Long> Tags;
} }

View File

@@ -0,0 +1,21 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/8/11 14:30
* @Version 1.0
*/
@Data
@ApiModel
public class BatchTransferInvestmentManagerRequest {
private List<Long> lineIds;
private String userId;
}

View File

@@ -0,0 +1,30 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: young.yu
* @Date: 2023-08-11 15:46
* @Description:
*/
@Data
@ApiModel(description = "呼叫信息")
public class CallFinishBackReq {
@ApiModelProperty(value = "请求编号", required = true)
private String transNo;
@ApiModelProperty(value = "呼叫状态: 1-呼叫接听, 2-呼叫未接听, 3-呼叫失败", required = true)
private Integer callStatus;
@ApiModelProperty(value = "呼叫失败的情况下必传,说明呼叫失败的原因")
private String failReason;
@ApiModelProperty(value = "呼叫接听情况下必传通话开始时间格式yyyy-MM-dd HH:mm:ss")
private String callStartTime;
@ApiModelProperty(value = "呼叫接听情况下必传通话结束时间格式yyyy-MM-dd HH:mm:ss")
private String callEndTime;
}

View File

@@ -0,0 +1,17 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(description = "呼叫记录信息")
public class CallRecordBackReq {
@ApiModelProperty(value = "请求编号", required = true)
private String transNo;
@ApiModelProperty(value = "录音上传地址", required = true)
private String recordUrl;
}

View File

@@ -0,0 +1,29 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: young.yu
* @Date: 2023-08-10 19:24
* @Description:
*/
@Data
@ApiModel
public class CallUpReq {
@ApiModelProperty(value = "线索id", required = true)
private String lineId;
@ApiModelProperty(value = "呼出人用户id", required = true)
private String outgoingUserId;
@ApiModelProperty(value = "呼出人手机号", required = true)
private String outgoingMobile;
@ApiModelProperty(value = "接听人用户id", required = true)
private String incomingUserId;
@ApiModelProperty(value = "接听人手机号", required = true)
private String incomingMobile;
}

View File

@@ -0,0 +1,28 @@
package com.cool.store.request.follow;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @author zhangchenbiao
* @FileName: AddFollowLogRequest
* @Description:新增跟进日志
* @date 2023-08-08 15:38
*/
@Data
public class AddFollowLogRequest {
@NotNull
@ApiModelProperty("线索id")
private Long partnerLineId;
@NotBlank
@Length(max = 200)
@ApiModelProperty("跟进日志")
private String followLog;
}

View File

@@ -0,0 +1,59 @@
package com.cool.store.request.follow;
import com.cool.store.entity.HyFollowTaskDO;
import com.cool.store.enums.FollowTaskStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* @author zhangchenbiao
* @FileName: FollowTaskPageVO
* @Description:新增跟进任务
* @date 2023-08-08 14:47
*/
@Data
public class AddFollowTaskRequest {
@NotNull
@ApiModelProperty("线索id")
private Long partnerLineId;
@NotBlank
@Length(max = 50)
@ApiModelProperty("任务标题")
private String taskTitle;
@NotNull
@Min(0)
@Max(6)
@ApiModelProperty("沟通方式: 0:电话、1:短信、2:微信、3:QQ、4:邮件、5:拜访、6:提醒")
private Integer communicationType;
@NotBlank
@Length(max = 300)
@ApiModelProperty("计划沟通内容")
private String communicationContent;
@NotNull
@ApiModelProperty("任务截止时间")
private Date deadline;
public static HyFollowTaskDO convertDO(AddFollowTaskRequest request){
HyFollowTaskDO result = new HyFollowTaskDO();
result.setPartnerLineId(request.getPartnerLineId());
result.setTaskTitle(request.getTaskTitle());
result.setCommunicationType(request.getCommunicationType());
result.setDeadline(request.getDeadline());
result.setCommunicationContent(request.getCommunicationContent());
result.setTaskStatus(FollowTaskStatusEnum.TODO.getCode());
return result;
}
}

View File

@@ -0,0 +1,22 @@
package com.cool.store.request.follow;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* @author zhangchenbiao
* @FileName: FollowTaskPageVO
* @Description:新增跟进任务
* @date 2023-08-08 14:47
*/
@Data
public class FollowTaskIdRequest {
@NotNull
@ApiModelProperty("跟进任务Id")
private Long followTaskId;
}

View File

@@ -0,0 +1,59 @@
package com.cool.store.request.follow;
import com.cool.store.entity.HyFollowTaskDO;
import com.cool.store.enums.FollowTaskStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* @author zhangchenbiao
* @FileName: FollowTaskPageVO
* @Description:新增跟进任务
* @date 2023-08-08 14:47
*/
@Data
public class UpdateFollowTaskRequest {
@NotNull
@ApiModelProperty("跟进任务Id")
private Long followTaskId;
@NotBlank
@Length(max = 50)
@ApiModelProperty("任务标题")
private String taskTitle;
@NotNull
@Min(0)
@Max(6)
@ApiModelProperty("沟通方式: 0:电话、1:短信、2:微信、3:QQ、4:邮件、5:拜访、6:提醒")
private Integer communicationType;
@NotBlank
@Length(max = 300)
@ApiModelProperty("计划沟通内容")
private String communicationContent;
@NotNull
@ApiModelProperty("任务截止时间")
private Date deadline;
public static HyFollowTaskDO convertDO(Long partnerLineId, UpdateFollowTaskRequest request){
HyFollowTaskDO result = new HyFollowTaskDO();
result.setId(request.getFollowTaskId());
result.setPartnerLineId(partnerLineId);
result.setTaskTitle(request.getTaskTitle());
result.setCommunicationType(request.getCommunicationType());
result.setDeadline(request.getDeadline());
result.setCommunicationContent(request.getCommunicationContent());
return result;
}
}

View File

@@ -0,0 +1,30 @@
package com.cool.store.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Fun Li 2023/8/9 15:38
* @version 1.0
*/
@Data
public class HyOutboundVo {
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("外呼手机号码")
private String outboundNumber;
@ApiModelProperty("编辑人姓名")
private String updaterName;
@ApiModelProperty("编辑人手机号")
private String updaterMobile;
@ApiModelProperty("编辑时间")
private Date updateTime;
}

View File

@@ -0,0 +1,30 @@
package com.cool.store.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Fun Li 2023/8/10 13:33
* @version 1.0
*/
@Data
public class LabelGroupListVo {
@ApiModelProperty("标签组id")
private long id;
@ApiModelProperty("标签组名称")
private String labelGroupName;
@ApiModelProperty("编辑人姓名")
private String editName;
@ApiModelProperty("编辑人电话")
private String editMobile;
@ApiModelProperty("编辑时间")
private Date editDate;
}

View File

@@ -0,0 +1,36 @@
package com.cool.store.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Fun Li 2023/8/10 14:42
* @version 1.0
*/
@Data
public class LabelListVo {
@ApiModelProperty(value = "标签名称")
private String labelName;
@ApiModelProperty(value = "标签组名称")
private String labelGroupName;
@ApiModelProperty(value = "编辑人姓名")
private String editName;
@ApiModelProperty(value = "编辑人电话")
private String editMobile;
@ApiModelProperty(value = "编辑时间")
private Date editDate;
@ApiModelProperty(value = "标签id")
private Long id;
@ApiModelProperty(value = "标签分组id")
private Long labelGroupId;
}

View File

@@ -8,8 +8,11 @@ import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@@ -23,6 +26,7 @@ import java.util.Map;
*/ */
@Data @Data
@ApiModel @ApiModel
@Slf4j
public class PartnerIntentApplyInfoVO { public class PartnerIntentApplyInfoVO {
@ApiModelProperty("") @ApiModelProperty("")
@@ -61,8 +65,20 @@ public class PartnerIntentApplyInfoVO {
@ApiModelProperty("阶段状态") @ApiModelProperty("阶段状态")
private String WorkflowStatus; private String WorkflowStatus;
@ApiModelProperty("用户画像")
private List<String> userPortraitList;
public static List<PartnerIntentApplyInfoVO> convertList(List<PartnerIntentApplyInfoDTO> list, Map<String, HyPartnerUserInfoDO> infoDOMap, Map<String, String> wantShopAreaNameMap, String workflowStatus){ @ApiModelProperty("上次跟进时间")
private String lastFollowTime;
@ApiModelProperty("接通状态")
private Integer callStatus;
@ApiModelProperty("来源名称")
private String userChannelName;
public static List<PartnerIntentApplyInfoVO> convertList(List<PartnerIntentApplyInfoDTO> list, Map<String, String> wantShopAreaNameMap, String workflowStatus,
Map<Long, String> userChannelMap,Map<Long,String> userPortraitMap ){
if(CollectionUtils.isEmpty(list)){ if(CollectionUtils.isEmpty(list)){
return Lists.newArrayList(); return Lists.newArrayList();
} }
@@ -78,11 +94,34 @@ public class PartnerIntentApplyInfoVO {
partnerIntentApplyInfoVO.setWantShopArea(partnerIntentApplyInfoDTO.getWantShopArea()); partnerIntentApplyInfoVO.setWantShopArea(partnerIntentApplyInfoDTO.getWantShopArea());
String deadLine = DateUtil.format(partnerIntentApplyInfoDTO.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC_2); String deadLine = DateUtil.format(partnerIntentApplyInfoDTO.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC_2);
partnerIntentApplyInfoVO.setDeadline(deadLine); partnerIntentApplyInfoVO.setDeadline(deadLine);
HyPartnerUserInfoDO infoDOMapOrDefault = infoDOMap.getOrDefault(partnerIntentApplyInfoDTO.getPartnerId(), new HyPartnerUserInfoDO()); partnerIntentApplyInfoVO.setPartnerUserName(partnerIntentApplyInfoDTO.getPartnerUserName());
partnerIntentApplyInfoVO.setPartnerUserName(infoDOMapOrDefault.getUsername()); partnerIntentApplyInfoVO.setPartnerUserPhone(partnerIntentApplyInfoDTO.getMobile());
partnerIntentApplyInfoVO.setPartnerUserPhone(infoDOMapOrDefault.getMobile());
partnerIntentApplyInfoVO.setWorkflowStatus(workflowStatus); partnerIntentApplyInfoVO.setWorkflowStatus(workflowStatus);
partnerIntentApplyInfoVO.setWantShopAreaName(wantShopAreaNameMap.get(partnerIntentApplyInfoDTO.getWantShopArea())); partnerIntentApplyInfoVO.setWantShopAreaName(wantShopAreaNameMap.get(partnerIntentApplyInfoDTO.getWantShopArea()));
partnerIntentApplyInfoVO.setLastFollowTime(partnerIntentApplyInfoDTO.getLastFollowTime());
Integer callStatus = null;
if(partnerIntentApplyInfoDTO.getCallStatus()!=null){
callStatus = partnerIntentApplyInfoDTO.getCallStatus()==1?partnerIntentApplyInfoDTO.getCallStatus():0;
}
partnerIntentApplyInfoVO.setCallStatus(callStatus);
partnerIntentApplyInfoVO.setUserChannelName(userChannelMap.getOrDefault(partnerIntentApplyInfoDTO.getUserChannelId(),""));
List<String> userPortraitList= new ArrayList<>();
if(StringUtils.isNotEmpty(partnerIntentApplyInfoDTO.getUserPortrait())){
String[] parts = partnerIntentApplyInfoDTO.getUserPortrait().split(",");
for (String part : parts) {
String trimmedPart = part.trim();
if (!trimmedPart.isEmpty()) {
try {
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
} catch (NumberFormatException e) {
log.info("Invalid format: {}" , trimmedPart);
}
}
}
}
partnerIntentApplyInfoVO.setUserPortraitList(userPortraitList);
resultList.add(partnerIntentApplyInfoVO); resultList.add(partnerIntentApplyInfoVO);
} }
return resultList; return resultList;

View File

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Author suzhuhong * @Author suzhuhong
@@ -71,4 +72,16 @@ public class PartnerInterviewInfoVO {
@ApiModelProperty("审批发起时间") @ApiModelProperty("审批发起时间")
private String approveTime; private String approveTime;
@ApiModelProperty("用户画像")
private List<String> userPortraitList;
@ApiModelProperty("上次跟进时间")
private String lastFollowTime;
@ApiModelProperty("接通状态")
private Integer callStatus;
@ApiModelProperty("来源名称")
private String userChannelName;
} }

View File

@@ -7,6 +7,8 @@ import com.cool.store.utils.CoolDateUtils;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import java.util.ArrayList; import java.util.ArrayList;
@@ -21,6 +23,7 @@ import java.util.Map;
*/ */
@Data @Data
@ApiModel @ApiModel
@Slf4j
public class PrivateSeaLineListVo { public class PrivateSeaLineListVo {
@@ -92,8 +95,15 @@ public class PrivateSeaLineListVo {
private String investmentManagerMobile; private String investmentManagerMobile;
@ApiModelProperty("用户画像")
private List<String> userPortraitList;
public static List<PrivateSeaLineListVo> convertList(List<PrivateSeaLineDTO> list, Map<String, String> finalDevManagerMap, Map<String, String> wantShopAreaNameMap,Map<Long, HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOMap){ @ApiModelProperty("来源名称")
private String userChannelName;
public static List<PrivateSeaLineListVo> convertList(List<PrivateSeaLineDTO> list, Map<String, String> finalDevManagerMap, Map<String, String> wantShopAreaNameMap,
Map<Long, HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOMap,Map<Long, String> channelMap,Map<Long, String> userPortraitMap){
List<PrivateSeaLineListVo> resultList = new ArrayList<>(); List<PrivateSeaLineListVo> resultList = new ArrayList<>();
for (PrivateSeaLineDTO x : list) { for (PrivateSeaLineDTO x : list) {
PrivateSeaLineListVo privateSeaLineListVo = new PrivateSeaLineListVo(); PrivateSeaLineListVo privateSeaLineListVo = new PrivateSeaLineListVo();
@@ -127,6 +137,22 @@ public class PrivateSeaLineListVo {
privateSeaLineListVo.setStartTime(hyPartnerInterviewPlanDOMap.getOrDefault(x.getLineId(),new HyPartnerInterviewPlanDO()).getStartTime()); privateSeaLineListVo.setStartTime(hyPartnerInterviewPlanDOMap.getOrDefault(x.getLineId(),new HyPartnerInterviewPlanDO()).getStartTime());
privateSeaLineListVo.setInterviewPlanId(hyPartnerInterviewPlanDOMap.getOrDefault(x.getLineId(),new HyPartnerInterviewPlanDO()).getId()); privateSeaLineListVo.setInterviewPlanId(hyPartnerInterviewPlanDOMap.getOrDefault(x.getLineId(),new HyPartnerInterviewPlanDO()).getId());
privateSeaLineListVo.setDevelopmentManagerName(finalDevManagerMap.get(x.getDevelopmentManager())); privateSeaLineListVo.setDevelopmentManagerName(finalDevManagerMap.get(x.getDevelopmentManager()));
privateSeaLineListVo.setUserChannelName(channelMap.get(x.getUserChannelId()));
List<String> userPortraitList= new ArrayList<>();
if(StringUtils.isNotEmpty(x.getUserPortrait())){
String[] parts = x.getUserPortrait().split(",");
for (String part : parts) {
String trimmedPart = part.trim();
if (!trimmedPart.isEmpty()) {
try {
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
} catch (NumberFormatException e) {
log.info("Invalid format: {}" , trimmedPart);
}
}
}
}
privateSeaLineListVo.setUserPortraitList(userPortraitList);
resultList.add(privateSeaLineListVo); resultList.add(privateSeaLineListVo);
} }
return resultList; return resultList;

View File

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Author suzhuhong * @Author suzhuhong
@@ -71,4 +72,10 @@ public class PublicSeaLineListVo {
private String updateTime; private String updateTime;
@ApiModelProperty("用户画像")
private List<String> userPortraitList;
@ApiModelProperty("来源名称")
private String userChannelName;
} }

View File

@@ -0,0 +1,38 @@
package com.cool.store.vo.follow;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author zhangchenbiao
* @FileName: FollowTaskPageVO
* @Description:跟进任务分页
* @date 2023-08-08 14:47
*/
@Data
public class FollowTaskLogVO {
@ApiModelProperty("日志id")
private Long followLogId;
@ApiModelProperty("线索id")
private Long partnerLineId;
@ApiModelProperty("操作时间")
private Date operateTime;
@ApiModelProperty("操作人id")
private String operateUserId;
@ApiModelProperty("操作人名称")
private String operateUsername;
@ApiModelProperty("跟进操作类型")
private String operateType;
@ApiModelProperty("操作内容")
private String operateContent;
}

View File

@@ -0,0 +1,68 @@
package com.cool.store.vo.follow;
import com.cool.store.dto.partner.PartnerSimpleInfoDTO;
import com.cool.store.entity.HyFollowTaskDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;
import java.util.*;
/**
* @author zhangchenbiao
* @FileName: FollowTaskPageVO
* @Description:跟进任务分页
* @date 2023-08-08 14:47
*/
@Data
public class FollowTaskPageVO {
@ApiModelProperty("线索id")
private Long partnerLineId;
@ApiModelProperty("任务标题")
private String taskTitle;
@ApiModelProperty("沟通方式: 0:电话、1:短信、2:微信、3:QQ、4:邮件、5:拜访、6:提醒")
private Integer communicationType;
@ApiModelProperty("任务截止时间")
private Date deadline;
@ApiModelProperty("任务状态:0:待完成、1:已完成、2:已逾期、3:作废")
private Integer taskStatus;
@ApiModelProperty("跟进阶段")
private String workflowStage;
@ApiModelProperty("线索用户名")
private String partnerUsername;
@ApiModelProperty("线索手机号")
private String partnerMobile;
public static List<FollowTaskPageVO> convertVO(List<HyFollowTaskDO> taskList, Map<Long, PartnerSimpleInfoDTO> partnerSimpleInfoMap){
List<FollowTaskPageVO> resultList = new ArrayList<>();
if(CollectionUtils.isNotEmpty(taskList)){
for (HyFollowTaskDO task : taskList) {
PartnerSimpleInfoDTO partnerInfo = partnerSimpleInfoMap.get(task.getPartnerLineId());
if(Objects.isNull(partnerInfo)){
continue;
}
FollowTaskPageVO result = new FollowTaskPageVO();
result.setPartnerLineId(task.getPartnerLineId());
result.setTaskTitle(task.getTaskTitle());
result.setCommunicationType(task.getCommunicationType());
result.setDeadline(task.getDeadline());
result.setTaskStatus(task.getTaskStatus());
result.setWorkflowStage(partnerInfo.getWorkflowStage());
result.setPartnerUsername(partnerInfo.getUsername());
result.setPartnerMobile(partnerInfo.getMobile());
resultList.add(result);
}
}
return resultList;
}
}

View File

@@ -85,6 +85,11 @@
<artifactId>dysmsapi20170525</artifactId> <artifactId>dysmsapi20170525</artifactId>
<version>2.0.1</version> <version>2.0.1</version>
</dependency> </dependency>
<!--websocket作为服务端-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!-- excel工具 --> <!-- excel工具 -->
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>

View File

@@ -0,0 +1,182 @@
package com.cool.store.handler;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
import java.util.concurrent.ConcurrentHashMap;
@Component
@Slf4j
@ServerEndpoint("/websocket/{tenantId}")
public class WebSocketServer {
/**
* 静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。
*/
private static int onlineCount = 0;
/**
* concurrent包的线程安全Set用来存放每个客户端对应的WebSocket对象。
*/
private static final ConcurrentHashMap<String, WebSocketServer> webSocketMap = new ConcurrentHashMap<>();
/**
* 与某个客户端的连接会话,需要通过它来给客户端发送数据
*/
private Session session;
/**
* 接收userId
*/
private String tenantId = "";
/**
* 连接建立成
* 功调用的方法
*/
@OnOpen
public void onOpen(Session session, @PathParam("tenantId") String tenantId) {
this.session = session;
this.tenantId = tenantId;
if (webSocketMap.containsKey(tenantId)) {
webSocketMap.remove(tenantId);
//加入set中
webSocketMap.put(tenantId, this);
} else {
//加入set中
webSocketMap.put(tenantId, this);
//在线数加1
addOnlineCount();
}
log.info("用户连接:" + tenantId + ",当前在线人数为:" + getOnlineCount());
sendMessage("连接成功");
}
/**
* 连接关闭
* 调用的方法
*/
@OnClose
public void onClose() {
if (webSocketMap.containsKey(tenantId)) {
webSocketMap.remove(tenantId);
//从set中删除
subOnlineCount();
}
log.info("用户退出:" + tenantId + ",当前在线人数为:" + getOnlineCount());
}
/**
* 收到客户端消
* 息后调用的方法
*
* @param message 客户端发送过来的消息
**/
@OnMessage
public void onMessage(String message, Session session) {
log.info("用户消息:" + tenantId + ",报文:" + message);
//可以群发消息
//消息保存到数据库、redis
if (StringUtils.isNotBlank(message)) {
try {
//解析发送的报文
JSONObject jsonObject = JSON.parseObject(message);
//追加发送人(防止串改)
jsonObject.put("fromUserId", this.tenantId);
String toUserId = jsonObject.getString("toUserId");
//传送给对应toUserId用户的websocket
if (StringUtils.isNotBlank(toUserId) && webSocketMap.containsKey(toUserId)) {
webSocketMap.get(toUserId).sendMessage(message);
} else {
//否则不在这个服务器上发送到mysql或者redis
log.error("请求的userId:" + toUserId + "不在该服务器上");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* @param session Session
* @param error Throwable
*/
@OnError
public void onError(Session session, Throwable error) {
log.error("用户错误:" + this.tenantId + ",原因:" + error.getMessage());
error.printStackTrace();
}
/**
* 实现服务
* 器主动推送
*/
public boolean sendMessage(String message) {
boolean flag = false;
try {
this.session.getBasicRemote().sendText(message);
flag = true;
} catch (IOException e) {
log.error("发送消息失败:" + this.tenantId + ",原因:" + e.getMessage());
e.printStackTrace();
}
return flag;
}
/**
* 发送自定
* 义消息
**/
public static boolean sendInfo(String message, String tenantId) {
boolean flag = false;
log.info("发送消息到:" + tenantId + ",报文:" + message);
if (StringUtils.isNotBlank(tenantId) && webSocketMap.containsKey(tenantId)) {
webSocketMap.get(tenantId).sendMessage(message);
flag = true;
} else {
log.error("用户" + tenantId + ",不在线!");
}
return flag;
}
/**
* 获得此时的
* 在线人数
*
* @return int
*/
public static synchronized int getOnlineCount() {
return onlineCount;
}
/**
* 在线人
* 数加1
*/
public static synchronized void addOnlineCount() {
WebSocketServer.onlineCount++;
}
/**
* 在线人
* 数减1
*/
public static synchronized void subOnlineCount() {
WebSocketServer.onlineCount--;
}
/**
* 判断用户是否在线
* @param tenantId
* @return
*/
public static boolean isOnline(String tenantId) {
return webSocketMap.containsKey(tenantId);
}
}

View File

@@ -0,0 +1,17 @@
package com.cool.store.service;
import com.cool.store.exception.ApiException;
import com.cool.store.request.CallFinishBackReq;
import com.cool.store.request.CallRecordBackReq;
import com.cool.store.request.CallUpReq;
/**
* @Author: young.yu
* @Date: 2023-08-10 18:56
* @Description:
*/
public interface CallService {
void callUp(CallUpReq request) throws ApiException;
void callFinishBack(CallFinishBackReq request) throws ApiException;
void callRecordBack(CallRecordBackReq request) throws ApiException;
}

View File

@@ -0,0 +1,78 @@
package com.cool.store.service;
import com.cool.store.request.follow.AddFollowLogRequest;
import com.cool.store.request.follow.AddFollowTaskRequest;
import com.cool.store.request.follow.FollowTaskIdRequest;
import com.cool.store.request.follow.UpdateFollowTaskRequest;
import com.cool.store.vo.follow.FollowTaskLogVO;
import com.cool.store.vo.follow.FollowTaskPageVO;
import com.github.pagehelper.PageInfo;
/**
* @author zhangchenbiao
* @FileName: FollowTaskService
* @Description:
* @date 2023-08-10 11:10
*/
public interface FollowTaskService {
/**
* 工作台获取跟进任务
* @param pageNum
* @param pageSize
* @param taskStatus
* @param queryDate
* @param followUserId
* @return
*/
PageInfo<FollowTaskPageVO> getFollowTaskPage(Integer pageNum, Integer pageSize, Integer taskStatus, String queryDate, String followUserId);
/**
* 获取线索跟进日志
* @param pageNum
* @param pageSize
* @param partnerLineId
* @return
*/
PageInfo<FollowTaskLogVO> getFollowLogPage(Integer pageNum, Integer pageSize, Long partnerLineId);
/**
* 添加跟进日志
* @param request
* @param userId
* @return
*/
Integer addFollowLog(AddFollowLogRequest request, String userId);
/**
* 新增跟进任务
* @param request
* @param userId
* @return
*/
Long addFollowTask(AddFollowTaskRequest request, String userId);
/**
* 编辑跟进任务
* @param request
* @param userId
* @return
*/
Integer updateFollowTask(UpdateFollowTaskRequest request, String userId);
/**
* 完成跟进任务
* @param request
* @param userId
* @return
*/
Integer finishFollowTask(FollowTaskIdRequest request, String userId);
/**
* 作废跟进任务
* @param request
* @param userId
* @return
*/
Integer cancelFollowTask(FollowTaskIdRequest request, String userId);
}

View File

@@ -0,0 +1,41 @@
package com.cool.store.service;
import com.cool.store.dto.outbound.AddNumberDTO;
import com.cool.store.dto.outbound.DeleteNumberDTO;
import com.cool.store.dto.outbound.OutboundListDTO;
import com.cool.store.dto.outbound.UpdateNumberDTO;
import com.cool.store.exception.ApiException;
import com.cool.store.vo.HyOutboundVo;
import java.util.List;
/**
* @author Fun Li 2023/8/9 15:35
* @version 1.0
*/
public interface HyOutboundService {
/**
* 获取呼出手机号列表信息
* @return 手机号信息列表
*/
List<HyOutboundVo> getOutboundNumberList(OutboundListDTO dto);
/**
* 新增呼出手机号
* @param dto 新增手机号信息
*/
void addOutboundNumber(AddNumberDTO dto) throws ApiException;
/**
* 编辑呼出手机号
* @param dto 修改的手机号信息
*/
void updateOutboundNumber(UpdateNumberDTO dto) throws ApiException;
/**
* 删除呼出手机号
* @param dto 待删除的手机号信息编号
*/
void deleteOutboundNumber(DeleteNumberDTO dto);
}

View File

@@ -10,6 +10,8 @@ import com.cool.store.vo.PartnerIntentInfoVO;
import com.cool.store.vo.PartnerUserInfoVO; import com.cool.store.vo.PartnerUserInfoVO;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import java.util.List;
/** /**
* @Author suzhuhong * @Author suzhuhong
* @Date 2023/6/9 14:54 * @Date 2023/6/9 14:54
@@ -26,7 +28,8 @@ public interface HyPartnerIntentInfoService {
* @param pageNumber * @param pageNumber
* @return * @return
*/ */
PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber); PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber,String keyword, Integer callStatus,
List<String> userPortraitIdList, Long lastFollowStartTime, Long lastFollowEndTime, String userChannelIdList);
/** /**
* 根据线索查询加盟商意向申请信息 * 根据线索查询加盟商意向申请信息

View File

@@ -3,10 +3,7 @@ package com.cool.store.service;
import com.cool.store.context.LoginUserInfo; import com.cool.store.context.LoginUserInfo;
import com.cool.store.entity.HyPartnerLineInfoDO; import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.exception.ApiException; import com.cool.store.exception.ApiException;
import com.cool.store.request.CloseFollowRequest; import com.cool.store.request.*;
import com.cool.store.request.LineRequest;
import com.cool.store.request.PrivateSeaLineListRequest;
import com.cool.store.request.TransferInvestmentManagerRequest;
import com.cool.store.vo.*; import com.cool.store.vo.*;
import com.cool.store.vo.interview.InterviewVO; import com.cool.store.vo.interview.InterviewVO;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
@@ -60,6 +57,8 @@ public interface HyPartnerLineInfoService {
*/ */
Boolean transferInvestmentManager(LoginUserInfo user, TransferInvestmentManagerRequest request) throws ApiException; Boolean transferInvestmentManager(LoginUserInfo user, TransferInvestmentManagerRequest request) throws ApiException;
Boolean batchTransferInvestmentManager(LoginUserInfo user, BatchTransferInvestmentManagerRequest request) throws ApiException;
/** /**
* 分配招商经理 * 分配招商经理
* @param userId * @param userId
@@ -117,7 +116,7 @@ public interface HyPartnerLineInfoService {
* @param privateSeaLineListRequest * @param privateSeaLineListRequest
* @return * @return
*/ */
PageInfo<PrivateSeaLineListVo> privateSeaLineList(String userId, PrivateSeaLineListRequest privateSeaLineListRequest) ; PageInfo<PrivateSeaLineListVo> privateSeaLineList(String userId, PrivateSeaLineListRequest privateSeaLineListRequest,Boolean allPrivateSeaFlag) ;
PartnerLineBaseInfoVO getPartnerLinBaseInfo(String partnerId); PartnerLineBaseInfoVO getPartnerLinBaseInfo(String partnerId);

View File

@@ -0,0 +1,21 @@
package com.cool.store.service;
import com.cool.store.dto.partner.UserChannelDTO;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/8/10 11:12
* @Version 1.0
*/
public interface HyPartnerUserChannelService {
/**
* 查询所有的线索来源
* @return
*/
List<UserChannelDTO> queryAllUserChannelList();
}

View File

@@ -0,0 +1,47 @@
package com.cool.store.service;
import com.cool.store.dto.label.LabelGroupAddDTO;
import com.cool.store.dto.label.LabelGroupDeleteDTO;
import com.cool.store.dto.label.LabelGroupListDTO;
import com.cool.store.dto.label.LabelGroupUpdateDTO;
import com.cool.store.exception.ApiException;
import com.cool.store.vo.LabelGroupListVo;
import java.util.List;
/**
* @author Fun Li 2023/8/10 13:34
* @version 1.0
*/
public interface LabelGroupService {
/**
* 查询标签组信息列表
* @param dto 查询条件
*/
List<LabelGroupListVo> getLabelGroupList(LabelGroupListDTO dto);
/**
* 添加标签组
* @param dto 新增标签组信息
*/
void addLabelGroup(LabelGroupAddDTO dto) throws ApiException;
/**
* 修改标签组信息
* @param dto 修改内容
*/
void updateLabelGroup(LabelGroupUpdateDTO dto);
/**
* 删除标签组
* @param dto 待删除标签组信息
*/
void deleteLabelGroup(LabelGroupDeleteDTO dto) throws ApiException;
/**
* 获取所有标签组
*/
List<LabelGroupListVo> getAllLabelGroupList();
}

View File

@@ -0,0 +1,58 @@
package com.cool.store.service;
import com.cool.store.dto.label.LabelAddDTO;
import com.cool.store.dto.label.LabelDeleteDTO;
import com.cool.store.dto.label.LabelListDTO;
import com.cool.store.dto.label.LabelUpdateDTO;
import com.cool.store.exception.ApiException;
import com.cool.store.vo.LabelListVo;
import java.util.List;
import java.util.Map;
/**
* @author Fun Li 2023/8/10 14:23
* @version 1.0
*/
public interface LabelService {
/**
* 获取数组列表
*
* @param dto 查询条件
*/
List<LabelListVo> getLabelList(LabelListDTO dto);
/**
* 添加标签组
* @param dto 新增标签组信息
*/
void addLabel(LabelAddDTO dto) throws ApiException;
/**
* 标签MAP
* @param userPortraitStrList
* @return
*/
Map<Long,String> getUserPortraitMap(List<String> userPortraitStrList);
/**
* 查询标签中文名称集合
* @param userPortraitMap
* @param userPortraitStr
* @return
*/
List<String> getUserPortraitList(Map<Long,String> userPortraitMap,String userPortraitStr);
/**
* 修改标签信息
* @param dto 新标签信息
*/
void updateLabel(LabelUpdateDTO dto) throws ApiException;
/**
* 删除标签
* @param dto
*/
void deleteLabel(LabelDeleteDTO dto);
}

View File

@@ -0,0 +1,109 @@
package com.cool.store.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.UUID;
import com.alibaba.fastjson.JSON;
import com.cool.store.dto.call.CallUpDTO;
import com.cool.store.entity.CallRecordDO;
import com.cool.store.enums.CallStatusEnum;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.handler.WebSocketServer;
import com.cool.store.mapper.CallRecordMapper;
import com.cool.store.mapper.HyOutboundMobileMapper;
import com.cool.store.request.CallFinishBackReq;
import com.cool.store.request.CallRecordBackReq;
import com.cool.store.request.CallUpReq;
import com.cool.store.service.CallService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* @Author: young.yu
* @Date: 2023-08-10 18:58
* @Description:
*/
@Slf4j
@Service
public class CallServiceImpl implements CallService {
@Autowired
private CallRecordMapper callRecordMapper;
@Autowired
private HyOutboundMobileMapper hyOutboundMobileMapper;
@Override
public void callUp(CallUpReq request) throws ApiException {
try {
//校验拨出手机号APP是否在线
boolean isOnline = WebSocketServer.isOnline(request.getOutgoingMobile());
if (!isOnline) {
throw new ApiException(ErrorCodeEnum.MOBILE_APP_NOT_ONLINE_ERROR);
}
CallRecordDO callRecordDO = new CallRecordDO();
callRecordDO.setOutgoingMobile(request.getOutgoingMobile());
callRecordDO.setIncomingMobile(request.getIncomingMobile());
callRecordDO.setOutgoingUserId(request.getOutgoingUserId());
callRecordDO.setIncomingUserId(request.getIncomingUserId());
callRecordDO.setPartnerLineId(Long.valueOf(request.getLineId()));
//请求id
String transNo = UUID.fastUUID().toString().replace("-", "");
callRecordDO.setTransNo(transNo);
callRecordDO.setCreater(request.getOutgoingUserId());
callRecordDO.setCreateTime(new Date());
callRecordDO.setCallStatus(CallStatusEnum.PENDING_CALL.getCode());
//发起app通话请求
CallUpDTO callUpDTO = new CallUpDTO();
callUpDTO.setTransNo(transNo);
callUpDTO.setOutgoingMobile(request.getOutgoingMobile());
callUpDTO.setIncomingMobile(request.getIncomingMobile());
boolean sendFlag = WebSocketServer.sendInfo(JSON.toJSONString(callUpDTO), callRecordDO.getOutgoingMobile());
if (!sendFlag) {
throw new ApiException(ErrorCodeEnum.CREATE_CALL_REQUEST_ERROR);
}
//保存通话记录
callRecordMapper.insertSelective(callRecordDO);
} catch (Exception e) {
log.error("callUp error, request:{}", JSON.toJSONString(request), e);
throw new ApiException(ErrorCodeEnum.CALL_UP_ERROR);
}
}
@Override
public void callFinishBack(CallFinishBackReq request) throws ApiException {
CallRecordDO callRecordDO = callRecordMapper.selectByTransNo(request.getTransNo());
//校验通话记录是否存在
if(callRecordDO == null){
throw new ApiException(ErrorCodeEnum.CALL_RECORD_NOT_EXIST_ERROR);
}
callRecordDO.setCallStatus(request.getCallStatus());
callRecordDO.setFailReason(request.getFailReason());
callRecordDO.setUpdater("system-app");
callRecordDO.setUpdateTime(new Date());
if(StringUtils.isNotEmpty(request.getCallStartTime())&&StringUtils.isNotEmpty(request.getCallEndTime())){
callRecordDO.setCallStartTime(DateUtil.parse(request.getCallStartTime()));
callRecordDO.setCallEndTime(DateUtil.parse(request.getCallEndTime()));
}
callRecordMapper.updateByTransNoSelective(callRecordDO);
}
@Override
public void callRecordBack(CallRecordBackReq request) throws ApiException {
CallRecordDO callRecordDO = callRecordMapper.selectByTransNo(request.getTransNo());
//校验通话记录是否存在
if(callRecordDO == null){
throw new ApiException(ErrorCodeEnum.CALL_RECORD_NOT_EXIST_ERROR);
}
callRecordDO.setRecordUrl(request.getRecordUrl());
callRecordDO.setUpdater("system-app");
callRecordDO.setUpdateTime(new Date());
callRecordMapper.updateByTransNoSelective(callRecordDO);
}
}

View File

@@ -0,0 +1,200 @@
package com.cool.store.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.constants.MessageConstants;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.HyFollowTaskDAO;
import com.cool.store.dao.HyPartnerLineInfoDAO;
import com.cool.store.dao.HyPartnerTaskInfoLogDAO;
import com.cool.store.dto.log.LineLogInfo;
import com.cool.store.dto.message.SendCardMessageDTO;
import com.cool.store.dto.partner.PartnerSimpleInfoDTO;
import com.cool.store.entity.HyFollowTaskDO;
import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.enums.*;
import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException;
import com.cool.store.http.ISVHttpRequest;
import com.cool.store.request.follow.AddFollowLogRequest;
import com.cool.store.request.follow.AddFollowTaskRequest;
import com.cool.store.request.follow.FollowTaskIdRequest;
import com.cool.store.request.follow.UpdateFollowTaskRequest;
import com.cool.store.service.FollowTaskService;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.vo.follow.FollowTaskLogVO;
import com.cool.store.vo.follow.FollowTaskPageVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.MessageFormat;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @author zhangchenbiao
* @FileName: FollowTaskServiceImpl
* @Description:
* @date 2023-08-10 11:10
*/
@Slf4j
@Service
public class FollowTaskServiceImpl implements FollowTaskService {
@Resource
private HyFollowTaskDAO hyFollowTaskDAO;
@Resource
private HyPartnerLineInfoDAO hyPartnerLineInfoDAO;
@Resource
private HyPartnerTaskInfoLogDAO hyPartnerTaskInfoLogDAO;
@Resource
private EnterpriseUserDAO enterpriseUserDAO;
@Resource
private ISVHttpRequest isvHttpRequest;
@Value("${feishu.notice.link.url:null}")
private String linkUrl;
@Override
public PageInfo<FollowTaskPageVO> getFollowTaskPage(Integer pageNum, Integer pageSize, Integer taskStatus, String queryDate, String followUserId) {
String deadlineStartTIme = null, deadlineEndTIme = null;
if(StringUtils.isNotBlank(queryDate) && FollowTaskStatusEnum.TODO.getCode().equals(taskStatus)){
//只有待完成的时候需要根据截止时间查询
deadlineStartTIme = queryDate + CommonConstants.DAY_START_TIME_SUFFIX;
deadlineEndTIme = queryDate + CommonConstants.DAY_END_TIME_SUFFIX;
}
Page<HyFollowTaskDO> taskPage = hyFollowTaskDAO.getTaskPage(followUserId, taskStatus, deadlineStartTIme, deadlineEndTIme, pageNum, pageSize);
PageInfo resultPage = new PageInfo(taskPage);
if(CollectionUtils.isNotEmpty(taskPage)){
List<Long> partnerLineIds = taskPage.stream().map(HyFollowTaskDO::getPartnerLineId).distinct().collect(Collectors.toList());
Map<Long, PartnerSimpleInfoDTO> partnerSimpleInfoMap = hyPartnerLineInfoDAO.getPartnerSimpleInfoByLineIds(partnerLineIds);
List<FollowTaskPageVO> resultList = FollowTaskPageVO.convertVO(taskPage, partnerSimpleInfoMap);
resultPage.setList(resultList);
}
return resultPage;
}
@Override
public PageInfo<FollowTaskLogVO> getFollowLogPage(Integer pageNum, Integer pageSize, Long partnerLineId) {
return null;
}
@Override
public Integer addFollowLog(AddFollowLogRequest request, String userId) {
HyPartnerLineInfoDO lineInfo = checkLine(request.getPartnerLineId());
String userName = enterpriseUserDAO.getUserName(userId);
LineLogInfo lineLogInfo = new LineLogInfo(lineInfo.getPartnerId(), request.getPartnerLineId(), userId, userName, OperateTypeEnum.ADD_FOLLOW_LOG, WorkflowStageEnum.getWorkflowStageByCode(lineInfo.getWorkflowStage()), lineInfo.getWorkflowStatus(), null);
JSONObject jsonObject = new JSONObject();
jsonObject.put(OperateLogFieldValueEnum.FOLLOW_LOG.getCode(), request.getFollowLog());
lineLogInfo.setData(jsonObject);
hyPartnerTaskInfoLogDAO.addOperateLog(lineLogInfo);
return null;
}
@Override
public Long addFollowTask(AddFollowTaskRequest request, String userId) {
if(request.getDeadline().getTime() < System.currentTimeMillis()){
throw new ServiceException(ErrorCodeEnum.DATELINE_BEFORE_NOW);
}
HyPartnerLineInfoDO lineInfo = checkLine(request.getPartnerLineId());
HyFollowTaskDO task = AddFollowTaskRequest.convertDO(request);
task.setFollowUserId(lineInfo.getInvestmentManager());
Long followTaskId = hyFollowTaskDAO.addFollowTask(task);
String userName = enterpriseUserDAO.getUserName(userId);
LineLogInfo lineLogInfo = new LineLogInfo(lineInfo.getPartnerId(), request.getPartnerLineId(), userId, userName, OperateTypeEnum.ADD_FOLLOW_TASK, WorkflowStageEnum.getWorkflowStageByCode(lineInfo.getWorkflowStage()), lineInfo.getWorkflowStatus(), null);
JSONObject jsonObject = new JSONObject();
jsonObject.put(OperateLogFieldValueEnum.FOLLOW_TASK_ID.getCode(), followTaskId);
lineLogInfo.setData(jsonObject);
hyPartnerTaskInfoLogDAO.addOperateLog(lineLogInfo);
if((request.getDeadline().getTime() - System.currentTimeMillis()) /CommonConstants.ONE_THOUSAND < CommonConstants.AN_HOUR_SECONDS){
//一小时内的任务立即发送通知
sendMessage(task);
}
return followTaskId;
}
@Override
public Integer updateFollowTask(UpdateFollowTaskRequest request, String userId) {
HyFollowTaskDO followTask = hyFollowTaskDAO.getFollowTask(request.getFollowTaskId());
if(!FollowTaskStatusEnum.TODO.getCode().equals(followTask.getTaskStatus())){
throw new ServiceException(ErrorCodeEnum.TASK_STATUS_NOT_ALLOW_OPERATE);
}
if(Objects.nonNull(request.getDeadline()) && request.getDeadline().getTime() < System.currentTimeMillis()){
throw new ServiceException(ErrorCodeEnum.DATELINE_BEFORE_NOW);
}
checkLine(followTask.getPartnerLineId());
HyFollowTaskDO task = UpdateFollowTaskRequest.convertDO(followTask.getPartnerLineId(), request);
if(!request.getDeadline().equals(followTask.getDeadline()) && (request.getDeadline().getTime() - System.currentTimeMillis()) / CommonConstants.ONE_THOUSAND < CommonConstants.AN_HOUR_SECONDS){
//一小时内的任务立即发送通知
sendMessage(task);
}
return hyFollowTaskDAO.updateFollowTask(task);
}
@Override
public Integer finishFollowTask(FollowTaskIdRequest request, String userId) {
HyFollowTaskDO followTask = hyFollowTaskDAO.getFollowTask(request.getFollowTaskId());
if(!FollowTaskStatusEnum.TODO.getCode().equals(followTask.getTaskStatus()) && !FollowTaskStatusEnum.OVERDUE.getCode().equals(followTask.getTaskStatus())){
throw new ServiceException(ErrorCodeEnum.TASK_STATUS_NOT_ALLOW_OPERATE);
}
checkLine(followTask.getPartnerLineId());
return hyFollowTaskDAO.finishFollowTask(request.getFollowTaskId());
}
@Override
public Integer cancelFollowTask(FollowTaskIdRequest request, String userId) {
HyFollowTaskDO followTask = hyFollowTaskDAO.getFollowTask(request.getFollowTaskId());
if(!FollowTaskStatusEnum.TODO.getCode().equals(followTask.getTaskStatus())){
throw new ServiceException(ErrorCodeEnum.TASK_STATUS_NOT_ALLOW_OPERATE);
}
checkLine(followTask.getPartnerLineId());
return hyFollowTaskDAO.cancelFollowTask(request.getFollowTaskId());
}
/**
* 线索校验
* @param partnerLineId
* @return
*/
private HyPartnerLineInfoDO checkLine(Long partnerLineId){
HyPartnerLineInfoDO lineInfo = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(partnerLineId);
if(Objects.isNull(lineInfo) || lineInfo.getDeleted()){
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
if(!LineStatusEnum.PRIVATE_SEAS.getCode().equals(lineInfo.getLineStatus())){
//线索只有私海的时候才能操作
throw new ServiceException(ErrorCodeEnum.LINE_STATUS_NOT_ALLOW_OPERATE);
}
return lineInfo;
}
private void sendMessage(HyFollowTaskDO task){
PartnerSimpleInfoDTO partnerInfo = hyPartnerLineInfoDAO.getPartnerSimpleInfoByLineId(task.getPartnerLineId());
if(Objects.isNull(partnerInfo)){
return;
}
String dateline = DateUtil.format(task.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC_2);
String content = MessageFormat.format(MessageConstants.FOLLOW_TASK_MESSAGE_CONTENT, dateline, partnerInfo.getUsername(), partnerInfo.getMobile());
SendCardMessageDTO sendCardMessage = new SendCardMessageDTO();
sendCardMessage.setMessageUrl(linkUrl);
sendCardMessage.setMessageType(MessageTypeEnum.SCHEDULE_REMINDER);
sendCardMessage.setContent(content);
sendCardMessage.setTitle(MessageConstants.FOLLOW_TASK_MESSAGE_TITLE);
sendCardMessage.setUserIds(Arrays.asList(task.getFollowUserId()));
try {
isvHttpRequest.sendFeiShuCardMessage(sendCardMessage);
} catch (ApiException e) {
log.error("跟进任务发送通知失败, {}", JSONObject.toJSONString(task));
}
}
}

View File

@@ -0,0 +1,100 @@
package com.cool.store.service.impl;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.dto.outbound.AddNumberDTO;
import com.cool.store.dto.outbound.DeleteNumberDTO;
import com.cool.store.dto.outbound.OutboundListDTO;
import com.cool.store.dto.outbound.UpdateNumberDTO;
import com.cool.store.entity.HyOutboundMobileDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.mapper.HyOutboundMobileMapper;
import com.cool.store.service.HyOutboundService;
import com.cool.store.vo.HyOutboundVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author Fun Li 2023/8/9 15:36
* @version 1.0
*/
@Service
public class HyOutboundServiceImpl implements HyOutboundService {
@Autowired
private HyOutboundMobileMapper outboundMobileMapper;
/**
* 获取呼出手机号列表信息
* @return 手机号信息列表
*/
@Override
public List<HyOutboundVo> getOutboundNumberList(OutboundListDTO dto) {
return outboundMobileMapper.getOutboundNumberList(dto, CurrentUserHolder.getUserId());
}
/**
* 新增呼出手机号
* @param dto 新增手机号信息
*/
@Override
public void addOutboundNumber(AddNumberDTO dto) throws ApiException {
if (whetherRepeat(dto.getOutboundNumber())) {
throw new ApiException(ErrorCodeEnum.OUTBOUND_NUMBER_EXIST);
}
String userId = CurrentUserHolder.getUserId();
HyOutboundMobileDO hyOutboundMobile = new HyOutboundMobileDO();
hyOutboundMobile.setMobile(dto.getOutboundNumber());
hyOutboundMobile.setEditUserId(userId);
hyOutboundMobile.setCreateUserId(userId);
hyOutboundMobile.setUpdateUserId(userId);
outboundMobileMapper.insertSelective(hyOutboundMobile);
}
/**
* 编辑呼出手机号
* @param dto 修改的手机号信息
*/
@Override
public void updateOutboundNumber(UpdateNumberDTO dto) throws ApiException {
if (whetherRepeat(dto.getNewOutboundNumber())) {
throw new ApiException(ErrorCodeEnum.OUTBOUND_NUMBER_EXIST);
}
String userId = CurrentUserHolder.getUserId();
HyOutboundMobileDO hyOutboundMobile = new HyOutboundMobileDO();
hyOutboundMobile.setId(dto.getId());
hyOutboundMobile.setMobile(dto.getNewOutboundNumber());
hyOutboundMobile.setEditUserId(userId);
hyOutboundMobile.setUpdateUserId(userId);
outboundMobileMapper.updateByPrimaryKeySelective(hyOutboundMobile);
}
/**
* 删除呼出手机号
* @param dto 待删除的手机号信息编号
*/
@Override
public void deleteOutboundNumber(DeleteNumberDTO dto) {
HyOutboundMobileDO hyOutboundMobile = new HyOutboundMobileDO();
String userId = CurrentUserHolder.getUserId();
hyOutboundMobile.setId(dto.getId());
hyOutboundMobile.setUpdateUserId(userId);
hyOutboundMobile.setDeleted(true);
outboundMobileMapper.updateByPrimaryKeySelective(hyOutboundMobile);
}
/**
* 查询某个手机号是否重复
* @param number 手机号
* @return 是否重复
*/
public boolean whetherRepeat(String number) {
HyOutboundMobileDO hyOutboundMobileDO = new HyOutboundMobileDO();
hyOutboundMobileDO.setMobile(number);
List<HyOutboundMobileDO> outboundMobileList = outboundMobileMapper.selectByPrimarySelective(hyOutboundMobileDO);
return outboundMobileList != null && outboundMobileList.size() != 0;
}
}

View File

@@ -3,6 +3,7 @@ package com.cool.store.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.constants.RedisConstant; import com.cool.store.constants.RedisConstant;
import com.cool.store.context.CurrentUserHolder; import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo; import com.cool.store.context.LoginUserInfo;
@@ -36,6 +37,7 @@ import javax.annotation.Resource;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.stream.Collectors;
/** /**
* @Author suzhuhong * @Author suzhuhong
@@ -91,7 +93,8 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
throw new ServiceException(ErrorCodeEnum.PARTNER_BASE_INFO_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.PARTNER_BASE_INFO_NOT_EXIST);
} }
hyPartnerBaseInfo.setId(addTagsRequest.getPartnerBaseInfoId()); hyPartnerBaseInfo.setId(addTagsRequest.getPartnerBaseInfoId());
hyPartnerBaseInfo.setUserPortrait(CollectionUtils.isNotEmpty(addTagsRequest.getTags())? JSONObject.toJSONString(addTagsRequest.getTags()):""); hyPartnerBaseInfo.setUserPortrait(CollectionUtils.isNotEmpty(addTagsRequest.getTags())?
addTagsRequest.getTags().stream().map(Object::toString).collect(Collectors.joining(CommonConstants.COMMA, CommonConstants.COMMA, CommonConstants.COMMA)):"");
hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(hyPartnerBaseInfo); hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(hyPartnerBaseInfo);
HyPartnerLineInfoDO line = hyPartnerLineInfoDAO.getByPartnerId(hyPartnerBaseInfo.getPartnerId()); HyPartnerLineInfoDO line = hyPartnerLineInfoDAO.getByPartnerId(hyPartnerBaseInfo.getPartnerId());
//添加日志 //添加日志

View File

@@ -15,14 +15,13 @@ import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
import com.cool.store.entity.*; import com.cool.store.entity.*;
import com.cool.store.enums.*; import com.cool.store.enums.*;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.HyPartnerLabelMapper;
import com.cool.store.mapper.HyPartnerUserChannelMapper;
import com.cool.store.request.BaseUserInfoRequest; import com.cool.store.request.BaseUserInfoRequest;
import com.cool.store.request.IndustryCognitionInfoRequest; import com.cool.store.request.IndustryCognitionInfoRequest;
import com.cool.store.request.PartnerIntentInfoRequest; import com.cool.store.request.PartnerIntentInfoRequest;
import com.cool.store.request.PartnerWantShopInfoRequest; import com.cool.store.request.PartnerWantShopInfoRequest;
import com.cool.store.service.HyPartnerIntentInfoService; import com.cool.store.service.*;
import com.cool.store.service.HyPartnerLineInfoService;
import com.cool.store.service.HyPhoneLocationService;
import com.cool.store.service.LogService;
import com.cool.store.utils.CoolDateUtils; import com.cool.store.utils.CoolDateUtils;
import com.cool.store.utils.RedisUtilPool; import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.StringUtil; import com.cool.store.utils.StringUtil;
@@ -73,12 +72,16 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
HyPartnerTaskInfoLogDAO hyPartnerTaskInfoLogDAO; HyPartnerTaskInfoLogDAO hyPartnerTaskInfoLogDAO;
@Autowired @Autowired
private LogService logService; private LogService logService;
@Resource
HyPartnerUserChannelMapper hyPartnerUserChannelMapper;
@Resource
LabelService labelService;
@Autowired @Autowired
private NoticeService noticeService; private NoticeService noticeService;
@Override @Override
public PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber) { public PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber,String keyword, Integer callStatus,
List<String> userPortraitIdList, Long lastFollowStartTime, Long lastFollowEndTime, String userChannelIdList) {
PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = new PartnerIntentApplyInfoVO(); PartnerIntentApplyInfoVO partnerIntentApplyInfoVO = new PartnerIntentApplyInfoVO();
String workflowStatus = ""; String workflowStatus = "";
if (CommonConstants.PENDING.equals(type)) { if (CommonConstants.PENDING.equals(type)) {
@@ -87,22 +90,35 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
if (CommonConstants.FOLLOW.equals(type)) { if (CommonConstants.FOLLOW.equals(type)) {
workflowStatus = WorkflowStatusEnum.INTENT_0.getCode(); workflowStatus = WorkflowStatusEnum.INTENT_0.getCode();
} }
String lastFollowStartTimeStr = null;
String lastFollowEndTimeStr = null;
if (lastFollowStartTime!=null||lastFollowEndTime!=null){
lastFollowStartTimeStr = DateUtil.format(new Date(lastFollowStartTime), CoolDateUtils.DATE_FORMAT_SEC);
lastFollowEndTimeStr = DateUtil.format(new Date(lastFollowEndTime), CoolDateUtils.DATE_FORMAT_SEC);
}
PageHelper.startPage(pageNumber,pageSize); PageHelper.startPage(pageNumber,pageSize);
PageInfo partnerIntentApplyInfo = new PageInfo(hyPartnerIntentInfoDAO.selectPartnerIntentApplyInfoList(userId, WorkflowStageEnum.INTENT.getCode(), workflowStatus)); PageInfo partnerIntentApplyInfo = new PageInfo(hyPartnerIntentInfoDAO.selectPartnerIntentApplyInfoList(userId, WorkflowStageEnum.INTENT.getCode(), workflowStatus,keyword
,callStatus,userPortraitIdList,lastFollowStartTimeStr,lastFollowEndTimeStr,userChannelIdList));
if (partnerIntentApplyInfo==null){ if (partnerIntentApplyInfo==null){
return new PageInfo<>(); return new PageInfo<>();
} }
List<PartnerIntentApplyInfoDTO> list = partnerIntentApplyInfo.getList(); List<PartnerIntentApplyInfoDTO> list = partnerIntentApplyInfo.getList();
List<String> partnerIds = list.stream().map(PartnerIntentApplyInfoDTO::getPartnerId).collect(Collectors.toList()); List<Integer> userChannelIds = list.stream().filter(x -> x.getUserChannelId() != null).map(PartnerIntentApplyInfoDTO::getUserChannelId).collect(Collectors.toList());
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIds); List<HyPartnerUserChannelDO> userChannelList = new ArrayList<>();
Map<String, HyPartnerUserInfoDO> infoDOMap = hyPartnerUserInfoDOS.stream().collect(Collectors.toMap(HyPartnerUserInfoDO::getPartnerId, data -> data)); if (CollectionUtils.isNotEmpty(userChannelIds)){
userChannelList = hyPartnerUserChannelMapper.getUserChannelByIds(userChannelIds);
}
List<String> userPortraitList = list.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait() )).map(PartnerIntentApplyInfoDTO::getUserPortrait).collect(Collectors.toList());
Map<Long, String> userChannelMap = userChannelList.stream().collect(Collectors.toMap(HyPartnerUserChannelDO::getChannelId, HyPartnerUserChannelDO::getChannelName));
List<Long> wantShopAreaList = list.stream().filter(x->StringUtils.isNotEmpty(x.getWantShopArea())).map(PartnerIntentApplyInfoDTO::getWantShopArea).map(Long::parseLong).distinct().collect(Collectors.toList()); List<Long> wantShopAreaList = list.stream().filter(x->StringUtils.isNotEmpty(x.getWantShopArea())).map(PartnerIntentApplyInfoDTO::getWantShopArea).map(Long::parseLong).distinct().collect(Collectors.toList());
Map<String, String> wantShopAreaNameMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaList); Map<String, String> wantShopAreaNameMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaList);
List<PartnerIntentApplyInfoVO> resultList = PartnerIntentApplyInfoVO.convertList(list, infoDOMap, wantShopAreaNameMap, workflowStatus); List<PartnerIntentApplyInfoVO> resultList = PartnerIntentApplyInfoVO.convertList(list, wantShopAreaNameMap, workflowStatus,userChannelMap,labelService.getUserPortraitMap(userPortraitList));
partnerIntentApplyInfo.setList(resultList); partnerIntentApplyInfo.setList(resultList);
return partnerIntentApplyInfo; return partnerIntentApplyInfo;
} }
@Override @Override
public Boolean updatePartnerIntentInfo(LoginUserInfo userInfo, BaseUserInfoRequest baseUserInfoRequest) { public Boolean updatePartnerIntentInfo(LoginUserInfo userInfo, BaseUserInfoRequest baseUserInfoRequest) {

View File

@@ -5,6 +5,7 @@ import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.*; import com.cool.store.dao.*;
import com.cool.store.dto.message.RemindInterviewMsgDTO; import com.cool.store.dto.message.RemindInterviewMsgDTO;
import com.cool.store.dto.message.SendCardMessageDTO; import com.cool.store.dto.message.SendCardMessageDTO;
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
import com.cool.store.dto.partner.PartnerInterviewInfoDTO; import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
import com.cool.store.entity.*; import com.cool.store.entity.*;
import com.cool.store.enums.MessageTypeEnum; import com.cool.store.enums.MessageTypeEnum;
@@ -16,11 +17,13 @@ import com.cool.store.http.ISVHttpRequest;
import com.cool.store.mapper.HyPartnerInterviewMapper; import com.cool.store.mapper.HyPartnerInterviewMapper;
import com.cool.store.mapper.HyPartnerInterviewPlanMapper; import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
import com.cool.store.mapper.HyPartnerLineInfoMapper; import com.cool.store.mapper.HyPartnerLineInfoMapper;
import com.cool.store.mapper.HyPartnerUserChannelMapper;
import com.cool.store.request.CloseFollowRequest; import com.cool.store.request.CloseFollowRequest;
import com.cool.store.request.GetInterviewListReq; import com.cool.store.request.GetInterviewListReq;
import com.cool.store.service.HyPartnerInterviewPlanService; import com.cool.store.service.HyPartnerInterviewPlanService;
import com.cool.store.service.HyPartnerLineInfoService; import com.cool.store.service.HyPartnerLineInfoService;
import com.cool.store.service.InterviewService; import com.cool.store.service.InterviewService;
import com.cool.store.service.LabelService;
import com.cool.store.utils.CoolDateUtils; import com.cool.store.utils.CoolDateUtils;
import com.cool.store.vo.InterviewDetailInfoVO; import com.cool.store.vo.InterviewDetailInfoVO;
import com.cool.store.vo.PartnerInterviewInfoVO; import com.cool.store.vo.PartnerInterviewInfoVO;
@@ -78,6 +81,10 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
@Autowired @Autowired
private InterviewService interviewService; private InterviewService interviewService;
@Resource
LabelService labelService;
@Resource
HyPartnerUserChannelMapper hyPartnerUserChannelMapper;
@Value("${feishu.notice.link.url:null}") @Value("${feishu.notice.link.url:null}")
@@ -129,6 +136,9 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
List<PartnerInterviewInfoVO> result = new ArrayList<>(); List<PartnerInterviewInfoVO> result = new ArrayList<>();
List<String> partnerIds = list.stream().map(PartnerInterviewInfoDTO::getPartnerId).collect(Collectors.toList()); List<String> partnerIds = list.stream().map(PartnerInterviewInfoDTO::getPartnerId).collect(Collectors.toList());
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIds); List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIds);
List<Integer> userChannelIds = hyPartnerUserInfoDOS.stream().filter(x -> x.getUserChannelId() != null).map(HyPartnerUserInfoDO::getUserChannelId).collect(Collectors.toList());
List<HyPartnerUserChannelDO> userChannelList = hyPartnerUserChannelMapper.getUserChannelByIds(userChannelIds);
Map<Long, String> channelMap = userChannelList.stream().collect(Collectors.toMap(HyPartnerUserChannelDO::getChannelId, HyPartnerUserChannelDO::getChannelName));
List<String> interviewerUserIds = list.stream().filter(x-> StringUtils.isNotEmpty(x.getInterviewer())).map(PartnerInterviewInfoDTO::getInterviewer).collect(Collectors.toList()); List<String> interviewerUserIds = list.stream().filter(x-> StringUtils.isNotEmpty(x.getInterviewer())).map(PartnerInterviewInfoDTO::getInterviewer).collect(Collectors.toList());
List<EnterpriseUserDO> userInfoByUserIds = enterpriseUserDAO.getUserInfoByUserIds(interviewerUserIds); List<EnterpriseUserDO> userInfoByUserIds = enterpriseUserDAO.getUserInfoByUserIds(interviewerUserIds);
Map<String, EnterpriseUserDO> interviewerUserMap = userInfoByUserIds.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, data -> data)); Map<String, EnterpriseUserDO> interviewerUserMap = userInfoByUserIds.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, data -> data));
@@ -136,8 +146,10 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
List<Long> lineIds = list.stream().map(PartnerInterviewInfoDTO::getPartnerLineId).collect(Collectors.toList()); List<Long> lineIds = list.stream().map(PartnerInterviewInfoDTO::getPartnerLineId).collect(Collectors.toList());
List<HyPartnerLineInfoDO> hyPartnerLineInfoDOS= hyPartnerLineInfoDAO.getHyPartnerLineInfoListByIds(lineIds); List<HyPartnerLineInfoDO> hyPartnerLineInfoDOS= hyPartnerLineInfoDAO.getHyPartnerLineInfoListByIds(lineIds);
Map<Long, HyPartnerLineInfoDO> hyPartnerLineInfoDOMap = hyPartnerLineInfoDOS.stream().collect(Collectors.toMap(HyPartnerLineInfoDO::getId, data -> data)); Map<Long, HyPartnerLineInfoDO> hyPartnerLineInfoDOMap = hyPartnerLineInfoDOS.stream().collect(Collectors.toMap(HyPartnerLineInfoDO::getId, data -> data));
List<String> userPortraitList = list.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait() )).map(PartnerInterviewInfoDTO::getUserPortrait).collect(Collectors.toList());
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
list.stream().forEach(x->{ list.stream().forEach(x->{
PartnerInterviewInfoVO partnerInterviewInfoVO = convertPartnerInterviewInfoDTOToVo(x); PartnerInterviewInfoVO partnerInterviewInfoVO = convertPartnerInterviewInfoDTOToVo(x,userPortraitMap,userNameMap.get(x.getPartnerId()),channelMap);
partnerInterviewInfoVO.setPartnerName(userNameMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getUsername()); partnerInterviewInfoVO.setPartnerName(userNameMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getUsername());
partnerInterviewInfoVO.setPartnerPhone(userNameMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getMobile()); partnerInterviewInfoVO.setPartnerPhone(userNameMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getMobile());
partnerInterviewInfoVO.setInterviewerName(interviewerUserMap.getOrDefault(x.getInterviewer(),new EnterpriseUserDO()).getName()); partnerInterviewInfoVO.setInterviewerName(interviewerUserMap.getOrDefault(x.getInterviewer(),new EnterpriseUserDO()).getName());
@@ -170,12 +182,17 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
List<String> partnerIds = list.stream().map(PartnerInterviewInfoDTO::getPartnerId).collect(Collectors.toList()); List<String> partnerIds = list.stream().map(PartnerInterviewInfoDTO::getPartnerId).collect(Collectors.toList());
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIds); List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(partnerIds);
Map<String, HyPartnerUserInfoDO> userNameMap = hyPartnerUserInfoDOS.stream().collect(Collectors.toMap(HyPartnerUserInfoDO::getPartnerId, Data->Data)); Map<String, HyPartnerUserInfoDO> userNameMap = hyPartnerUserInfoDOS.stream().collect(Collectors.toMap(HyPartnerUserInfoDO::getPartnerId, Data->Data));
List<Integer> userChannelIds = hyPartnerUserInfoDOS.stream().filter(x -> x.getUserChannelId() != null).map(HyPartnerUserInfoDO::getUserChannelId).collect(Collectors.toList());
List<HyPartnerUserChannelDO> userChannelList = hyPartnerUserChannelMapper.getUserChannelByIds(userChannelIds);
Map<Long, String> channelMap = userChannelList.stream().collect(Collectors.toMap(HyPartnerUserChannelDO::getChannelId, HyPartnerUserChannelDO::getChannelName));
List<Long> lineIds = list.stream().map(PartnerInterviewInfoDTO::getPartnerLineId).collect(Collectors.toList()); List<Long> lineIds = list.stream().map(PartnerInterviewInfoDTO::getPartnerLineId).collect(Collectors.toList());
List<HyPartnerLineInfoDO> hyPartnerLineInfoDOS= hyPartnerLineInfoDAO.getHyPartnerLineInfoListByIds(lineIds); List<HyPartnerLineInfoDO> hyPartnerLineInfoDOS= hyPartnerLineInfoDAO.getHyPartnerLineInfoListByIds(lineIds);
Map<Long, HyPartnerLineInfoDO> hyPartnerLineInfoDOMap = hyPartnerLineInfoDOS.stream().collect(Collectors.toMap(HyPartnerLineInfoDO::getId, data -> data)); Map<Long, HyPartnerLineInfoDO> hyPartnerLineInfoDOMap = hyPartnerLineInfoDOS.stream().collect(Collectors.toMap(HyPartnerLineInfoDO::getId, data -> data));
List<String> userPortraitList = list.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait() )).map(PartnerInterviewInfoDTO::getUserPortrait).collect(Collectors.toList());
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
List<PartnerInterviewInfoVO> result = new ArrayList<>(); List<PartnerInterviewInfoVO> result = new ArrayList<>();
list.stream().forEach(x->{ list.stream().forEach(x->{
PartnerInterviewInfoVO partnerInterviewInfoVO = convertPartnerInterviewInfoDTOToVo(x); PartnerInterviewInfoVO partnerInterviewInfoVO = convertPartnerInterviewInfoDTOToVo(x,userPortraitMap,userNameMap.get(x.getPartnerId()),channelMap);
partnerInterviewInfoVO.setPartnerName(userNameMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getUsername()); partnerInterviewInfoVO.setPartnerName(userNameMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getUsername());
partnerInterviewInfoVO.setPartnerPhone(userNameMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getMobile()); partnerInterviewInfoVO.setPartnerPhone(userNameMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getMobile());
partnerInterviewInfoVO.setLineStatus(hyPartnerLineInfoDOMap.getOrDefault(x.getPartnerLineId(),new HyPartnerLineInfoDO()).getLineStatus()); partnerInterviewInfoVO.setLineStatus(hyPartnerLineInfoDOMap.getOrDefault(x.getPartnerLineId(),new HyPartnerLineInfoDO()).getLineStatus());
@@ -310,7 +327,7 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
* @param partnerInterviewInfoDTO * @param partnerInterviewInfoDTO
* @return * @return
*/ */
private PartnerInterviewInfoVO convertPartnerInterviewInfoDTOToVo(PartnerInterviewInfoDTO partnerInterviewInfoDTO){ private PartnerInterviewInfoVO convertPartnerInterviewInfoDTOToVo(PartnerInterviewInfoDTO partnerInterviewInfoDTO,Map<Long, String> userPortraitMap, HyPartnerUserInfoDO hyPartnerUserInfoDO,Map<Long, String> channelMap){
PartnerInterviewInfoVO partnerInterviewInfoVO = new PartnerInterviewInfoVO(); PartnerInterviewInfoVO partnerInterviewInfoVO = new PartnerInterviewInfoVO();
partnerInterviewInfoVO.setInterviewId(partnerInterviewInfoDTO.getInterviewId()); partnerInterviewInfoVO.setInterviewId(partnerInterviewInfoDTO.getInterviewId());
partnerInterviewInfoVO.setInterviewPlanId(partnerInterviewInfoDTO.getId()); partnerInterviewInfoVO.setInterviewPlanId(partnerInterviewInfoDTO.getId());
@@ -325,6 +342,17 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
partnerInterviewInfoVO.setAuthCode(partnerInterviewInfoDTO.getIntentionContractNo()); partnerInterviewInfoVO.setAuthCode(partnerInterviewInfoDTO.getIntentionContractNo());
partnerInterviewInfoVO.setEndTime(DateUtil.format(partnerInterviewInfoDTO.getEndTime(),CoolDateUtils.DATE_FORMAT_SEC_2)); partnerInterviewInfoVO.setEndTime(DateUtil.format(partnerInterviewInfoDTO.getEndTime(),CoolDateUtils.DATE_FORMAT_SEC_2));
partnerInterviewInfoVO.setApproveTime(DateUtil.format(partnerInterviewInfoDTO.getApproveTime(),CoolDateUtils.DATE_FORMAT_SEC_2)); partnerInterviewInfoVO.setApproveTime(DateUtil.format(partnerInterviewInfoDTO.getApproveTime(),CoolDateUtils.DATE_FORMAT_SEC_2));
partnerInterviewInfoVO.setLastFollowTime(DateUtil.format(partnerInterviewInfoDTO.getLastFollowTime(),CoolDateUtils.DATE_FORMAT_SEC_2));
Integer callStatus = null;
if(partnerInterviewInfoDTO.getCallStatus()!=null){
callStatus = partnerInterviewInfoDTO.getCallStatus()==1?partnerInterviewInfoDTO.getCallStatus():0;
}
partnerInterviewInfoVO.setCallStatus(callStatus);
if (hyPartnerUserInfoDO!=null){
partnerInterviewInfoVO.setUserChannelName(channelMap.get(hyPartnerUserInfoDO.getUserChannelId()));
}
List<String> userPortrait = labelService.getUserPortraitList(userPortraitMap, partnerInterviewInfoDTO.getUserPortrait());
partnerInterviewInfoVO.setUserPortraitList(userPortrait);
return partnerInterviewInfoVO; return partnerInterviewInfoVO;
} }

View File

@@ -15,6 +15,7 @@ import com.cool.store.entity.*;
import com.cool.store.enums.*; import com.cool.store.enums.*;
import com.cool.store.exception.ApiException; import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.HyPartnerUserChannelMapper;
import com.cool.store.request.*; import com.cool.store.request.*;
import com.cool.store.service.*; import com.cool.store.service.*;
import com.cool.store.utils.CoolDateUtils; import com.cool.store.utils.CoolDateUtils;
@@ -24,6 +25,7 @@ import com.cool.store.vo.*;
import com.cool.store.vo.interview.InterviewVO; import com.cool.store.vo.interview.InterviewVO;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -77,9 +79,13 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
HyPartnerTaskInfoLogDAO hyPartnerTaskInfoLogDAO; HyPartnerTaskInfoLogDAO hyPartnerTaskInfoLogDAO;
@Resource @Resource
HyPhoneLocationService hyPhoneLocationService; HyPhoneLocationService hyPhoneLocationService;
@Resource
HyPartnerUserChannelMapper hyPartnerUserChannelMapper;
@Autowired @Autowired
private NoticeService noticeService; private NoticeService noticeService;
@Resource
LabelService labelService;
@Autowired @Autowired
private SmsService smsService; private SmsService smsService;
@@ -103,6 +109,15 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
} }
PartnerLineInfoAndBaseInfoVO partnerLineInfoAndBaseInfoVO = convertPartnerLineInfoAndBaseInfoDTOToVo(partnerLineInfoAndBaseInfoDTO); PartnerLineInfoAndBaseInfoVO partnerLineInfoAndBaseInfoVO = convertPartnerLineInfoAndBaseInfoDTOToVo(partnerLineInfoAndBaseInfoDTO);
String userPortrait = partnerLineInfoAndBaseInfoDTO.getUserPortrait();
if (StringUtils.isNotEmpty(userPortrait)){
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(Arrays.asList(userPortrait));
List<String> userPortraitList = userPortraitMap.values().stream()
.collect(Collectors.toList());
partnerLineInfoAndBaseInfoVO.setUserPortrait(userPortraitList);
}
List<String> userIds = new ArrayList<>(); List<String> userIds = new ArrayList<>();
if (StringUtils.isNotEmpty(partnerLineInfoAndBaseInfoDTO.getPassUserId())){ if (StringUtils.isNotEmpty(partnerLineInfoAndBaseInfoDTO.getPassUserId())){
userIds.add(partnerLineInfoAndBaseInfoDTO.getPassUserId()); userIds.add(partnerLineInfoAndBaseInfoDTO.getPassUserId());
@@ -186,6 +201,24 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
return Boolean.TRUE; return Boolean.TRUE;
} }
@Override
public Boolean batchTransferInvestmentManager(LoginUserInfo user, BatchTransferInvestmentManagerRequest request) throws ApiException {
if (CollectionUtils.isEmpty(request.getLineIds())||StringUtils.isEmpty(request.getUserId())){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
for (Long lineId:request.getLineIds()) {
TransferInvestmentManagerRequest transferInvestmentManagerRequest = new TransferInvestmentManagerRequest();
transferInvestmentManagerRequest.setUserId(request.getUserId());
transferInvestmentManagerRequest.setLineId(lineId);
try {
this.transferInvestmentManager(user,transferInvestmentManagerRequest);
} catch (ApiException e) {
log.info("transferInvestmentManager_success Transfer_interview_management_failed,lineId:{}",lineId);
}
}
return Boolean.TRUE;
}
@Override @Override
public Boolean allocationInvestmentManager(LoginUserInfo user, List<Long> lineIdList) { public Boolean allocationInvestmentManager(LoginUserInfo user, List<Long> lineIdList) {
if (user==null|| CollectionUtils.isEmpty(lineIdList)){ if (user==null|| CollectionUtils.isEmpty(lineIdList)){
@@ -472,6 +505,13 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
List<Long> wantShopAreaList = list.stream().map(PublicSeaLineDTO::getWantShopArea).filter(Objects::nonNull).map(Long::parseLong).distinct().collect(Collectors.toList()); List<Long> wantShopAreaList = list.stream().map(PublicSeaLineDTO::getWantShopArea).filter(Objects::nonNull).map(Long::parseLong).distinct().collect(Collectors.toList());
Map<String, String> wantShopAreaNameMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaList); Map<String, String> wantShopAreaNameMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaList);
List<Integer> userChannelIds = list.stream().filter(x -> x.getUserChannelId() != null).map(PublicSeaLineDTO::getUserChannelId).collect(Collectors.toList());
List<HyPartnerUserChannelDO> userChannelList = hyPartnerUserChannelMapper.getUserChannelByIds(userChannelIds);
Map<Long, String> channelMap = userChannelList.stream().collect(Collectors.toMap(HyPartnerUserChannelDO::getChannelId, HyPartnerUserChannelDO::getChannelName));
List<String> userPortraitList = list.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait() )).map(PublicSeaLineDTO::getUserPortrait).collect(Collectors.toList());
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
List<PublicSeaLineListVo> result = new ArrayList<>(); List<PublicSeaLineListVo> result = new ArrayList<>();
list.forEach(x->{ list.forEach(x->{
PublicSeaLineListVo publicSeaLineListVo = new PublicSeaLineListVo(); PublicSeaLineListVo publicSeaLineListVo = new PublicSeaLineListVo();
@@ -496,6 +536,9 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
String closeTime = DateUtil.format(hy.getCloseTime(), CoolDateUtils.DATE_FORMAT_SEC_2); String closeTime = DateUtil.format(hy.getCloseTime(), CoolDateUtils.DATE_FORMAT_SEC_2);
publicSeaLineListVo.setLastCloseDate(closeTime); publicSeaLineListVo.setLastCloseDate(closeTime);
publicSeaLineListVo.setLastInvestmentManager(nameMobileMap.get(hy.getInvestmentManager())); publicSeaLineListVo.setLastInvestmentManager(nameMobileMap.get(hy.getInvestmentManager()));
List<String> userPortrait = labelService.getUserPortraitList(userPortraitMap, x.getUserPortrait());
publicSeaLineListVo.setUserPortraitList(userPortrait);
publicSeaLineListVo.setUserChannelName(channelMap.get(x.getUserChannelId()));
result.add(publicSeaLineListVo); result.add(publicSeaLineListVo);
}); });
publicSeaLineList.setList(result); publicSeaLineList.setList(result);
@@ -506,8 +549,12 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
@Override @Override
public PageInfo<PrivateSeaLineListVo> privateSeaLineList(String userId, PrivateSeaLineListRequest request) { public PageInfo<PrivateSeaLineListVo> privateSeaLineList(String userId, PrivateSeaLineListRequest request,Boolean allPrivateSeaFlag) {
UserPositionAndUserScopeDTO userIdsByScope = enterpriseUserService.getUserIdsByScope(userId); //allPrivateSeaFlag 为true的时候 查询全量私海
UserPositionAndUserScopeDTO userIdsByScope = new UserPositionAndUserScopeDTO();
if (!allPrivateSeaFlag){
userIdsByScope = enterpriseUserService.getUserIdsByScope(userId);
}
String intentAreaName = getIntentAreaName(request.getIntentArea()); String intentAreaName = getIntentAreaName(request.getIntentArea());
PageHelper.startPage(request.getPageNum(),request.getPageSize()); PageHelper.startPage(request.getPageNum(),request.getPageSize());
PageInfo privateLineList = new PageInfo(hyPartnerLineInfoDAO.getPrivateSeaLineList(request.getKeyword(), request.getKeywordType(), request.getWorkflowStage(), PageInfo privateLineList = new PageInfo(hyPartnerLineInfoDAO.getPrivateSeaLineList(request.getKeyword(), request.getKeywordType(), request.getWorkflowStage(),
@@ -530,7 +577,15 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
} }
List<Long> wantShopAreaList = list.stream().filter(x->StringUtils.isNotEmpty(x.getWantShopArea())).map(PrivateSeaLineDTO::getWantShopArea).map(Long::parseLong).distinct().collect(Collectors.toList()); List<Long> wantShopAreaList = list.stream().filter(x->StringUtils.isNotEmpty(x.getWantShopArea())).map(PrivateSeaLineDTO::getWantShopArea).map(Long::parseLong).distinct().collect(Collectors.toList());
Map<String, String> wantShopAreaNameMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaList); Map<String, String> wantShopAreaNameMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaList);
List<PrivateSeaLineListVo> result = PrivateSeaLineListVo.convertList(list, devManagerMap, wantShopAreaNameMap,hyPartnerInterviewPlanDOMap);
List<Integer> userChannelIds = list.stream().filter(x -> x.getUserChannelId() != null).map(PrivateSeaLineDTO::getUserChannelId).collect(Collectors.toList());
List<HyPartnerUserChannelDO> userChannelList = hyPartnerUserChannelMapper.getUserChannelByIds(userChannelIds);
Map<Long, String> channelMap = userChannelList.stream().collect(Collectors.toMap(HyPartnerUserChannelDO::getChannelId, HyPartnerUserChannelDO::getChannelName));
List<String> userPortraitList = list.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait() )).map(PrivateSeaLineDTO::getUserPortrait).collect(Collectors.toList());
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
List<PrivateSeaLineListVo> result = PrivateSeaLineListVo.convertList(list, devManagerMap, wantShopAreaNameMap,hyPartnerInterviewPlanDOMap,channelMap,userPortraitMap);
privateLineList.setList(result); privateLineList.setList(result);
return privateLineList; return privateLineList;
} }
@@ -806,9 +861,6 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
partnerLineInfoAndBaseInfoVO.setId(partnerLineInfoAndBaseInfoDTO.getId()); partnerLineInfoAndBaseInfoVO.setId(partnerLineInfoAndBaseInfoDTO.getId());
partnerLineInfoAndBaseInfoVO.setPartnerUserId(partnerLineInfoAndBaseInfoDTO.getPartnerId()); partnerLineInfoAndBaseInfoVO.setPartnerUserId(partnerLineInfoAndBaseInfoDTO.getPartnerId());
partnerLineInfoAndBaseInfoVO.setInvestmentManager(partnerLineInfoAndBaseInfoDTO.getInvestmentManager()); partnerLineInfoAndBaseInfoVO.setInvestmentManager(partnerLineInfoAndBaseInfoDTO.getInvestmentManager());
if (StringUtils.isNotEmpty(partnerLineInfoAndBaseInfoDTO.getUserPortrait())){
partnerLineInfoAndBaseInfoVO.setUserPortrait(JSONObject.parseArray(partnerLineInfoAndBaseInfoDTO.getUserPortrait(),String.class));
}
partnerLineInfoAndBaseInfoVO.setPartnerBaseInfoId(partnerLineInfoAndBaseInfoDTO.getPartnerBaseInfoId()); partnerLineInfoAndBaseInfoVO.setPartnerBaseInfoId(partnerLineInfoAndBaseInfoDTO.getPartnerBaseInfoId());
partnerLineInfoAndBaseInfoVO.setWorkflowStage(partnerLineInfoAndBaseInfoDTO.getWorkflowStage()); partnerLineInfoAndBaseInfoVO.setWorkflowStage(partnerLineInfoAndBaseInfoDTO.getWorkflowStage());
partnerLineInfoAndBaseInfoVO.setWorkflowStatus(partnerLineInfoAndBaseInfoDTO.getWorkflowStatus()); partnerLineInfoAndBaseInfoVO.setWorkflowStatus(partnerLineInfoAndBaseInfoDTO.getWorkflowStatus());

View File

@@ -0,0 +1,36 @@
package com.cool.store.service.impl;
import com.cool.store.dto.partner.UserChannelDTO;
import com.cool.store.entity.HyPartnerUserChannelDO;
import com.cool.store.mapper.HyPartnerUserChannelMapper;
import com.cool.store.service.HyPartnerUserChannelService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2023/8/10 11:14
* @Version 1.0
*/
@Service
public class HyPartnerUserChannelServiceImpl implements HyPartnerUserChannelService {
@Resource
HyPartnerUserChannelMapper hyPartnerUserChannelMapper;
@Override
public List<UserChannelDTO> queryAllUserChannelList() {
List<HyPartnerUserChannelDO> allUserChannel = hyPartnerUserChannelMapper.getAllUserChannel();
List<UserChannelDTO> result = new ArrayList<>();
allUserChannel.forEach(x->{
UserChannelDTO userChannelDTO = new UserChannelDTO();
userChannelDTO.setUserChannelId(x.getChannelId());
userChannelDTO.setUserChannelName(x.getChannelName());
result.add(userChannelDTO);
});
return result;
}
}

View File

@@ -0,0 +1,115 @@
package com.cool.store.service.impl;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.dto.label.LabelGroupAddDTO;
import com.cool.store.dto.label.LabelGroupDeleteDTO;
import com.cool.store.dto.label.LabelGroupListDTO;
import com.cool.store.dto.label.LabelGroupUpdateDTO;
import com.cool.store.entity.HyPartnerLabelGroupDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.mapper.HyPartnerLabelGroupMapper;
import com.cool.store.mapper.HyPartnerLabelMapper;
import com.cool.store.service.LabelGroupService;
import com.cool.store.vo.LabelGroupListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* @author Fun Li 2023/8/10 13:35
* @version 1.0
*/
@Service
public class LabelGroupServiceImpl implements LabelGroupService {
@Autowired
private HyPartnerLabelGroupMapper labelGroupMapper;
@Autowired
private HyPartnerLabelMapper labelMapper;
/**
* 查询标签组信息列表
* @param dto 查询条件
*/
@Override
public List<LabelGroupListVo> getLabelGroupList(LabelGroupListDTO dto) {
HyPartnerLabelGroupDO labelGroupDO = new HyPartnerLabelGroupDO();
labelGroupDO.setLabelGroupName(dto.getLabelGroupName());
return labelGroupMapper.getLabelGroupList(labelGroupDO);
}
/**
* 添加标签组
* @param dto 新增标签组信息
*/
@Override
public void addLabelGroup(LabelGroupAddDTO dto) throws ApiException {
HyPartnerLabelGroupDO labelGroupDO = new HyPartnerLabelGroupDO();
labelGroupDO.setLabelGroupName(dto.getLabelGroupName());
List<HyPartnerLabelGroupDO> existLabelGroup = labelGroupMapper.selectSelective(labelGroupDO);
if (existLabelGroup != null && existLabelGroup.size() > 0) {
throw new ApiException(ErrorCodeEnum.LABEL_GROUP_EXIST);
}
String userId = CurrentUserHolder.getUserId();
labelGroupDO.setEditUserId(userId);
labelGroupDO.setEditDate(new Date());
labelGroupDO.setCreateUserId(userId);
labelGroupDO.setUpdateUserId(userId);
labelGroupMapper.insertSelective(labelGroupDO);
}
/**
* 修改标签组信息
* @param dto 修改内容
*/
@Override
public void updateLabelGroup(LabelGroupUpdateDTO dto) {
HyPartnerLabelGroupDO labelGroupDO = new HyPartnerLabelGroupDO();
String userId = CurrentUserHolder.getUserId();
labelGroupDO.setId(dto.getId());
labelGroupDO.setLabelGroupName(dto.getLabelGroupName());
labelGroupDO.setEditUserId(userId);
labelGroupDO.setEditDate(new Date());
labelGroupDO.setUpdateUserId(userId);
labelGroupMapper.updateByPrimaryKeySelective(labelGroupDO);
}
/**
* 删除标签组
* @param dto 待删除标签组信息
*/
@Override
public void deleteLabelGroup(LabelGroupDeleteDTO dto) throws ApiException {
if (whetherGroupInUse(dto.getId())) {
throw new ApiException(ErrorCodeEnum.LABEL_GROUP_IN_USE);
}
HyPartnerLabelGroupDO labelGroupDO = new HyPartnerLabelGroupDO();
String userId = CurrentUserHolder.getUserId();
labelGroupDO.setId(dto.getId());
labelGroupDO.setDeleted(Boolean.TRUE);
labelGroupDO.setUpdateUserId(userId);
labelGroupMapper.updateByPrimaryKeySelective(labelGroupDO);
}
/**
* 获取所有标签组
*/
@Override
public List<LabelGroupListVo> getAllLabelGroupList() {
HyPartnerLabelGroupDO labelGroupDO = new HyPartnerLabelGroupDO();
return labelGroupMapper.getLabelGroupList(labelGroupDO);
}
/**
* 某个标签组内是否有未删除的标签
* @param id 标签组 id
*/
private Boolean whetherGroupInUse(Long id) {
return labelMapper.whetherGroupInUse(id);
}
}

View File

@@ -0,0 +1,151 @@
package com.cool.store.service.impl;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.dto.label.LabelAddDTO;
import com.cool.store.dto.label.LabelDeleteDTO;
import com.cool.store.dto.label.LabelListDTO;
import com.cool.store.dto.label.LabelUpdateDTO;
import com.cool.store.entity.HyPartnerLabelDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.mapper.HyPartnerLabelMapper;
import com.cool.store.service.LabelService;
import com.cool.store.vo.LabelListVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author Fun Li 2023/8/10 14:24
* @version 1.0
*/
@Service
@Slf4j
public class LabelServiceImpl implements LabelService {
@Autowired
private HyPartnerLabelMapper labelMapper;
/**
* 获取数组列表
*
* @param dto 查询条件
*/
@Override
public List<LabelListVo> getLabelList(LabelListDTO dto) {
return labelMapper.getLabelList(dto);
}
/**
* 添加标签组
* @param dto 新增标签组信息
*/
@Override
public void addLabel(LabelAddDTO dto) throws ApiException {
HyPartnerLabelDO labelDO = new HyPartnerLabelDO();
labelDO.setLabelName(dto.getLabelName());
if (whetherLabelRepeat(labelDO)) {
throw new ApiException(ErrorCodeEnum.LABEL_EXIST);
}
String userId = CurrentUserHolder.getUserId();
labelDO.setLabelGroupId(dto.getLabelGroupId());
labelDO.setEditUserId(userId);
labelDO.setEditDate(new Date());
labelDO.setCreateUserId(userId);
labelDO.setUpdateUserId(userId);
labelMapper.insertSelective(labelDO);
}
/**
* 修改标签信息
* @param dto 新标签信息
*/
@Override
public void updateLabel(LabelUpdateDTO dto) throws ApiException {
HyPartnerLabelDO labelDO = new HyPartnerLabelDO();
labelDO.setLabelName(dto.getLabelName());
if (whetherLabelRepeat(labelDO)) {
throw new ApiException(ErrorCodeEnum.LABEL_EXIST);
}
String userId = CurrentUserHolder.getUserId();
labelDO.setId(dto.getId());
labelDO.setLabelGroupId(dto.getLabelGroupId());
labelDO.setEditUserId(userId);
labelDO.setEditDate(new Date());
labelDO.setUpdateUserId(userId);
labelMapper.updateByPrimaryKeySelective(labelDO);
}
/**
* 删除标签
* @param dto
*/
@Override
public void deleteLabel(LabelDeleteDTO dto) {
HyPartnerLabelDO labelDO = new HyPartnerLabelDO();
String userId = CurrentUserHolder.getUserId();
labelDO.setId(dto.getId());
labelDO.setEditUserId(userId);
labelDO.setEditDate(new Date());
labelDO.setUpdateUserId(userId);
labelDO.setDeleted(Boolean.TRUE);
labelMapper.updateByPrimaryKeySelective(labelDO);
}
private Boolean whetherLabelRepeat(HyPartnerLabelDO label) throws ApiException {
List<HyPartnerLabelDO> hyPartnerLabelDOS = labelMapper.selectSelective(label);
if (hyPartnerLabelDOS != null && hyPartnerLabelDOS.size() > 0) {
return Boolean.TRUE;
}
return Boolean.FALSE;
}
@Override
public Map<Long,String> getUserPortraitMap(List<String> userPortraitStrList){
Set<Long> userPortraitIdList = new HashSet<>();
for (String userPortrait:userPortraitStrList) {
String[] parts = userPortrait.split(",");
for (String part : parts) {
String trimmedPart = part.trim();
if (!trimmedPart.isEmpty()) {
try {
Long value = Long.parseLong(trimmedPart);
userPortraitIdList.add(value);
} catch (NumberFormatException e) {
log.info("Invalid format: {}" , trimmedPart);
}
}
}
}
List<HyPartnerLabelDO> labelListByIds = new ArrayList<>();
if (CollectionUtils.isNotEmpty(userPortraitIdList)){
labelListByIds = labelMapper.getLabelListByIds(new ArrayList<>(userPortraitIdList));
}
return labelListByIds.stream().collect(Collectors.toMap(HyPartnerLabelDO::getId,HyPartnerLabelDO::getLabelName));
}
@Override
public List<String> getUserPortraitList(Map<Long, String> userPortraitMap, String userPortraitStr) {
List<String> userPortraitList= new ArrayList<>();
if(StringUtils.isNotEmpty(userPortraitStr)){
String[] parts = userPortraitStr.split(",");
for (String part : parts) {
String trimmedPart = part.trim();
if (!trimmedPart.isEmpty()) {
try {
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
} catch (NumberFormatException e) {
log.info("Invalid format: {}" , trimmedPart);
}
}
}
}
return userPortraitList;
}
}

View File

@@ -1,7 +1,6 @@
package com.cool.store; package com.cool.store;
import com.zaxxer.hikari.HikariDataSource; import com.zaxxer.hikari.HikariDataSource;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
@@ -10,6 +9,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import tk.mybatis.spring.annotation.MapperScan;
import javax.sql.DataSource; import javax.sql.DataSource;

View File

@@ -49,7 +49,10 @@ public class TokenValidateFilter implements Filter {
//腾讯音视频回调,单独做验签 //腾讯音视频回调,单独做验签
"/partner/pc/video/**", "/partner/pc/video/**",
//TODO 800回调地址暂时不做验证 //TODO 800回调地址暂时不做验证
"/partner/pc/flow/qualificationReview/callback","/**/ecSync/ecToApplet/**"); "/partner/pc/flow/qualificationReview/callback",
"/**/ecSync/ecToApplet/**",
"/partner/pc/websocket/**",
"/partner/pc/call/**");
/** /**

Some files were not shown because too many files have changed in this diff Show More