航线图片地址优化
This commit is contained in:
parent
92553d35be
commit
87f0333f0e
|
|
@ -77,4 +77,5 @@ public interface BusinessConstant {
|
|||
String TCP_PROTOCOL = "tcp://";
|
||||
String DRC = "drc_";
|
||||
String FILE_PATH = "file/";
|
||||
String IMAGE_PATH = "image/";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class RouteController {
|
|||
})
|
||||
@RequiresPermissions("bus:route:page")
|
||||
public Result<PageData<RouteDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params) {
|
||||
PageData<RouteDTO> page = routeService.page(params);
|
||||
PageData<RouteDTO> page = routeService.pageList(params);
|
||||
|
||||
return new Result<PageData<RouteDTO>>().ok(page);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
package com.multictrl.modules.business.service;
|
||||
|
||||
import com.multictrl.common.page.PageData;
|
||||
import com.multictrl.common.service.CrudService;
|
||||
import com.multictrl.modules.business.dto.RouteDTO;
|
||||
import com.multictrl.modules.business.entity.RouteEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 航线信息表
|
||||
*
|
||||
|
|
@ -12,6 +15,9 @@ import com.multictrl.modules.business.entity.RouteEntity;
|
|||
*/
|
||||
public interface RouteService extends CrudService<RouteEntity, RouteDTO> {
|
||||
|
||||
//分页查询
|
||||
PageData<RouteDTO> pageList(Map<String, Object> params);
|
||||
|
||||
//新增航线
|
||||
void saveRoute(RouteDTO routeDTO);
|
||||
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ public class MinioServiceImpl implements MinioService {
|
|||
throw new RenException(ErrorCode.OSS_UPLOAD_FILE_ERROR, file.getOriginalFilename());
|
||||
}
|
||||
|
||||
return BusinessConstant.ROUTE_IMG_BUCKET + "/" + path;
|
||||
return BusinessConstant.IMAGE_PATH + BusinessConstant.ROUTE_IMG_BUCKET + "/" + path;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import com.multictrl.common.constant.BusinessConstant;
|
||||
import com.multictrl.common.exception.ErrorCode;
|
||||
import com.multictrl.common.page.PageData;
|
||||
import com.multictrl.common.service.impl.CrudServiceImpl;
|
||||
import com.multictrl.common.utils.ConvertUtils;
|
||||
import com.multictrl.common.utils.kmz.KmzUtils;
|
||||
|
|
@ -57,6 +58,15 @@ public class RouteServiceImpl extends CrudServiceImpl<RouteDao, RouteEntity, Rou
|
|||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageData<RouteDTO> pageList(Map<String, Object> params) {
|
||||
PageData<RouteDTO> page = page(params);
|
||||
for (RouteDTO dto : page.getList()) {
|
||||
dto.setImgUrl(BusinessConstant.IMAGE_PATH + dto.getImgUrl());
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void saveRoute(RouteDTO routeDTO) {
|
||||
|
|
@ -73,6 +83,8 @@ public class RouteServiceImpl extends CrudServiceImpl<RouteDao, RouteEntity, Rou
|
|||
routeEntity.setKmzUrl(kmzUrl);
|
||||
routeEntity.setDeptId(SecurityUser.getDeptId());
|
||||
routeEntity.setWaypointNum(routeWaypointList.size());
|
||||
String imgUrl = routeDTO.getImgUrl();
|
||||
routeEntity.setImgUrl(imgUrl.replaceAll(BusinessConstant.IMAGE_PATH, ""));
|
||||
baseDao.insert(routeEntity);
|
||||
|
||||
//保存航点信息
|
||||
|
|
@ -98,6 +110,8 @@ public class RouteServiceImpl extends CrudServiceImpl<RouteDao, RouteEntity, Rou
|
|||
RouteEntity entity = selectById(routeId);
|
||||
routeEntity.setDeptId(entity.getDeptId());
|
||||
routeEntity.setWaypointNum(routeWaypointList.size());
|
||||
String imgUrl = routeDTO.getImgUrl();
|
||||
routeEntity.setImgUrl(imgUrl.replaceAll(BusinessConstant.IMAGE_PATH, ""));
|
||||
updateById(routeEntity);
|
||||
|
||||
//删除历史航点及航点动作
|
||||
|
|
|
|||
Loading…
Reference in New Issue