Commit eba1295c by 阳浪

咨询查询所有

parent 8f16b596
...@@ -52,16 +52,21 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -52,16 +52,21 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
public void addEvent(String type,Long businessId){ public void addEvent(String type,Long businessId){
logger.info("新增埋点{},{}",type,businessId); logger.info("新增埋点{},{}",type,businessId);
RequestContext context = ContextHolder.get(); RequestContext context = ContextHolder.get();
Long userId = context.getAccountId();
if(Objects.equals(type,"event_login")){
userId = businessId;
ContextHolder.get().setAccountId(userId);
}
EventTrack eventTrack = new EventTrack(); EventTrack eventTrack = new EventTrack();
Date toDay = new Date(); Date toDay = new Date();
eventTrack.setBusinessId(businessId); eventTrack.setBusinessId(businessId);
eventTrack.setCreateById(context.getAccountId()); eventTrack.setCreateById(userId);
eventTrack.setCreateByName(context.getAccountName()); eventTrack.setCreateByName(context.getAccountName());
eventTrack.setCreateTime(toDay); eventTrack.setCreateTime(toDay);
eventTrack.setUpdateById(context.getAccountId()); eventTrack.setUpdateById(userId);
eventTrack.setUpdateByName(context.getAccountName()); eventTrack.setUpdateByName(context.getAccountName());
eventTrack.setUpdateTime(toDay); eventTrack.setUpdateTime(toDay);
AuthzUserGroupVo authzUserGroupVo = leaveWordClient.getAuthzUserGroup(); AuthzUserGroupVo authzUserGroupVo = leaveWordClient.getAuthzUserGroup(userId);
if(authzUserGroupVo!=null){ if(authzUserGroupVo!=null){
eventTrack.setDeptId(authzUserGroupVo.getId()); eventTrack.setDeptId(authzUserGroupVo.getId());
eventTrack.setDeptName(authzUserGroupVo.getName()); eventTrack.setDeptName(authzUserGroupVo.getName());
...@@ -69,7 +74,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr ...@@ -69,7 +74,7 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
String key = "event_track_type"; String key = "event_track_type";
List<Dictionary> dictionaryList = dictionaryFeignClients.listChildDictionary(key,false,1); List<Dictionary> dictionaryList = dictionaryFeignClients.listChildDictionary(key,false,1);
if(CollUtil.isNotEmpty(dictionaryList)){ if(CollUtil.isNotEmpty(dictionaryList)){
Optional<Dictionary> optional = dictionaryList.stream().filter(d-> Objects.equals(d.getCode(),key+"_"+type)).findFirst(); Optional<Dictionary> optional = dictionaryList.stream().filter(d-> Objects.equals(d.getCode(),type)).findFirst();
if(optional!=null&&optional.isPresent()){ if(optional!=null&&optional.isPresent()){
Dictionary dictionary = optional.get(); Dictionary dictionary = optional.get();
eventTrack.setSubType(dictionary.getCnName()); eventTrack.setSubType(dictionary.getCnName());
......
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