@@ -24,6 +24,10 @@ public class CommonConfig { | |||
* 高德KEY | |||
*/ | |||
public static String gaodeKey; | |||
/** | |||
* 图片域名 | |||
*/ | |||
public static String imageURL; | |||
/** | |||
* 机场url | |||
@@ -52,4 +56,14 @@ public class CommonConfig { | |||
public void setGaodeKey(String key) { | |||
gaodeKey = key; | |||
} | |||
/** | |||
* 图片域名赋值 | |||
* | |||
* @param url 域名地址 | |||
*/ | |||
@Value("${tuoheng.image-url}") | |||
public void setImageUrl(String url) { | |||
imageURL = url; | |||
} | |||
} |
@@ -119,9 +119,6 @@ public class InspectionFile implements Serializable { | |||
*/ | |||
private String questionId; | |||
@TableField(exist = false) | |||
private static final long serialVersionUID = 1L; | |||
} |
@@ -1,10 +1,12 @@ | |||
package com.tuoheng.service.information.impl; | |||
import cn.hutool.core.convert.Convert; | |||
import cn.hutool.core.util.ObjectUtil; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.tuoheng.common.CommonConfig; | |||
import com.tuoheng.enums.MarkTypeEnum; | |||
import com.tuoheng.model.entity.Inspection; | |||
import com.tuoheng.model.entity.InspectionFile; | |||
@@ -46,6 +48,20 @@ public class InspectionFileServiceImpl extends ServiceImpl<InspectionFileMapper, | |||
.eq(ObjectUtil.isNotEmpty(query.getClientId()), InspectionFile::getClientId, query.getClientId()) | |||
.eq(InspectionFile::getMark, MarkTypeEnum.VALID.getCode()) | |||
.orderByDesc(InspectionFile::getCreateTime)); | |||
//问题图片带域名 | |||
pageDate.convert(item -> { | |||
InspectionFile inspectionFile = Convert.convert(InspectionFile.class, item); | |||
if (ObjectUtil.isNotEmpty(item.getFileOriginal())) { | |||
inspectionFile.setFileOriginal(CommonConfig.imageURL + item.getFileOriginal()); | |||
} | |||
if (ObjectUtil.isNotEmpty(item.getFileImage())) { | |||
inspectionFile.setFileImage(CommonConfig.imageURL + item.getFileImage()); | |||
} | |||
if (ObjectUtil.isNotEmpty(item.getFileThumbnail())) { | |||
inspectionFile.setFileThumbnail(CommonConfig.imageURL + item.getFileThumbnail()); | |||
} | |||
return inspectionFile; | |||
}); | |||
return JsonResult.success(pageDate); | |||
} |
@@ -40,7 +40,7 @@ public class InspectionServiceImpl extends ServiceImpl<InspectionMapper, Inspect | |||
//分页校验 | |||
query.checkParam(); | |||
//分页 | |||
IPage<Inspection> page = new Page<>(query.getPage(), query.getLimit()); | |||
IPage<Inspection> page = new Page <>(query.getPage(), query.getLimit()); | |||
IPage<Inspection> pageDate = inspectionMapper.selectPage(page, Wrappers.<Inspection>lambdaQuery() | |||
.like(ObjectUtil.isNotEmpty(query.getName()), Inspection::getName, query.getName()) |
@@ -73,4 +73,6 @@ tuoheng: | |||
#dsp配置地址 | |||
dsp-url: http://106.15.64.139:7011/api/web/dsp | |||
# 高德Key | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
# 图片域名 | |||
image-url: https://image.t-aaron.com/ |
@@ -72,4 +72,6 @@ tuoheng: | |||
#dsp配置地址 | |||
dsp-url: https://dsp-portal.t-aaron.com/api/web/dsp | |||
# 高德Key | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
# 图片域名 | |||
image-url: https://image.t-aaron.com/ |
@@ -72,4 +72,6 @@ tuoheng: | |||
#dsp配置地址 | |||
dsp-url: http://106.15.64.139:7011/api/web/dsp | |||
# 高德Key | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
# 图片域名 | |||
image-url: https://image.t-aaron.com/ |