设置信息时增加影像类型及影像类型描述字段

This commit is contained in:
cuizhibin 2025-07-24 09:33:05 +08:00
parent 748067961f
commit 3c7f8a22d7
6 changed files with 27 additions and 3 deletions

View File

@ -112,6 +112,10 @@ public class ImageEntity extends AuditableEntity implements Serializable {
@TableField("image_type")
private String imageType;
@ApiModelProperty("影像类型描述")
@TableField("image_type_label")
private String imageTypeLabel;
@ApiModelProperty("图片路径")
@TableField("image_path")
private String imagePath;

View File

@ -63,6 +63,12 @@ public class ImageCollectReq implements Serializable {
@ApiModelProperty("来源")
private String imageSource;
@ApiModelProperty("图片类型")
private String imageType;
@ApiModelProperty("图片类型描述")
private String imageTypeLabel;
@ApiModelProperty("图像信息")
private List<ImageReq> imageList;
}

View File

@ -46,4 +46,10 @@ public class ImageResp implements Serializable {
@ApiModelProperty("是否已审核0未审核1已审核")
private Boolean reviewState;
@ApiModelProperty("影像类型,枚举ImageTypeEnum")
private String imageType;
@ApiModelProperty("影像类型描述")
private String imageTypeLabel;
}

View File

@ -57,6 +57,8 @@ public class ImageCollectServiceImpl extends ServiceImpl<ImageCollectMapper, Ima
imageList.forEach(image -> {
image.setPartId(partId);
image.setCollectId(imageCollect.getCollectId());
image.setImageType(req.getImageType());
image.setImageTypeLabel(req.getImageTypeLabel());
String path = permPathPrefix + image.getImageName();
File file = new File(temPathPrefix.concat(image.getImageName()));
if (file.exists()) {

View File

@ -77,7 +77,9 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
resp.setAudioList(BeanUtil.copyToList(audioMap.get(resp.getImageId()), AudioFileInfoResp.class));
resp.setWeatherLabel(WeatherEnum.getDescByCode(resp.getWeather()));
resp.setShootingMethodLabel(ShootingMethodEnum.getDescByCode(resp.getShootingMethod()));
resp.setImageTypeLabel(ImageTypeEnum.getDescByCode(resp.getImageType()));
if (StrUtil.isEmpty(resp.getImageTypeLabel())) {
resp.setImageTypeLabel(ImageTypeEnum.getDescByCode(resp.getImageType()));
}
resp.setImageSourceLabel(ImageSourceEnum.getDescByCode(resp.getImageSource()));
});
}
@ -167,6 +169,8 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
imageEntity.setImagePath(FilePathEnum.IMAGE_TEMP.getFileDownPath(path));
imageEntity.setPartId(partId);
imageEntity.setCollectId(imageCollect.getCollectId());
imageEntity.setImageType(collectReq.getImageType());
imageEntity.setImageTypeLabel(collectReq.getImageTypeLabel());
imageList.add(imageEntity);
} catch (Exception e) {
e.printStackTrace();

View File

@ -5,7 +5,7 @@
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.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.image_source, i.review_state
ic.shooting_method, ic.shooting_distance,ic.collector_name, i.image_type, i.image_path, ic.image_source, i.review_state, i.image_type_label
FROM image i
LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id
LEFT JOIN part p ON i.part_id = p.part_id
@ -35,6 +35,8 @@
<result property="imageSize" column="image_size"></result>
<result property="imageResolution" column="image_resolution"></result>
<result property="reviewState" column="review_state"></result>
<result property="imageType" column="image_type"></result>
<result property="imageTypeLabel" column="image_type_label"></result>
<association property="imageExifInfo">
<result property="imageWidth" column="image_width"></result>
<result property="imageHeight" column="image_height"></result>
@ -68,7 +70,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,
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,
ic.wind_level, ic.shooting_method, ic.shooting_distance, ic.collector_name, ic.image_source, i.review_state
ic.wind_level, ic.shooting_method, ic.shooting_distance, ic.collector_name, ic.image_source, i.review_state, i.image_type, i.image_type_label
FROM image i
LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id
WHERE i.image_id = #{imageId}