Merge branch 'master' into dev/feat/partner1.3_20230904
# Conflicts: # coolstore-partner-service/src/main/java/com/cool/store/service/impl/HyPartnerLineInfoServiceImpl.java
This commit is contained in:
@@ -7,6 +7,8 @@ public class ExcelErrorConstants {
|
||||
|
||||
public static final String NAME_LOSE = "姓名缺失";
|
||||
|
||||
public static final String NAME_OVER_LENGTH = "姓名过长";
|
||||
|
||||
public static final String MOBILE_LOSE= "手机号缺失";
|
||||
|
||||
public static final String MOBILE_ERROR= "手机号有误";
|
||||
@@ -25,4 +27,6 @@ public class ExcelErrorConstants {
|
||||
|
||||
public static final String INVESTMENT_MANAGER_LOSE = "未找到此招商经理,请核实";
|
||||
|
||||
public static final String COUNT_MORE = "每次数据最多导入500条,请分批上传";
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ public enum AcceptAdjustTypeEnum {
|
||||
NOT_ACCEPT(0,"不接受调剂"),
|
||||
NATIONAL_ADJUSTMENT(1,"全国调剂"),
|
||||
PROVINCIAL_ADJUSTMENT(2,"省内调剂"),
|
||||
LOCAL_ADJUSTMENT(3,"市区开放"),
|
||||
LOCAL_ADJUSTMENT(3,"市内调剂"),
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -84,11 +84,10 @@ public enum ErrorCodeEnum {
|
||||
INTERVIEW_INTERVIEW_TIME_IS_UNUSABLE(1021114, "当前预约时间不可用,请和线索用户协商其他时间后确定预约时间\n面试人:{0} 手机号:{1}", null),
|
||||
INTERVIEW_PARTNER_NOT_EXIST(1021115, "线索下的加盟商不存在!", null),
|
||||
ROOM_STATUS_ERROR(10211156, "当前面试房间状态不允许进行该操作!", null),
|
||||
MOBILE_APP_NOT_ONLINE_ERROR(10211157, "拨出手机APP不在线!", null),
|
||||
MOBILE_APP_NOT_ONLINE_ERROR(10211157, "呼叫失败,请确认呼出号码正确并检查是否安装并打开呼叫插件", null),
|
||||
CALL_RECORD_NOT_EXIST_ERROR(10211158, "通话记录不存在!", null),
|
||||
|
||||
CREATE_CALL_REQUEST_ERROR(10211158, "创建电话请求失败!", null),
|
||||
CALL_UP_ERROR(10211159, "拨出电话异常!", null),
|
||||
CREATE_CALL_REQUEST_ERROR(10211160, "创建电话请求失败!", null),
|
||||
CONTENT_DUPLICATED(10211200, "动态标题重复!", null),
|
||||
SIGN_FAIL(600000, "验签失败", null),
|
||||
GET_ACCESSTOKEN_ERROR(600001, "获取小程序TOKEN错误!", null),
|
||||
|
||||
@@ -10,9 +10,10 @@ import com.alibaba.fastjson.JSONObject;
|
||||
public enum FeiShuNoticeMsgEnum {
|
||||
|
||||
common_notice("工作台通知", "{0}", "img_v2_45d7a901-1eab-498b-a760-b38d287f0c1g"),
|
||||
ALLOCATION_INVESTMENT_MANAGER("分配招商经理", "有新的线索 于 {0} 分配给您,线索信息{1}手机号{2},请及时跟进", "img_v2_33296002-829e-490e-bd11-0d9ae763a67g"),
|
||||
TRANS_INVESTMENT_MANAGER("转让招商经理", "有新的线索 于 {0} 转让给您,线索信息{1}手机号{2},请及时跟进", "img_v2_33296002-829e-490e-bd11-0d9ae763a67g"),
|
||||
INTENTION_APPLY("加盟意向申请", "您有一个【加盟意向申请】待审核,申请人{0}手机号{1}于 {2} 提交加盟意向申请,请及时处理", "img_v2_69eb6e5f-bf12-4a02-a47f-b17ce24fcfeg"),
|
||||
ALLOCATION_INVESTMENT_MANAGER("分配招商经理", "有新的线索于 {0} 分配给您,线索信息 {1} 手机号 {2},请及时跟进", "img_v2_33296002-829e-490e-bd11-0d9ae763a67g"),
|
||||
TRANS_INVESTMENT_MANAGER("转让招商经理", "有新的线索于 {0} 转让给您,线索信息 {1} 手机号 {2},请及时跟进", "img_v2_33296002-829e-490e-bd11-0d9ae763a67g"),
|
||||
BATCH_TRANS_INVESTMENT_MANAGER("收到新线索", "有{0}条新线索于 {1} 转让给您,请及时跟进", "img_v2_33296002-829e-490e-bd11-0d9ae763a67g"),
|
||||
INTENTION_APPLY("加盟意向申请", "您有一个【加盟意向申请】待审核,申请人 {0} 手机号 {1} 于 {2} 提交加盟意向申请,请及时处理", "img_v2_c909097d-67d1-4c11-a911-a2584b67ca6g"),
|
||||
FOLLOW_TASK("线索跟进任务", "{0}", "img_v2_1960b7ef-8c4e-4c3d-8b67-3d918a85578g"),
|
||||
INTERVIEW_APPOINTMENT("面试预约申请", "{0}","img_v2_107bb06b-2a7a-43e1-a6ae-e5d2f2dae17g"),
|
||||
;
|
||||
|
||||
@@ -12,6 +12,8 @@ public enum FollowTaskStatusEnum {
|
||||
FINISHED(1, "已完成"),
|
||||
OVERDUE(2, "已逾期"),
|
||||
CANCELLED(3, "作废"),
|
||||
OVERDUE_FINISH(4, "逾期完成"),
|
||||
OVERDUE_CANCELLED(5, "逾期作废"),
|
||||
;
|
||||
//任务状态:0:待完成、1:已完成、2:已逾期、3:作废
|
||||
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.cool.store.utils;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
|
||||
**/
|
||||
@Repository
|
||||
public class SpringUtils implements BeanFactoryPostProcessor {
|
||||
|
||||
//Spring应用上下文环境
|
||||
private static ConfigurableListableBeanFactory beanFactory;
|
||||
|
||||
@Override
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
|
||||
SpringUtils.beanFactory = beanFactory;
|
||||
}
|
||||
|
||||
public static ConfigurableListableBeanFactory getBeanFactory() {
|
||||
return beanFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对象
|
||||
*
|
||||
* @param name
|
||||
* @return Object 一个以所给名字注册的bean的实例
|
||||
* @throws org.springframework.beans.BeansException
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T getBean(String name) throws BeansException {
|
||||
return (T) getBeanFactory().getBean(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型为requiredType的对象
|
||||
*
|
||||
* @param clz
|
||||
* @return
|
||||
* @throws org.springframework.beans.BeansException
|
||||
*
|
||||
*/
|
||||
public static <T> T getBean(Class<T> clz) throws BeansException {
|
||||
T result = (T) getBeanFactory().getBean(clz);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true
|
||||
*
|
||||
* @param name
|
||||
* @return boolean
|
||||
*/
|
||||
public static boolean containsBean(String name) {
|
||||
return getBeanFactory().containsBean(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException)
|
||||
*
|
||||
* @param name
|
||||
* @return boolean
|
||||
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
|
||||
*
|
||||
*/
|
||||
public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
|
||||
return getBeanFactory().isSingleton(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name
|
||||
* @return Class 注册对象的类型
|
||||
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
|
||||
*
|
||||
*/
|
||||
public static Class<?> getType(String name) throws NoSuchBeanDefinitionException {
|
||||
return getBeanFactory().getType(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果给定的bean名字在bean定义中有别名,则返回这些别名
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
|
||||
*
|
||||
*/
|
||||
public static String[] getAliases(String name) throws NoSuchBeanDefinitionException {
|
||||
return getBeanFactory().getAliases(name);
|
||||
}
|
||||
}
|
||||
@@ -86,10 +86,10 @@ public class HyFollowTaskDAO {
|
||||
* @param followTaskId
|
||||
* @return
|
||||
*/
|
||||
public Integer finishFollowTask(Long followTaskId){
|
||||
public Integer finishFollowTask(Long followTaskId, FollowTaskStatusEnum followTaskStatus){
|
||||
HyFollowTaskDO update = new HyFollowTaskDO();
|
||||
update.setId(followTaskId);
|
||||
update.setTaskStatus(FollowTaskStatusEnum.FINISHED.getCode());
|
||||
update.setTaskStatus(followTaskStatus.getCode());
|
||||
update.setFinishTime(new Date());
|
||||
return updateFollowTask(update);
|
||||
}
|
||||
@@ -99,10 +99,10 @@ public class HyFollowTaskDAO {
|
||||
* @param followTaskId
|
||||
* @return
|
||||
*/
|
||||
public Integer cancelFollowTask(Long followTaskId){
|
||||
public Integer cancelFollowTask(Long followTaskId, FollowTaskStatusEnum followTaskStatus){
|
||||
HyFollowTaskDO update = new HyFollowTaskDO();
|
||||
update.setId(followTaskId);
|
||||
update.setTaskStatus(FollowTaskStatusEnum.CANCELLED.getCode());
|
||||
update.setTaskStatus(followTaskStatus.getCode());
|
||||
return updateFollowTask(update);
|
||||
}
|
||||
|
||||
@@ -178,11 +178,12 @@ public class HyFollowTaskDAO {
|
||||
* @param followUserIds
|
||||
* @return
|
||||
*/
|
||||
public List<FollowTaskNumDTO> getUserTaskNum(List<String> followUserIds){
|
||||
if(CollectionUtils.isEmpty(followUserIds)){
|
||||
public List<FollowTaskNumDTO> getUserTaskNum(List<String> followUserIds, Date date){
|
||||
if(CollectionUtils.isEmpty(followUserIds) || Objects.isNull(date)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return hyFollowTaskMapper.getUserTaskNum(followUserIds);
|
||||
String endTime = DateUtil.format(date, CoolDateUtils.DATE_FORMAT_DAY) + CommonConstants.DAY_END_TIME_SUFFIX;
|
||||
return hyFollowTaskMapper.getUserTaskNum(followUserIds, endTime);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -206,6 +207,18 @@ public class HyFollowTaskDAO {
|
||||
return hyFollowTaskMapper.updateUndoTaskStatusToOverdue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改线索id
|
||||
* @param oldLineId
|
||||
* @param newLineId
|
||||
*/
|
||||
public Integer changeLineId(Long oldLineId, Long newLineId){
|
||||
if(Objects.isNull(oldLineId) || Objects.isNull(newLineId)){
|
||||
return CommonConstants.ZERO;
|
||||
}
|
||||
return hyFollowTaskMapper.changeLineId(oldLineId, newLineId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.log.LineLogInfo;
|
||||
import com.cool.store.entity.HyPartnerTaskInfoLogDO;
|
||||
import com.cool.store.enums.OperateTypeEnum;
|
||||
@@ -50,6 +51,19 @@ public class HyPartnerTaskInfoLogDAO {
|
||||
insertSelective(logInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除日志
|
||||
* @param lineId
|
||||
* @param message
|
||||
* @return
|
||||
*/
|
||||
public int deleteByLineId(Long lineId, String message){
|
||||
if(Objects.isNull(lineId)){
|
||||
return CommonConstants.ZERO;
|
||||
}
|
||||
return hyPartnerTaskInfoLogMapper.deleteByLineId(lineId, message);
|
||||
}
|
||||
|
||||
public int updateLineId(String newPartnerId,Long newLineId,Long oldLineId){
|
||||
if (newLineId==null || Objects.isNull(oldLineId)){
|
||||
return 0;
|
||||
|
||||
@@ -78,7 +78,7 @@ public interface HyFollowTaskMapper {
|
||||
* @param followUserIds
|
||||
* @return
|
||||
*/
|
||||
List<FollowTaskNumDTO> getUserTaskNum(@Param("followUserIds") List<String> followUserIds);
|
||||
List<FollowTaskNumDTO> getUserTaskNum(@Param("followUserIds") List<String> followUserIds, @Param("endTime")String endTime);
|
||||
|
||||
/**
|
||||
* 获取待完成任务
|
||||
@@ -100,4 +100,12 @@ public interface HyFollowTaskMapper {
|
||||
* @return
|
||||
*/
|
||||
List<HyFollowTaskDO> getFollowTaskList(@Param("followTaskIds") List<Long> followTaskIds);
|
||||
|
||||
/**
|
||||
* 更改线索id
|
||||
* @param oldLineId
|
||||
* @param newLineId
|
||||
* @return
|
||||
*/
|
||||
Integer changeLineId(@Param("oldLineId") Long oldLineId, @Param("newLineId") Long newLineId);
|
||||
}
|
||||
@@ -39,4 +39,12 @@ public interface HyPartnerTaskInfoLogMapper {
|
||||
* @return
|
||||
*/
|
||||
Page<HyPartnerTaskInfoLogDO> getLogPageByLineId(@Param("partnerLineId")Long partnerLineId, @Param("operateTypes")List<String> operateTypes);
|
||||
|
||||
/**
|
||||
* 删除线索
|
||||
* @param partnerLineId
|
||||
* @param message
|
||||
* @return
|
||||
*/
|
||||
int deleteByLineId(@Param("partnerLineId") Long partnerLineId, @Param("message") String message);
|
||||
}
|
||||
@@ -143,20 +143,39 @@
|
||||
|
||||
<select id="getTaskPage" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
a.id,
|
||||
a.partner_line_id,
|
||||
a.follow_user_id,
|
||||
a.task_title,
|
||||
a.communication_type,
|
||||
a.deadline,
|
||||
a.communication_content,
|
||||
a.task_status,
|
||||
a.finish_time,
|
||||
a.deleted,
|
||||
a.create_time,
|
||||
a.update_time
|
||||
from
|
||||
hy_follow_task
|
||||
hy_follow_task a
|
||||
inner join hy_partner_line_info b on a.partner_line_id = b.id and b.deleted = '0' and b.line_status in ('1', '2')
|
||||
where
|
||||
deleted = '0' and follow_user_id = #{followUserId}
|
||||
a.deleted = '0' and a.follow_user_id = #{followUserId}
|
||||
<if test="taskStatus != null">
|
||||
and task_status = #{taskStatus}
|
||||
and a.task_status = #{taskStatus}
|
||||
</if>
|
||||
<if test="deadlineStartTime != null">
|
||||
and deadline >= #{deadlineStartTime}
|
||||
and a.deadline >= #{deadlineStartTime}
|
||||
</if>
|
||||
<if test="deadlineEndTime != null">
|
||||
<![CDATA[ and deadline <= #{deadlineEndTime}]]>
|
||||
<![CDATA[ and a.deadline <= #{deadlineEndTime}]]>
|
||||
</if>
|
||||
<if test="taskStatus == 0">
|
||||
order by a.deadline asc, a.id desc
|
||||
</if>
|
||||
<if test="taskStatus == 2">
|
||||
order by a.deadline desc, a.id desc
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getFollowTask" resultMap="BaseResultMap">
|
||||
@@ -173,37 +192,56 @@
|
||||
</update>
|
||||
|
||||
<update id="cancelUndoFollowTask">
|
||||
update hy_follow_task set task_status = '3' where partner_line_id = #{partnerLineId} and task_status in ('0', '2')
|
||||
update
|
||||
hy_follow_task
|
||||
set
|
||||
task_status = if(deadline >= now(), 3, 5)
|
||||
where
|
||||
partner_line_id = #{partnerLineId} and task_status in ('0', '2')
|
||||
</update>
|
||||
|
||||
<select id="getRemindFollowUserIds" resultType="string">
|
||||
select
|
||||
follow_user_id
|
||||
a.follow_user_id
|
||||
from
|
||||
hy_follow_task
|
||||
hy_follow_task a
|
||||
inner join hy_partner_line_info b on a.partner_line_id = b.id and b.deleted = '0' and b.line_status in ('1', '2')
|
||||
where
|
||||
deleted = '0' and (task_status in ('2') or (task_status in ('0') and deadline >= #{startTime} and #{endTime} >= deadline))
|
||||
a.deleted = '0' and (a.task_status in ('2') or (a.task_status in ('0') and a.deadline >= #{startTime} and #{endTime} >= a.deadline))
|
||||
</select>
|
||||
|
||||
<select id="getUserTaskNum" resultType="com.cool.store.dto.follow.FollowTaskNumDTO">
|
||||
select
|
||||
follow_user_id,
|
||||
sum(if(task_status=2 or (task_status in ('0') and now() >= deadline), 1,0)) as overdueNum,
|
||||
sum(if(task_status=0, 1, 0)) as todoNum
|
||||
a.follow_user_id,
|
||||
sum(if(a.task_status=2 or (a.task_status in ('0') and now() >= a.deadline), 1,0)) as overdueNum,
|
||||
sum(if(a.task_status=0 and #{endTime} > a.deadline, 1, 0)) as todoNum
|
||||
from
|
||||
hy_follow_task
|
||||
hy_follow_task a
|
||||
inner join hy_partner_line_info b on a.partner_line_id = b.id and b.deleted = '0' and b.line_status in ('1', '2')
|
||||
where
|
||||
follow_user_id in <foreach collection="followUserIds" item="followUserId" separator="," open="(" close=")">#{followUserId}</foreach>
|
||||
group by follow_user_id
|
||||
a.follow_user_id in <foreach collection="followUserIds" item="followUserId" separator="," open="(" close=")">#{followUserId}</foreach>
|
||||
group by a.follow_user_id
|
||||
</select>
|
||||
|
||||
<select id="getUndoTaskPage" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
a.id,
|
||||
a.partner_line_id,
|
||||
a.follow_user_id,
|
||||
a.task_title,
|
||||
a.communication_type,
|
||||
a.deadline,
|
||||
a.communication_content,
|
||||
a.task_status,
|
||||
a.finish_time,
|
||||
a.deleted,
|
||||
a.create_time,
|
||||
a.update_time
|
||||
from
|
||||
hy_follow_task
|
||||
hy_follow_task a
|
||||
inner join hy_partner_line_info b on a.partner_line_id = b.id and b.deleted = '0' and b.line_status in ('1', '2')
|
||||
where
|
||||
deleted = '0' and task_status in ('0') and deadline > #{startTime} and #{endTime} > deadline
|
||||
a.deleted = '0' and a.task_status in ('0') and a.deadline > #{startTime} and #{endTime} > a.deadline
|
||||
</select>
|
||||
|
||||
<update id="updateUndoTaskStatusToOverdue">
|
||||
@@ -218,5 +256,9 @@
|
||||
where
|
||||
deleted = '0' and id in <foreach collection="followTaskIds" item="followTaskId" separator="," open="(" close=")">#{followTaskId}</foreach>
|
||||
</select>
|
||||
|
||||
<update id="changeLineId">
|
||||
update hy_follow_task set partner_line_id = #{newLineId} where partner_line_id = #{oldLineId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -127,6 +127,7 @@
|
||||
from hy_intend_dev_zone_info
|
||||
where type = #{type}
|
||||
and deleted = 0
|
||||
order by create_time desc , id desc
|
||||
</select>
|
||||
|
||||
<select id="getZoneInfoByRegionIds" resultMap="BaseResultMap">
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
from hy_outbound_mobile
|
||||
where deleted = 0
|
||||
<if test="id != null">
|
||||
id = #{id}
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="mobile != null and mobile != ''">
|
||||
and mobile = #{mobile}
|
||||
|
||||
@@ -240,6 +240,7 @@
|
||||
nation = #{record.nation},
|
||||
birthdate = #{record.birthdate},
|
||||
id_card = #{record.idCard},
|
||||
user_portrait = #{record.userPortrait},
|
||||
id_card_photo_front = #{record.idCardPhotoFront},
|
||||
id_card_photo_black = #{record.idCardPhotoBlack},
|
||||
live_address = #{record.liveAddress},
|
||||
|
||||
@@ -317,18 +317,15 @@
|
||||
b.id as id,
|
||||
hpci.intention_contract_no as intentionContractNo
|
||||
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 and a.deleted = 0
|
||||
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 and b.deleted = 0
|
||||
left join hy_partner_certification_info hpci on hpci.partner_interview_id = a.id
|
||||
LEFT join call_record cr on hpli.id = cr.partner_line_id
|
||||
where hpli.deleted = 0 and hpli.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="filter">
|
||||
and b.deleted = 0
|
||||
</if>
|
||||
<if test="workflowStage!=null and workflowStage!=''">
|
||||
and hpli.workflow_stage = #{workflowStage}
|
||||
</if>
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
update_user_id = #{updateUserId},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark},
|
||||
remark = #{remark}
|
||||
</if>
|
||||
</set>
|
||||
where deleted = 0
|
||||
|
||||
@@ -20,12 +20,16 @@
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="close_time" jdbcType="TIMESTAMP" property="closeTime" />
|
||||
<result column="close_user_id" jdbcType="VARCHAR" property="closeUserId" />
|
||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||
<result column="create_user_mobile" jdbcType="VARCHAR" property="createUserMobile" />
|
||||
<result column="operator_type" jdbcType="VARCHAR" property="operatorType" />
|
||||
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, partner_id, workflow_stage, workflow_status, line_status, investment_manager,
|
||||
development_director, development_manager, deadline, pass_reason, reject_public_reason,
|
||||
reject_real_reason, certify_file, deleted, create_time, update_time, close_time,
|
||||
close_user_id
|
||||
close_user_id,create_user_id,create_user_mobile,operator_type,update_user_id
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKeySelective" resultMap="BaseResultMap">
|
||||
@@ -124,6 +128,18 @@
|
||||
<if test="record.closeUserId != null">
|
||||
close_user_id,
|
||||
</if>
|
||||
<if test="record.createUserId != null">
|
||||
create_user_id,
|
||||
</if>
|
||||
<if test="record.createUserMobile != null">
|
||||
create_user_mobile,
|
||||
</if>
|
||||
<if test="record.operatorType != null">
|
||||
operator_type,
|
||||
</if>
|
||||
<if test="record.updateUserId != null">
|
||||
update_user_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="record.partnerId != null">
|
||||
@@ -177,6 +193,18 @@
|
||||
<if test="record.closeUserId != null">
|
||||
#{record.closeUserId},
|
||||
</if>
|
||||
<if test="record.createUserId != null">
|
||||
#{record.createUserId},
|
||||
</if>
|
||||
<if test="record.createUserMobile != null">
|
||||
#{record.createUserMobile},
|
||||
</if>
|
||||
<if test="record.operatorType != null">
|
||||
#{record.operatorType},
|
||||
</if>
|
||||
<if test="record.updateUserId != null">
|
||||
#{record.updateUserId},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective">
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
<include refid="Blob_Column_List"/>
|
||||
from hy_partner_task_info_log
|
||||
where partner_line_id = #{partnerLineId}
|
||||
and operate_type = #{operateType}
|
||||
and operate_type = #{operateType} and deleted = '0'
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
@@ -156,8 +156,12 @@
|
||||
from
|
||||
hy_partner_task_info_log
|
||||
where
|
||||
partner_line_id= #{partnerLineId} and operate_type in <foreach collection="operateTypes" open="(" close=")" separator="," item="operateType">#{operateType}</foreach>
|
||||
deleted = '0' and partner_line_id= #{partnerLineId} and operate_type in <foreach collection="operateTypes" open="(" close=")" separator="," item="operateType">#{operateType}</foreach>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<update id="deleteByLineId">
|
||||
update hy_partner_task_info_log set deleted = '1', message = #{message} where partner_line_id= #{partnerLineId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -77,7 +77,7 @@
|
||||
AND investment_manager IS NOT NULL
|
||||
GROUP BY
|
||||
partner_id ) tl_l on b.partner_id=tl_l.partner_id
|
||||
WHERE ( a.create_time BETWEEN #{selectTime} and #{now} or
|
||||
WHERE ( b.update_time BETWEEN #{selectTime} and #{now} or
|
||||
a.update_time BETWEEN #{selectTime} and #{now} ) and a.username is not null order by a.id Limit #{limit1},#{limit2}
|
||||
</select>
|
||||
<select id="selectByHourDateCount" resultType="java.lang.Integer">
|
||||
@@ -99,7 +99,7 @@
|
||||
AND investment_manager IS NOT NULL
|
||||
GROUP BY
|
||||
partner_id ) tl_l on b.partner_id=tl_l.partner_id
|
||||
WHERE (a.create_time BETWEEN #{selectTime} and #{now} or
|
||||
WHERE (b.update_time BETWEEN #{selectTime} and #{now} or
|
||||
a.update_time BETWEEN #{selectTime} and #{now} ) and a.username is not null
|
||||
</select>
|
||||
|
||||
|
||||
@@ -40,10 +40,10 @@ public class HyFollowTaskDO implements Serializable {
|
||||
@ApiModelProperty("计划沟通内容")
|
||||
private String communicationContent;
|
||||
|
||||
@ApiModelProperty("任务状态:0:待完成、1:已完成、2:已逾期、3:作废")
|
||||
@ApiModelProperty("任务状态:0:待完成、1:已完成、2:已逾期、3:作废、4逾期完成、5逾期作废")
|
||||
private Integer taskStatus;
|
||||
|
||||
@ApiModelProperty("任务截止时间")
|
||||
@ApiModelProperty("完成时间")
|
||||
private Date finishTime;
|
||||
|
||||
@ApiModelProperty("删除标识")
|
||||
|
||||
@@ -6,9 +6,7 @@ import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Fun Li
|
||||
@@ -41,8 +39,8 @@ public class HyOutboundMobileDO {
|
||||
private Boolean deleted;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -82,4 +82,16 @@ public class HyPartnerLineInfoDO implements Serializable {
|
||||
|
||||
@ApiModelProperty("hy_partner_user_channel.channel_id")
|
||||
private Integer userChannelId;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private String createUserId;
|
||||
|
||||
@ApiModelProperty("创建人手机号")
|
||||
private String createUserMobile;
|
||||
|
||||
@ApiModelProperty("操作类型")
|
||||
private String operatorType;
|
||||
|
||||
@ApiModelProperty("更新人")
|
||||
private String updateUserId;
|
||||
}
|
||||
@@ -6,10 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -25,6 +22,7 @@ public class AddLineRequest {
|
||||
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
@ApiModelProperty("姓名")
|
||||
@Size(max = 10,message = "姓名过长")
|
||||
private String partnerName;
|
||||
|
||||
@Pattern(regexp = "(?:0|86|\\+86)?1[3-9]\\d{9}",message = "手机号码不正确,请检查后重试")
|
||||
|
||||
@@ -45,14 +45,20 @@ public class UpdateFollowTaskRequest {
|
||||
@ApiModelProperty("任务截止时间")
|
||||
private Date deadline;
|
||||
|
||||
public static HyFollowTaskDO convertDO(Long partnerLineId, UpdateFollowTaskRequest request){
|
||||
public static HyFollowTaskDO convertDO(Long partnerLineId, String followUserId, UpdateFollowTaskRequest request){
|
||||
HyFollowTaskDO result = new HyFollowTaskDO();
|
||||
result.setId(request.getFollowTaskId());
|
||||
result.setPartnerLineId(partnerLineId);
|
||||
result.setFollowUserId(followUserId);
|
||||
result.setTaskTitle(request.getTaskTitle());
|
||||
result.setCommunicationType(request.getCommunicationType());
|
||||
result.setDeadline(request.getDeadline());
|
||||
result.setCommunicationContent(request.getCommunicationContent());
|
||||
if(request.getDeadline().getTime() > System.currentTimeMillis()){
|
||||
result.setTaskStatus(FollowTaskStatusEnum.TODO.getCode());
|
||||
}else{
|
||||
result.setTaskStatus(FollowTaskStatusEnum.OVERDUE.getCode());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,9 @@ public class PartnerIntentApplyInfoVO {
|
||||
String trimmedPart = part.trim();
|
||||
if (!trimmedPart.isEmpty()) {
|
||||
try {
|
||||
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
|
||||
if (userPortraitMap.get(Long.valueOf(part)) != null){
|
||||
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
log.info("Invalid format: {}" , trimmedPart);
|
||||
}
|
||||
|
||||
@@ -145,7 +145,9 @@ public class PrivateSeaLineListVo {
|
||||
String trimmedPart = part.trim();
|
||||
if (!trimmedPart.isEmpty()) {
|
||||
try {
|
||||
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
|
||||
if (userPortraitMap.get(Long.valueOf(part)) != null){
|
||||
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
log.info("Invalid format: {}" , trimmedPart);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.cool.store.vo.follow;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dto.log.LogFieldDTO;
|
||||
import com.cool.store.entity.CallRecordDO;
|
||||
import com.cool.store.entity.HyFollowTaskDO;
|
||||
import com.cool.store.entity.HyPartnerTaskInfoLogDO;
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.cool.store.config.websocket;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||
|
||||
import javax.websocket.HandshakeResponse;
|
||||
import javax.websocket.server.HandshakeRequest;
|
||||
import javax.websocket.server.ServerEndpointConfig;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Configuration
|
||||
public class WebSocketConfig extends ServerEndpointConfig.Configurator {
|
||||
|
||||
@Bean
|
||||
public ServerEndpointExporter serverEndpointExporter() {
|
||||
return new ServerEndpointExporter();
|
||||
}
|
||||
|
||||
/**
|
||||
* 建立握手时,连接前的操作
|
||||
*/
|
||||
@Override
|
||||
public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
|
||||
// 这个userProperties 可以通过 session.getUserProperties()获取
|
||||
final Map<String, Object> userProperties = sec.getUserProperties();
|
||||
Map<String, List<String>> headers = request.getHeaders();
|
||||
List<String> mobiles = headers.get("mobiles");
|
||||
userProperties.put("mobiles", mobiles.get(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化端点对象,也就是被@ServerEndpoint所标注的对象
|
||||
*/
|
||||
@Override
|
||||
public <T> T getEndpointInstance(Class<T> clazz) throws InstantiationException {
|
||||
return super.getEndpointInstance(clazz);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,30 @@
|
||||
package com.cool.store.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.config.websocket.WebSocketConfig;
|
||||
import com.cool.store.utils.RedisUtil;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.SpringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.websocket.*;
|
||||
import javax.websocket.server.PathParam;
|
||||
import javax.websocket.server.ServerEndpoint;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@ServerEndpoint("/websocket/{tenantId}")
|
||||
@ServerEndpoint(value="/websocket/{tenantId}",configurator = WebSocketConfig.class)
|
||||
public class WebSocketServer {
|
||||
|
||||
/**
|
||||
@@ -34,12 +44,24 @@ public class WebSocketServer {
|
||||
*/
|
||||
private String tenantId = "";
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private List<String> mobiles;
|
||||
|
||||
private static RedisUtilPool redisUtilPool = SpringUtils.getBean(RedisUtilPool.class);
|
||||
/**
|
||||
* 连接建立成
|
||||
* 功调用的方法
|
||||
*/
|
||||
@OnOpen
|
||||
public void onOpen(Session session, @PathParam("tenantId") String tenantId) {
|
||||
String mobiles = getHeader(session, "mobiles");
|
||||
if(StringUtils.isEmpty(mobiles)){
|
||||
return;
|
||||
}
|
||||
|
||||
this.mobiles = Arrays.asList(mobiles.split(","));
|
||||
this.session = session;
|
||||
this.tenantId = tenantId;
|
||||
if (webSocketMap.containsKey(tenantId)) {
|
||||
@@ -52,6 +74,9 @@ public class WebSocketServer {
|
||||
//在线数加1
|
||||
addOnlineCount();
|
||||
}
|
||||
for (String mobile : this.mobiles) {
|
||||
redisUtilPool.setString(mobile, tenantId, 3600);
|
||||
}
|
||||
log.info("用户连接:" + tenantId + ",当前在线人数为:" + getOnlineCount());
|
||||
sendMessage("连接成功");
|
||||
}
|
||||
@@ -63,6 +88,7 @@ public class WebSocketServer {
|
||||
@OnClose
|
||||
public void onClose() {
|
||||
if (webSocketMap.containsKey(tenantId)) {
|
||||
webSocketMap.get(tenantId).mobiles.forEach(mobile -> redisUtilPool.delKey(mobile));
|
||||
webSocketMap.remove(tenantId);
|
||||
//从set中删除
|
||||
subOnlineCount();
|
||||
@@ -177,6 +203,39 @@ public class WebSocketServer {
|
||||
* @return
|
||||
*/
|
||||
public static boolean isOnline(String tenantId) {
|
||||
if(StringUtils.isEmpty(tenantId)) {
|
||||
return false;
|
||||
}
|
||||
return webSocketMap.containsKey(tenantId);
|
||||
}
|
||||
|
||||
public static String getHeader(Session session, String headerName) {
|
||||
final String header = (String) session.getUserProperties().get(headerName);
|
||||
if (StrUtil.isBlank(header)) {
|
||||
log.error("获取header失败,不安全的链接,即将关闭");
|
||||
try {
|
||||
session.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return header;
|
||||
}
|
||||
|
||||
public static String getTenantIdByMobile(String mobile){
|
||||
String jsonStr = redisUtilPool.getString(mobile);
|
||||
if (StringUtils.isNotEmpty(jsonStr)){
|
||||
return jsonStr;
|
||||
}
|
||||
|
||||
//如果redis中没有,循环webSocketMap,找到对应的tenantId
|
||||
for (String key : webSocketMap.keySet()) {
|
||||
WebSocketServer webSocketServer = webSocketMap.get(key);
|
||||
if (webSocketServer.mobiles.contains(mobile)){
|
||||
return webSocketServer.tenantId;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public interface HyPartnerLineInfoService {
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
Boolean transferInvestmentManager(LoginUserInfo user, TransferInvestmentManagerRequest request) throws ApiException;
|
||||
Boolean transferInvestmentManager(LoginUserInfo user, TransferInvestmentManagerRequest request,Boolean sendFlag) throws ApiException;
|
||||
|
||||
Boolean batchTransferInvestmentManager(LoginUserInfo user, BatchTransferInvestmentManagerRequest request) throws ApiException;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public interface LabelGroupService {
|
||||
* 修改标签组信息
|
||||
* @param dto 修改内容
|
||||
*/
|
||||
void updateLabelGroup(LabelGroupUpdateDTO dto);
|
||||
void updateLabelGroup(LabelGroupUpdateDTO dto) throws ApiException;
|
||||
|
||||
/**
|
||||
* 删除标签组
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.cool.store.request.CallUpReq;
|
||||
import com.cool.store.service.CallService;
|
||||
import com.cool.store.service.LogService;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -60,8 +61,9 @@ public class CallServiceImpl implements CallService {
|
||||
private LogService logService;
|
||||
@Override
|
||||
public String callUp(CallUpReq request) throws ApiException {
|
||||
String tenantId = WebSocketServer.getTenantIdByMobile(request.getOutgoingMobile());
|
||||
//校验拨出手机号APP是否在线
|
||||
boolean isOnline = WebSocketServer.isOnline(request.getOutgoingMobile());
|
||||
boolean isOnline = WebSocketServer.isOnline(tenantId);
|
||||
if (!isOnline) {
|
||||
throw new ApiException(ErrorCodeEnum.MOBILE_APP_NOT_ONLINE_ERROR);
|
||||
}
|
||||
@@ -85,7 +87,7 @@ public class CallServiceImpl implements CallService {
|
||||
callUpDTO.setTransNo(transNo);
|
||||
callUpDTO.setOutgoingMobile(request.getOutgoingMobile());
|
||||
callUpDTO.setIncomingMobile(request.getIncomingMobile());
|
||||
boolean sendFlag = WebSocketServer.sendInfo(JSON.toJSONString(callUpDTO), callRecordDO.getOutgoingMobile());
|
||||
boolean sendFlag = WebSocketServer.sendInfo(JSON.toJSONString(callUpDTO), tenantId);
|
||||
if (!sendFlag) {
|
||||
throw new ApiException(ErrorCodeEnum.CREATE_CALL_REQUEST_ERROR);
|
||||
}
|
||||
|
||||
@@ -147,6 +147,11 @@ public class EcSyncServiceImpl implements EcSyncService {
|
||||
EcClient ecClient=new EcClient();
|
||||
//有就更新ec没有就插入
|
||||
if (newUserInfo != null) {
|
||||
//招商客户姓名为空
|
||||
if (ObjectUtil.isNull(newUserInfo.getUsername())||StringUtil.isEmpty(newUserInfo.getUsername())) {
|
||||
newUserInfo.setUsername(resultUser.getUsername());
|
||||
hyPartnerUserInfoDAO.updateByPrimaryKeySelective(newUserInfo);
|
||||
}
|
||||
// EC与沪姨合伙人同时存在的线索用户,但用户姓名不同,将沪姨合伙人线索姓名同步至EC覆盖原EC线索姓名
|
||||
if (!newUserInfo.getUsername().equals(resultUser.getUsername())) {
|
||||
UpdateCustomerRequest updateUserRequest=new UpdateCustomerRequest();
|
||||
@@ -218,6 +223,12 @@ public class EcSyncServiceImpl implements EcSyncService {
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Integer a=null;
|
||||
System.out.println(a.equals("bb"));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到不带86开头的号码
|
||||
*
|
||||
|
||||
@@ -73,7 +73,7 @@ public class FollowTaskServiceImpl implements FollowTaskService {
|
||||
private RedisUtilPool redisUtilPool;
|
||||
@Resource
|
||||
private NoticeService noticeService;
|
||||
@Value("${feishu.notice.link.url:null}")
|
||||
@Value("${feishu.notice.link.url}")
|
||||
private String linkUrl;
|
||||
|
||||
@Override
|
||||
@@ -149,14 +149,14 @@ public class FollowTaskServiceImpl implements FollowTaskService {
|
||||
@Override
|
||||
public Integer updateFollowTask(UpdateFollowTaskRequest request, String userId) {
|
||||
HyFollowTaskDO followTask = hyFollowTaskDAO.getFollowTask(request.getFollowTaskId());
|
||||
if(!FollowTaskStatusEnum.TODO.getCode().equals(followTask.getTaskStatus())){
|
||||
if(FollowTaskStatusEnum.FINISHED.getCode().equals(followTask.getTaskStatus()) || FollowTaskStatusEnum.CANCELLED.getCode().equals(followTask.getTaskStatus())|| FollowTaskStatusEnum.OVERDUE_CANCELLED.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);
|
||||
HyFollowTaskDO task = UpdateFollowTaskRequest.convertDO(followTask.getPartnerLineId(),followTask.getFollowUserId(), request);
|
||||
if(!request.getDeadline().equals(followTask.getDeadline()) && (request.getDeadline().getTime() - System.currentTimeMillis()) / CommonConstants.ONE_THOUSAND < CommonConstants.AN_HOUR_SECONDS){
|
||||
//一小时内的任务立即发送通知
|
||||
sendMessage(task);
|
||||
@@ -171,17 +171,25 @@ public class FollowTaskServiceImpl implements FollowTaskService {
|
||||
throw new ServiceException(ErrorCodeEnum.TASK_STATUS_NOT_ALLOW_OPERATE);
|
||||
}
|
||||
checkLine(followTask.getPartnerLineId());
|
||||
return hyFollowTaskDAO.finishFollowTask(request.getFollowTaskId());
|
||||
FollowTaskStatusEnum followTaskStatus = FollowTaskStatusEnum.FINISHED;
|
||||
if(followTask.getDeadline().getTime() < System.currentTimeMillis()){
|
||||
followTaskStatus = FollowTaskStatusEnum.OVERDUE_FINISH;
|
||||
}
|
||||
return hyFollowTaskDAO.finishFollowTask(request.getFollowTaskId(), followTaskStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer cancelFollowTask(FollowTaskIdRequest request, String userId) {
|
||||
HyFollowTaskDO followTask = hyFollowTaskDAO.getFollowTask(request.getFollowTaskId());
|
||||
if(!FollowTaskStatusEnum.TODO.getCode().equals(followTask.getTaskStatus())){
|
||||
if(FollowTaskStatusEnum.FINISHED.getCode().equals(followTask.getTaskStatus()) || FollowTaskStatusEnum.OVERDUE_FINISH.getCode().equals(followTask.getTaskStatus())){
|
||||
throw new ServiceException(ErrorCodeEnum.TASK_STATUS_NOT_ALLOW_OPERATE);
|
||||
}
|
||||
checkLine(followTask.getPartnerLineId());
|
||||
return hyFollowTaskDAO.cancelFollowTask(request.getFollowTaskId());
|
||||
FollowTaskStatusEnum followTaskStatus = FollowTaskStatusEnum.CANCELLED;
|
||||
if(followTask.getDeadline().getTime() < System.currentTimeMillis()){
|
||||
followTaskStatus = FollowTaskStatusEnum.OVERDUE_CANCELLED;
|
||||
}
|
||||
return hyFollowTaskDAO.cancelFollowTask(request.getFollowTaskId(), followTaskStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -215,7 +223,7 @@ public class FollowTaskServiceImpl implements FollowTaskService {
|
||||
//一小时内发送过不再发送通知
|
||||
continue;
|
||||
}
|
||||
String dateline = DateUtil.format(followTask.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC_2);
|
||||
String dateline = DateUtil.format(followTask.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC_7);
|
||||
String content = MessageFormat.format(MessageConstants.FOLLOW_TASK_MESSAGE_CONTENT, dateline, partnerInfo.getUsername(), partnerInfo.getMobile());
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.FOLLOW_TASK, Arrays.asList(followTask.getFollowUserId()), content);
|
||||
}
|
||||
@@ -227,8 +235,9 @@ public class FollowTaskServiceImpl implements FollowTaskService {
|
||||
//获取已逾期的 以及截止时间为当天的任务 的招商经理
|
||||
Boolean hasNext = true;
|
||||
int pageNum = CommonConstants.ONE, pageSize = CommonConstants.HUNDRED;
|
||||
Date today = new Date();
|
||||
while (hasNext){
|
||||
Page<String> remindFollowUserIds = hyFollowTaskDAO.getRemindFollowUserIds(new Date(), pageNum, pageSize);
|
||||
Page<String> remindFollowUserIds = hyFollowTaskDAO.getRemindFollowUserIds(today, pageNum, pageSize);
|
||||
if(CollectionUtils.isEmpty(remindFollowUserIds)){
|
||||
break;
|
||||
}
|
||||
@@ -236,7 +245,7 @@ public class FollowTaskServiceImpl implements FollowTaskService {
|
||||
hasNext = false;
|
||||
}
|
||||
pageNum++;
|
||||
List<FollowTaskNumDTO> followTaskList = hyFollowTaskDAO.getUserTaskNum(remindFollowUserIds);
|
||||
List<FollowTaskNumDTO> followTaskList = hyFollowTaskDAO.getUserTaskNum(remindFollowUserIds, today);
|
||||
for (FollowTaskNumDTO followTask : followTaskList) {
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.FOLLOW_TASK, Arrays.asList(followTask.getFollowUserId()), FollowTaskNumDTO.getMessageContent(followTask));
|
||||
}
|
||||
@@ -265,13 +274,7 @@ public class FollowTaskServiceImpl implements FollowTaskService {
|
||||
if(Objects.isNull(partnerInfo)){
|
||||
return;
|
||||
}
|
||||
String lockKey = MessageFormat.format(CommonConstants.FOLLOW_TASK_NOTICE_KEY, task.getFollowUserId(), task.getId());
|
||||
boolean result = redisUtilPool.setNxExpire(lockKey, DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC), CommonConstants.FOLLOW_TASK_NOTICE_LOCK_TIMES);
|
||||
if(!result){
|
||||
//一小时内发送过不再发送通知
|
||||
return;
|
||||
}
|
||||
String dateline = DateUtil.format(task.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC_2);
|
||||
String dateline = DateUtil.format(task.getDeadline(), CoolDateUtils.DATE_FORMAT_SEC_7);
|
||||
String content = MessageFormat.format(MessageConstants.FOLLOW_TASK_MESSAGE_CONTENT, dateline, partnerInfo.getUsername(), partnerInfo.getMobile());
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.FOLLOW_TASK, Arrays.asList(task.getFollowUserId()), content);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ 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.entity.HyPartnerLabelGroupDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.mapper.HyOutboundMobileMapper;
|
||||
@@ -14,6 +15,7 @@ import com.cool.store.vo.HyOutboundVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -41,12 +43,12 @@ public class HyOutboundServiceImpl implements HyOutboundService {
|
||||
*/
|
||||
@Override
|
||||
public void addOutboundNumber(AddNumberDTO dto) throws ApiException {
|
||||
if (whetherRepeat(dto.getOutboundNumber())) {
|
||||
HyOutboundMobileDO hyOutboundMobile = new HyOutboundMobileDO();
|
||||
hyOutboundMobile.setMobile(dto.getOutboundNumber());
|
||||
if (whetherRepeat(hyOutboundMobile)) {
|
||||
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);
|
||||
@@ -59,15 +61,16 @@ public class HyOutboundServiceImpl implements HyOutboundService {
|
||||
*/
|
||||
@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());
|
||||
if (whetherRepeat(hyOutboundMobile)) {
|
||||
throw new ApiException(ErrorCodeEnum.OUTBOUND_NUMBER_EXIST);
|
||||
}
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
hyOutboundMobile.setEditUserId(userId);
|
||||
hyOutboundMobile.setUpdateUserId(userId);
|
||||
hyOutboundMobile.setUpdateTime(new Date());
|
||||
outboundMobileMapper.updateByPrimaryKeySelective(hyOutboundMobile);
|
||||
}
|
||||
|
||||
@@ -87,14 +90,23 @@ public class HyOutboundServiceImpl implements HyOutboundService {
|
||||
|
||||
/**
|
||||
* 查询某个手机号是否重复
|
||||
* @param number 手机号
|
||||
* @param hyOutboundMobileDO 手机号信息
|
||||
* @return 是否重复
|
||||
*/
|
||||
public boolean whetherRepeat(String number) {
|
||||
HyOutboundMobileDO hyOutboundMobileDO = new HyOutboundMobileDO();
|
||||
hyOutboundMobileDO.setMobile(number);
|
||||
public boolean whetherRepeat(HyOutboundMobileDO hyOutboundMobileDO) {
|
||||
Long id = hyOutboundMobileDO.getId();
|
||||
hyOutboundMobileDO.setId(null);
|
||||
List<HyOutboundMobileDO> outboundMobileList = outboundMobileMapper.selectByPrimarySelective(hyOutboundMobileDO);
|
||||
return outboundMobileList != null && outboundMobileList.size() != 0;
|
||||
hyOutboundMobileDO.setId(id);
|
||||
//如果修改后的号码与原号码一致也不算重复,但是要记录更新人
|
||||
if (outboundMobileList != null && outboundMobileList.size() > 0) {
|
||||
//更新操作还要检查是否与原号码信息相同,相同的话也不算重复
|
||||
if (outboundMobileList.get(0).getId().equals(id)) {
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -80,6 +80,8 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
||||
private LogService logService;
|
||||
@Resource
|
||||
private LabelService labelService;
|
||||
@Resource
|
||||
private HyFollowTaskDAO hyFollowTaskDAO;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -109,6 +111,9 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
||||
List<String> removeLabels = new ArrayList<>(oldLabels);
|
||||
addLabels.removeAll(oldLabels);
|
||||
removeLabels.removeAll(newLabels);
|
||||
if(CollectionUtils.isEmpty(addLabels) && CollectionUtils.isEmpty(removeLabels)){
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
LineLogInfo lineLogInfo = new LineLogInfo(line.getPartnerId(), line.getId(), user.getUserId(),
|
||||
user.getName(), OperateTypeEnum.ADD_TAGS,
|
||||
WorkflowStageEnum.getWorkflowStageByCode(line.getWorkflowStage()),
|
||||
@@ -234,7 +239,7 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
||||
// 新线索绑定身份证号
|
||||
HyPartnerBaseInfoDO newBaseInfo = hyPartnerBaseInfoDAO.getByPartnerIdAndLineId(currentUser.getPartnerId(), lineId);
|
||||
fillBaseInfoIdCard(newBaseInfo, oldBaseInfo.getIdCard(), oldBaseInfo.getIdCardPhotoFront(), oldBaseInfo.getIdCardPhotoBlack(), oldBaseInfo.getUsername(),
|
||||
oldBaseInfo.getSex(), oldBaseInfo.getBirthdate(), oldBaseInfo.getNation(), oldBaseInfo.getLiveAddress(), oldBaseInfo.getStatus());
|
||||
oldBaseInfo.getSex(), oldBaseInfo.getBirthdate(), oldBaseInfo.getNation(), oldBaseInfo.getLiveAddress(), oldBaseInfo.getStatus(),oldBaseInfo.getUserPortrait());
|
||||
newBaseInfo.setStatus(oldBaseInfo.getStatus());
|
||||
hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(newBaseInfo);
|
||||
//修改名称
|
||||
@@ -255,7 +260,7 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
||||
hyPartnerUserInfoDO.setShopId(oldPartnerUser.getShopId());
|
||||
hyPartnerUserInfoDAO.updateByPrimaryKeySelective(hyPartnerUserInfoDO);
|
||||
// 老的身份证信息置空
|
||||
fillBaseInfoIdCard(oldBaseInfo, null, null, null, null, null, null, null, null, null);
|
||||
fillBaseInfoIdCard(oldBaseInfo, null, null, null, null, null, null, null, null, null,null);
|
||||
oldBaseInfo.setStatus(Integer.valueOf(WorkflowStatusEnum.INTENT_0.getCode()));
|
||||
hyPartnerBaseInfoDAO.updateByPrimaryKey(oldBaseInfo);
|
||||
hyPartnerIntentInfoDAO.updateLineId(newPartnerId,newLindId,oldLineInfo.getId());
|
||||
@@ -263,7 +268,12 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
||||
hyPartnerInterviewPlanDAO.updateLineId(newPartnerId,newLindId,oldLineInfo.getId());
|
||||
hyInterviewDAO.updateLineId(newPartnerId,newLindId,oldLineInfo.getId());
|
||||
hyPartnerCertificationInfoMapper.updateLineId(newPartnerId,newLindId,oldLineInfo.getId());
|
||||
//软删新线索操作日志
|
||||
hyPartnerTaskInfoLogDAO.deleteByLineId(newLindId, "换绑");
|
||||
hyPartnerTaskInfoLogDAO.updateLineId(newPartnerId,newLindId,oldLineInfo.getId());
|
||||
//先作废新的线索跟进任务
|
||||
hyFollowTaskDAO.cancelUndoFollowTask(newLindId);
|
||||
hyFollowTaskDAO.changeLineId(oldLineInfo.getId(), newLindId);
|
||||
String cacheKeyBaseInfo = MessageFormat.format(RedisConstant.PARTNER_BASEINFO_CACHE_KEY, newPartnerId, newLindId);
|
||||
String cacheKeyClerkInfo = MessageFormat.format(RedisConstant.PARTNER_CLERKINFO_CACHE_KEY,newPartnerId, newLindId);
|
||||
String cacheKeyIntentInfo = MessageFormat.format(RedisConstant.PARTNER_INTENTINFO_CACHE_KEY, newPartnerId, newLindId);
|
||||
@@ -311,12 +321,13 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
||||
}
|
||||
|
||||
private void fillBaseInfoIdCard(HyPartnerBaseInfoDO newBaseInfo, String idCard, String idCardPhotoFront, String idCardPhotoBlack,
|
||||
String username, Integer sex, Date birthdate, String nation, String liveAddress, Integer status) {
|
||||
String username, Integer sex, Date birthdate, String nation, String liveAddress, Integer status,String userPortrait) {
|
||||
newBaseInfo.setIdCard(idCard);
|
||||
newBaseInfo.setIdCardPhotoBlack(idCardPhotoFront);
|
||||
newBaseInfo.setIdCardPhotoFront(idCardPhotoBlack);
|
||||
newBaseInfo.setUsername(username);
|
||||
newBaseInfo.setSex(sex);
|
||||
newBaseInfo.setUserPortrait(userPortrait);
|
||||
newBaseInfo.setBirthdate(birthdate);
|
||||
newBaseInfo.setNation(nation);
|
||||
newBaseInfo.setLiveAddress(liveAddress);
|
||||
|
||||
@@ -244,14 +244,16 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
|
||||
|
||||
if(flag){//分配招商经理成功才发送分配招商经理的飞书工作通知
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,DateUtil.formatDateTime(new Date()),hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile());
|
||||
String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7);
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile());
|
||||
}
|
||||
}
|
||||
if(!isUpdateIntentInfo){
|
||||
if(CollectionUtils.isEmpty(userIdList)){
|
||||
userIdList.add(hyPartnerLineInfoDO.getInvestmentManager());
|
||||
}
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTENTION_APPLY,userIdList,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile(),DateUtil.formatDateTime(new Date()));
|
||||
String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7);
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.INTENTION_APPLY,userIdList,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile(), dateTime);
|
||||
}
|
||||
//记录日志
|
||||
PartnerUserInfoVO operator = PartnerUserHolder.getUser();
|
||||
|
||||
@@ -86,7 +86,7 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
|
||||
HyPartnerUserChannelDAO hyPartnerUserChannelDAO;
|
||||
|
||||
|
||||
@Value("${feishu.notice.link.url:null}")
|
||||
@Value("${feishu.notice.link.url}")
|
||||
private String linkUrl;
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -168,7 +168,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Boolean transferInvestmentManager(LoginUserInfo user, TransferInvestmentManagerRequest request) throws ApiException {
|
||||
public Boolean transferInvestmentManager(LoginUserInfo user, TransferInvestmentManagerRequest request,Boolean sendFlag) throws ApiException {
|
||||
if (StringUtil.isBlank(request.getUserId())||request.getLineId()==null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
@@ -194,8 +194,11 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
workFlowService.transferInvestmentManager(WorkflowStageEnum.getWorkflowStageByCode(hyPartnerLineInfoDO.getWorkflowStage()),request);
|
||||
}
|
||||
//发送飞书工作通知
|
||||
HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerLineId(request.getLineId());
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.TRANS_INVESTMENT_MANAGER,Arrays.asList(request.getUserId()),DateUtil.formatDateTime(new Date()),hyPartnerBaseInfoDO.getUsername(),hyPartnerBaseInfoDO.getMobile());
|
||||
if (sendFlag){
|
||||
String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7);
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(hyPartnerLineInfoDO.getPartnerId());
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.TRANS_INVESTMENT_MANAGER,Arrays.asList(request.getUserId()),dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile());
|
||||
}
|
||||
|
||||
//作废待完成&已逾期的任务
|
||||
hyFollowTaskDAO.cancelUndoFollowTask(request.getLineId());
|
||||
@@ -221,6 +224,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
if (CollectionUtils.isEmpty(request.getLineIds())||StringUtils.isEmpty(request.getUserId())){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
int num = request.getLineIds().size();
|
||||
List<HyPartnerLineInfoDO> hyPartnerLineInfoList = hyPartnerLineInfoDAO.getHyPartnerLineInfoList(request.getLineIds(), request.getUserId());
|
||||
//如果选中的线索中有线索招商经理已经是被装让的招商经理,则不允许批量操作
|
||||
if (CollectionUtils.isNotEmpty(hyPartnerLineInfoList)){
|
||||
@@ -231,11 +235,14 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
transferInvestmentManagerRequest.setUserId(request.getUserId());
|
||||
transferInvestmentManagerRequest.setLineId(lineId);
|
||||
try {
|
||||
this.transferInvestmentManager(user,transferInvestmentManagerRequest);
|
||||
this.transferInvestmentManager(user,transferInvestmentManagerRequest,num<=1?true:false);
|
||||
} catch (ApiException e) {
|
||||
log.info("transferInvestmentManager_success Transfer_interview_management_failed,lineId:{}",lineId);
|
||||
}
|
||||
}
|
||||
if (num>1){
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.BATCH_TRANS_INVESTMENT_MANAGER,Arrays.asList(request.getUserId()),num,DateUtil.format(new Date(),CoolDateUtils.DATE_FORMAT_SEC_7));
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@@ -281,9 +288,9 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
//给招商经理发送飞书工作通知
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
userIdList.add(user.getUserId());
|
||||
HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerLineId(x.getId());
|
||||
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,DateUtil.formatDateTime(new Date()),hyPartnerBaseInfoDO.getUsername(),hyPartnerBaseInfoDO.getMobile());
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(x.getPartnerId());
|
||||
String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7);
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile());
|
||||
|
||||
LineLogInfo lineLogInfo = new LineLogInfo(x.getPartnerId(), x.getId(), user.getUserId(),
|
||||
user.getName(), OperateTypeEnum.ALLOCATION_INVESTMENT_MANAGER,
|
||||
@@ -718,12 +725,13 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
}
|
||||
//省内调剂 有重点或者开放的 分配
|
||||
if (AcceptAdjustTypeEnum.PROVINCIAL_ADJUSTMENT.getCode().equals(acceptAdjustType)){
|
||||
|
||||
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOList= new ArrayList<>();
|
||||
if(hyOpenAreaInfoDO != null){
|
||||
String areaPath = hyOpenAreaInfoDO.getAreaPath();
|
||||
String province = areaPath.substring(0, areaPath.indexOf("/", areaPath.indexOf("/") + 1));
|
||||
hyOpenAreaInfoDOList = hyOpenAreaInfoDAO.queryByKeyword(province, true, null, true);
|
||||
//过滤一级目录
|
||||
hyOpenAreaInfoDOList = hyOpenAreaInfoDOList.stream().filter(x->x.getParentId()!=null).collect(Collectors.toList());
|
||||
}
|
||||
if (hyOpenAreaInfoDOList.size()>CommonConstants.ZERO){
|
||||
return Boolean.TRUE;
|
||||
@@ -819,7 +827,8 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
userIdList.add(investmentManager);
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(partnerId);
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,DateUtil.formatDateTime(new Date()),hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile());
|
||||
String dateTime = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC_7);
|
||||
noticeService.sendFeiShuNotice(FeiShuNoticeMsgEnum.ALLOCATION_INVESTMENT_MANAGER,userIdList,dateTime,hyPartnerUserInfoDO.getUsername(),hyPartnerUserInfoDO.getMobile());
|
||||
}
|
||||
return hyPartnerLineInfoDO;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class InterviewServiceImpl implements InterviewService {
|
||||
@Value("${hs.sms.templateCode:null}")
|
||||
private String templateCode;
|
||||
|
||||
@Value("${feishu.notice.link.url:null}")
|
||||
@Value("${feishu.notice.link.url}")
|
||||
private String linkUrl;
|
||||
|
||||
@Autowired
|
||||
@@ -616,7 +616,7 @@ public class InterviewServiceImpl implements InterviewService {
|
||||
.append(" 手机号 ")
|
||||
.append(partnerMobile)
|
||||
.append(",预约面试时间")
|
||||
.append(DateUtil.format(DateUtil.parse(interviewTime), "yyyy年MM月dd日 HH:mm"));
|
||||
.append(DateUtil.format(DateUtil.parse(interviewTime), CoolDateUtils.DATE_FORMAT_SEC_7));
|
||||
return sb.toString();
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -5,6 +5,7 @@ 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.HyPartnerLabelDO;
|
||||
import com.cool.store.entity.HyPartnerLabelGroupDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ApiException;
|
||||
@@ -14,6 +15,7 @@ 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 org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -50,8 +52,7 @@ public class LabelGroupServiceImpl implements LabelGroupService {
|
||||
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) {
|
||||
if (whetherGroupDuplicated(labelGroupDO)) {
|
||||
throw new ApiException(ErrorCodeEnum.LABEL_GROUP_EXIST);
|
||||
}
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
@@ -67,8 +68,13 @@ public class LabelGroupServiceImpl implements LabelGroupService {
|
||||
* @param dto 修改内容
|
||||
*/
|
||||
@Override
|
||||
public void updateLabelGroup(LabelGroupUpdateDTO dto) {
|
||||
public void updateLabelGroup(LabelGroupUpdateDTO dto) throws ApiException {
|
||||
HyPartnerLabelGroupDO labelGroupDO = new HyPartnerLabelGroupDO();
|
||||
labelGroupDO.setLabelGroupName(dto.getLabelGroupName());
|
||||
labelGroupDO.setId(dto.getId());
|
||||
if (whetherGroupDuplicated(labelGroupDO)) {
|
||||
throw new ApiException(ErrorCodeEnum.LABEL_GROUP_EXIST);
|
||||
}
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
labelGroupDO.setId(dto.getId());
|
||||
labelGroupDO.setLabelGroupName(dto.getLabelGroupName());
|
||||
@@ -112,4 +118,20 @@ public class LabelGroupServiceImpl implements LabelGroupService {
|
||||
return labelMapper.whetherGroupInUse(id);
|
||||
}
|
||||
|
||||
private Boolean whetherGroupDuplicated(HyPartnerLabelGroupDO labelGroupDO) {
|
||||
Long id = labelGroupDO.getId();
|
||||
labelGroupDO.setId(null);
|
||||
List<HyPartnerLabelGroupDO> hyPartnerLabelGroupDOS = labelGroupMapper.selectSelective(labelGroupDO);
|
||||
labelGroupDO.setId(id);
|
||||
//如果修改后的标签组名与原标签组名一致也不算重复,但是要记录更新人
|
||||
if (hyPartnerLabelGroupDOS != null && hyPartnerLabelGroupDOS.size() > 0) {
|
||||
//更新操作还要检查是否与原标签组信息相同,相同的话也不算重复
|
||||
if (hyPartnerLabelGroupDOS.get(0).getId().equals(id)) {
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -69,12 +69,12 @@ public class LabelServiceImpl implements LabelService {
|
||||
@Override
|
||||
public void updateLabel(LabelUpdateDTO dto) throws ApiException {
|
||||
HyPartnerLabelDO labelDO = new HyPartnerLabelDO();
|
||||
labelDO.setId(dto.getId());
|
||||
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());
|
||||
@@ -99,8 +99,16 @@ public class LabelServiceImpl implements LabelService {
|
||||
}
|
||||
|
||||
private Boolean whetherLabelRepeat(HyPartnerLabelDO label) throws ApiException {
|
||||
Long id = label.getId();
|
||||
label.setId(null);
|
||||
List<HyPartnerLabelDO> hyPartnerLabelDOS = labelMapper.selectSelective(label);
|
||||
label.setId(id);
|
||||
//如果修改后的标签名与原标签名一致也不算重复,但是要记录更新人
|
||||
if (hyPartnerLabelDOS != null && hyPartnerLabelDOS.size() > 0) {
|
||||
//更新操作还要检查是否与原标签信息相同,相同的话也不算重复
|
||||
if (hyPartnerLabelDOS.get(0).getId().equals(id)) {
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
@@ -139,7 +147,9 @@ public class LabelServiceImpl implements LabelService {
|
||||
String trimmedPart = part.trim();
|
||||
if (!trimmedPart.isEmpty()) {
|
||||
try {
|
||||
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
|
||||
if (userPortraitMap.get(Long.valueOf(part)) != null){
|
||||
userPortraitList.add(userPortraitMap.get(Long.valueOf(part)));
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
log.info("Invalid format: {}" , trimmedPart);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cool.store.constants.ExcelErrorConstants;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
@@ -77,7 +78,7 @@ public class LineHighSeasServiceImpl implements LineHighSeasService {
|
||||
if (ObjectUtil.isNotNull(hyPartnerUserInfoDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARTNER_MOBILE_EXIST);
|
||||
}
|
||||
return add(request);
|
||||
return add(request,"add");
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +87,7 @@ public class LineHighSeasServiceImpl implements LineHighSeasService {
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
public boolean add(AddLineRequest request) {
|
||||
public boolean add(AddLineRequest request,String type) {
|
||||
Boolean flag =false;
|
||||
String partnerId = UUIDUtils.get32UUID();
|
||||
HyPartnerUserInfoDO resultUser = new HyPartnerUserInfoDO();
|
||||
@@ -95,7 +96,9 @@ public class LineHighSeasServiceImpl implements LineHighSeasService {
|
||||
hyPartnerUserInfoDAO.insertSelective(resultUser);
|
||||
|
||||
HyPartnerLineInfoDO resultLine = new HyPartnerLineInfoDO();
|
||||
resultLine.setPartnerId(partnerId).setCreateTime(new Date()).setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
|
||||
resultLine.setPartnerId(partnerId).setCreateTime(new Date()).setWorkflowStage(WorkflowStageEnum.INTENT.getCode())
|
||||
.setCreateUserId(CurrentUserHolder.getUserId()).setCreateUserMobile(CurrentUserHolder.getUser().getMobile())
|
||||
.setOperatorType(type);
|
||||
|
||||
//判断招商经理是否为空
|
||||
if (StringUtil.isNotEmpty(request.getInvestmentManager())) {
|
||||
@@ -133,19 +136,26 @@ public class LineHighSeasServiceImpl implements LineHighSeasService {
|
||||
if (lineDOList.size() > excelMaxSize) {
|
||||
//超出五百条的excel都标红
|
||||
for (int i = excelMaxSize; i < lineDOList.size() ; i++) {
|
||||
styleCells.put(i,new HashMap<>());
|
||||
lineDOList.get(i).setErrorInfo(ExcelErrorConstants.COUNT_MORE);
|
||||
styleCells.put(i,new HashMap<>(4));
|
||||
}
|
||||
ExcelUtil.setRowStyle(styleCells,ExcelUtil.FONT_RED,7);
|
||||
util.exportExcel(outputStream, lineDOList, "", styleCells);
|
||||
InputStream stream = new ByteArrayInputStream(outputStream.toByteArray());
|
||||
String fileStr = ossServer.uploadFileServer(stream, dir + getExcelName());
|
||||
return new ResponseResult(500, "每次数据最多导入500条,请分批上传", new ErrorExcelResponse(lineDOList.size(), excelMaxSize, fileStr));
|
||||
return new ResponseResult(500, "共上传" + lineDOList.size() + "条线索,其中" + styleCells.size() + "条存在异常", new ErrorExcelResponse(lineDOList.size(), styleCells.size(), fileStr));
|
||||
}
|
||||
for (int i = 0; i < lineDOList.size(); i++) {
|
||||
HyPartnerLineDO hyPartnerLineDO = lineDOList.get(i);
|
||||
if (StringUtil.isEmpty(hyPartnerLineDO.getPartnerName())) {
|
||||
String partnerName = hyPartnerLineDO.getPartnerName();
|
||||
if (StringUtil.isEmpty(partnerName)) {
|
||||
hyPartnerLineDO.setErrorInfo(StringUtil.isEmpty(hyPartnerLineDO.getErrorInfo()) ? ExcelErrorConstants.NAME_LOSE : hyPartnerLineDO.getErrorInfo().concat(Constants.SEMICOLON).concat(ExcelErrorConstants.NAME_LOSE));
|
||||
ExcelUtil.setStyleMap(styleCells, i, 0, new String[]{ExcelUtil.FONT_RED});
|
||||
}else {
|
||||
if (partnerName.length()>10) {
|
||||
hyPartnerLineDO.setErrorInfo(StringUtil.isEmpty(hyPartnerLineDO.getErrorInfo()) ? ExcelErrorConstants.NAME_OVER_LENGTH : hyPartnerLineDO.getErrorInfo().concat(Constants.SEMICOLON).concat(ExcelErrorConstants.NAME_OVER_LENGTH));
|
||||
ExcelUtil.setStyleMap(styleCells, i, 0, new String[]{ExcelUtil.FONT_RED});
|
||||
}
|
||||
}
|
||||
String mobile = hyPartnerLineDO.getMobile().trim();
|
||||
//手机号为空
|
||||
@@ -231,9 +241,9 @@ public class LineHighSeasServiceImpl implements LineHighSeasService {
|
||||
AddLineRequest addLineRequest = new AddLineRequest();
|
||||
BeanUtil.copyProperties(hyPartnerLineDO, addLineRequest);
|
||||
addLineRequest.setWantShopArea(hyPartnerLineDO.getWantShopArea().toString());
|
||||
add(addLineRequest);
|
||||
add(addLineRequest,"import");
|
||||
}
|
||||
return new ResponseResult(200, "共上传" + lineDOList.size() + "条线索", new ErrorExcelResponse(lineDOList.size(), styleCells.size(), fileStr));
|
||||
return new ResponseResult(ResponseCodeEnum.SUCCESS.getCode(), "共上传" + lineDOList.size() + "条线索", new ErrorExcelResponse(lineDOList.size(), styleCells.size(), fileStr));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -218,7 +218,7 @@ public class ExcelUtil<T> {
|
||||
// 定义一个map用于存放excel列的序号和field.
|
||||
Map<String, Integer> cellMap = new HashMap<>(16);
|
||||
// 获取表头
|
||||
Row heard = sheet.getRow(0);
|
||||
Row heard = sheet.getRow(6);
|
||||
for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) {
|
||||
Cell cell = heard.getCell(i);
|
||||
if (ObjectUtil.isNotNull(cell)) {
|
||||
@@ -911,7 +911,7 @@ public class ExcelUtil<T> {
|
||||
* 创建一个工作簿
|
||||
*/
|
||||
public void createWorkbook() {
|
||||
this.wb = new SXSSFWorkbook(500);
|
||||
this.wb = new SXSSFWorkbook(800);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1131,9 +1131,11 @@ public class ExcelUtil<T> {
|
||||
*/
|
||||
private List<T> fillCollection(Sheet sheet, int rows, Map<Integer, Field> fieldsMap) throws InstantiationException, IllegalAccessException {
|
||||
List<T> list = new ArrayList<>();
|
||||
for (int i = 1; i < rows; i++) {
|
||||
int j=10;
|
||||
for (int i = 0; i < rows-5; i++) {
|
||||
// 从第2行开始取数据,默认第一行是表头.
|
||||
Row row = sheet.getRow(i);
|
||||
Row row = sheet.getRow(j);
|
||||
j++;
|
||||
T entity = null;
|
||||
for (Map.Entry<Integer, Field> entry : fieldsMap.entrySet()) {
|
||||
Object val = this.getCellValue(row, entry.getKey());
|
||||
|
||||
@@ -52,9 +52,7 @@ public class TokenValidateFilter implements Filter {
|
||||
"/partner/pc/flow/qualificationReview/callback",
|
||||
"/**/ecSync/ecToApplet/**",
|
||||
"/partner/pc/websocket/**",
|
||||
"/partner/pc/call/**",
|
||||
//TODO 暂时放开前端 OSS 配置获取接口给安卓端调试
|
||||
"/partner/pc/oss/**");
|
||||
"/partner/pc/call/**");
|
||||
|
||||
/**
|
||||
* @param uri
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||
|
||||
/**
|
||||
* WebSocket的配置信息
|
||||
*/
|
||||
@Configuration
|
||||
public class WebSocketConfig {
|
||||
@Bean
|
||||
public ServerEndpointExporter serverEndpointExporter() {
|
||||
|
||||
return new ServerEndpointExporter();
|
||||
}
|
||||
}
|
||||
@@ -196,7 +196,7 @@ public class DeskController {
|
||||
@PostMapping(path = "/transferInvestmentManager")
|
||||
@ApiOperation("转让招商经理")
|
||||
public ResponseResult<Boolean> transferInvestmentManager(@RequestBody TransferInvestmentManagerRequest request) throws ApiException {
|
||||
return ResponseResult.success(hyPartnerLineInfoService.transferInvestmentManager(CurrentUserHolder.getUser(),request ));
|
||||
return ResponseResult.success(hyPartnerLineInfoService.transferInvestmentManager(CurrentUserHolder.getUser(),request,Boolean.TRUE ));
|
||||
}
|
||||
|
||||
@PostMapping(path = "/batchTransferInvestmentManager")
|
||||
|
||||
@@ -48,7 +48,7 @@ public class LabelGroupController {
|
||||
|
||||
@ApiOperation("修改标签组")
|
||||
@PostMapping({"/edit"})
|
||||
public ResponseResult updateLabelGroup(@RequestBody LabelGroupUpdateDTO dto) {
|
||||
public ResponseResult updateLabelGroup(@RequestBody LabelGroupUpdateDTO dto) throws ApiException {
|
||||
labelGroupService.updateLabelGroup(dto);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@@ -274,4 +274,10 @@ public class TestController {
|
||||
followTaskService.followTaskDailyRemind();
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@GetMapping("/followTaskAnHourAgoRemind")
|
||||
public ResponseResult followTaskAnHourAgoRemind() {
|
||||
followTaskService.followTaskAnHourAgoRemind();
|
||||
return ResponseResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user