| | |
| | | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.dto.operation.PointMapQuery; |
| | |
| | | import com.xiaopeng.common.core.constant.CacheConstants; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import com.xiaopeng.evi.oss.service.AliOssService; |
| | | import com.xiaopeng.operation.dto.NearestDto; |
| | | import com.xiaopeng.operation.mapper.XpPointMapper; |
| | | import com.xiaopeng.operation.mapper.XpSystemSettingMapper; |
| | |
| | | import com.xiaopeng.operation.vo.NearestNextVo; |
| | | import com.xiaopeng.operation.vo.NearestVo; |
| | | import com.xiaopeng.operation.vo.OrderDistanceVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private IXpElectronicFenceService xpElectronicFenceService; |
| | | |
| | | @Autowired |
| | | private AliOssService aliOssService; |
| | | |
| | | @Override |
| | | public NearestVo nearest(NearestDto dto) { |
| | |
| | | query.setOperationStatusIds(statusIds); |
| | | } |
| | | List<XpPoint> list = this.baseMapper.listAll(query); |
| | | for (XpPoint xpPoint : list) { |
| | | if (StringUtils.hasLength(xpPoint.getPointPictures())) { |
| | | JSONObject jsonObject = JSONObject.parseObject(xpPoint.getPointPictures()); |
| | | if(jsonObject!=null){ |
| | | String downloadUrl = null; |
| | | try { |
| | | // 1 |
| | | downloadUrl= aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | xpPoint.setPointPictures(jsonObject.toJSONString()); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |