|
@@ -1,12 +1,7 @@
|
|
|
package cn.com.ty.lift.ud.motiontrail.service.impl;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -109,8 +104,8 @@ public class MotionTrailServiceImpl extends ServiceImpl<MotionTrailMapper, Motio
|
|
|
}
|
|
|
List<MotionTrail> queryTrailByTeam = motionTrailMapper.queryTrailByTeam(request.getMtCompanyId());
|
|
|
for (MotionTrail mt : queryTrailByTeam) {
|
|
|
- UserInfoEntity byUserId = userInfoMapper.getByUserId(mt.getUserId());
|
|
|
- mt.setUserInfo(byUserId);
|
|
|
+ UserInfoEntity userInfo = Optional.ofNullable(userInfoMapper.getByUserId(mt.getUserId())).orElse(new UserInfoEntity());
|
|
|
+ mt.setUserInfo(userInfo);
|
|
|
}
|
|
|
Map<String, List> rst = new HashMap<>();
|
|
|
List polylines = new ArrayList();
|
|
@@ -124,6 +119,8 @@ public class MotionTrailServiceImpl extends ServiceImpl<MotionTrailMapper, Motio
|
|
|
Map temp = new HashMap();
|
|
|
temp.put("position", mark);
|
|
|
temp.put("text", sdf.format(item.getCreateTime()));
|
|
|
+ temp.put("avatarUrl", item.getUserInfo().getAvatarUrl());
|
|
|
+ temp.put("name",item.getUserInfo().getName());
|
|
|
texts.add(temp);
|
|
|
});
|
|
|
rst.put("polylines", polylines);
|