From 4373fb4374047f923eda126ec603468afdf2993f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E9=9B=84?= Date: Mon, 7 Jul 2025 16:44:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=A2=9E=E5=8A=A0=E6=9D=A5?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dite/znpt/domain/entity/ImageCollectEntity.java | 4 ++++ .../com/dite/znpt/domain/vo/ImageCollectInfo.java | 6 ++++++ .../com/dite/znpt/domain/vo/ImageCollectReq.java | 3 +++ .../java/com/dite/znpt/domain/vo/ImageListResp.java | 6 ++++++ .../dite/znpt/service/impl/ImageServiceImpl.java | 13 ++++++++----- core/src/main/resources/mapper/ImageMapper.xml | 5 +++-- 6 files changed, 30 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/com/dite/znpt/domain/entity/ImageCollectEntity.java b/core/src/main/java/com/dite/znpt/domain/entity/ImageCollectEntity.java index dbd7331..5321e72 100644 --- a/core/src/main/java/com/dite/znpt/domain/entity/ImageCollectEntity.java +++ b/core/src/main/java/com/dite/znpt/domain/entity/ImageCollectEntity.java @@ -75,4 +75,8 @@ public class ImageCollectEntity extends AuditableEntity implements Serializable @ApiModelProperty("采集员姓名") @TableField("collector_name") private String collectorName; + + @ApiModelProperty("来源") + @TableField("image_source") + private String imageSource; } diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ImageCollectInfo.java b/core/src/main/java/com/dite/znpt/domain/vo/ImageCollectInfo.java index 1c7811f..df0237e 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ImageCollectInfo.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ImageCollectInfo.java @@ -47,4 +47,10 @@ public class ImageCollectInfo implements Serializable { @ApiModelProperty("采集员姓名") private String collectorName; + + @ApiModelProperty("来源") + private String imageSource; + + @ApiModelProperty("来源描述") + private String imageSourceLabel; } diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ImageCollectReq.java b/core/src/main/java/com/dite/znpt/domain/vo/ImageCollectReq.java index c95417c..ec0dc60 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ImageCollectReq.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ImageCollectReq.java @@ -60,6 +60,9 @@ public class ImageCollectReq implements Serializable { @ApiModelProperty("采集员姓名") private String collectorName; + @ApiModelProperty("来源") + private String imageSource; + @ApiModelProperty("图像信息") private List imageList; } diff --git a/core/src/main/java/com/dite/znpt/domain/vo/ImageListResp.java b/core/src/main/java/com/dite/znpt/domain/vo/ImageListResp.java index 5be2861..771dd3a 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/ImageListResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/ImageListResp.java @@ -83,6 +83,12 @@ public class ImageListResp implements Serializable { @ApiModelProperty("采集员姓名") private String collectorName; + @ApiModelProperty("来源,枚举ImageSourceEnum") + private String imageSource; + + @ApiModelProperty("来源描述") + private String imageSourceLabel; + @ApiModelProperty("影像类型,枚举ImageTypeEnum") private String imageType; diff --git a/core/src/main/java/com/dite/znpt/service/impl/ImageServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/ImageServiceImpl.java index 95dca45..c47e9c2 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/ImageServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/ImageServiceImpl.java @@ -69,18 +69,19 @@ public class ImageServiceImpl extends ServiceImpl impl @Override public List list(ImageListReq req) { - List partList= this.baseMapper.queryImageList(req); - if (CollUtil.isNotEmpty(partList)) { - Map> audioMap = audioFileInfoService.selectByImageIds(partList.stream().map(ImageListResp::getImageId).collect(Collectors.toList())) + List list = this.baseMapper.queryImageList(req); + if (CollUtil.isNotEmpty(list)) { + Map> audioMap = audioFileInfoService.selectByImageIds(list.stream().map(ImageListResp::getImageId).collect(Collectors.toList())) .stream().collect(Collectors.groupingBy(AudioFileInfoResp::getImageId)); - partList.forEach(resp -> { + list.forEach(resp -> { 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())); + resp.setImageSourceLabel(ImageSourceEnum.getDescByCode(resp.getImageSource())); }); } - return partList; + return list; } @Override @@ -124,6 +125,7 @@ public class ImageServiceImpl extends ServiceImpl impl if (null != imageResp.getImageCollectInfo()) { imageResp.getImageCollectInfo().setWeatherLabel(WeatherEnum.getDescByCode(imageResp.getImageCollectInfo().getWeather())); imageResp.getImageCollectInfo().setShootingMethodLabel(ShootingMethodEnum.getDescByCode(imageResp.getImageCollectInfo().getShootingMethodLabel())); + imageResp.getImageCollectInfo().setImageSourceLabel(ImageSourceEnum.getDescByCode(imageResp.getImageCollectInfo().getImageSource())); } } return imageResp; @@ -150,6 +152,7 @@ public class ImageServiceImpl extends ServiceImpl impl 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()); imageCollect.setCollectId(IdUtil.simpleUUID()); + imageCollect.setImageSource(imageSource); List imageList = new ArrayList<>(); for (MultipartFile file : files) { ImageEntity imageEntity = new ImageEntity(); diff --git a/core/src/main/resources/mapper/ImageMapper.xml b/core/src/main/resources/mapper/ImageMapper.xml index f409ebf..580bbd0 100644 --- a/core/src/main/resources/mapper/ImageMapper.xml +++ b/core/src/main/resources/mapper/ImageMapper.xml @@ -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.shooting_method, ic.shooting_distance,ic.collector_name, i.image_type, i.image_path, ic.image_source 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 @@ -56,6 +56,7 @@ + @@ -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, 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.wind_level, ic.shooting_method, ic.shooting_distance, ic.collector_name, ic.image_source FROM image i LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id WHERE i.image_id = #{imageId}