Commit 4522c87d by 水库浪子

修改轨迹相关BUG

1 parent 85d4eb5e
...@@ -107,7 +107,6 @@ public class WeCustomerPortraitController extends BaseController { ...@@ -107,7 +107,6 @@ public class WeCustomerPortraitController extends BaseController {
public AjaxResult updateWeCustomerPorTraitTag(@RequestBody WeMakeCustomerTag weMakeCustomerTag){ public AjaxResult updateWeCustomerPorTraitTag(@RequestBody WeMakeCustomerTag weMakeCustomerTag){
iWeCustomerService.makeLabel(weMakeCustomerTag); iWeCustomerService.makeLabel(weMakeCustomerTag);
return AjaxResult.success(); return AjaxResult.success();
...@@ -150,16 +149,15 @@ public class WeCustomerPortraitController extends BaseController { ...@@ -150,16 +149,15 @@ public class WeCustomerPortraitController extends BaseController {
* @return * @return
*/ */
@GetMapping(value = "/findTrajectory") @GetMapping(value = "/findTrajectory")
public TableDataInfo findTrajectory(Integer trajectoryType){ public TableDataInfo findTrajectory(String userId,String externalUserid,Integer trajectoryType){
startPage(); startPage();
LambdaQueryWrapper<WeCustomerTrajectory> ne = new LambdaQueryWrapper<WeCustomerTrajectory>() LambdaQueryWrapper<WeCustomerTrajectory> ne = new LambdaQueryWrapper<WeCustomerTrajectory>()
.ne(WeCustomerTrajectory::getStatus, Constants.DELETE_CODE); .ne(WeCustomerTrajectory::getStatus, Constants.DELETE_CODE)
.eq(WeCustomerTrajectory::getUserId,userId)
.eq(WeCustomerTrajectory::getExternalUserid,externalUserid);
if(trajectoryType != null){ if(trajectoryType != null){
ne.eq(WeCustomerTrajectory::getTrajectoryType, trajectoryType); ne.eq(WeCustomerTrajectory::getTrajectoryType, trajectoryType);
} }
return getDataTable( return getDataTable(
iWeCustomerTrajectoryService.list(ne) iWeCustomerTrajectoryService.list(ne)
); );
......
package com.linkwechat.common.enums;
public enum TrajectorySceneType {
TRAJECTORY_TYPE_XXDT_BCZL(TrajectoryType.TRAJECTORY_TYPE_XXDT.getType(),"信息动态-补充资料",1),
TRAJECTORY_TYPE_XXDT_SZBQ(TrajectoryType.TRAJECTORY_TYPE_XXDT.getType(),"信息动态-设置标签",2);
private String name;
private Integer type;
private Integer key;
TrajectorySceneType( Integer type,String name,Integer key) {
this.name = name;
this.type = type;
this.key=key;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getKey() {
return key;
}
public void setKey(Integer key) {
this.key = key;
}
}
...@@ -12,7 +12,6 @@ public enum TrajectoryType { ...@@ -12,7 +12,6 @@ public enum TrajectoryType {
TRAJECTORY_TYPE_XXDT(1,"信息动态"), TRAJECTORY_TYPE_XXDT(1,"信息动态"),
TRAJECTORY_TYPE_SJDT(2,"社交动态"), TRAJECTORY_TYPE_SJDT(2,"社交动态"),
TRAJECTORY_TYPE_HDGZ(3,"活动规则"), TRAJECTORY_TYPE_HDGZ(3,"活动规则"),
...@@ -30,4 +29,21 @@ public enum TrajectoryType { ...@@ -30,4 +29,21 @@ public enum TrajectoryType {
} }
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
} }
package com.linkwechat.wecom.annotation;
import java.lang.annotation.*;
/**
* 客户轨迹记录相关注解
*/
@Target({ElementType.PARAMETER,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface CustomerTrajectoryRecord {
int trajectoryType();
}
...@@ -19,6 +19,7 @@ import java.util.List; ...@@ -19,6 +19,7 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
public class WeMakeCustomerTag { public class WeMakeCustomerTag {
private String externalUserid; private String externalUserid;
private String userId;
private List<WeTag> addTag; private List<WeTag> addTag;
} }
...@@ -7,4 +7,7 @@ public interface IWeCustomerTrajectoryService extends IService<WeCustomerTraject ...@@ -7,4 +7,7 @@ public interface IWeCustomerTrajectoryService extends IService<WeCustomerTraject
void waitHandleMsg(String url); void waitHandleMsg(String url);
void inforMationNews(String userId,String externalUserid,Integer trajectoryType);
} }
...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.common.constant.Constants; import com.linkwechat.common.constant.Constants;
import com.linkwechat.common.constant.WeConstans; import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.core.domain.entity.SysUser; import com.linkwechat.common.core.domain.entity.SysUser;
import com.linkwechat.common.enums.TrajectorySceneType;
import com.linkwechat.common.utils.DateUtils; import com.linkwechat.common.utils.DateUtils;
import com.linkwechat.common.utils.SecurityUtils; import com.linkwechat.common.utils.SecurityUtils;
import com.linkwechat.common.utils.SnowFlakeUtil; import com.linkwechat.common.utils.SnowFlakeUtil;
...@@ -81,6 +82,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -81,6 +82,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
private WeUserClient weUserClient; private WeUserClient weUserClient;
@Autowired
private IWeCustomerTrajectoryService iWeCustomerTrajectoryService;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean saveOrUpdate(WeCustomer weCustomer) { public boolean saveOrUpdate(WeCustomer weCustomer) {
...@@ -346,7 +351,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -346,7 +351,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
//查询出当前用户对应的 //查询出当前用户对应的
List<WeFlowerCustomerRel> flowerCustomerRels = iWeFlowerCustomerRelService.list(new LambdaQueryWrapper<WeFlowerCustomerRel>() List<WeFlowerCustomerRel> flowerCustomerRels = iWeFlowerCustomerRelService.list(new LambdaQueryWrapper<WeFlowerCustomerRel>()
.eq(WeFlowerCustomerRel::getExternalUserid, weMakeCustomerTag.getExternalUserid())); .eq(WeFlowerCustomerRel::getExternalUserid, weMakeCustomerTag.getExternalUserid())
.eq(WeFlowerCustomerRel::getUserId,weMakeCustomerTag.getUserId())
);
if (CollectionUtil.isNotEmpty(flowerCustomerRels)) { if (CollectionUtil.isNotEmpty(flowerCustomerRels)) {
...@@ -398,6 +405,12 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -398,6 +405,12 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
} }
} }
} }
iWeCustomerTrajectoryService.inforMationNews(weMakeCustomerTag.getUserId(),weMakeCustomerTag.getExternalUserid(),
TrajectorySceneType.TRAJECTORY_TYPE_XXDT_SZBQ.getKey());
} }
...@@ -684,15 +697,14 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -684,15 +697,14 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
this.updateById( this.updateById(
weCustomer weCustomer
); );
WeFlowerCustomerRel weFlowerCustomerRel = WeFlowerCustomerRel.builder().build(); WeFlowerCustomerRel weFlowerCustomerRel = WeFlowerCustomerRel.builder().build();
BeanUtils.copyBeanProp(weFlowerCustomerRel,weCustomerPortrait); BeanUtils.copyBeanProp(weFlowerCustomerRel,weCustomerPortrait);
//更新企业添加人表 //更新企业添加人表
iWeFlowerCustomerRelService.update(weFlowerCustomerRel,new LambdaQueryWrapper<WeFlowerCustomerRel>() iWeFlowerCustomerRelService.update(weFlowerCustomerRel,new LambdaQueryWrapper<WeFlowerCustomerRel>()
.eq(WeFlowerCustomerRel::getExternalUserid,weCustomerPortrait.getExternalUserid()) .eq(WeFlowerCustomerRel::getExternalUserid,weCustomerPortrait.getExternalUserid())
.eq(WeFlowerCustomerRel::getUserId,weCustomerPortrait.getUserId())); .eq(WeFlowerCustomerRel::getUserId,weCustomerPortrait.getUserId()));
//添加轨迹内容(信息动态)
iWeCustomerTrajectoryService.inforMationNews(weCustomerPortrait.getUserId(),weCustomerPortrait.getExternalUserid(), TrajectorySceneType.TRAJECTORY_TYPE_XXDT_BCZL.getKey());
} }
......
...@@ -6,10 +6,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -6,10 +6,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.common.constant.Constants; import com.linkwechat.common.constant.Constants;
import com.linkwechat.common.enums.MediaType; import com.linkwechat.common.enums.MediaType;
import com.linkwechat.common.enums.MessageType; import com.linkwechat.common.enums.MessageType;
import com.linkwechat.common.enums.TrajectorySceneType;
import com.linkwechat.common.enums.TrajectoryType;
import com.linkwechat.wecom.client.WeCustomerMessagePushClient; import com.linkwechat.wecom.client.WeCustomerMessagePushClient;
import com.linkwechat.wecom.client.WeMessagePushClient; import com.linkwechat.wecom.client.WeMessagePushClient;
import com.linkwechat.wecom.domain.WeCustomer; import com.linkwechat.wecom.domain.WeCustomer;
import com.linkwechat.wecom.domain.WeCustomerTrajectory; import com.linkwechat.wecom.domain.WeCustomerTrajectory;
import com.linkwechat.wecom.domain.WeUser;
import com.linkwechat.wecom.domain.dto.WeMessagePushDto; import com.linkwechat.wecom.domain.dto.WeMessagePushDto;
import com.linkwechat.wecom.domain.dto.message.TextMessageDto; import com.linkwechat.wecom.domain.dto.message.TextMessageDto;
import com.linkwechat.wecom.domain.dto.message.WeCustomerMessagePushDto; import com.linkwechat.wecom.domain.dto.message.WeCustomerMessagePushDto;
...@@ -17,7 +20,9 @@ import com.linkwechat.wecom.mapper.WeCustomerTrajectoryMapper; ...@@ -17,7 +20,9 @@ import com.linkwechat.wecom.mapper.WeCustomerTrajectoryMapper;
import com.linkwechat.wecom.service.IWeCustomerMessageService; import com.linkwechat.wecom.service.IWeCustomerMessageService;
import com.linkwechat.wecom.service.IWeCustomerService; import com.linkwechat.wecom.service.IWeCustomerService;
import com.linkwechat.wecom.service.IWeCustomerTrajectoryService; import com.linkwechat.wecom.service.IWeCustomerTrajectoryService;
import com.linkwechat.wecom.service.IWeUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
...@@ -37,6 +42,11 @@ public class WeCustomerTrajectoryServiceImpl extends ServiceImpl<WeCustomerTraje ...@@ -37,6 +42,11 @@ public class WeCustomerTrajectoryServiceImpl extends ServiceImpl<WeCustomerTraje
@Autowired @Autowired
private IWeCustomerService iWeCustomerService; private IWeCustomerService iWeCustomerService;
@Autowired
private IWeUserService iWeUserService;
/** /**
* 待办理处理通知 * 待办理处理通知
*/ */
...@@ -69,7 +79,31 @@ public class WeCustomerTrajectoryServiceImpl extends ServiceImpl<WeCustomerTraje ...@@ -69,7 +79,31 @@ public class WeCustomerTrajectoryServiceImpl extends ServiceImpl<WeCustomerTraje
}); });
} }
}
/**
* 信息动态编辑
* @param userId
* @param externalUserid
* @param trajectoryType
*/
@Override
public void inforMationNews(String userId, String externalUserid, Integer trajectoryType) {
WeUser weUser = iWeUserService.getById(userId);
if(null != weUser){
this.save(
WeCustomerTrajectory.builder()
.externalUserid(externalUserid)
.trajectoryType(TrajectoryType.TRAJECTORY_TYPE_XXDT.getType())
.userId(userId)
.content(
TrajectorySceneType.TRAJECTORY_TYPE_XXDT_BCZL.getKey().equals(trajectoryType)?
"员工"+weUser.getName()+"编辑了当前客户信息":"员工"+weUser.getName()+"编辑了当前客户标签"
).build()
);
}
} }
} }
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
wcm.content, wcm.content,
wcm.chat_type, wcm.chat_type,
wcm.setting_time, wcm.setting_time,
wcm.expect_send, (SELECT count(*) FROM `we_customer_messgaeResult` wcmr where wcmr.message_id=wcm.message_id and `status` !=2) as expect_send,
(SELECT count(*) FROM `we_customer_messgaeResult` wcmr where wcmr.message_id=wcm.message_id and `status`=1) as actual_send, (SELECT count(*) FROM `we_customer_messgaeResult` wcmr where wcmr.message_id=wcm.message_id and `status`=1) as actual_send,
wcm.timed_task, wcm.timed_task,
wcm.msgid, wcm.msgid,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!