图片增加来源
This commit is contained in:
parent
14ba8266fa
commit
4373fb4374
|
@ -75,4 +75,8 @@ public class ImageCollectEntity extends AuditableEntity implements Serializable
|
||||||
@ApiModelProperty("采集员姓名")
|
@ApiModelProperty("采集员姓名")
|
||||||
@TableField("collector_name")
|
@TableField("collector_name")
|
||||||
private String collectorName;
|
private String collectorName;
|
||||||
|
|
||||||
|
@ApiModelProperty("来源")
|
||||||
|
@TableField("image_source")
|
||||||
|
private String imageSource;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,4 +47,10 @@ public class ImageCollectInfo implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty("采集员姓名")
|
@ApiModelProperty("采集员姓名")
|
||||||
private String collectorName;
|
private String collectorName;
|
||||||
|
|
||||||
|
@ApiModelProperty("来源")
|
||||||
|
private String imageSource;
|
||||||
|
|
||||||
|
@ApiModelProperty("来源描述")
|
||||||
|
private String imageSourceLabel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,9 @@ public class ImageCollectReq implements Serializable {
|
||||||
@ApiModelProperty("采集员姓名")
|
@ApiModelProperty("采集员姓名")
|
||||||
private String collectorName;
|
private String collectorName;
|
||||||
|
|
||||||
|
@ApiModelProperty("来源")
|
||||||
|
private String imageSource;
|
||||||
|
|
||||||
@ApiModelProperty("图像信息")
|
@ApiModelProperty("图像信息")
|
||||||
private List<ImageReq> imageList;
|
private List<ImageReq> imageList;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,12 @@ public class ImageListResp implements Serializable {
|
||||||
@ApiModelProperty("采集员姓名")
|
@ApiModelProperty("采集员姓名")
|
||||||
private String collectorName;
|
private String collectorName;
|
||||||
|
|
||||||
|
@ApiModelProperty("来源,枚举ImageSourceEnum")
|
||||||
|
private String imageSource;
|
||||||
|
|
||||||
|
@ApiModelProperty("来源描述")
|
||||||
|
private String imageSourceLabel;
|
||||||
|
|
||||||
@ApiModelProperty("影像类型,枚举ImageTypeEnum")
|
@ApiModelProperty("影像类型,枚举ImageTypeEnum")
|
||||||
private String imageType;
|
private String imageType;
|
||||||
|
|
||||||
|
|
|
@ -69,18 +69,19 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ImageListResp> list(ImageListReq req) {
|
public List<ImageListResp> list(ImageListReq req) {
|
||||||
List<ImageListResp> partList= this.baseMapper.queryImageList(req);
|
List<ImageListResp> list = this.baseMapper.queryImageList(req);
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
Map<String, List<AudioFileInfoResp>> audioMap = audioFileInfoService.selectByImageIds(partList.stream().map(ImageListResp::getImageId).collect(Collectors.toList()))
|
Map<String, List<AudioFileInfoResp>> audioMap = audioFileInfoService.selectByImageIds(list.stream().map(ImageListResp::getImageId).collect(Collectors.toList()))
|
||||||
.stream().collect(Collectors.groupingBy(AudioFileInfoResp::getImageId));
|
.stream().collect(Collectors.groupingBy(AudioFileInfoResp::getImageId));
|
||||||
partList.forEach(resp -> {
|
list.forEach(resp -> {
|
||||||
resp.setAudioList(BeanUtil.copyToList(audioMap.get(resp.getImageId()), AudioFileInfoResp.class));
|
resp.setAudioList(BeanUtil.copyToList(audioMap.get(resp.getImageId()), AudioFileInfoResp.class));
|
||||||
resp.setWeatherLabel(WeatherEnum.getDescByCode(resp.getWeather()));
|
resp.setWeatherLabel(WeatherEnum.getDescByCode(resp.getWeather()));
|
||||||
resp.setShootingMethodLabel(ShootingMethodEnum.getDescByCode(resp.getShootingMethod()));
|
resp.setShootingMethodLabel(ShootingMethodEnum.getDescByCode(resp.getShootingMethod()));
|
||||||
resp.setImageTypeLabel(ImageTypeEnum.getDescByCode(resp.getImageType()));
|
resp.setImageTypeLabel(ImageTypeEnum.getDescByCode(resp.getImageType()));
|
||||||
|
resp.setImageSourceLabel(ImageSourceEnum.getDescByCode(resp.getImageSource()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return partList;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -124,6 +125,7 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
||||||
if (null != imageResp.getImageCollectInfo()) {
|
if (null != imageResp.getImageCollectInfo()) {
|
||||||
imageResp.getImageCollectInfo().setWeatherLabel(WeatherEnum.getDescByCode(imageResp.getImageCollectInfo().getWeather()));
|
imageResp.getImageCollectInfo().setWeatherLabel(WeatherEnum.getDescByCode(imageResp.getImageCollectInfo().getWeather()));
|
||||||
imageResp.getImageCollectInfo().setShootingMethodLabel(ShootingMethodEnum.getDescByCode(imageResp.getImageCollectInfo().getShootingMethodLabel()));
|
imageResp.getImageCollectInfo().setShootingMethodLabel(ShootingMethodEnum.getDescByCode(imageResp.getImageCollectInfo().getShootingMethodLabel()));
|
||||||
|
imageResp.getImageCollectInfo().setImageSourceLabel(ImageSourceEnum.getDescByCode(imageResp.getImageCollectInfo().getImageSource()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return imageResp;
|
return imageResp;
|
||||||
|
@ -150,6 +152,7 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
||||||
String temPathPrefix = FilePathEnum.IMAGE_TEMP.getFileAbsolutePathPrefix().concat(imageSource).concat(FileUtil.FILE_SEPARATOR).concat(partId).concat(FileUtil.FILE_SEPARATOR);
|
String temPathPrefix = FilePathEnum.IMAGE_TEMP.getFileAbsolutePathPrefix().concat(imageSource).concat(FileUtil.FILE_SEPARATOR).concat(partId).concat(FileUtil.FILE_SEPARATOR);
|
||||||
ImageCollectEntity imageCollect = Optional.ofNullable(BeanUtil.copyProperties(collectReq, ImageCollectEntity.class)).orElse(new ImageCollectEntity());
|
ImageCollectEntity imageCollect = Optional.ofNullable(BeanUtil.copyProperties(collectReq, ImageCollectEntity.class)).orElse(new ImageCollectEntity());
|
||||||
imageCollect.setCollectId(IdUtil.simpleUUID());
|
imageCollect.setCollectId(IdUtil.simpleUUID());
|
||||||
|
imageCollect.setImageSource(imageSource);
|
||||||
List<ImageEntity> imageList = new ArrayList<>();
|
List<ImageEntity> imageList = new ArrayList<>();
|
||||||
for (MultipartFile file : files) {
|
for (MultipartFile file : files) {
|
||||||
ImageEntity imageEntity = new ImageEntity();
|
ImageEntity imageEntity = new ImageEntity();
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
SELECT
|
SELECT
|
||||||
i.image_id, i.image_name, i.part_id, p.part_name, i.image_resolution, i.focal_distance, i.shooting_time, i.camera_manufacturer,
|
i.image_id, i.image_name, i.part_id, p.part_name, i.image_resolution, i.focal_distance, i.shooting_time, i.camera_manufacturer,
|
||||||
i.camera_model, i.GPS, ic.weather, ic.humidness, CONCAT(ic.temperature_min, '℃', '~',temperature_max, '℃') AS temperature, ic.wind_level,
|
i.camera_model, i.GPS, ic.weather, ic.humidness, CONCAT(ic.temperature_min, '℃', '~',temperature_max, '℃') AS temperature, ic.wind_level,
|
||||||
ic.shooting_method, ic.shooting_distance,ic.collector_name, i.image_type, i.image_path
|
ic.shooting_method, ic.shooting_distance,ic.collector_name, i.image_type, i.image_path, ic.image_source
|
||||||
FROM image i
|
FROM image i
|
||||||
LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id
|
LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id
|
||||||
LEFT JOIN part p ON i.part_id = p.part_id
|
LEFT JOIN part p ON i.part_id = p.part_id
|
||||||
|
@ -56,6 +56,7 @@
|
||||||
<result property="shootingMethod" column="shooting_method"></result>
|
<result property="shootingMethod" column="shooting_method"></result>
|
||||||
<result property="shootingDistance" column="shooting_distance"></result>
|
<result property="shootingDistance" column="shooting_distance"></result>
|
||||||
<result property="collectorName" column="collector_name"></result>
|
<result property="collectorName" column="collector_name"></result>
|
||||||
|
<result property="imageSource" column="image_source"></result>
|
||||||
</association>
|
</association>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
@ -63,7 +64,7 @@
|
||||||
SELECT i.image_id, i.image_name, i.image_path, i.image_height, i.image_resolution, i.image_width, i.image_height, i.focal_distance,
|
SELECT i.image_id, i.image_name, i.image_path, i.image_height, i.image_resolution, i.image_width, i.image_height, i.focal_distance,
|
||||||
i.focal_distance35, i.x_resolution, i.y_resolution, i.resolution_units, i.shooting_time, i.camera_manufacturer, i.camera_model,
|
i.focal_distance35, i.x_resolution, i.y_resolution, i.resolution_units, i.shooting_time, i.camera_manufacturer, i.camera_model,
|
||||||
i.latitude, i.latitude, i.altitude, ic.collect_id, ic.weather, CONCAT(ic.temperature_min, '℃', '~',temperature_max, '℃') AS temperature,
|
i.latitude, i.latitude, i.altitude, ic.collect_id, ic.weather, CONCAT(ic.temperature_min, '℃', '~',temperature_max, '℃') AS temperature,
|
||||||
ic.wind_level, ic.shooting_method, ic.shooting_distance, ic.collector_name
|
ic.wind_level, ic.shooting_method, ic.shooting_distance, ic.collector_name, ic.image_source
|
||||||
FROM image i
|
FROM image i
|
||||||
LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id
|
LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id
|
||||||
WHERE i.image_id = #{imageId}
|
WHERE i.image_id = #{imageId}
|
||||||
|
|
Loading…
Reference in New Issue