字典图片、机库图片优化
This commit is contained in:
parent
6d9bd5a7ca
commit
4f4a110765
|
|
@ -7,7 +7,7 @@ import lombok.Getter;
|
|||
@Getter
|
||||
public enum DJIImage {
|
||||
DJI("DJI", "source-material/dji.png"),
|
||||
DOCK1("DJI Dock1", "source-material/dock1.png"),
|
||||
DOCK1("DJI Dock", "source-material/dock1.png"),
|
||||
DOCK2("DJI Dock2", "source-material/dock2.png"),
|
||||
DOCK3("DJI Dock3", "source-material/dock3.png");
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
@RestController
|
||||
@RequestMapping("business/q20/cmd")
|
||||
@Tag(name = "Q20控制指令")
|
||||
@ApiOrder(12)
|
||||
@ApiOrder(102)
|
||||
@RequiredArgsConstructor
|
||||
public class Q20CommandController {
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import java.util.List;
|
|||
@RestController
|
||||
@RequestMapping("business/q20")
|
||||
@Tag(name = "Q20飞机管理")
|
||||
@ApiOrder(10)
|
||||
@ApiOrder(100)
|
||||
@RequiredArgsConstructor
|
||||
public class Q20Controller {
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.multictrl.modules.business.q20.controller;
|
|||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.multictrl.common.annotation.ApiOrder;
|
||||
import com.multictrl.common.exception.RenException;
|
||||
import com.multictrl.common.utils.Result;
|
||||
import com.multictrl.modules.business.service.DJIBaseService;
|
||||
|
|
@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
@RestController
|
||||
@RequestMapping("business/q20/mock")
|
||||
@Tag(name = "Q20 MQTT模拟(测试)")
|
||||
@ApiOrder(104)
|
||||
@RequiredArgsConstructor
|
||||
public class Q20MockController {
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
@RestController
|
||||
@RequestMapping("business/q20/param")
|
||||
@Tag(name = "Q20参数指令")
|
||||
@ApiOrder(11)
|
||||
@ApiOrder(101)
|
||||
@RequiredArgsConstructor
|
||||
public class Q20ParamController {
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import java.util.Map;
|
|||
@RestController
|
||||
@RequestMapping("business/q20/route")
|
||||
@Tag(name = "Q20航线任务")
|
||||
@ApiOrder(13)
|
||||
@ApiOrder(103)
|
||||
@RequiredArgsConstructor
|
||||
public class Q20RouteController {
|
||||
|
||||
|
|
|
|||
|
|
@ -110,10 +110,10 @@ public class DockServiceImpl extends CrudServiceImpl<DockDao, DockEntity, DockDT
|
|||
dockDTO.setDockModel(dockDevice.getDeviceName());
|
||||
}
|
||||
} else {
|
||||
String dockMode = dockDTO.getDockMode();
|
||||
String dockModel = dockDTO.getDockModel();
|
||||
List<SysDictDataEntity> list = dictDataDao.selectList(new QueryWrapper<SysDictDataEntity>()
|
||||
.eq("dict_value", dockMode).orderByAsc("create_date"));
|
||||
if (list != null) {
|
||||
.eq("dict_value", dockModel).orderByAsc("create_date"));
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
dockDTO.setImgUrl(BusinessConstant.IMAGE_PATH + list.get(0).getImageUrl());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,12 @@ public class SysDictDataServiceImpl extends BaseServiceImpl<SysDictDataDao, SysD
|
|||
getPage(params, "sort", true),
|
||||
getWrapper(params)
|
||||
);
|
||||
for (SysDictDataEntity record : page.getRecords()) {
|
||||
String imageUrl = record.getImageUrl();
|
||||
if (StrUtil.isNotBlank(imageUrl)) {
|
||||
record.setImageUrl(BusinessConstant.IMAGE_PATH + imageUrl);
|
||||
}
|
||||
}
|
||||
|
||||
return getPageData(page, SysDictDataDTO.class);
|
||||
}
|
||||
|
|
@ -58,6 +64,10 @@ public class SysDictDataServiceImpl extends BaseServiceImpl<SysDictDataDao, SysD
|
|||
@Override
|
||||
public SysDictDataDTO get(Long id) {
|
||||
SysDictDataEntity entity = baseDao.selectById(id);
|
||||
String imageUrl = entity.getImageUrl();
|
||||
if (StrUtil.isNotBlank(imageUrl)) {
|
||||
entity.setImageUrl(BusinessConstant.IMAGE_PATH + imageUrl);
|
||||
}
|
||||
|
||||
return ConvertUtils.sourceToTarget(entity, SysDictDataDTO.class);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue