客户详情相关bug

1 parent 24bbc068
...@@ -210,6 +210,10 @@ public class WeCustomerController extends BaseController ...@@ -210,6 +210,10 @@ public class WeCustomerController extends BaseController
List<WeCustomerTrajectory> weCustomerTrajectories = iWeCustomerTrajectoryService List<WeCustomerTrajectory> weCustomerTrajectories = iWeCustomerTrajectoryService
.followUpRecord(externalUserid, userId, trajectoryType); .followUpRecord(externalUserid, userId, trajectoryType);
TableDataInfo dataTable = getDataTable(weCustomerTrajectories);
dataTable.setLastSyncTime(
iWeSynchRecordService.findUpdateLatestTime(SynchRecordConstants.SYNCH_MOMENTS_INTERACTE)
);//最近同步时间
return getDataTable(weCustomerTrajectories); return getDataTable(weCustomerTrajectories);
} }
......
...@@ -11,4 +11,5 @@ public class SynchRecordConstants { ...@@ -11,4 +11,5 @@ public class SynchRecordConstants {
public static final int SYNCH_CUSTOMER_PERSON_MOMENTS=4;//个人朋友圈 public static final int SYNCH_CUSTOMER_PERSON_MOMENTS=4;//个人朋友圈
public static final int SYNCH_CUSTOMER_ENTERPRISE_MOMENTS=5;//企业朋友圈 public static final int SYNCH_CUSTOMER_ENTERPRISE_MOMENTS=5;//企业朋友圈
public static final int SYNCH_CUSTOMER_TAG=6;//企业标签同步 public static final int SYNCH_CUSTOMER_TAG=6;//企业标签同步
public static final int SYNCH_MOMENTS_INTERACTE=7;//同步指定员工个人朋友圈互动情况
} }
...@@ -322,34 +322,44 @@ public class WeMomentsServiceImpl extends ServiceImpl<WeMomentsMapper, WeMoments ...@@ -322,34 +322,44 @@ public class WeMomentsServiceImpl extends ServiceImpl<WeMomentsMapper, WeMoments
* @param userIds * @param userIds
*/ */
@Override @Override
@Async @SynchRecord(synchType = SynchRecordConstants.SYNCH_MOMENTS_INTERACTE)
public void synchMomentsInteracte(List<String> userIds) { public void synchMomentsInteracte(List<String> userIds) {
if(CollectionUtil.isNotEmpty(userIds)){ SecurityContext securityContext = SecurityContextHolder.getContext();
userIds.stream().forEach(userId->{
//异步同步一下标签库,解决标签不同步问题
Threads.SINGLE_THREAD_POOL.execute(new Runnable() {
@Override
public void run() {
if(CollectionUtil.isNotEmpty(userIds)){
userIds.stream().forEach(userId->{
List<WeMoments> weMoments = list(new LambdaQueryWrapper<WeMoments>()
.apply(StringUtils.isNotEmpty(userId), "FIND_IN_SET('" + userId + "',add_user)")
.eq(WeMoments::getType,1)
.eq(WeMoments::getDelFlag, WeConstans.WE_SUCCESS_CODE));
if(CollectionUtil.isNotEmpty(weMoments)){
List<WeMomentsInteracte> interactes=new ArrayList<>();
weMoments.stream().forEach(moment->{
interactes.addAll(
getInteracte(moment.getMomentId(), moment.getCreator())
);
});
if(CollectionUtil.isNotEmpty(interactes)){
weMomentsInteracteService.batchAddOrUpdate(interactes);
}
}
List<WeMoments> weMoments = this.list(new LambdaQueryWrapper<WeMoments>()
.apply(StringUtils.isNotEmpty(userId), "FIND_IN_SET('" + userId + "',add_user)")
.eq(WeMoments::getType,1)
.eq(WeMoments::getDelFlag, WeConstans.WE_SUCCESS_CODE));
if(CollectionUtil.isNotEmpty(weMoments)){
List<WeMomentsInteracte> interactes=new ArrayList<>();
weMoments.stream().forEach(moment->{
interactes.addAll(
getInteracte(moment.getMomentId(), moment.getCreator())
);
});
if(CollectionUtil.isNotEmpty(interactes)){
weMomentsInteracteService.batchAddOrUpdate(interactes);
}
}
});
}
}); }
});
}
} }
......
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
wu.user_id, wu.user_id,
wu.user_name, wu.user_name,
wct.track_time, wct.track_time,
wct.track_state wct.track_state,
wct.title
FROM FROM
we_customer_trajectory wct we_customer_trajectory wct
LEFT JOIN we_user wu ON wu.user_id = wct.user_id LEFT JOIN we_user wu ON wu.user_id = wct.user_id
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!