工业图像列表,删除图像、查看图像详情
This commit is contained in:
parent
f37d16e195
commit
e912f0c91c
|
@ -0,0 +1,18 @@
|
||||||
|
package com.dite.znpt.constant;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/4/26 23:19
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
public class Message implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 4010434089386946123L;
|
||||||
|
|
||||||
|
public static final String IMAGE_IS_EMPTY = "图像信息为空";
|
||||||
|
public static final String IMAGE_PATH_IS_NOT_EXIST = "图像地址不存在";
|
||||||
|
public static final String IMAGE_ID_IS_NOT_EXIST = "图像id不存在";
|
||||||
|
}
|
|
@ -44,8 +44,8 @@ public class ImageCollectEntity extends AuditableEntity implements Serializable
|
||||||
@TableField("shooting_time_end")
|
@TableField("shooting_time_end")
|
||||||
private LocalDateTime shootingTimeEnd;
|
private LocalDateTime shootingTimeEnd;
|
||||||
|
|
||||||
@ApiModelProperty("天气")
|
@ApiModelProperty("天气,枚举:WeatherEnum")
|
||||||
@TableField("weather,枚举:WeatherEnum")
|
@TableField("weather")
|
||||||
private String weather;
|
private String weather;
|
||||||
|
|
||||||
@ApiModelProperty("湿度(百分比)")
|
@ApiModelProperty("湿度(百分比)")
|
||||||
|
|
|
@ -12,6 +12,7 @@ import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,14 +41,42 @@ public class ImageEntity extends AuditableEntity implements Serializable {
|
||||||
@TableField("image_name")
|
@TableField("image_name")
|
||||||
private String imageName;
|
private String imageName;
|
||||||
|
|
||||||
@ApiModelProperty("图像尺寸")
|
@ApiModelProperty("图像大小")
|
||||||
@TableField("image_size")
|
@TableField("image_size")
|
||||||
private String imageSize;
|
private String imageSize;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像宽")
|
||||||
|
@TableField("image_width")
|
||||||
|
private String imageWidth;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像高")
|
||||||
|
@TableField("image_height")
|
||||||
|
private String imageHeight;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像分辨率")
|
||||||
|
@TableField("image_resolution")
|
||||||
|
private String imageResolution;
|
||||||
|
|
||||||
|
@ApiModelProperty("焦平面X轴分辨率")
|
||||||
|
@TableField("x_resolution")
|
||||||
|
private String xResolution;
|
||||||
|
|
||||||
|
@ApiModelProperty("焦平面Y轴分辨率")
|
||||||
|
@TableField("y_resolution")
|
||||||
|
private String YResolution;
|
||||||
|
|
||||||
|
@ApiModelProperty("焦平面分辨率单位")
|
||||||
|
@TableField("resolution_units")
|
||||||
|
private String ResolutionUnits;
|
||||||
|
|
||||||
@ApiModelProperty("焦距")
|
@ApiModelProperty("焦距")
|
||||||
@TableField("focal_distance")
|
@TableField("focal_distance")
|
||||||
private String focalDistance;
|
private String focalDistance;
|
||||||
|
|
||||||
|
@ApiModelProperty("35毫米焦距")
|
||||||
|
@TableField("focal_distance35")
|
||||||
|
private String focalDistance35;
|
||||||
|
|
||||||
@ApiModelProperty("拍摄时间")
|
@ApiModelProperty("拍摄时间")
|
||||||
@TableField("shooting_time")
|
@TableField("shooting_time")
|
||||||
private LocalDateTime shootingTime;
|
private LocalDateTime shootingTime;
|
||||||
|
@ -72,8 +101,12 @@ public class ImageEntity extends AuditableEntity implements Serializable {
|
||||||
@TableField("altitude")
|
@TableField("altitude")
|
||||||
private String altitude;
|
private String altitude;
|
||||||
|
|
||||||
|
@ApiModelProperty("GPS")
|
||||||
|
@TableField("GPS")
|
||||||
|
private String GPS;
|
||||||
|
|
||||||
@ApiModelProperty("影像类型")
|
@ApiModelProperty("影像类型")
|
||||||
@TableField("image_type,枚举ImageTypeEnum")
|
@TableField("image_type")
|
||||||
private String imageType;
|
private String imageType;
|
||||||
|
|
||||||
@ApiModelProperty("图片路径")
|
@ApiModelProperty("图片路径")
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/4/24 21:16
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("图像拍摄信息")
|
||||||
|
public class ImageCollectInfo implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 6594307991137605975L;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像采集信息id")
|
||||||
|
private String collectId;
|
||||||
|
|
||||||
|
@ApiModelProperty("天气,枚举:WeatherEnum")
|
||||||
|
private String weather;
|
||||||
|
|
||||||
|
@ApiModelProperty("天气描述")
|
||||||
|
private String weatherLabel;
|
||||||
|
|
||||||
|
@ApiModelProperty("湿度(百分比)")
|
||||||
|
private Integer humidness;
|
||||||
|
|
||||||
|
@ApiModelProperty("温度")
|
||||||
|
private String temperature;
|
||||||
|
|
||||||
|
@ApiModelProperty("风力等级")
|
||||||
|
private Integer windLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty("拍摄方式,枚举ShootingMethodEnum")
|
||||||
|
private String shootingMethod;
|
||||||
|
|
||||||
|
@ApiModelProperty("拍摄方式描述")
|
||||||
|
private String shootingMethodLabel;
|
||||||
|
|
||||||
|
@ApiModelProperty("拍摄距离")
|
||||||
|
private Integer shootingDistance;
|
||||||
|
|
||||||
|
@ApiModelProperty("采集员姓名")
|
||||||
|
private String collectorName;
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package com.dite.znpt.domain.vo;
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -22,9 +23,11 @@ public class ImageCollectReq implements Serializable {
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 8937301872925896770L;
|
private static final long serialVersionUID = 8937301872925896770L;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty("拍摄时间-起")
|
@ApiModelProperty("拍摄时间-起")
|
||||||
private LocalDateTime shootingTimeBegin;
|
private LocalDateTime shootingTimeBegin;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty("拍摄时间-讫")
|
@ApiModelProperty("拍摄时间-讫")
|
||||||
private LocalDateTime shootingTimeEnd;
|
private LocalDateTime shootingTimeEnd;
|
||||||
|
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
package com.dite.znpt.domain.vo;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: gaoxiong
|
|
||||||
* @Date: 2025/4/24 21:16
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ApiModel("图像采集信息响应实体")
|
|
||||||
public class ImageCollectResp implements Serializable {
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 6594307991137605975L;
|
|
||||||
}
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/4/26 23:35
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("图像Exif信息")
|
||||||
|
public class ImageExifInfo implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty("图像宽")
|
||||||
|
private String imageWidth;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像高")
|
||||||
|
private String imageHeight;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像分辨率")
|
||||||
|
private String imageResolution;
|
||||||
|
|
||||||
|
@ApiModelProperty("焦距")
|
||||||
|
private String focalDistance;
|
||||||
|
|
||||||
|
@ApiModelProperty("35毫米焦距")
|
||||||
|
private String focalDistance35;
|
||||||
|
|
||||||
|
@ApiModelProperty("焦平面X轴分辨率")
|
||||||
|
@TableField("x_resolution")
|
||||||
|
private String xResolution;
|
||||||
|
|
||||||
|
@ApiModelProperty("焦平面Y轴分辨率")
|
||||||
|
@TableField("y_resolution")
|
||||||
|
private String yResolution;
|
||||||
|
|
||||||
|
@ApiModelProperty("焦平面分辨率单位")
|
||||||
|
@TableField("resolution_units")
|
||||||
|
private String resolutionUnits;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty("拍摄时间")
|
||||||
|
private LocalDateTime shootingTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("相机制造商")
|
||||||
|
private String cameraManufacturer;
|
||||||
|
|
||||||
|
@ApiModelProperty("相机型号")
|
||||||
|
private String cameraModel;
|
||||||
|
|
||||||
|
@ApiModelProperty("经度")
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
@ApiModelProperty("纬度")
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
@ApiModelProperty("海拔")
|
||||||
|
private String altitude;
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package com.dite.znpt.domain.vo;
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
@ -16,4 +17,11 @@ import java.io.Serializable;
|
||||||
public class ImageListReq implements Serializable {
|
public class ImageListReq implements Serializable {
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 671014582625089979L;
|
private static final long serialVersionUID = 671014582625089979L;
|
||||||
|
|
||||||
|
@ApiModelProperty("关键字")
|
||||||
|
private String keyword;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像类型")
|
||||||
|
private String[] imageTypes;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,86 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/4/26 21:07
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("图像列表信息响应实体")
|
||||||
|
public class ImageListResp implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 3168482118066685077L;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像id")
|
||||||
|
private String imageId;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像名称")
|
||||||
|
@TableField("image_name")
|
||||||
|
private String imageName;
|
||||||
|
|
||||||
|
@ApiModelProperty("部件名称")
|
||||||
|
private String partName;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像分辨率")
|
||||||
|
private String imageResolution;
|
||||||
|
|
||||||
|
@ApiModelProperty("焦距")
|
||||||
|
private String focalDistance;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty("拍摄时间")
|
||||||
|
private LocalDateTime shootingTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("相机制造商")
|
||||||
|
private String cameraManufacturer;
|
||||||
|
|
||||||
|
@ApiModelProperty("相机型号")
|
||||||
|
private String cameraModel;
|
||||||
|
|
||||||
|
@ApiModelProperty("GPS")
|
||||||
|
private String GPS;
|
||||||
|
|
||||||
|
@ApiModelProperty("天气,枚举:WeatherEnum")
|
||||||
|
private String weather;
|
||||||
|
|
||||||
|
@ApiModelProperty("天气描述")
|
||||||
|
private String weatherLabel;
|
||||||
|
|
||||||
|
@ApiModelProperty("湿度(百分比)")
|
||||||
|
private Integer humidness;
|
||||||
|
|
||||||
|
@ApiModelProperty("温度")
|
||||||
|
private String temperature;
|
||||||
|
|
||||||
|
@ApiModelProperty("风力等级")
|
||||||
|
private Integer windLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty("拍摄方式,枚举ShootingMethodEnum")
|
||||||
|
private String shootingMethod;
|
||||||
|
|
||||||
|
@ApiModelProperty("拍摄方式描述")
|
||||||
|
private String shootingMethodLabel;
|
||||||
|
|
||||||
|
@ApiModelProperty("拍摄距离")
|
||||||
|
private Integer shootingDistance;
|
||||||
|
|
||||||
|
@ApiModelProperty("采集员姓名")
|
||||||
|
private String collectorName;
|
||||||
|
|
||||||
|
@ApiModelProperty("影像类型,枚举ImageTypeEnum")
|
||||||
|
private String imageType;
|
||||||
|
|
||||||
|
@ApiModelProperty("影像类型描述")
|
||||||
|
private String imageTypeLabel;
|
||||||
|
}
|
|
@ -17,7 +17,7 @@ import java.time.LocalDateTime;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ApiModel("图像信息请求实体")
|
@ApiModel("图像信息请求实体")
|
||||||
public class ImageReq implements Serializable {
|
public class ImageReq extends ImageExifInfo implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = -1726859254176864573L;
|
private static final long serialVersionUID = -1726859254176864573L;
|
||||||
|
@ -29,31 +29,16 @@ public class ImageReq implements Serializable {
|
||||||
@TableField("image_name")
|
@TableField("image_name")
|
||||||
private String imageName;
|
private String imageName;
|
||||||
|
|
||||||
@ApiModelProperty("图像尺寸")
|
@ApiModelProperty("图像大小")
|
||||||
private String imageSize;
|
private String imageSize;
|
||||||
|
|
||||||
@ApiModelProperty("焦距")
|
@ApiModelProperty("图像分辨率")
|
||||||
private String focalDistance;
|
private String imageResolution;
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@ApiModelProperty("拍摄时间")
|
|
||||||
private LocalDateTime shootingTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("相机制造商")
|
|
||||||
private String cameraManufacturer;
|
|
||||||
|
|
||||||
@ApiModelProperty("相机型号")
|
|
||||||
private String cameraModel;
|
|
||||||
|
|
||||||
@ApiModelProperty("经度")
|
|
||||||
private String longitude;
|
|
||||||
|
|
||||||
@ApiModelProperty("纬度")
|
|
||||||
private String latitude;
|
|
||||||
|
|
||||||
@ApiModelProperty("海拔")
|
|
||||||
private String altitude;
|
|
||||||
|
|
||||||
@ApiModelProperty("图片路径")
|
@ApiModelProperty("图片路径")
|
||||||
private String imagePath;
|
private String imagePath;
|
||||||
|
|
||||||
|
@ApiModelProperty("GPS")
|
||||||
|
private String GPS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,10 +17,29 @@ import java.time.LocalDateTime;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ApiModel("图像信息响应实体")
|
@ApiModel("图像信息响应实体")
|
||||||
public class ImageResp extends ImageReq implements Serializable {
|
public class ImageResp implements Serializable {
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = -5215414858454232077L;
|
private static final long serialVersionUID = -5215414858454232077L;
|
||||||
|
|
||||||
@ApiModelProperty("影像类型,枚举ImageTypeEnum")
|
@ApiModelProperty("图像id")
|
||||||
private String imageType;
|
private String imageId;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像名称")
|
||||||
|
private String imageName;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像路径")
|
||||||
|
private String imagePath;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像大小")
|
||||||
|
private String imageSize;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像分辨率")
|
||||||
|
private String imageResolution;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像Exif信息")
|
||||||
|
private ImageExifInfo imageExifInfo;
|
||||||
|
|
||||||
|
@ApiModelProperty("图像拍摄信息")
|
||||||
|
private ImageCollectInfo imageCollectInfo;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,11 @@ public enum ImageTypeEnum {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getDescByCode(String code){
|
||||||
|
ImageTypeEnum e = getByCode(code);
|
||||||
|
return null == e ? null : e.desc;
|
||||||
|
}
|
||||||
|
|
||||||
public static List<JSONObject> listAll(){
|
public static List<JSONObject> listAll(){
|
||||||
List<JSONObject> list = new ArrayList<>(ImageTypeEnum.values().length);
|
List<JSONObject> list = new ArrayList<>(ImageTypeEnum.values().length);
|
||||||
for (ImageTypeEnum e : ImageTypeEnum.values() ) {
|
for (ImageTypeEnum e : ImageTypeEnum.values() ) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ public enum ShootingMethodEnum {
|
||||||
this.desc = desc;
|
this.desc = desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ShootingMethodEnum getByCode(String code){
|
public static ShootingMethodEnum getByCode(String code){
|
||||||
for (ShootingMethodEnum e : ShootingMethodEnum.values() ) {
|
for (ShootingMethodEnum e : ShootingMethodEnum.values() ) {
|
||||||
if(e.code.equals(code)){
|
if(e.code.equals(code)){
|
||||||
return e;
|
return e;
|
||||||
|
@ -33,6 +33,11 @@ public enum ShootingMethodEnum {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getDescByCode(String code){
|
||||||
|
ShootingMethodEnum e = getByCode(code);
|
||||||
|
return null == e ? null : e.desc;
|
||||||
|
}
|
||||||
|
|
||||||
public static List<JSONObject> listAll(){
|
public static List<JSONObject> listAll(){
|
||||||
List<JSONObject> list = new ArrayList<>(ShootingMethodEnum.values().length);
|
List<JSONObject> list = new ArrayList<>(ShootingMethodEnum.values().length);
|
||||||
for (ShootingMethodEnum e : ShootingMethodEnum.values() ) {
|
for (ShootingMethodEnum e : ShootingMethodEnum.values() ) {
|
||||||
|
|
|
@ -53,6 +53,11 @@ public enum WeatherEnum {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getDescByCode(String code){
|
||||||
|
WeatherEnum e = getByCode(code);
|
||||||
|
return null == e ? null : e.desc;
|
||||||
|
}
|
||||||
|
|
||||||
public static List<JSONObject> listAll(){
|
public static List<JSONObject> listAll(){
|
||||||
List<JSONObject> list = new ArrayList<>(WeatherEnum.values().length);
|
List<JSONObject> list = new ArrayList<>(WeatherEnum.values().length);
|
||||||
for (WeatherEnum e : WeatherEnum.values() ) {
|
for (WeatherEnum e : WeatherEnum.values() ) {
|
||||||
|
|
|
@ -2,10 +2,7 @@ package com.dite.znpt.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.dite.znpt.domain.entity.ImageEntity;
|
import com.dite.znpt.domain.entity.ImageEntity;
|
||||||
import com.dite.znpt.domain.vo.ImageListReq;
|
import com.dite.znpt.domain.vo.*;
|
||||||
import com.dite.znpt.domain.vo.ImageResp;
|
|
||||||
import com.dite.znpt.domain.vo.PartListReq;
|
|
||||||
import com.dite.znpt.domain.vo.PartResp;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -15,5 +12,7 @@ import java.util.List;
|
||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
public interface ImageMapper extends BaseMapper<ImageEntity> {
|
public interface ImageMapper extends BaseMapper<ImageEntity> {
|
||||||
List<ImageResp> queryBySelective(ImageListReq req);
|
List<ImageListResp> queryImageList(ImageListReq req);
|
||||||
|
|
||||||
|
ImageResp detail(String imageId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@ package com.dite.znpt.service;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.dite.znpt.domain.entity.ImageEntity;
|
import com.dite.znpt.domain.entity.ImageEntity;
|
||||||
import com.dite.znpt.domain.vo.ImageListReq;
|
import com.dite.znpt.domain.vo.ImageListReq;
|
||||||
|
import com.dite.znpt.domain.vo.ImageListResp;
|
||||||
|
import com.dite.znpt.domain.vo.ImageReq;
|
||||||
import com.dite.znpt.domain.vo.ImageResp;
|
import com.dite.znpt.domain.vo.ImageResp;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
@ -15,7 +17,13 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface ImageService extends IService<ImageEntity> {
|
public interface ImageService extends IService<ImageEntity> {
|
||||||
|
|
||||||
List<ImageResp> selectList(ImageListReq req);
|
List<ImageListResp> list(ImageListReq req);
|
||||||
|
|
||||||
List<ImageResp> batchUpload(String departId, MultipartFile[] files);
|
List<ImageListResp> page(ImageListReq req);
|
||||||
|
|
||||||
|
ImageResp detail(String imageId);
|
||||||
|
|
||||||
|
List<ImageReq> batchUpload(String departId, MultipartFile[] files);
|
||||||
|
|
||||||
|
void delete(String imageId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
package com.dite.znpt.service.impl;
|
package com.dite.znpt.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.dite.znpt.constant.Message;
|
||||||
import com.dite.znpt.converts.Converts;
|
import com.dite.znpt.converts.Converts;
|
||||||
import com.dite.znpt.domain.entity.ImageCollectEntity;
|
import com.dite.znpt.domain.entity.ImageCollectEntity;
|
||||||
import com.dite.znpt.domain.entity.ImageEntity;
|
import com.dite.znpt.domain.entity.ImageEntity;
|
||||||
import com.dite.znpt.domain.vo.ImageCollectReq;
|
import com.dite.znpt.domain.vo.ImageCollectReq;
|
||||||
|
import com.dite.znpt.exception.ServiceException;
|
||||||
import com.dite.znpt.mapper.ImageCollectMapper;
|
import com.dite.znpt.mapper.ImageCollectMapper;
|
||||||
import com.dite.znpt.service.ImageCollectService;
|
import com.dite.znpt.service.ImageCollectService;
|
||||||
import com.dite.znpt.service.ImageService;
|
import com.dite.znpt.service.ImageService;
|
||||||
|
@ -35,6 +38,9 @@ public class ImageCollectServiceImpl extends ServiceImpl<ImageCollectMapper, Ima
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public void save(String partId, ImageCollectReq req) {
|
public void save(String partId, ImageCollectReq req) {
|
||||||
|
if(CollUtil.isEmpty(req.getImageList())){
|
||||||
|
throw new ServiceException(Message.IMAGE_IS_EMPTY);
|
||||||
|
}
|
||||||
ImageCollectEntity imageCollect = Converts.INSTANCE.toImageCollectEntity(req);
|
ImageCollectEntity imageCollect = Converts.INSTANCE.toImageCollectEntity(req);
|
||||||
imageCollect.setPartId(partId);
|
imageCollect.setPartId(partId);
|
||||||
this.save(imageCollect);
|
this.save(imageCollect);
|
||||||
|
@ -53,6 +59,9 @@ public class ImageCollectServiceImpl extends ServiceImpl<ImageCollectMapper, Ima
|
||||||
imageList.remove(image);
|
imageList.remove(image);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if(CollUtil.isEmpty(imageList)){
|
||||||
|
throw new ServiceException(Message.IMAGE_PATH_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
imageService.saveOrUpdateBatch(imageList);
|
imageService.saveOrUpdateBatch(imageList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,23 @@
|
||||||
package com.dite.znpt.service.impl;
|
package com.dite.znpt.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.dite.znpt.constant.Message;
|
||||||
import com.dite.znpt.domain.entity.ImageEntity;
|
import com.dite.znpt.domain.entity.ImageEntity;
|
||||||
import com.dite.znpt.domain.vo.ImageListReq;
|
import com.dite.znpt.domain.vo.ImageListReq;
|
||||||
|
import com.dite.znpt.domain.vo.ImageListResp;
|
||||||
|
import com.dite.znpt.domain.vo.ImageReq;
|
||||||
import com.dite.znpt.domain.vo.ImageResp;
|
import com.dite.znpt.domain.vo.ImageResp;
|
||||||
|
import com.dite.znpt.enums.ImageTypeEnum;
|
||||||
|
import com.dite.znpt.enums.ShootingMethodEnum;
|
||||||
|
import com.dite.znpt.enums.WeatherEnum;
|
||||||
|
import com.dite.znpt.exception.ServiceException;
|
||||||
import com.dite.znpt.mapper.ImageMapper;
|
import com.dite.znpt.mapper.ImageMapper;
|
||||||
|
import com.dite.znpt.service.ImageCollectService;
|
||||||
import com.dite.znpt.service.ImageService;
|
import com.dite.znpt.service.ImageService;
|
||||||
import com.dite.znpt.util.EXIFUtil;
|
import com.dite.znpt.util.EXIFUtil;
|
||||||
import com.dite.znpt.util.PageUtil;
|
import com.dite.znpt.util.PageUtil;
|
||||||
|
@ -16,11 +26,10 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.math.BigDecimal;
|
||||||
import java.nio.file.Files;
|
import java.math.RoundingMode;
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -36,23 +45,44 @@ import java.util.regex.Pattern;
|
||||||
@Service
|
@Service
|
||||||
public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> implements ImageService {
|
public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> implements ImageService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ImageCollectService imageCollectService;
|
||||||
|
|
||||||
@Value("${upload.temp-path}")
|
@Value("${upload.temp-path}")
|
||||||
private String tempPath;
|
private String tempPath;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ImageResp> selectList(ImageListReq req) {
|
public List<ImageListResp> list(ImageListReq req) {
|
||||||
PageUtil.startPage();
|
List<ImageListResp> partList= this.baseMapper.queryImageList(req);
|
||||||
List<ImageResp> imageList= this.baseMapper.queryBySelective(req);
|
partList.forEach(resp -> {
|
||||||
imageList.forEach(resp -> {
|
resp.setWeatherLabel(WeatherEnum.getDescByCode(resp.getWeather()));
|
||||||
|
resp.setShootingMethodLabel(ShootingMethodEnum.getDescByCode(resp.getShootingMethod()));
|
||||||
|
resp.setImageTypeLabel(ImageTypeEnum.getDescByCode(resp.getImageType()));
|
||||||
});
|
});
|
||||||
return imageList;
|
return partList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ImageListResp> page(ImageListReq req) {
|
||||||
|
PageUtil.startPage();
|
||||||
|
return this.list(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ImageResp detail(String imageId) {
|
||||||
|
ImageResp imageResp = this.baseMapper.detail(imageId);
|
||||||
|
imageResp.getImageCollectInfo().setWeatherLabel(WeatherEnum.getDescByCode(imageResp.getImageCollectInfo().getWeather()));
|
||||||
|
imageResp.getImageCollectInfo().setShootingMethodLabel(ShootingMethodEnum.getDescByCode(imageResp.getImageCollectInfo().getShootingMethodLabel()));
|
||||||
|
return imageResp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public List<ImageResp> batchUpload(String departId, MultipartFile[] files) {
|
public List<ImageReq> batchUpload(String departId, MultipartFile[] files) {
|
||||||
List<ImageResp> list = new ArrayList<>(files.length);
|
if(null == files || files.length == 0){
|
||||||
|
throw new ServiceException(Message.IMAGE_IS_EMPTY);
|
||||||
|
}
|
||||||
|
List<ImageReq> list = new ArrayList<>(files.length);
|
||||||
String path_prefix = tempPath.concat(StrUtil.BACKSLASH).concat(departId).concat(StrUtil.BACKSLASH);
|
String path_prefix = tempPath.concat(StrUtil.BACKSLASH).concat(departId).concat(StrUtil.BACKSLASH);
|
||||||
for (MultipartFile file : files) {
|
for (MultipartFile file : files) {
|
||||||
if (!file.isEmpty()) {
|
if (!file.isEmpty()) {
|
||||||
|
@ -68,22 +98,52 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ImageResp imageRespBuilder(String path) throws Exception {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
ImageResp resp = new ImageResp();
|
@Override
|
||||||
|
public void delete(String imageId) {
|
||||||
|
ImageEntity image = this.getById(imageId);
|
||||||
|
if(null ==image){
|
||||||
|
throw new ServiceException(Message.IMAGE_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
this.removeById(image);
|
||||||
|
List<ImageEntity> imageList = this.list(Wrappers.<ImageEntity>lambdaQuery().eq(ImageEntity::getCollectId, image.getCollectId()));
|
||||||
|
if(CollUtil.isEmpty(imageList)){
|
||||||
|
imageCollectService.removeById(image.getCollectId());
|
||||||
|
}
|
||||||
|
File file = new File(image.getImagePath());
|
||||||
|
if (file.exists()) {
|
||||||
|
FileUtil.del(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ImageReq imageRespBuilder(String path) throws Exception {
|
||||||
|
ImageReq req = new ImageReq();
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
JSONObject obj = EXIFUtil.printImageTags(file);
|
JSONObject obj = EXIFUtil.printImageTags(file);
|
||||||
resp.setCameraManufacturer(obj.getStr("Make"));
|
req.setCameraManufacturer(obj.getStr("Make"));
|
||||||
resp.setCameraModel(obj.getStr("Model"));
|
req.setCameraModel(obj.getStr("Model"));
|
||||||
resp.setImageName(obj.getStr("File Name"));
|
req.setImageName(obj.getStr("File Name"));
|
||||||
resp.setImagePath(path);
|
req.setImagePath(path);
|
||||||
resp.setImageSize(extractDigit(obj.getStr("Image Width")).concat("*").concat(extractDigit(obj.getStr("Image Height"))));
|
BigDecimal imageSize = new BigDecimal(extractDigit(obj.getStr("File Size"))).divide(new BigDecimal(1024*1024), 4, RoundingMode.HALF_UP);
|
||||||
|
req.setImageSize(imageSize.toString().concat("M"));
|
||||||
|
req.setImageWidth(extractDigit(obj.getStr("Image Width")));
|
||||||
|
req.setImageHeight(extractDigit(obj.getStr("Image Height")));
|
||||||
|
req.setImageResolution(req.getImageWidth().concat("x").concat(req.getImageHeight()));
|
||||||
|
req.setFocalDistance35(extractDigit(obj.getStr("Focal Length 35")));
|
||||||
|
req.setXResolution(extractDigit(obj.getStr("X Resolution")));
|
||||||
|
req.setYResolution(extractDigit(obj.getStr("Y Resolution")));
|
||||||
|
req.setResolutionUnits(obj.getStr("Resolution Units"));
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy:MM:dd HH:mm:ss");
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy:MM:dd HH:mm:ss");
|
||||||
resp.setShootingTime(LocalDateTime.parse( obj.getStr("Date/Time Original"),formatter));
|
req.setShootingTime(LocalDateTime.parse( obj.getStr("Date/Time Original"),formatter));
|
||||||
resp.setFocalDistance(extractDigit(obj.getStr("Focal Length")));
|
req.setFocalDistance(extractDigit(obj.getStr("Focal Length")));
|
||||||
resp.setLatitude(obj.getStr("GPS Latitude").concat("°").concat(directionTranslator(obj.getStr("GPS Latitude Ref"))));
|
req.setLatitude(obj.getStr("GPS Latitude"));
|
||||||
resp.setLongitude(obj.getStr("GPS Longitude").concat("°").concat(directionTranslator(obj.getStr("GPS Longitude Ref"))));
|
req.setLongitude(obj.getStr("GPS Longitude"));
|
||||||
resp.setAltitude(extractDigit(obj.getStr("GPS Altitude")).concat("m"));
|
req.setAltitude(extractDigit(obj.getStr("GPS Altitude")));
|
||||||
return resp;
|
String gps = req.getLatitude().concat("°").concat(directionTranslator(obj.getStr("GPS Latitude Ref"))).concat(StrUtil.COMMA)
|
||||||
|
.concat(req.getLongitude()).concat("°").concat(directionTranslator(obj.getStr("GPS Longitude Ref"))).concat(StrUtil.COMMA)
|
||||||
|
.concat("海拔").concat(req.getAltitude()).concat("m");
|
||||||
|
req.setGPS(gps);
|
||||||
|
return req;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String directionTranslator(String direction){
|
private String directionTranslator(String direction){
|
||||||
|
@ -109,4 +169,5 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
a.shooting_distance, a.collector_name,
|
a.shooting_distance, a.collector_name,
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ImageCollectResp">
|
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ImageCollectInfo">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List"/>
|
<include refid="Base_Column_List"/>
|
||||||
from image_collect_info a
|
from image_collect_info a
|
||||||
|
|
|
@ -1,20 +1,65 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.dite.znpt.mapper.ImageMapper">
|
<mapper namespace="com.dite.znpt.mapper.ImageMapper">
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<select id="queryImageList" resultType="com.dite.znpt.domain.vo.ImageListResp">
|
||||||
a.image, a.part_id, a.turbine_id, a.project_id, a.image_name, a.image_size, a.focal_distance,
|
SELECT
|
||||||
a.shooting_time, a.camera_manufacture, a.camera_model, a.longitude, a.latitude, a.altitude,
|
i.image_id, i.image_name, ic.part_id, p.part_name, i.image_resolution, i.focal_distance, i.shooting_time, i.camera_manufacturer,
|
||||||
a.image_type, a.image_path
|
i.camera_model, i.GPS, ic.weather, ic.humidness, CONCAT(ic.temperature_min, '℃', '~',temperature_max, '℃') AS temperature, ic.wind_level,
|
||||||
</sql>
|
ic.shooting_method, ic.shooting_distance,ic.collector_name, i.image_type
|
||||||
|
FROM image i
|
||||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ImageResp">
|
LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id
|
||||||
select
|
LEFT JOIN part p ON ic.part_id = p.part_id
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
from image a
|
|
||||||
<where>
|
<where>
|
||||||
<if test="keyword != null and keyword != ''">
|
<if test="keyword != null and keyword != ''">
|
||||||
and a.image_name like concat('%', #{keyword,jdbcType=VARCHAR}, '%')
|
AND i.image_name LIKE concat('%', #{keyword}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="imageTypes != null and imageTypes.length > 0">
|
||||||
|
AND i.image_type in <foreach collection="imageTypes" item="imageType" open="(" close=")" separator=",">#{imageType}</foreach>
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<resultMap id="imageRespMap" type="com.dite.znpt.domain.vo.ImageResp">
|
||||||
|
<id property="imageId" column="image_id"></id>
|
||||||
|
<result property="imageName" column="image_name"></result>
|
||||||
|
<result property="imagePath" column="image_path"></result>
|
||||||
|
<result property="imageSize" column="image_size"></result>
|
||||||
|
<result property="imageResolution" column="image_resolution"></result>
|
||||||
|
<association property="imageExifInfo">
|
||||||
|
<result property="imageWidth" column="image_width"></result>
|
||||||
|
<result property="imageHeight" column="image_height"></result>
|
||||||
|
<result property="imageResolution" column="image_resolution"></result>
|
||||||
|
<result property="focalDistance" column="focal_distance"></result>
|
||||||
|
<result property="focalDistance35" column="focal_distance35"></result>
|
||||||
|
<result property="xResolution" column="x_resolution"></result>
|
||||||
|
<result property="yResolution" column="y_resolution"></result>
|
||||||
|
<result property="resolutionUnits" column="resolution_units"></result>
|
||||||
|
<result property="shootingTime" column="shooting_time"></result>
|
||||||
|
<result property="cameraManufacturer" column="camera_manufacturer"></result>
|
||||||
|
<result property="cameraModel" column="camera_model"></result>
|
||||||
|
<result property="longitude" column="latitude"></result>
|
||||||
|
<result property="latitude" column="latitude"></result>
|
||||||
|
<result property="altitude" column="altitude"></result>
|
||||||
|
</association>
|
||||||
|
<association property="imageCollectInfo">
|
||||||
|
<id property="collectId" column="collect_id" ></id>
|
||||||
|
<result property="weather" column="weather"></result>
|
||||||
|
<result property="humidness" column="humidness"></result>
|
||||||
|
<result property="temperature" column="temperature"></result>
|
||||||
|
<result property="windLevel" column="wind_level"></result>
|
||||||
|
<result property="shootingMethod" column="shooting_method"></result>
|
||||||
|
<result property="shootingDistance" column="shooting_distance"></result>
|
||||||
|
<result property="collectorName" column="collector_name"></result>
|
||||||
|
</association>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="detail" resultMap="imageRespMap">
|
||||||
|
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
|
||||||
|
FROM image i
|
||||||
|
LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id
|
||||||
|
WHERE i.image_id = #{imageId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -1,33 +0,0 @@
|
||||||
package com.dite.znpt.web.controller;
|
|
||||||
|
|
||||||
import com.dite.znpt.domain.Result;
|
|
||||||
import com.dite.znpt.domain.vo.ImageCollectReq;
|
|
||||||
import com.dite.znpt.domain.vo.ImageResp;
|
|
||||||
import com.dite.znpt.service.ImageCollectService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: gaoxiong
|
|
||||||
* @Date: 2025/4/26 1:34
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
@Api(tags = "图像采集信息")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/image-collect")
|
|
||||||
public class ImageCollectController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ImageCollectService imageCollectService;
|
|
||||||
@ApiOperation(value = "保存图像采集信息", httpMethod = "POST")
|
|
||||||
@PostMapping("/{departId}")
|
|
||||||
public Result save(@PathVariable String departId, @RequestBody ImageCollectReq req) {
|
|
||||||
imageCollectService.save(departId, req);
|
|
||||||
return Result.ok();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,19 +3,15 @@ package com.dite.znpt.web.controller;
|
||||||
|
|
||||||
import com.dite.znpt.domain.PageResult;
|
import com.dite.znpt.domain.PageResult;
|
||||||
import com.dite.znpt.domain.Result;
|
import com.dite.znpt.domain.Result;
|
||||||
import com.dite.znpt.domain.vo.ImageListReq;
|
import com.dite.znpt.domain.vo.*;
|
||||||
import com.dite.znpt.domain.vo.ImageResp;
|
import com.dite.znpt.service.ImageCollectService;
|
||||||
import com.dite.znpt.service.ImageService;
|
import com.dite.znpt.service.ImageService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,16 +27,44 @@ public class ImageController {
|
||||||
@Resource
|
@Resource
|
||||||
private ImageService imageService;
|
private ImageService imageService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ImageCollectService imageCollectService;
|
||||||
|
|
||||||
@ApiOperation(value = "分页查询图像列表", httpMethod = "GET")
|
@ApiOperation(value = "分页查询图像列表", httpMethod = "GET")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public PageResult<ImageResp> list(ImageListReq req) {
|
public PageResult<ImageListResp> page(@RequestBody ImageListReq req) {
|
||||||
return PageResult.ok(imageService.selectList(req));
|
return PageResult.ok(imageService.page(req));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询图像列表", httpMethod = "GET")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result<List<ImageListResp>> list(@RequestBody ImageListReq req){
|
||||||
|
return Result.ok(imageService.list(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询图像详情", httpMethod = "GET")
|
||||||
|
@GetMapping("/detail/{imageId}")
|
||||||
|
public Result<ImageResp> detail(@PathVariable String imageId){
|
||||||
|
return Result.ok(imageService.detail(imageId));
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "批量上传图像", httpMethod = "POST")
|
@ApiOperation(value = "批量上传图像", httpMethod = "POST")
|
||||||
@PostMapping("/upload-batch/{departId}")
|
@PostMapping("/upload-batch/{departId}")
|
||||||
public Result<List<ImageResp>> uploadBatch(@PathVariable String departId, @RequestParam("files") MultipartFile[] files) {
|
public Result<List<ImageReq>> uploadBatch(@PathVariable String departId, @RequestParam("files") MultipartFile[] files) {
|
||||||
return Result.ok(imageService.batchUpload(departId, files));
|
return Result.ok(imageService.batchUpload(departId, files));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "设置信息", httpMethod = "POST")
|
||||||
|
@PostMapping("/setting-info/{departId}")
|
||||||
|
public Result save(@PathVariable String departId, @RequestBody ImageCollectReq req) {
|
||||||
|
imageCollectService.save(departId, req);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除图像", httpMethod = "DELETE")
|
||||||
|
@DeleteMapping("/{imageId}")
|
||||||
|
public Result remove(@PathVariable String imageId){
|
||||||
|
imageService.delete(imageId);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue