Commit 5c06ae85 by 王祖波

更新跟进时间

parent 590285b7
......@@ -143,5 +143,13 @@ public interface TabHaobanInteractRecordMapper {
*/
int modifyUnionId(@Param("enterpriseId") String enterpriseId, @Param("oldUnionId") String oldUnionId, @Param("newUnionId") String newUnionId);
/**
* 更新跟进时间
*
* @param enterpriseId
* @return
*/
int modifyFollowTimeBatch(@Param("enterpriseId") String enterpriseId, @Param("clerkId") String clerkId, @Param("memberId") String memberId, @Param("limitTime") Date limitTime);
}
......@@ -88,6 +88,11 @@ public class TabHaobanInteractRecord implements Serializable {
*/
private Date lastAccessTime;
/**
* 跟进时间
*/
private Date followTime;
public Long getId() {
return id;
......@@ -240,5 +245,13 @@ public class TabHaobanInteractRecord implements Serializable {
public void setLastAccessTime(Date lastAccessTime) {
this.lastAccessTime = lastAccessTime;
}
public Date getFollowTime() {
return followTime;
}
public void setFollowTime(Date followTime) {
this.followTime = followTime;
}
}
......@@ -76,7 +76,13 @@ public interface InteractRecordService {
*/
InteractRecordBO queryLeastRecord(String enterpriseId, String clerkId, String bizId, String memberId);
// void modifyFollowTime(String enterpriseId,String clerkId, String memberId);
/**
* 更新销售线索跟进时间
* @param enterpriseId
* @param clerkId
* @param memberId
*/
void modifyFollowTime(String enterpriseId,String clerkId, String memberId);
/**
* 更新unionId
......
package com.gic.haoban.manage.service.service.content.impl;
import cn.hutool.core.date.DateTime;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.DateUtil;
......@@ -25,7 +26,6 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
......@@ -267,6 +267,21 @@ public class InteractRecordServiceImpl implements InteractRecordService {
}
@Override
public void modifyFollowTime(String enterpriseId, String clerkId, String memberId) {
DateTime now = cn.hutool.core.date.DateUtil.date();
DateTime limitTime = cn.hutool.core.date.DateUtil.offsetDay(cn.hutool.core.date.DateUtil.endOfDay(now), -7);
log.info("更新跟进时间 now:{},limitTime:{}", now, limitTime);
tabHaobanInteractRecordMapper.modifyFollowTimeBatch(enterpriseId, clerkId, memberId,limitTime);
InteractRecordBO interactRecordBO = queryLeastRecord(enterpriseId, clerkId, null, memberId);
if (interactRecordBO != null) {
TabHaobanInteractRecord modifyInteractRecord = new TabHaobanInteractRecord();
modifyInteractRecord.setId(interactRecordBO.getId());
modifyInteractRecord.setFollowTime(now);
tabHaobanInteractRecordMapper.update(modifyInteractRecord);
}
}
@Override
public List<InteractRecordBO> lastInteractRecord(String enterpriseId, String clerkId, List<MemberLastInteractBO> list) {
if (CollectionUtils.isEmpty(list)) {
return new ArrayList<>();
......
......@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.service.content.impl;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Constant;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.UniqueIdUtils;
......@@ -41,12 +42,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -246,6 +242,12 @@ public class PotentialCustomerServiceImpl implements PotentialCustomerService {
temp.setStarFlag(potentialCustomerBO.getStarFlag());
temp.setSeeFlag(potentialCustomerBO.getSeeFlag());
potentialCustomerMapper.update(temp);
if (Objects.equals(potentialCustomerBO.getSeeFlag(), Constant.FLAG_TRUE)) {
String enterpriseId = potentialCustomerBO.getEnterpriseId();
String clerkId = potentialCustomerBO.getClerkId();
String memberId = potentialCustomerBO.getMemberId();
interactRecordService.modifyFollowTime(enterpriseId, clerkId, memberId);
}
}
/**
......
......@@ -22,6 +22,7 @@
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="lastAccessTime" column="last_access_time" jdbcType="TIMESTAMP"/>
<result property="followTime" column="follow_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="baseSql">
......@@ -43,7 +44,8 @@
extend_info,
create_time,
update_time,
last_access_time
last_access_time,
follow_time
</sql>
<!--查询单个-->
......@@ -66,7 +68,8 @@
extend_info,
create_time,
update_time,
last_access_time
last_access_time,
follow_time
from tab_haoban_interact_record
where id = #{id}
</select>
......@@ -75,7 +78,7 @@
<select id="queryAllByLimit" resultMap="TabHaobanInteractRecordMap">
select
id, enterprise_id, member_id, union_id, clerk_id, trace_id, biz_id, biz_type, store_id, channel_source,share_source,
event_type, duration_time, times, delete_flag, extend_info, create_time, update_time,last_access_time
event_type, duration_time, times, delete_flag, extend_info, create_time, update_time,last_access_time,follow_time
from tab_haoban_interact_record
<where>
<if test="clerkId != null and clerkId != ''">
......@@ -256,6 +259,9 @@
<if test="lastAccessTime != null">
last_access_time = #{lastAccessTime}
</if>
<if test="followTime != null">
follow_time = #{followTime}
</if>
</set>
where id = #{id}
</update>
......@@ -367,5 +373,13 @@
where enterprise_id = #{enterpriseId} and union_id = #{oldUnionId} and delete_flag = 0
</update>
<update id="modifyFollowTimeBatch">
update tab_haoban_interact_record
set follow_time = now()
where enterprise_id = #{enterpriseId} and clerk_id = #{clerkId} and member_id = #{memberId}
and create_time >= #{limitTime} and follow_time is null
and delete_flag = 0
</update>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment