Compare commits
25 Commits
e73257514b
...
469f9ebf47
Author | SHA1 | Date |
---|---|---|
|
469f9ebf47 | |
|
817791b6e1 | |
|
1143ea4c18 | |
|
25d828a319 | |
|
a65975a520 | |
|
4f23f68a26 | |
|
b1bb6dac97 | |
|
a440eca381 | |
|
4373fb4374 | |
|
3e2b4e571b | |
|
14ba8266fa | |
|
db2b42af57 | |
|
a9149df19c | |
|
7787724b9d | |
|
5f77b1a3a7 | |
|
693e09ca61 | |
|
a0b239f34e | |
|
105e339464 | |
|
cbe77aeef3 | |
|
cffae035db | |
|
caf716c126 | |
|
09064b201d | |
|
8788c6f7e4 | |
|
3dd13474b6 | |
|
8cba5fe502 |
13
core/pom.xml
13
core/pom.xml
|
@ -149,7 +149,20 @@
|
|||
<version>1.3.0-91</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.microsoft.onnxruntime</groupId>
|
||||
<artifactId>onnxruntime</artifactId>
|
||||
<version>1.16.1</version>
|
||||
</dependency>
|
||||
<!-- javacv 和 opencv 别同时用 -->
|
||||
<dependency>
|
||||
<groupId>org.openpnp</groupId>
|
||||
<artifactId>opencv</artifactId>
|
||||
<version>4.7.0-0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package com.dite.znpt.config;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
public class CustomLocalDateTimeDeserializer extends JsonDeserializer<LocalDateTime> {
|
||||
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@Override
|
||||
public LocalDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
|
||||
String date = p.getText();
|
||||
return LocalDateTimeUtil.parse(date, FORMATTER);
|
||||
}
|
||||
}
|
|
@ -9,6 +9,8 @@ import org.springframework.context.annotation.Configuration;
|
|||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @date 2022/3/20 10:34 上午
|
||||
* @description:
|
||||
|
@ -25,6 +27,7 @@ public class JacksonConfig {
|
|||
SimpleModule simpleModule = new SimpleModule();
|
||||
//JSON Long ==> String
|
||||
simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
|
||||
simpleModule.addDeserializer(LocalDateTime.class, new CustomLocalDateTimeDeserializer());
|
||||
objectMapper.registerModule(simpleModule);
|
||||
return objectMapper;
|
||||
}
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
package com.dite.znpt.config;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.dite.znpt.constant.Constants;
|
||||
import com.dite.znpt.enums.FilePathEnum;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -27,7 +24,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|||
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
||||
registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/");
|
||||
for (FilePathEnum pathEnum : FilePathEnum.values()) {
|
||||
registry.addResourceHandler(pathEnum.getUrlPath() + "**").addResourceLocations("file:" + pathEnum.getFileAbsolutePath());
|
||||
registry.addResourceHandler(pathEnum.getUrlPath() + "**").addResourceLocations("file:" + pathEnum.getFileAbsolutePathPrefix());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,112 @@
|
|||
package com.dite.znpt.config;
|
||||
|
||||
import ai.onnxruntime.OrtEnvironment;
|
||||
import ai.onnxruntime.OrtException;
|
||||
import ai.onnxruntime.OrtSession;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.dite.znpt.domain.entity.ModelConfigEntity;
|
||||
import com.dite.znpt.enums.FilePathEnum;
|
||||
import com.dite.znpt.mapper.ModelConfigMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class YoloModelRegistry {
|
||||
|
||||
private final ModelConfigMapper modelConfigMapper;
|
||||
|
||||
private final Map<String, OrtSession> sessionMap = new ConcurrentHashMap<>();
|
||||
private final Map<String, ModelMetadata> metaMap = new ConcurrentHashMap<>();
|
||||
private final Map<String, ModelConfigEntity> modelParamMap = new ConcurrentHashMap<>();
|
||||
@Getter
|
||||
private final OrtEnvironment environment = OrtEnvironment.getEnvironment();
|
||||
|
||||
static {
|
||||
// 加载opencv动态库
|
||||
nu.pattern.OpenCV.loadLocally();
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void loadModelsOnStartup() throws OrtException {
|
||||
List<ModelConfigEntity> configs = modelConfigMapper.selectList(Wrappers.emptyWrapper());
|
||||
for (ModelConfigEntity config : configs) {
|
||||
loadModel(config);
|
||||
}
|
||||
}
|
||||
|
||||
public void loadModel(ModelConfigEntity config) throws OrtException {
|
||||
OrtSession.SessionOptions opts = new OrtSession.SessionOptions();
|
||||
// 使用gpu,需要本机安装过cuda,并修改pom.xml,不安装也能运行本程序
|
||||
// sessionOptions.addCUDA(0);
|
||||
OrtSession session = environment.createSession(FilePathEnum.ATTACH.getFileAbsolutePath(config.getModelPath()), opts);
|
||||
String labelStr = session.getMetadata().getCustomMetadata().get("names");
|
||||
|
||||
// label解析
|
||||
List<String> labels = new ArrayList<>();
|
||||
List<double[]> colors = new ArrayList<>();
|
||||
Pattern pattern = Pattern.compile("'([^']*)'");
|
||||
Matcher matcher = pattern.matcher(labelStr);
|
||||
Random random = new Random();
|
||||
while (matcher.find()) {
|
||||
labels.add(matcher.group(1));
|
||||
colors.add(new double[]{random.nextDouble() * 256, random.nextDouble() * 256, random.nextDouble() * 256});
|
||||
}
|
||||
|
||||
sessionMap.put(config.getModelId(), session);
|
||||
metaMap.put(config.getModelId(), new ModelMetadata(labels.toArray(new String[0]), colors, config));
|
||||
modelParamMap.put(config.getModelId(), config);
|
||||
}
|
||||
|
||||
public OrtSession getSession(String modelId) {
|
||||
return sessionMap.get(modelId);
|
||||
}
|
||||
|
||||
public ModelMetadata getMetadata(String modelId) {
|
||||
return metaMap.get(modelId);
|
||||
}
|
||||
|
||||
public ModelConfigEntity getModelConfig(String modelId) {
|
||||
return modelParamMap.get(modelId);
|
||||
}
|
||||
|
||||
public void unloadModel(String modelId) {
|
||||
OrtSession session = sessionMap.remove(modelId);
|
||||
if (session != null) {
|
||||
try {
|
||||
session.close(); // 释放 ONNX runtime 资源
|
||||
} catch (OrtException e) {
|
||||
log.warn("模型 {} 卸载时发生错误: {}", modelId, e.getMessage());
|
||||
}
|
||||
}
|
||||
metaMap.remove(modelId);
|
||||
}
|
||||
|
||||
public void reloadModel(ModelConfigEntity modelConfig) throws OrtException {
|
||||
unloadModel(modelConfig.getModelId());
|
||||
loadModel(modelConfig);
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static class ModelMetadata {
|
||||
private String[] labels;
|
||||
private List<double[]> colors;
|
||||
private ModelConfigEntity config;
|
||||
}
|
||||
}
|
||||
|
|
@ -17,6 +17,7 @@ public class Message implements Serializable {
|
|||
public static final String ATTACH_FILE_IS_NOT_EXIST = "不存在{}的附件文件";
|
||||
public static final String IMAGE_PATH_IS_NOT_EXIST = "图像地址不存在";
|
||||
public static final String IMAGE_ID_IS_NOT_EXIST = "图像id不存在";
|
||||
public static final String IMAGE_SOURCE_IS_NOT_EXIST = "图像类型不存在";
|
||||
public static final String DEFECT_ID_IS_NOT_EXIST = "缺陷id不存在";
|
||||
public static final String PROJECT_ID_IS_NOT_EXIST = "项目id不存在";
|
||||
public static final String TURBINE_ID_IS_NOT_EXIST = "机组id不存在";
|
||||
|
@ -27,6 +28,8 @@ public class Message implements Serializable {
|
|||
public static final String MOBILE_EXIST = "手机号码已经存在,请重新输入";
|
||||
public static final String EMAIL_EXIST = "邮箱已经存在,请重新输入";
|
||||
public static final String IDENTITY_CARD_EXIST = "身份证已经存在,请重新输入";
|
||||
public static final String OLD_PASSWORD_EQUAL_NEW_PASSWORD = "身份证已经存在,请重新输入";
|
||||
public static final String OLD_PASSWORD_IS_ERROR = "旧密码错误,请重新输入";
|
||||
public static final String DEPT_PARENT_NOT_EXIST = "父级部门不存在";
|
||||
public static final String DEPT_ID_NOT_EXIST = "部门id不存在";
|
||||
public static final String POST_ID_NOT_EXIST = "岗位id不存在";
|
||||
|
@ -60,4 +63,8 @@ public class Message implements Serializable {
|
|||
public static final String WORK_SHIFT_NAME_EXIST = "班次名称已经存在";
|
||||
public static final String WORK_SHIFT_NOT_EXIST = "班次不存在";
|
||||
public static final String WORK_SHIFT_IS_NOT_UNPUBLISH = "班次的状态不是未发布";
|
||||
public static final String IMAGE_AUTO_MARK_ERROR = "自动标注出错:";
|
||||
public static final String SUGGESTION_ID_IS_NOT_EXIST = "维修建议id不存在";
|
||||
public static final String SUGGESTION_LEVEL_TYPE_FORBID_REPEAT = "存在缺陷级别为[{}]缺陷类型为[{}]的维修建议";
|
||||
public static final String CHECK_SCHEME_ID_IS_NOT_EXIST = "检查方案id不存在";
|
||||
}
|
||||
|
|
|
@ -97,5 +97,16 @@ public interface Converts {
|
|||
WorkShiftResp toWorkShiftResp(WorkShiftEntity entity);
|
||||
|
||||
WorkShiftEntity toWorkShiftEntity(WorkShiftReq req);
|
||||
|
||||
List<MaintainSuggestionResp> toMaintainSuggestionResp(List<MaintainSuggestionEntity> list);
|
||||
|
||||
MaintainSuggestionResp toMaintainSuggestionResp(MaintainSuggestionEntity entity);
|
||||
|
||||
MaintainSuggestionEntity toMaintainSuggestionEntity(MaintainSuggestionReq req);
|
||||
|
||||
List<CheckSchemeResp> toCheckSchemeResp(List<CheckSchemeEntity> list);
|
||||
CheckSchemeResp toCheckSchemeResp(CheckSchemeEntity entity);
|
||||
|
||||
CheckSchemeEntity toCheckSchemeEntity(CheckSchemeReq req);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package com.dite.znpt.domain.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Detection{
|
||||
|
||||
@ApiModelProperty("标签")
|
||||
public String label;
|
||||
@ApiModelProperty("分类id")
|
||||
private Integer clsId;
|
||||
@ApiModelProperty("位置")
|
||||
private float[] bbox;
|
||||
@ApiModelProperty("置信度")
|
||||
private float confidence;
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.dite.znpt.domain.bo;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Size;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
public class Letterbox {
|
||||
|
||||
@Setter
|
||||
private Size newShape ;
|
||||
private final double[] color = new double[]{114,114,114};
|
||||
private final Boolean auto = false;
|
||||
private final Boolean scaleUp = true;
|
||||
@Setter
|
||||
private Integer stride = 32;
|
||||
|
||||
@Getter
|
||||
private double ratio;
|
||||
@Getter
|
||||
private double dw;
|
||||
@Getter
|
||||
private double dh;
|
||||
|
||||
public Letterbox(int w,int h) {
|
||||
this.newShape = new Size(w, h);
|
||||
}
|
||||
|
||||
public Letterbox() {
|
||||
this.newShape = new Size(640, 640);
|
||||
}
|
||||
|
||||
|
||||
public Integer getWidth() {
|
||||
return (int) this.newShape.width;
|
||||
}
|
||||
|
||||
public Integer getHeight() {
|
||||
return (int) this.newShape.height;
|
||||
}
|
||||
|
||||
public Mat letterbox(Mat im) { // 调整图像大小和填充图像,使满足步长约束,并记录参数
|
||||
|
||||
int[] shape = {im.rows(), im.cols()}; // 当前形状 [height, width]
|
||||
// Scale ratio (new / old)
|
||||
double r = Math.min(this.newShape.height / shape[0], this.newShape.width / shape[1]);
|
||||
if (!this.scaleUp) { // 仅缩小,不扩大(一且为了mAP)
|
||||
r = Math.min(r, 1.0);
|
||||
}
|
||||
// Compute padding
|
||||
Size newUnpad = new Size(Math.round(shape[1] * r), Math.round(shape[0] * r));
|
||||
double dw = this.newShape.width - newUnpad.width, dh = this.newShape.height - newUnpad.height; // wh 填充
|
||||
if (this.auto) { // 最小矩形
|
||||
dw = dw % this.stride;
|
||||
dh = dh % this.stride;
|
||||
}
|
||||
dw /= 2; // 填充的时候两边都填充一半,使图像居于中心
|
||||
dh /= 2;
|
||||
if (shape[1] != newUnpad.width || shape[0] != newUnpad.height) { // resize
|
||||
Imgproc.resize(im, im, newUnpad, 0, 0, Imgproc.INTER_LINEAR);
|
||||
}
|
||||
int top = (int) Math.round(dh - 0.1), bottom = (int) Math.round(dh + 0.1);
|
||||
int left = (int) Math.round(dw - 0.1), right = (int) Math.round(dw + 0.1);
|
||||
// 将图像填充为正方形
|
||||
Core.copyMakeBorder(im, im, top, bottom, left, right, Core.BORDER_CONSTANT, new org.opencv.core.Scalar(this.color));
|
||||
this.ratio = r;
|
||||
this.dh = dh;
|
||||
this.dw = dw;
|
||||
return im;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.dite.znpt.domain.bo;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public final class ODConfig {
|
||||
|
||||
|
||||
public static final Integer lineThicknessRatio = 333;
|
||||
public static final Double fontSizeRatio = 1080.0;
|
||||
|
||||
private static final List<String> default_names = new ArrayList<>(Arrays.asList(
|
||||
"person", "bicycle", "car", "motorcycle", "airplane", "bus", "train",
|
||||
"truck", "boat", "traffic light", "fire hydrant", "stop sign", "parking meter",
|
||||
"bench", "bird", "cat", "dog", "horse", "sheep", "cow", "elephant", "bear",
|
||||
"zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase",
|
||||
"frisbee", "skis", "snowboard", "sports ball", "kite", "baseball bat",
|
||||
"baseball glove", "skateboard", "surfboard", "tennis racket", "bottle",
|
||||
"wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple",
|
||||
"sandwich", "orange", "broccoli", "carrot", "hot dog", "pizza", "donut",
|
||||
"cake", "chair", "couch", "potted plant", "bed", "dining table", "toilet",
|
||||
"tv", "laptop", "mouse", "remote", "keyboard", "cell phone", "microwave",
|
||||
"oven", "toaster", "sink", "refrigerator", "book", "clock", "vase", "scissors",
|
||||
"teddy bear", "hair drier", "toothbrush"));
|
||||
|
||||
|
||||
private static final List<String> names = new ArrayList<>(Arrays.asList(
|
||||
"no_helmet", "helmet"));
|
||||
|
||||
private final Map<String, double[]> colors;
|
||||
|
||||
public ODConfig() {
|
||||
this.colors = new HashMap<>();
|
||||
default_names.forEach(name->{
|
||||
Random random = new Random();
|
||||
double[] color = {random.nextDouble()*256, random.nextDouble()*256, random.nextDouble()*256};
|
||||
colors.put(name, color);
|
||||
});
|
||||
}
|
||||
|
||||
public String getName(int clsId) {
|
||||
return names.get(clsId);
|
||||
}
|
||||
|
||||
public double[] getColor(int clsId) {
|
||||
return colors.get(getName(clsId));
|
||||
}
|
||||
|
||||
public double[] getNameColor(String Name){
|
||||
return colors.get(Name);
|
||||
}
|
||||
|
||||
public double[] getOtherColor(int clsId) {
|
||||
return colors.get(default_names.get(clsId));
|
||||
}
|
||||
}
|
|
@ -1,10 +1,8 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
@ -29,8 +27,8 @@ public class AudioFileInfoEntity extends AuditableEntity implements Serializable
|
|||
|
||||
@ExcelProperty("id")
|
||||
@ApiModelProperty("id")
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
@TableId(value = "audio_id", type = IdType.ASSIGN_ID)
|
||||
private String audioId;
|
||||
|
||||
@ExcelProperty("图片id")
|
||||
@ApiModelProperty("图片id")
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/9 23:29
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("check_scheme")
|
||||
@ApiModel(value="CheckSchemeEntity对象", description="检查方案")
|
||||
public class CheckSchemeEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
@ApiModelProperty("方案id")
|
||||
@TableId(value = "scheme_id", type = IdType.ASSIGN_UUID)
|
||||
private String schemeId;
|
||||
|
||||
@ApiModelProperty("工作内容")
|
||||
@TableField("work_content")
|
||||
private String workContent;
|
||||
|
||||
@ApiModelProperty("人员配置")
|
||||
@TableField("staff_config")
|
||||
private String staffConfig;
|
||||
|
||||
@ApiModelProperty("设备配置")
|
||||
@TableField("device_config")
|
||||
private String deviceConfig;
|
||||
|
||||
@ApiModelProperty("实施方案")
|
||||
@TableField("construction_scheme")
|
||||
private String constructionScheme;
|
||||
|
||||
@ApiModelProperty("检查方式,枚举CheckMethodEnum")
|
||||
@TableField("check_method")
|
||||
private String checkMethod;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("删除标志(0代表存在 1代表删除)")
|
||||
@TableField("delFlag")
|
||||
private String delFlag;
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@ import lombok.EqualsAndHashCode;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
|
@ -117,4 +116,8 @@ public class ImageEntity extends AuditableEntity implements Serializable {
|
|||
@TableField("image_path")
|
||||
private String imagePath;
|
||||
|
||||
@ApiModelProperty("是否已审核,0未审核,1已审核")
|
||||
@TableField("review_state")
|
||||
private Boolean reviewState;
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/7/7/周一 16:59
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("inspection_report")
|
||||
@ApiModel(value="InspectionReportEntity对象", description="检测报告表")
|
||||
public class InspectionReportEntity extends AuditableEntity implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 6994234156669409533L;
|
||||
|
||||
@ApiModelProperty("报告id")
|
||||
@TableId(value = "report_id", type = IdType.ASSIGN_UUID)
|
||||
private String reportId;
|
||||
|
||||
@ApiModelProperty("主标题")
|
||||
@TableField("title")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty("副标题")
|
||||
@TableField("sub_title")
|
||||
private String subTitle;
|
||||
|
||||
@ApiModelProperty("封面")
|
||||
@TableField("cover_image")
|
||||
private String coverImage;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
@TableField("project_id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("机组id")
|
||||
@TableField("turbine_id")
|
||||
private String turbineId;
|
||||
|
||||
@ApiModelProperty("检查日期")
|
||||
@TableField("check_date")
|
||||
private LocalDate checkDate;
|
||||
|
||||
@ApiModelProperty("检查位置")
|
||||
@TableField("check_position")
|
||||
private String checkPosition;
|
||||
|
||||
@ApiModelProperty("检查内容")
|
||||
@TableField("check_content")
|
||||
private String checkContent;
|
||||
|
||||
@ApiModelProperty("检查方式")
|
||||
@TableField("check_method")
|
||||
private String checkMethod;
|
||||
|
||||
@ApiModelProperty("检查人员id,多个人员英文逗号分隔")
|
||||
@TableField("check_user_id")
|
||||
private String checkUserId;
|
||||
|
||||
@ApiModelProperty("报告编制人员id")
|
||||
@TableField("report_writer")
|
||||
private String reportWriter;
|
||||
|
||||
@ApiModelProperty("报告编制时间")
|
||||
@TableField("report_write_time")
|
||||
private LocalDateTime reportWriteTime;
|
||||
|
||||
@ApiModelProperty("报告复核人员id")
|
||||
@TableField("report_reviewer")
|
||||
private String reportReviewer;
|
||||
|
||||
@ApiModelProperty("报告复核时间")
|
||||
@TableField("report_review_time")
|
||||
private LocalDateTime reportReviewTime;
|
||||
|
||||
@ApiModelProperty("报告审核人员id")
|
||||
@TableField("report_auditor")
|
||||
private String reportAuditor;
|
||||
|
||||
@ApiModelProperty("报告审核时间")
|
||||
@TableField("report_audit_time")
|
||||
private LocalDateTime reportAuditTime;
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/7 22:18
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("maintain_suggestion")
|
||||
@ApiModel(value="MaintainSuggestionEntity对象", description="维修建议库")
|
||||
public class MaintainSuggestionEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -5774159362861473940L;
|
||||
|
||||
@ApiModelProperty("建议id")
|
||||
@TableId(value = "suggestion_id", type = IdType.ASSIGN_UUID)
|
||||
private String suggestionId;
|
||||
|
||||
@ApiModelProperty("建议类容")
|
||||
@TableField("suggestion_content")
|
||||
private String suggestionContent;
|
||||
|
||||
@ApiModelProperty("缺陷级别")
|
||||
@TableField("defect_level")
|
||||
private String defectLevel;
|
||||
|
||||
|
||||
@ApiModelProperty("缺陷类型")
|
||||
@TableField("defect_type")
|
||||
private String defectType;
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
* @Description: 模型配置表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("model_config")
|
||||
@ApiModel(value="ModelConfigEntity对象", description="模型配置表")
|
||||
public class ModelConfigEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -73052440757340126L;
|
||||
|
||||
@ExcelProperty("模型id")
|
||||
@ApiModelProperty("模型id")
|
||||
@TableId(value = "model_id", type = IdType.ASSIGN_ID)
|
||||
private String modelId;
|
||||
|
||||
@ExcelProperty("模型名称")
|
||||
@ApiModelProperty("模型名称")
|
||||
@TableField("model_name")
|
||||
private String modelName;
|
||||
|
||||
@ExcelProperty("模型路径")
|
||||
@ApiModelProperty("模型路径")
|
||||
@TableField("model_path")
|
||||
private String modelPath;
|
||||
|
||||
@ExcelProperty("模型置信度")
|
||||
@ApiModelProperty("模型置信度")
|
||||
@TableField("conf_threshold")
|
||||
private Float confThreshold;
|
||||
|
||||
@ExcelProperty("非极大抑制")
|
||||
@ApiModelProperty("非极大抑制")
|
||||
@TableField("nms_threshold")
|
||||
private Float nmsThreshold;
|
||||
}
|
||||
|
|
@ -1,24 +1,27 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
* @Description: 表实体类
|
||||
* @Description: 部件表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("part")
|
||||
@ApiModel(value="PartEntity对象", description="表")
|
||||
@ApiModel(value="PartEntity对象", description="部件表")
|
||||
public class PartEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -53853862365306266L;
|
||||
|
|
|
@ -80,6 +80,11 @@ public class ProjectEntity extends AuditableEntity implements Serializable {
|
|||
@TableField("scale")
|
||||
private String scale;
|
||||
|
||||
@ExcelProperty("总工期,单位天")
|
||||
@ApiModelProperty("总工期,单位天")
|
||||
@TableField("duration")
|
||||
private Integer duration;
|
||||
|
||||
@ExcelProperty("风机型号")
|
||||
@ApiModelProperty("风机型号")
|
||||
@TableField("turbine_model")
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author sakura
|
||||
* @date 2025/04/10 13:35
|
||||
|
@ -36,8 +39,8 @@ public class TConstructionEntity extends AuditableEntity implements Serializable
|
|||
|
||||
@ExcelProperty("机组id")
|
||||
@ApiModelProperty("机组id")
|
||||
@TableField("turbine_code")
|
||||
private String turbineCode;
|
||||
@TableField("turbine_id")
|
||||
private String turbineId;
|
||||
|
||||
@ExcelProperty("作业开始时间")
|
||||
@ApiModelProperty("作业开始时间")
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
|
@ -9,8 +7,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.AudioFileInfoEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
|
@ -21,19 +17,16 @@ import com.dite.znpt.domain.entity.AudioFileInfoEntity;
|
|||
@ApiModel("音频文件信息响应实体")
|
||||
public class AudioFileInfoResp {
|
||||
|
||||
@ExcelProperty("id")
|
||||
@ApiModelProperty("id")
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
@ExcelProperty("audioId")
|
||||
@ApiModelProperty("audioId")
|
||||
private String audioId;
|
||||
|
||||
@ExcelProperty("图片id")
|
||||
@ApiModelProperty("图片id")
|
||||
@TableField("image_id")
|
||||
private String imageId;
|
||||
|
||||
@ExcelProperty("文件保存路径")
|
||||
@ApiModelProperty("文件保存路径")
|
||||
@TableField("file_path")
|
||||
private String filePath;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/9 23:35
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("检查方案请求实体")
|
||||
public class CheckSchemeReq implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 2699725873314667276L;
|
||||
|
||||
@NotBlank(message = "工作内容不能为空")
|
||||
@Size(max = 1000, message = "工作内容不能超过1000个字")
|
||||
@ApiModelProperty("工作内容")
|
||||
private String workContent;
|
||||
|
||||
@NotBlank(message = "人员配置不能为空")
|
||||
@Size(max = 200, message = "人员配置不能超过200个字")
|
||||
@ApiModelProperty("人员配置")
|
||||
private String staffConfig;
|
||||
|
||||
@NotBlank(message = "设备配置不能为空")
|
||||
@Size(max = 500, message = "设备配置不能超过500个字")
|
||||
@ApiModelProperty("设备配置")
|
||||
private String deviceConfig;
|
||||
|
||||
@NotBlank(message = "实施方案不能为空")
|
||||
@Size(max = 2000, message = "实施方案不能超过2000个字")
|
||||
@ApiModelProperty("实施方案")
|
||||
private String constructionScheme;
|
||||
|
||||
@NotBlank(message = "检查方式不能为空")
|
||||
@ApiModelProperty("检查方式,枚举CheckMethodEnum")
|
||||
private String checkMethod;
|
||||
|
||||
@NotBlank(message = "备注不能为空")
|
||||
@Size(max = 500, message = "备注不能超过500个字")
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
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/7/9 23:14
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("检查方案响应实体")
|
||||
public class CheckSchemeResp implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 2327453920890578467L;
|
||||
|
||||
@ApiModelProperty("方案id")
|
||||
private String schemeId;
|
||||
|
||||
@ApiModelProperty("工作内容")
|
||||
private String workContent;
|
||||
|
||||
@ApiModelProperty("人员配置")
|
||||
private String staffConfig;
|
||||
|
||||
@ApiModelProperty("设备配置")
|
||||
private String deviceConfig;
|
||||
|
||||
@ApiModelProperty("实施方案")
|
||||
private String constructionScheme;
|
||||
|
||||
@ApiModelProperty("检查方式,枚举CheckMethodEnum")
|
||||
private String checkMethod;
|
||||
|
||||
@ApiModelProperty("检查方式描述")
|
||||
private String checkMethodLabel;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
|
@ -1,12 +1,11 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
|
@ -27,6 +26,9 @@ public class DefectListReq implements Serializable {
|
|||
@ApiModelProperty("机组id")
|
||||
private String turbineId;
|
||||
|
||||
@ApiModelProperty("部件id")
|
||||
private String partId;
|
||||
|
||||
@ApiModelProperty("缺陷类型,枚举:DefectTypeEnum")
|
||||
private String defectType;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.dite.znpt.domain.bo.Detection;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
@ -32,4 +33,10 @@ public class DefectListResp implements Serializable {
|
|||
|
||||
@ApiModelProperty("说明")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty("标注信息")
|
||||
private String labelInfo;
|
||||
|
||||
@ApiModelProperty("标注信息")
|
||||
private Detection markInfo;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.dite.znpt.util.ValidationGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel("缺陷记录列表请求实体")
|
||||
public class DefectMarkReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 585419070823466048L;
|
||||
|
||||
@ApiModelProperty("图片id")
|
||||
private String imageId;
|
||||
|
||||
@NotBlank(groups = {ValidationGroup.Request.class}, message = "模型id不能为空")
|
||||
@ApiModelProperty("模型id")
|
||||
private String modelId;
|
||||
|
||||
@NotNull(groups = {ValidationGroup.Request.class}, message = "模型置信度不能为空")
|
||||
@Min(value = 0, groups = {ValidationGroup.Request.class}, message = "模型置信度只能在0-100之间")
|
||||
@Max(value = 100, groups = {ValidationGroup.Request.class}, message = "模型置信度只能在0-100之间")
|
||||
@ApiModelProperty("置信度")
|
||||
private float confThreshold;
|
||||
|
||||
@ApiModelProperty("缺陷类型")
|
||||
private List<String> defectTypeList;
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.dite.znpt.domain.bo.Detection;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
@ -51,9 +52,15 @@ public class DefectReq implements Serializable {
|
|||
@ApiModelProperty("标注信息")
|
||||
private String labelInfo;
|
||||
|
||||
@ApiModelProperty("标注信息")
|
||||
private Detection markInfo;
|
||||
|
||||
@ApiModelProperty("说明")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty("维修建议")
|
||||
private String repairIdea;
|
||||
|
||||
@ApiModelProperty("附件id")
|
||||
private String attachId;
|
||||
}
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
|
@ -27,6 +22,9 @@ public class DefectResp extends DefectReq implements Serializable {
|
|||
@ApiModelProperty("缺陷id")
|
||||
private String defectId;
|
||||
|
||||
@ApiModelProperty("图像id")
|
||||
private String imageId;
|
||||
|
||||
@ApiModelProperty("缺陷类型描述")
|
||||
private String defectTypeLabel;
|
||||
|
||||
|
@ -39,5 +37,8 @@ public class DefectResp extends DefectReq implements Serializable {
|
|||
@ApiModelProperty("来源描述")
|
||||
private String sourceLabel;
|
||||
|
||||
@ApiModelProperty("缺陷附件路径")
|
||||
private String attachPath;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -47,4 +47,10 @@ public class ImageCollectInfo implements Serializable {
|
|||
|
||||
@ApiModelProperty("采集员姓名")
|
||||
private String collectorName;
|
||||
|
||||
@ApiModelProperty("来源")
|
||||
private String imageSource;
|
||||
|
||||
@ApiModelProperty("来源描述")
|
||||
private String imageSourceLabel;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
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 org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
@ -23,10 +23,12 @@ public class ImageCollectReq implements Serializable {
|
|||
@Serial
|
||||
private static final long serialVersionUID = 8937301872925896770L;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("拍摄时间-起")
|
||||
private LocalDateTime shootingTimeBegin;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("拍摄时间-止")
|
||||
private LocalDateTime shootingTimeEnd;
|
||||
|
@ -58,6 +60,9 @@ public class ImageCollectReq implements Serializable {
|
|||
@ApiModelProperty("采集员姓名")
|
||||
private String collectorName;
|
||||
|
||||
@ApiModelProperty("来源")
|
||||
private String imageSource;
|
||||
|
||||
@ApiModelProperty("图像信息")
|
||||
private List<ImageReq> imageList;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,13 @@ public class ImageListReq implements Serializable {
|
|||
@ApiModelProperty("机组id")
|
||||
private String turbineId;
|
||||
|
||||
@ApiModelProperty("部件id")
|
||||
private String partId;
|
||||
|
||||
@ApiModelProperty("图像类型")
|
||||
private String[] imageTypes;
|
||||
|
||||
@ApiModelProperty("是否已审核,0未审核,1已审核")
|
||||
private Boolean reviewState;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.dite.znpt.domain.entity.AudioFileInfoEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
@ -28,9 +26,11 @@ public class ImageListResp implements Serializable {
|
|||
private String imageId;
|
||||
|
||||
@ApiModelProperty("图像名称")
|
||||
@TableField("image_name")
|
||||
private String imageName;
|
||||
|
||||
@ApiModelProperty("图像路径")
|
||||
private String imagePath;
|
||||
|
||||
@ApiModelProperty("部件id")
|
||||
private String partId;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.dite.znpt.domain.entity.AudioFileInfoEntity;
|
||||
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;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -47,4 +43,7 @@ public class ImageResp implements Serializable {
|
|||
@ApiModelProperty("关联图像的音频列表")
|
||||
private List<AudioFileInfoResp> audioList;
|
||||
|
||||
@ApiModelProperty("是否已审核,0未审核,1已审核")
|
||||
private Boolean reviewState;
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
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.LocalDate;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/9 22:23
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("检查报告检查信息")
|
||||
public class InspectionReportCheckInfo implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 193233798058399831L;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty("检查日期")
|
||||
private LocalDate checkDate;
|
||||
|
||||
@ApiModelProperty("检查位置")
|
||||
private String checkPosition;
|
||||
|
||||
@ApiModelProperty("检查内容")
|
||||
private String checkContent;
|
||||
|
||||
@ApiModelProperty("检查方式")
|
||||
private String checkMethod;
|
||||
|
||||
@ApiModelProperty("检查人员id,多个人员英文逗号分隔")
|
||||
private String checkUserId;
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
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/7/9 22:16
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("检查报告封面信息")
|
||||
public class InspectionReportCoverInfo implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 2416173276374292199L;
|
||||
|
||||
@ApiModelProperty("报告id")
|
||||
private String reportId;
|
||||
|
||||
@ApiModelProperty("主标题")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty("副标题")
|
||||
private String subTitle;
|
||||
|
||||
@ApiModelProperty("封面")
|
||||
private String coverImage;
|
||||
|
||||
@ApiModelProperty("报告编制人员id")
|
||||
private String reportWriter;
|
||||
|
||||
@ApiModelProperty("报告编制人员")
|
||||
private String reportWriterName;
|
||||
|
||||
@ApiModelProperty("报告编制时间")
|
||||
private LocalDateTime reportWriteTime;
|
||||
|
||||
@ApiModelProperty("报告复核人员id")
|
||||
private String reportReviewer;
|
||||
|
||||
@ApiModelProperty("报告复核人员")
|
||||
private String reportReviewerName;
|
||||
|
||||
@ApiModelProperty("报告复核时间")
|
||||
private LocalDateTime reportReviewTime;
|
||||
|
||||
@ApiModelProperty("报告审核人员id")
|
||||
private String reportAuditor;
|
||||
|
||||
@ApiModelProperty("报告审核人员")
|
||||
private String reportAuditName;
|
||||
|
||||
@ApiModelProperty("报告审核时间")
|
||||
private LocalDateTime reportAuditTime;
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
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.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/9 22:08
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("检查报告请求实体")
|
||||
public class InspectionReportReq implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 4937399975205847660L;
|
||||
|
||||
@ApiModelProperty("报告id")
|
||||
private String reportId;
|
||||
|
||||
@ApiModelProperty("主标题")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty("副标题")
|
||||
private String subTitle;
|
||||
|
||||
@ApiModelProperty("封面")
|
||||
private String coverImage;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("机组id")
|
||||
private String turbineId;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty("检查日期")
|
||||
private LocalDate checkDate;
|
||||
|
||||
@ApiModelProperty("检查位置")
|
||||
private String checkPosition;
|
||||
|
||||
@ApiModelProperty("检查内容")
|
||||
private String checkContent;
|
||||
|
||||
@ApiModelProperty("检查方式,多个方式英文逗号分隔")
|
||||
private String checkMethod;
|
||||
|
||||
@ApiModelProperty("检查人员id,多个人员英文逗号分隔")
|
||||
private String checkUserId;
|
||||
|
||||
@ApiModelProperty("报告编制人员id")
|
||||
private String reportWriter;
|
||||
|
||||
@ApiModelProperty("报告编制时间")
|
||||
private LocalDateTime reportWriteTime;
|
||||
|
||||
@ApiModelProperty("报告复核人员id")
|
||||
private String reportReviewer;
|
||||
|
||||
@ApiModelProperty("报告复核时间")
|
||||
private LocalDateTime reportReviewTime;
|
||||
|
||||
@ApiModelProperty("报告审核人员id")
|
||||
private String reportAuditor;
|
||||
|
||||
@ApiModelProperty("报告审核时间")
|
||||
private LocalDateTime reportAuditTime;
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
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;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/9 22:14
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("检查报告响应实体")
|
||||
public class InspectionReportResp implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -2229157312487991799L;
|
||||
|
||||
@ApiModelProperty("封面信息")
|
||||
private InspectionReportCoverInfo coverInfo;
|
||||
|
||||
@ApiModelProperty("项目信息")
|
||||
private ProjectResp projectInfo;
|
||||
|
||||
@ApiModelProperty("检查信息")
|
||||
private InspectionReportCheckInfo checkInfo;
|
||||
|
||||
@ApiModelProperty("机组信息")
|
||||
private TurbineInfoResp turbineInfo;
|
||||
|
||||
@ApiModelProperty("检查方案")
|
||||
private List<CheckSchemeResp> schemeInfoList;
|
||||
|
||||
@ApiModelProperty("缺陷信息")
|
||||
private List<DefectResp> defectInfoList;
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/9 22:24
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("检查报告方案信息")
|
||||
public class InspectionReportSchemeInfo implements Serializable {
|
||||
|
||||
|
||||
@ApiModelProperty("检查日期")
|
||||
@TableField("check_date")
|
||||
private LocalDate checkDate;
|
||||
|
||||
@ApiModelProperty("检查位置")
|
||||
@TableField("check_position")
|
||||
private String checkPosition;
|
||||
|
||||
@ApiModelProperty("检查内容")
|
||||
@TableField("check_content")
|
||||
private String checkContent;
|
||||
|
||||
@ApiModelProperty("检查方式")
|
||||
@TableField("check_method")
|
||||
private String checkMethod;
|
||||
|
||||
@ApiModelProperty("检查人员id,多个人员英文逗号分隔")
|
||||
@TableField("check_user_id")
|
||||
private String checkUserId;
|
||||
}
|
|
@ -25,6 +25,6 @@ public class LoginReq implements Serializable {
|
|||
private String account;
|
||||
|
||||
@NotBlank(message = "密码不能为空")
|
||||
@ApiModelProperty("密码,密文传输,采用aes加密,秘钥为账号")
|
||||
@ApiModelProperty("密码,密文传输,密码加密采用aes(加密模式ECB,填充方式PKCS#7)加密传输,加密密钥产生逻辑:对账号做md5()计算,然后取值8-24位。")
|
||||
private String password;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/7 22:25
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("维修建议请求实体")
|
||||
public class MaintainSuggestionReq implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 6390137746113715095L;
|
||||
|
||||
@NotBlank(message = "建议内容不能为空")
|
||||
@Size(max = 200, message = "建议内容不能超过200个字符")
|
||||
@ApiModelProperty("建议内容")
|
||||
private String suggestionContent;
|
||||
|
||||
@NotBlank(message = "缺陷类型不能为空")
|
||||
@ApiModelProperty("缺陷类型,枚举:DefectTypeEnum")
|
||||
private String defectType;
|
||||
|
||||
@NotBlank(message = "缺陷级别不能为空")
|
||||
@ApiModelProperty("缺陷级别,枚举:DefectLevelEnum")
|
||||
private String defectLevel;
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/7 22:26
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("维修建议响应实体")
|
||||
public class MaintainSuggestionResp implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -5835303002016693551L;
|
||||
|
||||
@ApiModelProperty("建议id")
|
||||
private String suggestionId;
|
||||
|
||||
@ApiModelProperty("建议内容")
|
||||
private String suggestionContent;
|
||||
|
||||
@ApiModelProperty("缺陷类型,枚举:DefectTypeEnum")
|
||||
private String defectType;
|
||||
|
||||
@ApiModelProperty("缺陷类型描述")
|
||||
private String defectTypeLabel;
|
||||
|
||||
@ApiModelProperty("缺陷级别,枚举:DefectLevelEnum")
|
||||
private String defectLevel;
|
||||
|
||||
@ApiModelProperty("缺陷级别描述")
|
||||
private String defectLevelLabel;
|
||||
}
|
|
@ -28,7 +28,7 @@ public class MenuReq implements Serializable {
|
|||
@ApiModelProperty("菜单名称")
|
||||
private String menuName;
|
||||
|
||||
@ApiModelProperty("父级菜单id")
|
||||
@ApiModelProperty("父级菜单id,父级菜单修改无效")
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty("显示顺序")
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
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 huise23
|
||||
* @date 2025/07/02 20:57
|
||||
* @Description: 请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("列表请求实体")
|
||||
public class ModelConfigListReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -41204426418525667L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("Id")
|
||||
private String modelId;
|
||||
|
||||
@ApiModelProperty("模型名称")
|
||||
private String modelName;
|
||||
|
||||
@ApiModelProperty("模型路径")
|
||||
private String modelPath;
|
||||
|
||||
@ApiModelProperty("模型置信度")
|
||||
private Float confThreshold;
|
||||
|
||||
@ApiModelProperty("非极大抑制")
|
||||
private Float nmsThreshold;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.dite.znpt.util.ValidationGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
* @Description: 模型配置表请求类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="ModelConfig请求对象", description="模型配置表")
|
||||
public class ModelConfigReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 930798215980875267L;
|
||||
|
||||
@ApiModelProperty("模型id")
|
||||
private String modelId;
|
||||
|
||||
@NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "模型名称不能为空")
|
||||
@Size(max = 50, groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "模型名称长度不能超过50")
|
||||
@ApiModelProperty("模型名称")
|
||||
private String modelName;
|
||||
|
||||
@NotEmpty(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "模型附件不能为空")
|
||||
@ApiModelProperty("模型附件id")
|
||||
private String attachId;
|
||||
|
||||
@NotNull(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "模型置信度不能为空")
|
||||
@Min(value = 0, groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "模型置信度只能在0-100之间")
|
||||
@Max(value = 100, groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "模型置信度只能在0-100之间")
|
||||
@ApiModelProperty("模型置信度")
|
||||
private Float confThreshold;
|
||||
|
||||
@NotNull(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "nms不能为空")
|
||||
@Min(value = 0, groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "nms只能在0-1之间")
|
||||
@Max(value = 1, groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "nms只能在0-1之间")
|
||||
@ApiModelProperty("nms")
|
||||
private Float nmsThreshold;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.dite.znpt.domain.entity.ModelConfigEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
* @Description: 响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("响应实体")
|
||||
public class ModelConfigResp extends ModelConfigEntity {
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/5/22/周四 17:36
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("修改密码请求实体")
|
||||
public class ModifyPasswordReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -5458522057381605255L;
|
||||
|
||||
@NotBlank(message = "账号不能为空")
|
||||
@ApiModelProperty("账号")
|
||||
private String account;
|
||||
|
||||
@NotBlank(message = "旧密码不能为空")
|
||||
@ApiModelProperty("旧密码,密文传输,密码加密采用aes(加密模式ECB,填充方式PKCS#7)加密传输,加密密钥产生逻辑:对账号做md5()计算,然后取值8-24位。")
|
||||
private String oldPassword;
|
||||
|
||||
@NotBlank(message = "新密码不能为空")
|
||||
@ApiModelProperty("新密码,密文传输,密码加密采用aes(加密模式ECB,填充方式PKCS#7)加密传输,加密密钥产生逻辑:对账号做md5()计算,然后取值8-24位。")
|
||||
private String newPassword;
|
||||
}
|
|
@ -67,6 +67,9 @@ public class ProjectListResp implements Serializable {
|
|||
@ApiModelProperty("项目规模")
|
||||
private String scale;
|
||||
|
||||
@ApiModelProperty("总工期,单位天")
|
||||
private Integer duration;
|
||||
|
||||
@ApiModelProperty("风机型号")
|
||||
private String turbineModel;
|
||||
|
||||
|
|
|
@ -74,6 +74,9 @@ public class ProjectReq implements Serializable {
|
|||
@ApiModelProperty("项目规模")
|
||||
private String scale;
|
||||
|
||||
@ApiModelProperty("总工期,单位天")
|
||||
private Integer duration;
|
||||
|
||||
@Size(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, max = 20, message = "风机型号不能超过20字符")
|
||||
@ApiModelProperty("风机型号")
|
||||
private String turbineModel;
|
||||
|
|
|
@ -1,21 +1,13 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import com.dite.znpt.util.ValidationGroup;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/06/27 14:21
|
||||
|
@ -60,11 +52,11 @@ public class ProjectTaskImportReq implements Serializable {
|
|||
@ExcelProperty(value = "实际结束时间")
|
||||
private LocalDate actualEndDate;
|
||||
|
||||
@ExcelProperty(value = "任务状态,0未开始,1进行中,2已结束")
|
||||
private Integer status;
|
||||
@ExcelProperty(value = "任务状态(未开始,进行中,已结束)")
|
||||
private String status;
|
||||
|
||||
@ExcelProperty(value = "是否逾期,默认未逾期")
|
||||
private Integer overdueStatus;
|
||||
@ExcelProperty(value = "是否逾期(已逾期,未逾期)")
|
||||
private String overdueStatus;
|
||||
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/24 13:44
|
||||
|
@ -29,7 +29,7 @@ public class TConstructionListReq implements Serializable {
|
|||
private String projectId;
|
||||
|
||||
@ApiModelProperty("机组id")
|
||||
private String turbineCode;
|
||||
private String turbineId;
|
||||
|
||||
@ApiModelProperty("作业开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/03 16:25
|
||||
* @Description: 施工信息表请求类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="TConstruction请求对象", description="施工信息表")
|
||||
public class TConstructionReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 583631934062856440L;
|
||||
|
||||
@ApiModelProperty("施工id")
|
||||
private String constructionId;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("机组id")
|
||||
private String turbineId;
|
||||
|
||||
@ApiModelProperty("作业开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty("作业结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ApiModelProperty("温度(℃)")
|
||||
private Double temperature;
|
||||
|
||||
@ApiModelProperty("风速(m/s)")
|
||||
private Double windSpeed;
|
||||
|
||||
@ApiModelProperty("采集图片数量")
|
||||
private Integer imageCount;
|
||||
|
||||
@ApiModelProperty("天气id")
|
||||
private String weatherCode;
|
||||
|
||||
@ApiModelProperty("施工状态")
|
||||
private String statusId;
|
||||
|
||||
@ApiModelProperty("当前时间")
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
|
|
@ -24,6 +24,7 @@ public class UserReq implements Serializable {
|
|||
@Serial
|
||||
private static final long serialVersionUID = -5491849652107338027L;
|
||||
|
||||
@NotBlank(message = "账号不能为空")
|
||||
@Pattern(groups = {ValidationGroup.Insert.class},regexp = "^[a-zA-Z0-9_]{4,20}$", message = "只能包含字母、数字或下划线,长度4-20")
|
||||
@ApiModelProperty("账号")
|
||||
private String account;
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.dite.znpt.domain.vo;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serial;
|
||||
|
@ -30,6 +31,7 @@ public class VideoFileInfoReq implements Serializable {
|
|||
@ApiModelProperty("作业人员id")
|
||||
private String workerUserId;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("拍摄时间")
|
||||
private LocalDateTime shootingTime;
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ import java.util.List;
|
|||
public enum AttachBusinessTypeEnum {
|
||||
PROJECT_TASK("PROJECT_TASK", "项目任务"),
|
||||
INSURANCE_FILE("insurance", "保险文件"),
|
||||
MODEL_FILE("model", "模型文件"),
|
||||
DEFECT_MARK_PIC("defect_mark_pic", "缺陷标注图片"),
|
||||
;
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
package com.dite.znpt.enums;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/9 23:23
|
||||
* @Description:
|
||||
*/
|
||||
@Getter
|
||||
public enum CheckMethodEnum {
|
||||
BLADE_OUTSIDE("blade-outside","叶片外观检查"),
|
||||
BLADE_INSIDE("blade-inside","叶片内腔检查"),
|
||||
BLADE_LIGHTNING_PROTECTION("blade-lightning-protection","叶片叶尖防雷导通检测"),
|
||||
TURBINE_LIGHTNING_PROTECTION("turbine-lightning-protection","风电机组防雷检测"),
|
||||
;
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
CheckMethodEnum(String code, String desc){
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static CheckMethodEnum getByCode(String code){
|
||||
for (CheckMethodEnum e : CheckMethodEnum.values() ) {
|
||||
if(e.code.equals(code)){
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDescByCode(String code){
|
||||
CheckMethodEnum e = getByCode(code);
|
||||
return null == e ? null : e.desc;
|
||||
}
|
||||
|
||||
public static List<JSONObject> listAll(){
|
||||
List<JSONObject> list = new ArrayList<>(CheckMethodEnum.values().length);
|
||||
for (CheckMethodEnum e : CheckMethodEnum.values() ) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set(e.code, e.desc);
|
||||
list.add(jsonObject);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||
*/
|
||||
@Getter
|
||||
public enum DefectTypeEnum {
|
||||
CRAZE("CRAZE", "合缝开裂"),
|
||||
BMLW("bmlw", "表面裂纹"),
|
||||
ABRASION("ABRASION", "合缝磨损"),
|
||||
LEATHER_BREAKAGE("LEATHER_BREAKAGE", "蒙皮破损"),
|
||||
FABRIC_BREAKAGE("FABRIC_BREAKAGE", "布层破损"),
|
||||
|
|
|
@ -14,34 +14,44 @@ public enum FilePathEnum {
|
|||
IMAGE_TEMP("/static/image/temp/", "image-temp"),
|
||||
VIDEO("/static/video/", "video"),
|
||||
AUDIO("/static/audio/", "audio"),
|
||||
ATTACH("/static/attach/", "attach"),
|
||||
INSURANCE("/static/insurance/", "insurance");
|
||||
ATTACH("/static/attach/", "attach");
|
||||
|
||||
@Getter
|
||||
private final String urlPath;
|
||||
private final String fileRelativePath;
|
||||
|
||||
/**
|
||||
* 功能描述:获取文件绝对路径
|
||||
* 功能描述:获取文件绝对路径前缀
|
||||
*
|
||||
* @return {@link String }
|
||||
* @author cuizhibin
|
||||
* @date 2025/06/23 14:46
|
||||
**/
|
||||
public String getFileAbsolutePath() {
|
||||
public String getFileAbsolutePathPrefix() {
|
||||
return SpringUtil.getBean(Environment.class).getProperty("upload.save-path") + fileRelativePath + FileUtil.FILE_SEPARATOR;
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:获取图像下载路径
|
||||
* 功能描述:获取文件绝对路径全路径
|
||||
*
|
||||
* @return {@link String }
|
||||
* @author cuizhibin
|
||||
* @date 2025/06/23 14:46
|
||||
**/
|
||||
public String getFileAbsolutePath(String fileDownPath) {
|
||||
return FileUtil.normalize(getFileAbsolutePathPrefix() + StrUtil.removePrefix(fileDownPath, urlPath));
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:获取下载路径
|
||||
*
|
||||
* @param absolutePath
|
||||
* @return {@link String }
|
||||
* @author cuizhibin
|
||||
* @date 2025/06/06 09:07
|
||||
**/
|
||||
public String getImageDownPath(String absolutePath) {
|
||||
String relativePath = StrUtil.removePrefix(absolutePath, getFileAbsolutePath());
|
||||
public String getFileDownPath(String absolutePath) {
|
||||
String relativePath = StrUtil.removePrefix(absolutePath, getFileAbsolutePathPrefix());
|
||||
return StrUtil.replace(urlPath.concat(relativePath), FileUtil.FILE_SEPARATOR, StrUtil.SLASH);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,19 +13,17 @@ import java.util.List;
|
|||
*/
|
||||
@Getter
|
||||
public enum ImageSourceEnum {
|
||||
COLLECT("collect", "图像采集", Boolean.TRUE),
|
||||
OUT_WORK("out-work", "外部工作", Boolean.TRUE),
|
||||
IN_WORK("in-work", "内部工作", Boolean.TRUE),
|
||||
LIGHTNING_PROTECTING_WORK("lightning-protection-work", "防雷工作", Boolean.FALSE);
|
||||
COLLECT("collect", "图像采集"),
|
||||
OUT_WORK("out-work", "外部工作"),
|
||||
IN_WORK("in-work", "内部工作"),
|
||||
LIGHTNING_PROTECTING_WORK("lightning-protection-work", "防雷工作");
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
private final boolean isDefectImage;
|
||||
|
||||
ImageSourceEnum(String code, String desc, boolean isDefectImage){
|
||||
ImageSourceEnum(String code, String desc){
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
this.isDefectImage = isDefectImage;
|
||||
}
|
||||
|
||||
public static ImageSourceEnum getByCode(String code){
|
||||
|
@ -42,14 +40,12 @@ public enum ImageSourceEnum {
|
|||
return null == e ? null : e.desc;
|
||||
}
|
||||
|
||||
public static List<JSONObject> list(Boolean isDefectImage){
|
||||
public static List<JSONObject> list(){
|
||||
List<JSONObject> list = new ArrayList<>(ImageSourceEnum.values().length);
|
||||
for (ImageSourceEnum e : ImageSourceEnum.values() ) {
|
||||
if(isDefectImage.equals(e.isDefectImage)){
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set(e.code, e.desc);
|
||||
list.add(jsonObject);
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set(e.code, e.desc);
|
||||
list.add(jsonObject);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.CheckSchemeEntity;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/9 23:37
|
||||
* @Description:
|
||||
*/
|
||||
public interface CheckSchemeMapper extends BaseMapper<CheckSchemeEntity> {
|
||||
}
|
|
@ -3,8 +3,8 @@ package com.dite.znpt.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.DefectEntity;
|
||||
import com.dite.znpt.domain.vo.DefectListReq;
|
||||
import com.dite.znpt.domain.vo.DefectListResp;
|
||||
import com.dite.znpt.domain.vo.DefectResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
* @Description: 缺陷记录表数据库访问层
|
||||
*/
|
||||
public interface DefectMapper extends BaseMapper<DefectEntity> {
|
||||
List<DefectResp> queryBySelective(DefectListReq defectReq);
|
||||
List<DefectListResp> queryBySelective(DefectListReq defectReq);
|
||||
DefectResp detail(String defectId);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.InspectionReportEntity;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/7/7/周一 17:34
|
||||
* @description
|
||||
*/
|
||||
public interface InspectionReportMapper extends BaseMapper<InspectionReportEntity> {
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.MaintainSuggestionEntity;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/7 22:22
|
||||
* @Description:
|
||||
*/
|
||||
public interface MaintainSuggestionMapper extends BaseMapper<MaintainSuggestionEntity> {
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.ModelConfigEntity;
|
||||
import com.dite.znpt.domain.vo.ModelConfigListReq;
|
||||
import com.dite.znpt.domain.vo.ModelConfigResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
* @Description: 模型配置表数据库访问层
|
||||
*/
|
||||
public interface ModelConfigMapper extends BaseMapper<ModelConfigEntity> {
|
||||
List<ModelConfigResp> queryBySelective(ModelConfigListReq modelConfigReq);
|
||||
}
|
||||
|
|
@ -4,15 +4,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.dite.znpt.domain.entity.PartEntity;
|
||||
import com.dite.znpt.domain.vo.PartListReq;
|
||||
import com.dite.znpt.domain.vo.PartListResp;
|
||||
import com.dite.znpt.domain.vo.PartResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
* @Description: 表数据库访问层
|
||||
* @Description: 部件表数据库访问层
|
||||
*/
|
||||
public interface PartMapper extends BaseMapper<PartEntity> {
|
||||
List<PartListResp> queryBySelective(PartListReq partReq);
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.dite.znpt.enums.AttachBusinessTypeEnum;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.rmi.ServerException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,6 +4,7 @@ import cn.dev33.satoken.stp.SaTokenInfo;
|
|||
import cn.hutool.core.lang.tree.Tree;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.vo.LoginReq;
|
||||
import com.dite.znpt.domain.vo.ModifyPasswordReq;
|
||||
import com.dite.znpt.domain.vo.UserInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -17,6 +18,8 @@ public interface AuthService {
|
|||
|
||||
Result<SaTokenInfo> doLogin(LoginReq req);
|
||||
|
||||
void modifyPassword(ModifyPasswordReq req);
|
||||
|
||||
void doLogout();
|
||||
|
||||
List<Tree<String>> getMenuInfo(String userId);
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.CheckSchemeEntity;
|
||||
import com.dite.znpt.domain.vo.CheckSchemeReq;
|
||||
import com.dite.znpt.domain.vo.CheckSchemeResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/9 23:38
|
||||
* @Description:
|
||||
*/
|
||||
public interface CheckSchemeService extends IService<CheckSchemeEntity> {
|
||||
List<CheckSchemeResp> page(String checkMethod);
|
||||
List<CheckSchemeResp> list(String checkMethod);
|
||||
CheckSchemeResp detail(String checkSchemeId);
|
||||
void save(CheckSchemeReq req);
|
||||
void update(String checkSchemeId, CheckSchemeReq req);
|
||||
void deleteById(String checkSchemeId);
|
||||
|
||||
}
|
|
@ -2,10 +2,7 @@ package com.dite.znpt.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.DefectEntity;
|
||||
import com.dite.znpt.domain.vo.DefectListReq;
|
||||
import com.dite.znpt.domain.vo.DefectReq;
|
||||
import com.dite.znpt.domain.vo.DefectResp;
|
||||
import com.dite.znpt.domain.vo.OutWorkDefectReq;
|
||||
import com.dite.znpt.domain.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -24,9 +21,9 @@ public interface DefectService extends IService<DefectEntity> {
|
|||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
List<DefectResp> page(DefectListReq req);
|
||||
List<DefectListResp> page(DefectListReq req);
|
||||
|
||||
List<DefectResp> list(DefectListReq req);
|
||||
List<DefectListResp> list(DefectListReq req);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条缺陷记录
|
||||
|
@ -75,5 +72,15 @@ public interface DefectService extends IService<DefectEntity> {
|
|||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
void deleteById(String defectId);
|
||||
|
||||
/**
|
||||
* 功能描述:缺陷自动检测
|
||||
*
|
||||
* @param markReq 马克请求类
|
||||
* @return {@link List }<{@link DefectResp }>
|
||||
* @author cuizhibin
|
||||
* @date 2025/07/04 14:53
|
||||
**/
|
||||
List<DefectResp> detect(DefectMarkReq markReq);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ public interface ImageService extends IService<ImageEntity> {
|
|||
|
||||
ImageResp detail(String imageId);
|
||||
|
||||
List<ImageReq> batchUploadDefectImage(String partId, String imageSource, MultipartFile[] files);
|
||||
List<ImageReq> batchUploadDefectImage(String partId, String imageSource, ImageCollectReq collectReq, MultipartFile[] files);
|
||||
|
||||
List<String> batchUploadCommonImage(String imageSource, ImageWorkReq imageWorkReq, MultipartFile[] file) throws IOException;
|
||||
|
||||
|
@ -42,4 +42,13 @@ public interface ImageService extends IService<ImageEntity> {
|
|||
* @date 2025/06/06 09:44
|
||||
**/
|
||||
void linkAppImagesToPart(AppImageToPartReq partReq);
|
||||
|
||||
/**
|
||||
* 功能描述:审核图片
|
||||
*
|
||||
* @param imageIds 图片id列表
|
||||
* @author cuizhibin
|
||||
* @date 2025/07/16 15:28
|
||||
**/
|
||||
void reviewImages(List<String> imageIds);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.InspectionReportEntity;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/7/7/周一 17:42
|
||||
* @description
|
||||
*/
|
||||
public interface InspectionReportService extends IService<InspectionReportEntity> {
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.MaintainSuggestionEntity;
|
||||
import com.dite.znpt.domain.vo.MaintainSuggestionReq;
|
||||
import com.dite.znpt.domain.vo.MaintainSuggestionResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/7 22:24
|
||||
* @Description:
|
||||
*/
|
||||
public interface MaintainSuggestionService extends IService<MaintainSuggestionEntity> {
|
||||
|
||||
List<MaintainSuggestionResp> page(String defectLevel, String defectType);
|
||||
List<MaintainSuggestionResp> list(String defectLevel, String defectType);
|
||||
MaintainSuggestionResp detail(String suggestionId);
|
||||
void save(MaintainSuggestionReq req);
|
||||
void update(String suggestionId, MaintainSuggestionReq req);
|
||||
void deleteById(String suggestionId);
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.ModelConfigEntity;
|
||||
import com.dite.znpt.domain.vo.ModelConfigListReq;
|
||||
import com.dite.znpt.domain.vo.ModelConfigReq;
|
||||
import com.dite.znpt.domain.vo.ModelConfigResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
* @Description: 模型配置表服务接口
|
||||
*/
|
||||
public interface ModelConfigService extends IService<ModelConfigEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询列表
|
||||
*
|
||||
* @param modelConfigReq
|
||||
* @return {@link List }<{@link ModelConfigResp }>
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
**/
|
||||
List<ModelConfigResp> selectList(ModelConfigListReq modelConfigReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条
|
||||
*
|
||||
* @param modelId Id
|
||||
* @return {@link ModelConfigResp }
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
**/
|
||||
ModelConfigResp selectById(String modelId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增
|
||||
*
|
||||
* @param modelConfigReq
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
**/
|
||||
void saveData(ModelConfigReq modelConfigReq);
|
||||
|
||||
/**
|
||||
* 功能描述:更新
|
||||
*
|
||||
* @param modelConfigReq
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
**/
|
||||
void updateData(ModelConfigReq modelConfigReq);
|
||||
|
||||
/**
|
||||
* 功能描述:删除
|
||||
*
|
||||
* @param modelId Id
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
**/
|
||||
void deleteById(String modelId);
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
* @Description: 表服务接口
|
||||
* @Description: 部件表服务接口
|
||||
*/
|
||||
public interface PartService extends IService<PartEntity> {
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.dite.znpt.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.TConstructionEntity;
|
||||
import com.dite.znpt.domain.vo.TConstructionListReq;
|
||||
import com.dite.znpt.domain.vo.TConstructionReq;
|
||||
import com.dite.znpt.domain.vo.TConstructionResp;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -37,20 +38,20 @@ public interface TConstructionService extends IService<TConstructionEntity> {
|
|||
/**
|
||||
* 功能描述:新增施工信息
|
||||
*
|
||||
* @param tConstruction 施工信息
|
||||
* @param req 施工信息
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
void saveData(TConstructionEntity tConstruction);
|
||||
void saveData(TConstructionReq req);
|
||||
|
||||
/**
|
||||
* 功能描述:更新施工信息
|
||||
*
|
||||
* @param tConstruction 施工信息
|
||||
* @param req 施工信息
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
void updateData(TConstructionEntity tConstruction);
|
||||
void updateData(TConstructionReq req);
|
||||
|
||||
/**
|
||||
* 功能描述:删除施工信息
|
||||
|
|
|
@ -10,17 +10,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.dite.znpt.constant.Constants;
|
||||
import com.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.domain.entity.AttachInfoEntity;
|
||||
import com.dite.znpt.domain.entity.InsuranceInfoEntity;
|
||||
import com.dite.znpt.domain.vo.AttachInfoReq;
|
||||
import com.dite.znpt.enums.AttachBusinessTypeEnum;
|
||||
import com.dite.znpt.enums.FilePathEnum;
|
||||
import com.dite.znpt.service.AttachInfoService;
|
||||
import com.dite.znpt.mapper.FileInfoMapper;
|
||||
import com.dite.znpt.service.AttachInfoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Service;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
@ -69,7 +67,7 @@ public class AttachInfoServiceImpl extends ServiceImpl<FileInfoMapper, AttachInf
|
|||
**/
|
||||
@Override
|
||||
public List<String> saveData(String businessType, AttachInfoReq infoReq, MultipartFile[] files) {
|
||||
String temPathPrefix = FilePathEnum.ATTACH.getFileAbsolutePath().concat(businessType).concat(FileUtil.FILE_SEPARATOR);
|
||||
String temPathPrefix = FilePathEnum.ATTACH.getFileAbsolutePathPrefix().concat(businessType).concat(FileUtil.FILE_SEPARATOR);
|
||||
if(StrUtil.isNotBlank(infoReq.getUserDefinedPath())){
|
||||
temPathPrefix = temPathPrefix.concat(infoReq.getUserDefinedPath()).concat(FileUtil.FILE_SEPARATOR);
|
||||
}
|
||||
|
@ -84,7 +82,7 @@ public class AttachInfoServiceImpl extends ServiceImpl<FileInfoMapper, AttachInf
|
|||
String path = temPathPrefix + file.getOriginalFilename();
|
||||
FileUtil.writeBytes(file.getBytes(),path);
|
||||
AttachInfoEntity attachInfo = AttachInfoEntity.builder()
|
||||
.attachPath(FilePathEnum.ATTACH.getImageDownPath(path))
|
||||
.attachPath(FilePathEnum.ATTACH.getFileDownPath(path))
|
||||
.businessType(businessType)
|
||||
.fileType(infoReq.getFileType())
|
||||
.remark(infoReq.getRemark())
|
||||
|
@ -105,7 +103,7 @@ public class AttachInfoServiceImpl extends ServiceImpl<FileInfoMapper, AttachInf
|
|||
if(null == attachInfo || !Constants.DEL_FLAG_0.equals(attachInfo.getDelFlag())){
|
||||
throw new ServerException(Message.ATTACH_INFO_IS_NOT_EXIST);
|
||||
}
|
||||
String filePath = FilePathEnum.ATTACH.getFileAbsolutePath().concat(StrUtil.removePrefix(attachInfo.getAttachPath(), FilePathEnum.ATTACH.getUrlPath()));
|
||||
String filePath = FilePathEnum.ATTACH.getFileAbsolutePathPrefix().concat(StrUtil.removePrefix(attachInfo.getAttachPath(), FilePathEnum.ATTACH.getUrlPath()));
|
||||
File file = new File(filePath);
|
||||
// 检查文件是否存在
|
||||
if (!file.exists()) {
|
||||
|
|
|
@ -51,7 +51,7 @@ public class AudioFileInfoServiceImpl extends ServiceImpl<AudioFileInfoMapper, A
|
|||
return lambdaQuery()
|
||||
.eq(Objects.nonNull(audioFileInfoReq.getImageId()), AudioFileInfoEntity::getImageId, audioFileInfoReq.getImageId())
|
||||
.in(CollUtil.isNotEmpty(audioFileInfoReq.getImageIds()), AudioFileInfoEntity::getImageId, audioFileInfoReq.getImageIds())
|
||||
.eq(Objects.nonNull(audioFileInfoReq.getAudioId()), AudioFileInfoEntity::getId, audioFileInfoReq.getAudioId()).list();
|
||||
.eq(Objects.nonNull(audioFileInfoReq.getAudioId()), AudioFileInfoEntity::getAudioId, audioFileInfoReq.getAudioId()).list();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -104,7 +104,7 @@ public class AudioFileInfoServiceImpl extends ServiceImpl<AudioFileInfoMapper, A
|
|||
throw new ServiceException(Message.IMAGE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
PartResp partResp = partService.detail(image.getPartId());
|
||||
String audioFilePrefix = FilePathEnum.AUDIO.getFileAbsolutePath() + partResp.getProjectName().concat(FileUtil.FILE_SEPARATOR).concat(partResp.getTurbineName()).concat(FileUtil.FILE_SEPARATOR);
|
||||
String audioFilePrefix = FilePathEnum.AUDIO.getFileAbsolutePathPrefix() + partResp.getProjectName().concat(FileUtil.FILE_SEPARATOR).concat(partResp.getTurbineName()).concat(FileUtil.FILE_SEPARATOR);
|
||||
List<AudioFileInfoEntity> list = new ArrayList<>();
|
||||
for (MultipartFile file : files) {
|
||||
AudioFileInfoEntity audio = new AudioFileInfoEntity();
|
||||
|
@ -113,7 +113,7 @@ public class AudioFileInfoServiceImpl extends ServiceImpl<AudioFileInfoMapper, A
|
|||
try {
|
||||
String path = audioFilePrefix + file.getOriginalFilename();
|
||||
FileUtil.writeBytes(file.getBytes(),path);
|
||||
audio.setFilePath(FilePathEnum.AUDIO.getImageDownPath(path));
|
||||
audio.setFilePath(FilePathEnum.AUDIO.getFileDownPath(path));
|
||||
list.add(audio);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -1,27 +1,35 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.dev33.satoken.secure.SaSecureUtil;
|
||||
import cn.dev33.satoken.stp.SaTokenInfo;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.dev33.satoken.stp.parameter.SaLoginParameter;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import cn.hutool.http.useragent.UserAgent;
|
||||
import cn.hutool.http.useragent.UserAgentInfo;
|
||||
import cn.hutool.http.useragent.UserAgentUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.dite.znpt.constant.Constants;
|
||||
import com.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.converts.Converts;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.entity.*;
|
||||
import com.dite.znpt.domain.entity.DeptEntity;
|
||||
import com.dite.znpt.domain.entity.MenuEntity;
|
||||
import com.dite.znpt.domain.entity.RoleMenuEntity;
|
||||
import com.dite.znpt.domain.entity.UserEntity;
|
||||
import com.dite.znpt.domain.vo.LoginReq;
|
||||
import com.dite.znpt.domain.vo.ModifyPasswordReq;
|
||||
import com.dite.znpt.domain.vo.RoleResp;
|
||||
import com.dite.znpt.domain.vo.UserInfo;
|
||||
import com.dite.znpt.enums.TerminalTypeEnum;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.service.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
|
@ -52,23 +60,21 @@ public class AuthServiceImpl implements AuthService {
|
|||
|
||||
@Override
|
||||
public Result<SaTokenInfo> doLogin(LoginReq req) {
|
||||
String key = SecureUtil.md5(req.getAccount()).substring(8,24);
|
||||
UserEntity user = userService.getOne(Wrappers.lambdaQuery(UserEntity.class).eq(UserEntity::getAccount, req.getAccount()).eq(UserEntity::getDelFlag, Constants.DEL_FLAG_0));
|
||||
if(null == user){
|
||||
return Result.error(Constants.ACCOUNT_ERROR_EXCEPTION, Constants.ACCOUNT_ERROR_EXCEPTION_MESSAGE);
|
||||
}
|
||||
try {
|
||||
String password = SecureUtil.aes(key.getBytes()).decryptStr(req.getPassword());
|
||||
String pwdCiphertext = SecureUtil.md5(req.getAccount().concat(password).concat(user.getSalt()));
|
||||
if(!pwdCiphertext.equals(user.getPassword())){
|
||||
return Result.error(Constants.PASSWORD_ERROR_EXCEPTION, Constants.PASSWORD_ERROR_EXCEPTION_MESSAGE);
|
||||
}
|
||||
}catch (Exception e){
|
||||
return Result.error(Constants.PASSWORD_EXCEPTION, Constants.PASSWORD_EXCEPTION_MESSAGE);
|
||||
}
|
||||
if(!user.getStatus().equals(Constants.STATUS_0)){
|
||||
return Result.error(Constants.USER_DISABLE_EXCEPTION, Constants.USER_DISABLE_EXCEPTION_MESSAGE);
|
||||
}
|
||||
|
||||
String key = SecureUtil.md5(req.getAccount()).substring(8,24);
|
||||
String password = SecureUtil.aes(key.getBytes()).decryptStr(req.getPassword());
|
||||
String pwdCiphertext = SecureUtil.md5(req.getAccount().concat(password).concat(user.getSalt()));
|
||||
if(!pwdCiphertext.equals(user.getPassword())){
|
||||
return Result.error(Constants.PASSWORD_ERROR_EXCEPTION, Constants.PASSWORD_ERROR_EXCEPTION_MESSAGE);
|
||||
}
|
||||
|
||||
if(user.getIsDefaultPassword()){
|
||||
return Result.error(Constants.DEFAULT_PASSWORD_EXCEPTION, Constants.DEFAULT_PASSWORD_EXCEPTION_MESSAGE);
|
||||
}
|
||||
|
@ -80,6 +86,34 @@ public class AuthServiceImpl implements AuthService {
|
|||
return Result.ok(StpUtil.getTokenInfo());
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void modifyPassword(ModifyPasswordReq req) {
|
||||
if(req.getOldPassword().equals(req.getNewPassword())){
|
||||
throw new ServiceException(Message.OLD_PASSWORD_EQUAL_NEW_PASSWORD);
|
||||
}
|
||||
UserEntity user = userService.getOne(Wrappers.lambdaQuery(UserEntity.class).eq(UserEntity::getAccount, req.getAccount()).eq(UserEntity::getDelFlag, Constants.DEL_FLAG_0));
|
||||
if(null == user){
|
||||
throw new ServiceException(Constants.ACCOUNT_ERROR_EXCEPTION_MESSAGE);
|
||||
}
|
||||
if(!user.getStatus().equals(Constants.STATUS_0)){
|
||||
throw new ServiceException(Constants.USER_DISABLE_EXCEPTION_MESSAGE);
|
||||
}
|
||||
String key = SecureUtil.md5(req.getAccount()).substring(8,24);
|
||||
String oldPassword = SecureUtil.aes(key.getBytes()).decryptStr(req.getOldPassword());
|
||||
String pwdCiphertext = SecureUtil.md5(req.getAccount().concat(oldPassword).concat(user.getSalt()));
|
||||
if(!pwdCiphertext.equals(user.getPassword())){
|
||||
throw new ServiceException(Message.OLD_PASSWORD_IS_ERROR);
|
||||
}
|
||||
String newPassword = SecureUtil.aes(key.getBytes()).decryptStr(req.getNewPassword());
|
||||
String salt = RandomUtil.randomString(req.getAccount(), 4);
|
||||
user.setSalt(salt);
|
||||
user.setPassword(SaSecureUtil.md5(req.getAccount().concat(newPassword).concat(salt)));
|
||||
user.setIsDefaultPassword(Boolean.FALSE);
|
||||
userService.updateById(user);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doLogout() {
|
||||
StpUtil.logout();
|
||||
|
@ -97,7 +131,10 @@ public class AuthServiceImpl implements AuthService {
|
|||
|
||||
private void saveSession(String userId){
|
||||
StpUtil.getSession().set("userInfo", queryUserInfo(userId));
|
||||
StpUtil.getSession().set("menuInfo", queryMenuInfo(userId));
|
||||
List<Tree<String>> menuInfo = queryMenuInfo(userId);
|
||||
if(!menuInfo.isEmpty()){
|
||||
StpUtil.getSession().set("menuInfo", menuInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private UserInfo queryUserInfo(String userId){
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.constant.Constants;
|
||||
import com.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.converts.Converts;
|
||||
import com.dite.znpt.domain.entity.CheckSchemeEntity;
|
||||
import com.dite.znpt.domain.vo.CheckSchemeReq;
|
||||
import com.dite.znpt.domain.vo.CheckSchemeResp;
|
||||
import com.dite.znpt.enums.CheckMethodEnum;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.CheckSchemeMapper;
|
||||
import com.dite.znpt.service.CheckSchemeService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/9 23:39
|
||||
* @Description:
|
||||
*/
|
||||
@Service
|
||||
public class CheckSchemeServiceImpl extends ServiceImpl<CheckSchemeMapper, CheckSchemeEntity> implements CheckSchemeService {
|
||||
|
||||
@Override
|
||||
public List<CheckSchemeResp> page(String checkMethod) {
|
||||
PageUtil.startPage();
|
||||
return this.list(checkMethod);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CheckSchemeResp> list(String checkMethod) {
|
||||
List<CheckSchemeResp> result = Converts.INSTANCE.toCheckSchemeResp(this.list(Wrappers.lambdaQuery(CheckSchemeEntity.class).eq(StrUtil.isNotBlank(checkMethod), CheckSchemeEntity::getCheckMethod, checkMethod)));
|
||||
result.forEach(resp -> {
|
||||
resp.setCheckMethodLabel(CheckMethodEnum.getDescByCode(resp.getCheckMethod()));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CheckSchemeResp detail(String checkSchemeId) {
|
||||
CheckSchemeEntity checkScheme = this.getById(checkSchemeId);
|
||||
if(null == checkScheme || checkScheme.getDelFlag() != Constants.DEL_FLAG_0){
|
||||
throw new ServiceException(Message.CHECK_SCHEME_ID_IS_NOT_EXIST);
|
||||
}
|
||||
CheckSchemeResp resp = Converts.INSTANCE.toCheckSchemeResp(checkScheme);
|
||||
resp.setCheckMethodLabel(CheckMethodEnum.getDescByCode(resp.getCheckMethod()));
|
||||
return resp;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void save(CheckSchemeReq req) {
|
||||
this.save(Converts.INSTANCE.toCheckSchemeEntity(req));
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void update(String checkSchemeId, CheckSchemeReq req) {
|
||||
CheckSchemeEntity checkScheme = this.getById(checkSchemeId);
|
||||
if(null == checkScheme || checkScheme.getDelFlag() != Constants.DEL_FLAG_0){
|
||||
throw new ServiceException(Message.CHECK_SCHEME_ID_IS_NOT_EXIST);
|
||||
}
|
||||
CheckSchemeEntity entity = Converts.INSTANCE.toCheckSchemeEntity(req);
|
||||
entity.setSchemeId(checkSchemeId);
|
||||
this.updateById(entity);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void deleteById(String checkSchemeId) {
|
||||
CheckSchemeEntity checkScheme = this.getById(checkSchemeId);
|
||||
if(null == checkScheme || checkScheme.getDelFlag() != Constants.DEL_FLAG_0){
|
||||
throw new ServiceException(Message.CHECK_SCHEME_ID_IS_NOT_EXIST);
|
||||
}
|
||||
checkScheme.setDelFlag(Constants.DEL_FLAG_1);
|
||||
this.updateById(checkScheme);
|
||||
}
|
||||
}
|
|
@ -1,28 +1,36 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import ai.onnxruntime.OrtException;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.converts.Converts;
|
||||
import com.dite.znpt.domain.bo.Detection;
|
||||
import com.dite.znpt.domain.entity.AttachInfoEntity;
|
||||
import com.dite.znpt.domain.entity.DefectEntity;
|
||||
import com.dite.znpt.domain.entity.ImageEntity;
|
||||
import com.dite.znpt.domain.vo.*;
|
||||
import com.dite.znpt.enums.DefectSourceEnum;
|
||||
import com.dite.znpt.enums.DefectTypeEnum;
|
||||
import com.dite.znpt.enums.RepairStatusEnum;
|
||||
import com.dite.znpt.enums.*;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.service.DefectService;
|
||||
import com.dite.znpt.mapper.DefectMapper;
|
||||
import com.dite.znpt.service.AttachInfoService;
|
||||
import com.dite.znpt.service.DefectService;
|
||||
import com.dite.znpt.service.ImageService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -36,6 +44,10 @@ import java.util.stream.Collectors;
|
|||
public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> implements DefectService {
|
||||
@Resource
|
||||
private ImageService imageService;
|
||||
@Autowired
|
||||
private MultiModelYoloService multiModelYoloService;
|
||||
@Autowired
|
||||
private AttachInfoService attachInfoService;
|
||||
|
||||
/**
|
||||
* 功能描述:查询缺陷记录列表
|
||||
|
@ -46,14 +58,21 @@ public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> i
|
|||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public List<DefectResp> page(DefectListReq req) {
|
||||
public List<DefectListResp> page(DefectListReq req) {
|
||||
PageUtil.startPage();
|
||||
return this.list(req);
|
||||
List<DefectListResp> list = this.list(req);
|
||||
list.forEach(defect -> {
|
||||
defect.setMarkInfo(JSONUtil.toBean(defect.getLabelInfo(), Detection.class));
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DefectResp> list(DefectListReq req) {
|
||||
List<DefectResp> defectList= this.baseMapper.queryBySelective(req);
|
||||
public List<DefectListResp> list(DefectListReq req) {
|
||||
List<DefectListResp> defectList= this.baseMapper.queryBySelective(req);
|
||||
defectList.forEach(defect -> {
|
||||
defect.setMarkInfo(JSONUtil.toBean(defect.getLabelInfo(), Detection.class));
|
||||
});
|
||||
return defectList;
|
||||
}
|
||||
|
||||
|
@ -69,9 +88,10 @@ public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> i
|
|||
public DefectResp detail(String defectId) {
|
||||
DefectResp defectResp = this.baseMapper.detail(defectId);
|
||||
defectResp.setDefectTypeLabel(DefectTypeEnum.getDescByCode(defectResp.getDefectType()));
|
||||
defectResp.setDefectLevel(DefectTypeEnum.getDescByCode(defectResp.getDefectLevel()));
|
||||
defectResp.setDefectLevel(DefectLevelEnum.getDescByCode(defectResp.getDefectLevel()));
|
||||
defectResp.setRepairStatusLabel(RepairStatusEnum.getDescByCode(defectResp.getRepairStatus()));
|
||||
defectResp.setSourceLabel(DefectSourceEnum.getDescByCode(defectResp.getSourceLabel()));
|
||||
defectResp.setMarkInfo(JSONUtil.toBean(defectResp.getLabelInfo(), Detection.class));
|
||||
return defectResp;
|
||||
}
|
||||
|
||||
|
@ -91,6 +111,8 @@ public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> i
|
|||
}
|
||||
DefectEntity defectEntity = Converts.INSTANCE.toDefectEntity(req);
|
||||
defectEntity.setImageId(imageId);
|
||||
defectEntity.setLabelInfo(JSONUtil.toJsonStr(req.getMarkInfo()));
|
||||
attachInfoService.updateBusinessIdByAttachIds(defectEntity.getImageId(), ListUtil.of(req.getAttachId()), AttachBusinessTypeEnum.DEFECT_MARK_PIC);
|
||||
this.save(defectEntity);
|
||||
}
|
||||
|
||||
|
@ -112,6 +134,7 @@ public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> i
|
|||
if(imageMap.containsKey(key)){
|
||||
DefectEntity defectEntity = Converts.INSTANCE.toDefectEntity(req);
|
||||
defectEntity.setImageId(imageMap.get(key).getImageId());
|
||||
defectEntity.setLabelInfo(JSONUtil.toJsonStr(req.getMarkInfo()));
|
||||
defectEntityList.add(defectEntity);
|
||||
}
|
||||
});
|
||||
|
@ -134,7 +157,9 @@ public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> i
|
|||
throw new ServiceException(Message.DEFECT_ID_IS_NOT_EXIST);
|
||||
}
|
||||
DefectEntity defectEntity = Converts.INSTANCE.toDefectEntity(req);
|
||||
defectEntity.setLabelInfo(JSONUtil.toJsonStr(req.getMarkInfo()));
|
||||
this.updateById(defectEntity);
|
||||
attachInfoService.updateBusinessIdByAttachIds(defectEntity.getImageId(), ListUtil.of(req.getAttachId()), AttachBusinessTypeEnum.DEFECT_MARK_PIC);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -150,4 +175,54 @@ public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> i
|
|||
this.removeById(defectId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:缺陷自动检测
|
||||
*
|
||||
* @param markReq 马克请求类
|
||||
* @return {@link List }<{@link DefectResp }>
|
||||
* @author cuizhibin
|
||||
* @date 2025/07/04 10:55
|
||||
**/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<DefectResp> detect(DefectMarkReq markReq) {
|
||||
ImageEntity image = imageService.getById(markReq.getImageId());
|
||||
if (Objects.isNull(image)) {
|
||||
throw new ServiceException(Message.IMAGE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
FilePathEnum pathEnum = image.getImagePath().contains("temp") ? FilePathEnum.IMAGE_TEMP : FilePathEnum.IMAGE;
|
||||
String inputPath = pathEnum.getFileAbsolutePath(image.getImagePath());
|
||||
// 写入attach同层级文件夹下
|
||||
String attachPath = FilePathEnum.ATTACH.getUrlPath() + StrUtil.removePrefix(image.getImagePath(), pathEnum.getUrlPath());
|
||||
String outputPath = FilePathEnum.ATTACH.getFileAbsolutePath(attachPath);
|
||||
FileUtil.mkParentDirs(outputPath);
|
||||
|
||||
AttachInfoEntity attachInfo = new AttachInfoEntity();
|
||||
attachInfo.setBusinessId(image.getImageId());
|
||||
attachInfo.setAttachPath(attachPath);
|
||||
attachInfo.setBusinessType(AttachBusinessTypeEnum.DEFECT_MARK_PIC.getCode());
|
||||
attachInfoService.save(attachInfo);
|
||||
try {
|
||||
List<Detection> detect = multiModelYoloService.detect(markReq.getModelId(), inputPath, outputPath, markReq.getConfThreshold());
|
||||
List<DefectResp> respList = new ArrayList<>();
|
||||
for (Detection detection : detect) {
|
||||
DefectResp resp = new DefectResp();
|
||||
resp.setImageId(markReq.getImageId());
|
||||
resp.setDefectType(detection.getLabel());
|
||||
resp.setDefectTypeLabel(DefectTypeEnum.getDescByCode(detection.getLabel()));
|
||||
resp.setDetectionDate(LocalDate.now());
|
||||
resp.setSource(DefectSourceEnum.AI.getCode());
|
||||
resp.setSourceLabel(DefectSourceEnum.AI.getDesc());
|
||||
resp.setMarkInfo(detection);
|
||||
resp.setRepairStatus(RepairStatusEnum.INCOMPLETE.getCode());
|
||||
resp.setRepairStatusLabel(RepairStatusEnum.INCOMPLETE.getDesc());
|
||||
resp.setAttachId(attachInfo.getAttachId());
|
||||
resp.setAttachPath(attachPath);
|
||||
respList.add(resp);
|
||||
}
|
||||
return respList;
|
||||
} catch (OrtException e) {
|
||||
throw new ServiceException(Message.IMAGE_AUTO_MARK_ERROR + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, DictEntity> impleme
|
|||
dictReq.setDictId(dictId);
|
||||
|
||||
List<DictResp> list = selectList(dictReq);
|
||||
return list.isEmpty() ? CollUtil.getFirst(list) : new DictResp();
|
||||
return CollUtil.isNotEmpty(list) ? CollUtil.getFirst(list) : new DictResp();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -52,8 +52,8 @@ public class ImageCollectServiceImpl extends ServiceImpl<ImageCollectMapper, Ima
|
|||
this.save(imageCollect);
|
||||
String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
List<ImageEntity> imageList = Converts.INSTANCE.toImageEntity(req.getImageList());
|
||||
String permPathPrefix = FilePathEnum.IMAGE.getFileAbsolutePath().concat(ImageSourceEnum.COLLECT.getCode()).concat(FileUtil.FILE_SEPARATOR).concat(partId).concat(FileUtil.FILE_SEPARATOR).concat(dateStr).concat(FileUtil.FILE_SEPARATOR);
|
||||
String temPathPrefix = FilePathEnum.IMAGE_TEMP.getFileAbsolutePath().concat(ImageSourceEnum.COLLECT.getCode()).concat(FileUtil.FILE_SEPARATOR).concat(partId).concat(FileUtil.FILE_SEPARATOR);
|
||||
String permPathPrefix = FilePathEnum.IMAGE.getFileAbsolutePathPrefix().concat(ImageSourceEnum.COLLECT.getCode()).concat(FileUtil.FILE_SEPARATOR).concat(partId).concat(FileUtil.FILE_SEPARATOR).concat(dateStr).concat(FileUtil.FILE_SEPARATOR);
|
||||
String temPathPrefix = FilePathEnum.IMAGE_TEMP.getFileAbsolutePathPrefix().concat(ImageSourceEnum.COLLECT.getCode()).concat(FileUtil.FILE_SEPARATOR).concat(partId).concat(FileUtil.FILE_SEPARATOR);
|
||||
imageList.forEach(image -> {
|
||||
image.setPartId(partId);
|
||||
image.setCollectId(imageCollect.getCollectId());
|
||||
|
@ -62,7 +62,7 @@ public class ImageCollectServiceImpl extends ServiceImpl<ImageCollectMapper, Ima
|
|||
if (file.exists()) {
|
||||
byte[] bytes = FileUtil.readBytes(file);
|
||||
FileUtil.writeBytes(bytes, path);
|
||||
String url = FilePathEnum.IMAGE.getUrlPath().concat(StrUtil.removePrefix(path,FilePathEnum.IMAGE.getFileAbsolutePath()).replace(FileUtil.FILE_SEPARATOR, StrUtil.SLASH));
|
||||
String url = FilePathEnum.IMAGE.getUrlPath().concat(StrUtil.removePrefix(path,FilePathEnum.IMAGE.getFileAbsolutePathPrefix()).replace(FileUtil.FILE_SEPARATOR, StrUtil.SLASH));
|
||||
image.setImagePath(url);
|
||||
FileUtil.del(file);
|
||||
}else {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
|
@ -12,14 +11,11 @@ import cn.hutool.core.util.StrUtil;
|
|||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.constant.Constants;
|
||||
import com.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.domain.bo.PartFullInfoBo;
|
||||
import com.dite.znpt.domain.entity.AudioFileInfoEntity;
|
||||
import com.dite.znpt.domain.entity.ImageCollectEntity;
|
||||
import com.dite.znpt.domain.entity.ImageEntity;
|
||||
import com.dite.znpt.domain.entity.PartEntity;
|
||||
import com.dite.znpt.domain.page.PageDomain;
|
||||
import com.dite.znpt.domain.vo.*;
|
||||
import com.dite.znpt.enums.*;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
|
@ -32,7 +28,6 @@ import com.dite.znpt.util.EXIFUtil;
|
|||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
@ -42,9 +37,7 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.URI;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.FileVisitor;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.SimpleFileVisitor;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
|
@ -76,18 +69,19 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
|
||||
@Override
|
||||
public List<ImageListResp> list(ImageListReq req) {
|
||||
List<ImageListResp> partList= this.baseMapper.queryImageList(req);
|
||||
if (CollUtil.isNotEmpty(partList)) {
|
||||
Map<String, List<AudioFileInfoResp>> audioMap = audioFileInfoService.selectByImageIds(partList.stream().map(ImageListResp::getImageId).collect(Collectors.toList()))
|
||||
List<ImageListResp> list = this.baseMapper.queryImageList(req);
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
Map<String, List<AudioFileInfoResp>> 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
|
||||
|
@ -103,8 +97,8 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
Map<String, PartEntity> partIdMap= partService.listByIds(partIds).stream().collect(Collectors.toMap(PartEntity::getPartId, Function.identity()));
|
||||
list.forEach(req -> {
|
||||
if(partIdMap.containsKey(req.getPartId())){
|
||||
String path_prefix = FilePathEnum.IMAGE.getFileAbsolutePath().concat(StrUtil.BACKSLASH).concat(req.getImageSource()).concat(StrUtil.BACKSLASH).concat(req.getPartId()).concat(StrUtil.BACKSLASH);
|
||||
String temp_path_prefix = FilePathEnum.IMAGE_TEMP.getFileAbsolutePath().concat(StrUtil.BACKSLASH).concat(req.getImageSource()).concat(StrUtil.BACKSLASH).concat(req.getPartId()).concat(StrUtil.BACKSLASH);
|
||||
String path_prefix = FilePathEnum.IMAGE.getFileAbsolutePathPrefix().concat(StrUtil.BACKSLASH).concat(req.getImageSource()).concat(StrUtil.BACKSLASH).concat(req.getPartId()).concat(StrUtil.BACKSLASH);
|
||||
String temp_path_prefix = FilePathEnum.IMAGE_TEMP.getFileAbsolutePathPrefix().concat(StrUtil.BACKSLASH).concat(req.getImageSource()).concat(StrUtil.BACKSLASH).concat(req.getPartId()).concat(StrUtil.BACKSLASH);
|
||||
File file = new File(req.getImagePath());
|
||||
if(file.exists() && req.getImagePath().contains(temp_path_prefix)){
|
||||
ImageEntity entity = new ImageEntity();
|
||||
|
@ -131,6 +125,7 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> 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;
|
||||
|
@ -138,7 +133,10 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public List<ImageReq> batchUploadDefectImage(String partId, String imageSource, MultipartFile[] files) {
|
||||
public List<ImageReq> batchUploadDefectImage(String partId, String imageSource, ImageCollectReq collectReq, MultipartFile[] files) {
|
||||
if (StrUtil.isEmpty(imageSource) || Objects.isNull(ImageSourceEnum.getByCode(imageSource))) {
|
||||
throw new ServiceException(Message.IMAGE_SOURCE_IS_NOT_EXIST);
|
||||
}
|
||||
if(null == partService.getById(partId)){
|
||||
throw new ServiceException(Message.PART_ID_IS_NOT_EXIST);
|
||||
}
|
||||
|
@ -146,23 +144,36 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
throw new ServiceException(Message.IMAGE_IS_EMPTY);
|
||||
}
|
||||
List<ImageReq> list = new ArrayList<>(files.length);
|
||||
File temCategory = new File(FilePathEnum.IMAGE_TEMP.getFileAbsolutePath());
|
||||
File temCategory = new File(FilePathEnum.IMAGE_TEMP.getFileAbsolutePathPrefix());
|
||||
if (!temCategory.exists()) {
|
||||
// 创建完整的目录
|
||||
temCategory.mkdirs();
|
||||
}
|
||||
String temPathPrefix = FilePathEnum.IMAGE_TEMP.getFileAbsolutePath().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());
|
||||
imageCollect.setCollectId(IdUtil.simpleUUID());
|
||||
imageCollect.setImageSource(imageSource);
|
||||
List<ImageEntity> imageList = new ArrayList<>();
|
||||
for (MultipartFile file : files) {
|
||||
ImageEntity imageEntity = new ImageEntity();
|
||||
if (!file.isEmpty()) {
|
||||
try {
|
||||
String path = temPathPrefix + file.getOriginalFilename();
|
||||
FileUtil.writeBytes(file.getBytes(),path);
|
||||
list.add(imageRespBuilder(path));
|
||||
ImageReq imageReq = imageRespBuilder(path);
|
||||
BeanUtil.copyProperties(imageReq, imageEntity);
|
||||
list.add(imageReq);
|
||||
imageEntity.setImagePath(FilePathEnum.IMAGE_TEMP.getFileDownPath(path));
|
||||
imageEntity.setPartId(partId);
|
||||
imageEntity.setCollectId(imageCollect.getCollectId());
|
||||
imageList.add(imageEntity);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
imageCollectService.save(imageCollect);
|
||||
baseMapper.insert(imageList);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
@ -173,7 +184,7 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
throw new ServiceException(Message.IMAGE_IS_EMPTY);
|
||||
}
|
||||
String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
String path_prefix = FilePathEnum.IMAGE.getFileAbsolutePath().concat(imageSource).concat(FileUtil.FILE_SEPARATOR).concat(dateStr).concat(FileUtil.FILE_SEPARATOR);
|
||||
String path_prefix = FilePathEnum.IMAGE.getFileAbsolutePathPrefix().concat(imageSource).concat(FileUtil.FILE_SEPARATOR).concat(dateStr).concat(FileUtil.FILE_SEPARATOR);
|
||||
if (Objects.nonNull(imageWorkReq)) {
|
||||
path_prefix = path_prefix.concat(StrUtil.emptyToDefault(imageWorkReq.getUploadUser(), "默认用户")).concat(FileUtil.FILE_SEPARATOR)
|
||||
.concat(StrUtil.emptyToDefault(imageWorkReq.getLongitude(), "0"))
|
||||
|
@ -188,7 +199,7 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
for (MultipartFile multipartFile : files) {
|
||||
String path = path_prefix + multipartFile.getOriginalFilename();
|
||||
FileUtil.writeBytes(multipartFile.getBytes(),path);
|
||||
result.add(FilePathEnum.IMAGE.getImageDownPath(path));
|
||||
result.add(FilePathEnum.IMAGE.getFileDownPath(path));
|
||||
}
|
||||
String partId = imageWorkReq.getPartId();
|
||||
if (StrUtil.isNotEmpty(partId)) {
|
||||
|
@ -202,7 +213,7 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
List<ImageEntity> imageList = new ArrayList<>();
|
||||
result.forEach(path -> {
|
||||
ImageEntity imageEntity = new ImageEntity();
|
||||
String absolutePath = FilePathEnum.IMAGE.getFileAbsolutePath() + StrUtil.removePrefix(path, FilePathEnum.IMAGE.getUrlPath());
|
||||
String absolutePath = FilePathEnum.IMAGE.getFileAbsolutePathPrefix() + StrUtil.removePrefix(path, FilePathEnum.IMAGE.getUrlPath());
|
||||
try {
|
||||
ImageReq imageReq = imageRespBuilder(absolutePath);
|
||||
BeanUtil.copyProperties(imageReq, imageEntity);
|
||||
|
@ -251,7 +262,7 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
req.setCameraManufacturer(obj.getStr("Make"));
|
||||
req.setCameraModel(obj.getStr("Model"));
|
||||
req.setImageName(obj.getStr("File Name"));
|
||||
req.setImagePath(FilePathEnum.IMAGE_TEMP.getImageDownPath(path));
|
||||
req.setImagePath(FilePathEnum.IMAGE_TEMP.getFileDownPath(path));
|
||||
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")));
|
||||
|
@ -308,11 +319,11 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
@Override
|
||||
public List<AppImageResp> listAppUploadImages() {
|
||||
List<String> filePaths = new ArrayList<>();
|
||||
PathUtil.walkFiles(Path.of(FilePathEnum.IMAGE.getFileAbsolutePath()), new SimpleFileVisitor<>() {
|
||||
PathUtil.walkFiles(Path.of(FilePathEnum.IMAGE.getFileAbsolutePathPrefix()), new SimpleFileVisitor<>() {
|
||||
@Override
|
||||
public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) {
|
||||
if (path.toFile().isFile()) {
|
||||
String imageDownPath = FilePathEnum.IMAGE.getImageDownPath(path.toFile().getAbsolutePath());
|
||||
String imageDownPath = FilePathEnum.IMAGE.getFileDownPath(path.toFile().getAbsolutePath());
|
||||
List<String> split = StrUtil.split(imageDownPath, StrUtil.SLASH, true, true);
|
||||
// /static/image/source/date
|
||||
try {
|
||||
|
@ -405,7 +416,7 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
List<ImageEntity> newImageList = new ArrayList<>();
|
||||
partReq.getImagePaths().forEach(path -> {
|
||||
ImageEntity imageEntity = new ImageEntity();
|
||||
String absolutePath = FilePathEnum.IMAGE.getFileAbsolutePath() + StrUtil.removePrefix(path, FilePathEnum.IMAGE.getUrlPath());
|
||||
String absolutePath = FilePathEnum.IMAGE.getFileAbsolutePathPrefix() + StrUtil.removePrefix(path, FilePathEnum.IMAGE.getUrlPath());
|
||||
try {
|
||||
ImageReq imageReq = imageRespBuilder(absolutePath);
|
||||
BeanUtil.copyProperties(imageReq, imageEntity);
|
||||
|
@ -430,4 +441,19 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
imageCollectService.save(BeanUtil.copyProperties(partReq, ImageCollectEntity.class));
|
||||
baseMapper.insert(newImageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:审核图片
|
||||
*
|
||||
* @param imageIds 图片id列表
|
||||
* @author cuizhibin
|
||||
* @date 2025/07/16 15:28
|
||||
**/
|
||||
@Override
|
||||
public void reviewImages(List<String> imageIds) {
|
||||
if (CollUtil.isEmpty(imageIds)) {
|
||||
throw new ServiceException(Message.IMAGE_IS_EMPTY);
|
||||
}
|
||||
lambdaUpdate().in(ImageEntity::getImageId, imageIds).set(ImageEntity::getReviewState, "1").update();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.InspectionReportEntity;
|
||||
import com.dite.znpt.mapper.InspectionReportMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/7/7/周一 17:42
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class InspectionReportServiceImpl extends ServiceImpl<InspectionReportMapper, InspectionReportEntity> implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1460849450000057636L;
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.converts.Converts;
|
||||
import com.dite.znpt.domain.entity.MaintainSuggestionEntity;
|
||||
import com.dite.znpt.domain.vo.MaintainSuggestionReq;
|
||||
import com.dite.znpt.domain.vo.MaintainSuggestionResp;
|
||||
import com.dite.znpt.enums.DefectLevelEnum;
|
||||
import com.dite.znpt.enums.DefectTypeEnum;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.MaintainSuggestionMapper;
|
||||
import com.dite.znpt.service.MaintainSuggestionService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/7/7 22:25
|
||||
* @Description:
|
||||
*/
|
||||
@Service
|
||||
public class MaintainSuggestionServiceImpl extends ServiceImpl<MaintainSuggestionMapper, MaintainSuggestionEntity> implements MaintainSuggestionService {
|
||||
@Override
|
||||
public List<MaintainSuggestionResp> page(String defectLevel, String defectType) {
|
||||
PageUtil.startPage();
|
||||
return this.list(defectLevel, defectType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MaintainSuggestionResp> list(String defectLevel, String defectType) {
|
||||
List<MaintainSuggestionResp> result = Converts.INSTANCE.toMaintainSuggestionResp(
|
||||
this.list(Wrappers.lambdaQuery(MaintainSuggestionEntity.class)
|
||||
.eq(StrUtil.isNotEmpty(defectLevel), MaintainSuggestionEntity::getDefectLevel, defectLevel)
|
||||
.eq(StrUtil.isNotEmpty(defectType), MaintainSuggestionEntity::getDefectType, defectType)
|
||||
));
|
||||
result.forEach(resp -> {
|
||||
resp.setDefectLevelLabel(DefectLevelEnum.getDescByCode(resp.getDefectLevel()));
|
||||
resp.setDefectTypeLabel(DefectTypeEnum.getDescByCode(resp.getDefectType()));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaintainSuggestionResp detail(String suggestionId) {
|
||||
MaintainSuggestionResp result = Converts.INSTANCE.toMaintainSuggestionResp(this.getById(suggestionId));
|
||||
result.setDefectLevelLabel(DefectLevelEnum.getDescByCode(result.getDefectLevel()));
|
||||
result.setDefectTypeLabel(DefectTypeEnum.getDescByCode(result.getDefectType()));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void save(MaintainSuggestionReq req) {
|
||||
if(!validDefectLevelAndType(req.getDefectLevel(), req.getDefectType())){
|
||||
throw new ServiceException(StrUtil.format(Message.SUGGESTION_LEVEL_TYPE_FORBID_REPEAT, req.getDefectLevel(), req.getDefectType()));
|
||||
}
|
||||
this.save(Converts.INSTANCE.toMaintainSuggestionEntity(req));
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void update(String suggestionId, MaintainSuggestionReq req) {
|
||||
MaintainSuggestionEntity maintainSuggestion = this.getById(suggestionId);
|
||||
if(null == maintainSuggestion){
|
||||
throw new ServiceException(Message.SUGGESTION_ID_IS_NOT_EXIST);
|
||||
}
|
||||
if(!req.getDefectLevel().equals(maintainSuggestion.getDefectLevel()) || !req.getDefectType().equals(maintainSuggestion.getDefectType())){
|
||||
if(!validDefectLevelAndType(req.getDefectLevel(), req.getDefectType())){
|
||||
throw new ServiceException(StrUtil.format(Message.SUGGESTION_LEVEL_TYPE_FORBID_REPEAT, req.getDefectLevel(), req.getDefectType()));
|
||||
}
|
||||
}
|
||||
MaintainSuggestionEntity entity = Converts.INSTANCE.toMaintainSuggestionEntity(req);
|
||||
entity.setSuggestionId(suggestionId);
|
||||
this.updateById(entity);
|
||||
}
|
||||
|
||||
private Boolean validDefectLevelAndType(String defectLevel, String defectType){
|
||||
return this.list(
|
||||
Wrappers.lambdaQuery(MaintainSuggestionEntity.class)
|
||||
.eq(MaintainSuggestionEntity::getDefectLevel, defectLevel)
|
||||
.eq(MaintainSuggestionEntity::getDefectType, defectType)
|
||||
).size() == 0 ;
|
||||
|
||||
};
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void deleteById(String suggestionId) {
|
||||
if(null == this.getById(suggestionId)){
|
||||
throw new ServiceException(Message.SUGGESTION_ID_IS_NOT_EXIST);
|
||||
}
|
||||
this.removeById(suggestionId);
|
||||
}
|
||||
}
|
|
@ -73,11 +73,13 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, MenuEntity> impleme
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void update(String menuId, MenuReq req) {
|
||||
if(null == this.getById(menuId)){
|
||||
MenuEntity menu = this.getById(menuId);
|
||||
if(null == menu){
|
||||
throw new ServiceException(Message.MENU_ID_NOT_EXIST);
|
||||
}
|
||||
MenuEntity entity = Converts.INSTANCE.toMenuEntity(req);
|
||||
entity.setMenuId(menuId);
|
||||
entity.setParentId(menu.getParentId());
|
||||
if(StrUtil.isBlank(entity.getParentId())){
|
||||
entity.setParentId("0");
|
||||
}
|
||||
|
|
|
@ -0,0 +1,123 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.config.YoloModelRegistry;
|
||||
import com.dite.znpt.domain.entity.AttachInfoEntity;
|
||||
import com.dite.znpt.domain.entity.ModelConfigEntity;
|
||||
import com.dite.znpt.domain.vo.ModelConfigListReq;
|
||||
import com.dite.znpt.domain.vo.ModelConfigReq;
|
||||
import com.dite.znpt.domain.vo.ModelConfigResp;
|
||||
import com.dite.znpt.enums.AttachBusinessTypeEnum;
|
||||
import com.dite.znpt.mapper.ModelConfigMapper;
|
||||
import com.dite.znpt.service.AttachInfoService;
|
||||
import com.dite.znpt.service.ModelConfigService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
* @Description: 模型配置表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ModelConfigServiceImpl extends ServiceImpl<ModelConfigMapper, ModelConfigEntity> implements ModelConfigService {
|
||||
|
||||
private final YoloModelRegistry modelRegistry;
|
||||
private final AttachInfoService attachInfoService;
|
||||
|
||||
/**
|
||||
* 功能描述:查询列表
|
||||
*
|
||||
* @param modelConfigReq 信息
|
||||
* @return {@link List }<{@link ModelConfigResp }>
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
**/
|
||||
@Override
|
||||
public List<ModelConfigResp> selectList(ModelConfigListReq modelConfigReq) {
|
||||
PageUtil.startPage();
|
||||
List<ModelConfigResp> modelConfigList= this.baseMapper.queryBySelective(modelConfigReq);
|
||||
modelConfigList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return modelConfigList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条
|
||||
*
|
||||
* @param modelId Id
|
||||
* @return {@link ModelConfigResp }
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
**/
|
||||
@Override
|
||||
public ModelConfigResp selectById(String modelId) {
|
||||
ModelConfigListReq modelConfigReq = new ModelConfigListReq();
|
||||
modelConfigReq.setModelId(modelId);
|
||||
|
||||
List<ModelConfigResp> list = selectList(modelConfigReq);
|
||||
return CollUtil.isNotEmpty(list) ? CollUtil.getFirst(list) : new ModelConfigResp();
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增
|
||||
*
|
||||
* @param modelConfigReq
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
**/
|
||||
@SneakyThrows
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveData(ModelConfigReq modelConfigReq) {
|
||||
ModelConfigEntity entity = BeanUtil.copyProperties(modelConfigReq, ModelConfigEntity.class);
|
||||
AttachInfoEntity attachInfo = attachInfoService.getById(modelConfigReq.getAttachId());
|
||||
entity.setModelPath(attachInfo.getAttachPath());
|
||||
save(entity);
|
||||
attachInfoService.updateBusinessIdByAttachIds(entity.getModelId(), ListUtil.of(modelConfigReq.getAttachId()), AttachBusinessTypeEnum.MODEL_FILE);
|
||||
modelRegistry.loadModel(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新
|
||||
*
|
||||
* @param modelConfigReq
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
**/
|
||||
@SneakyThrows
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateData(ModelConfigReq modelConfigReq) {
|
||||
ModelConfigEntity entity = BeanUtil.copyProperties(modelConfigReq, ModelConfigEntity.class);
|
||||
AttachInfoEntity attachInfo = attachInfoService.getById(modelConfigReq.getAttachId());
|
||||
entity.setModelPath(attachInfo.getAttachPath());
|
||||
attachInfoService.updateBusinessIdByAttachIds(entity.getModelId(), ListUtil.of(modelConfigReq.getAttachId()), AttachBusinessTypeEnum.MODEL_FILE);
|
||||
updateById(entity);
|
||||
modelRegistry.reloadModel(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除
|
||||
*
|
||||
* @param modelId Id
|
||||
* @author huise23
|
||||
* @date 2025/07/02 20:57
|
||||
**/
|
||||
@Override
|
||||
public void deleteById(String modelId) {
|
||||
modelRegistry.unloadModel(modelId);
|
||||
removeById(modelId);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import ai.onnxruntime.OnnxTensor;
|
||||
import ai.onnxruntime.OrtEnvironment;
|
||||
import ai.onnxruntime.OrtException;
|
||||
import ai.onnxruntime.OrtSession;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.dite.znpt.config.YoloModelRegistry;
|
||||
import com.dite.znpt.domain.bo.Detection;
|
||||
import com.dite.znpt.domain.bo.Letterbox;
|
||||
import com.dite.znpt.domain.bo.ODConfig;
|
||||
import com.dite.znpt.domain.entity.ModelConfigEntity;
|
||||
import com.dite.znpt.util.ModelUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.Scalar;
|
||||
import org.opencv.imgcodecs.Imgcodecs;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.util.*;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MultiModelYoloService {
|
||||
|
||||
@Autowired
|
||||
private YoloModelRegistry registry;
|
||||
|
||||
public List<Detection> detect(String modelId, String inputFile, String outputFile, Float confThreshold) throws OrtException {
|
||||
OrtSession session = registry.getSession(modelId);
|
||||
YoloModelRegistry.ModelMetadata meta = registry.getMetadata(modelId);
|
||||
OrtEnvironment environment = registry.getEnvironment();
|
||||
ModelConfigEntity modelConfig = registry.getModelConfig(modelId);
|
||||
confThreshold = (Objects.isNull(confThreshold) ? modelConfig.getConfThreshold() : confThreshold) / 100;
|
||||
|
||||
Mat img = Imgcodecs.imread(inputFile);
|
||||
Mat image = img.clone();
|
||||
Imgproc.cvtColor(image, image, Imgproc.COLOR_BGR2RGB);
|
||||
|
||||
// 在这里先定义下框的粗细、字的大小、字的类型、字的颜色(按比例设置大小粗细比较好一些)
|
||||
int minDwDh = Math.min(img.width(), img.height());
|
||||
int thickness = minDwDh/ ODConfig.lineThicknessRatio;
|
||||
long start_time = System.currentTimeMillis();
|
||||
// 更改 image 尺寸
|
||||
Letterbox letterbox = new Letterbox();
|
||||
image = letterbox.letterbox(image);
|
||||
|
||||
double ratio = letterbox.getRatio();
|
||||
double dw = letterbox.getDw();
|
||||
double dh = letterbox.getDh();
|
||||
int rows = letterbox.getHeight();
|
||||
int cols = letterbox.getWidth();
|
||||
int channels = image.channels();
|
||||
|
||||
// 将Mat对象的像素值赋值给Float[]对象
|
||||
float[] pixels = new float[channels * rows * cols];
|
||||
for (int i = 0; i < rows; i++) {
|
||||
for (int j = 0; j < cols; j++) {
|
||||
double[] pixel = image.get(j,i);
|
||||
for (int k = 0; k < channels; k++) {
|
||||
// 这样设置相当于同时做了image.transpose((2, 0, 1))操作
|
||||
pixels[rows*cols*k+j*cols+i] = (float) pixel[k]/255.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 创建OnnxTensor对象
|
||||
long[] shape = { 1L, (long)channels, (long)rows, (long)cols };
|
||||
OnnxTensor tensor = OnnxTensor.createTensor(environment, FloatBuffer.wrap(pixels), shape);
|
||||
HashMap<String, OnnxTensor> stringOnnxTensorHashMap = new HashMap<>();
|
||||
stringOnnxTensorHashMap.put(session.getInputInfo().keySet().iterator().next(), tensor);
|
||||
|
||||
// 运行推理
|
||||
OrtSession.Result output = session.run(stringOnnxTensorHashMap);
|
||||
float[][] outputData = ((float[][][])output.get(0).getValue())[0];
|
||||
|
||||
outputData = ModelUtil.transposeMatrix(outputData);
|
||||
Map<Integer, List<float[]>> class2Bbox = new HashMap<>();
|
||||
|
||||
for (float[] bbox : outputData) {
|
||||
float[] conditionalProbabilities = Arrays.copyOfRange(bbox, 4, bbox.length);
|
||||
int label = ModelUtil.argmax(conditionalProbabilities);
|
||||
float conf = conditionalProbabilities[label];
|
||||
if (conf < confThreshold) continue;
|
||||
|
||||
bbox[4] = conf;
|
||||
|
||||
// xywh to (x1, y1, x2, y2)
|
||||
ModelUtil.xywh2xyxy(bbox);
|
||||
|
||||
// skip invalid predictions
|
||||
if (bbox[0] >= bbox[2] || bbox[1] >= bbox[3]) continue;
|
||||
|
||||
class2Bbox.putIfAbsent(label, new ArrayList<>());
|
||||
class2Bbox.get(label).add(bbox);
|
||||
}
|
||||
|
||||
List<Detection> detections = new ArrayList<>();
|
||||
for (Map.Entry<Integer, List<float[]>> entry : class2Bbox.entrySet()) {
|
||||
int label = entry.getKey();
|
||||
List<float[]> bboxes = entry.getValue();
|
||||
bboxes = ModelUtil.nonMaxSuppression(bboxes, modelConfig.getNmsThreshold());
|
||||
for (float[] bbox : bboxes) {
|
||||
String labelString = meta.getLabels()[label];
|
||||
detections.add(new Detection(labelString,entry.getKey(), Arrays.copyOfRange(bbox, 0, 4), bbox[4]));
|
||||
}
|
||||
}
|
||||
|
||||
// 打印检测结果并将图片写入指定目录
|
||||
for (Detection detection : detections) {
|
||||
float[] bbox = detection.getBbox();
|
||||
log.info(detection.toString());
|
||||
// 画框
|
||||
Point topLeft = new Point((bbox[0]-dw)/ratio, (bbox[1]-dh)/ratio);
|
||||
Point bottomRight = new Point((bbox[2]-dw)/ratio, (bbox[3]-dh)/ratio);
|
||||
Scalar color = new Scalar(meta.getColors().get(detection.getClsId()));
|
||||
Imgproc.rectangle(img, topLeft, bottomRight, color, thickness);
|
||||
// 框上写文字
|
||||
Point boxNameLoc = new Point((bbox[0]-dw)/ratio, (bbox[1]-dh-2)/ratio-3);
|
||||
|
||||
Imgproc.putText(img, detection.getLabel(), boxNameLoc, Imgproc.FONT_HERSHEY_SIMPLEX, 2.5, color, thickness);
|
||||
}
|
||||
log.info("检测{},发现{}处问题,耗时:{} ms.", inputFile, detections.size(), (System.currentTimeMillis() - start_time));
|
||||
|
||||
// 保存图像到输出目录
|
||||
Imgcodecs.imwrite(outputFile, img);
|
||||
return detections;
|
||||
}
|
||||
|
||||
public void runFolderDetection(String modelId, String inputFolder, String outputFolder, Float confThreshold) throws Exception {
|
||||
List<File> fileList = FileUtil.loopFiles(inputFolder, file -> {
|
||||
String extName = FileUtil.extName(file);
|
||||
return StrUtil.equalsAnyIgnoreCase(extName, "jpg", "png");
|
||||
});
|
||||
for (File file : fileList) {
|
||||
List<Detection> detections = detect(modelId, file.getAbsolutePath(), outputFolder+ FileUtil.FILE_SEPARATOR+FileUtil.getName(file), confThreshold);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -17,7 +17,6 @@ import com.dite.znpt.domain.vo.PartResp;
|
|||
import com.dite.znpt.enums.PartTypeEnum;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.PartMapper;
|
||||
import com.dite.znpt.mapper.TurbineMapper;
|
||||
import com.dite.znpt.service.PartService;
|
||||
import com.dite.znpt.service.ProjectService;
|
||||
import com.dite.znpt.service.TurbineService;
|
||||
|
@ -35,7 +34,7 @@ import java.util.stream.Collectors;
|
|||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
* @Description: 表服务实现类
|
||||
* @Description: 部件表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.text.StrBuilder;
|
||||
import cn.hutool.core.util.BooleanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
@ -10,20 +10,19 @@ import com.dite.znpt.constant.Message;
|
|||
import com.dite.znpt.domain.entity.AttachInfoEntity;
|
||||
import com.dite.znpt.domain.entity.ProjectTaskEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectTaskListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectTaskResp;
|
||||
import com.dite.znpt.domain.vo.ProjectTaskReq;
|
||||
import com.dite.znpt.domain.vo.ProjectTaskResp;
|
||||
import com.dite.znpt.domain.vo.ProjectTaskStartReq;
|
||||
import com.dite.znpt.enums.AttachBusinessTypeEnum;
|
||||
import com.dite.znpt.enums.ProjectTaskStateEnum;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.ProjectTaskGroupMapper;
|
||||
import com.dite.znpt.mapper.ProjectTaskMapper;
|
||||
import com.dite.znpt.service.AttachInfoService;
|
||||
import com.dite.znpt.service.ProjectTaskService;
|
||||
import com.dite.znpt.mapper.ProjectTaskMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
@ -82,7 +81,7 @@ public class ProjectTaskServiceImpl extends ServiceImpl<ProjectTaskMapper, Proje
|
|||
projectTaskReq.setTaskId(taskId);
|
||||
|
||||
List<ProjectTaskResp> list = selectList(projectTaskReq);
|
||||
return list.isEmpty() ? CollUtil.getFirst(list) : new ProjectTaskResp();
|
||||
return CollUtil.isNotEmpty(list) ? CollUtil.getFirst(list) : new ProjectTaskResp();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.TConstructionEntity;
|
||||
import com.dite.znpt.domain.vo.TConstructionListReq;
|
||||
import com.dite.znpt.domain.vo.TConstructionReq;
|
||||
import com.dite.znpt.domain.vo.TConstructionResp;
|
||||
import com.dite.znpt.service.TConstructionService;
|
||||
import com.dite.znpt.mapper.TConstructionMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.service.TConstructionService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -60,27 +62,25 @@ public class TConstructionServiceImpl extends ServiceImpl<TConstructionMapper, T
|
|||
/**
|
||||
* 功能描述:新增施工信息
|
||||
*
|
||||
* @param tConstruction 施工信息
|
||||
* @param req 施工信息
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public void saveData(TConstructionEntity tConstruction) {
|
||||
// todo 校验
|
||||
save(tConstruction);
|
||||
public void saveData(TConstructionReq req) {
|
||||
save(BeanUtil.copyProperties(req, TConstructionEntity.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新施工信息
|
||||
*
|
||||
* @param tConstruction 施工信息
|
||||
* @param req 施工信息
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public void updateData(TConstructionEntity tConstruction) {
|
||||
// todo 校验
|
||||
updateById(tConstruction);
|
||||
public void updateData(TConstructionReq req) {
|
||||
updateById(BeanUtil.copyProperties(req, TConstructionEntity.class));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -134,8 +134,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public String save(UserReq req) {
|
||||
UserEntity entity = Converts.INSTANCE.toUserEntity(req);
|
||||
validate(req, null);
|
||||
UserEntity entity = validate(req, null);
|
||||
String salt = RandomUtil.randomString(req.getAccount(), 4);
|
||||
entity.setSalt(salt);
|
||||
String password = enableDefaultPassword ? defaultPassword : PasswordUtil.generatePassword();
|
||||
|
@ -176,11 +175,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
|
|||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(Integer.parseInt("00001") + 1);
|
||||
System.out.println(StrUtil.fillBefore("2",'0', 5));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 功能描述:更新用户信息
|
||||
|
@ -197,10 +191,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
|
|||
if(null == originalEntity || originalEntity.getDelFlag().equals(Constants.DEL_FLAG_1)){
|
||||
throw new ServiceException(Message.USER_ID_NOT_EXIST);
|
||||
}
|
||||
UserEntity entity = Converts.INSTANCE.toUserEntity(req);
|
||||
UserEntity entity = validate(req, originalEntity);
|
||||
entity.setUserId(userId);
|
||||
entity.setAccount(null);
|
||||
validate(req, originalEntity);
|
||||
if(CollUtil.isNotEmpty(req.getPostIds())){
|
||||
userPostService.bindUserPost(userId, req.getPostIds());
|
||||
}
|
||||
|
@ -208,7 +201,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
|
|||
}
|
||||
|
||||
|
||||
private void validate(UserReq req, UserEntity originalEntity){
|
||||
private UserEntity validate(UserReq req, UserEntity originalEntity){
|
||||
if(StrUtil.isNotBlank(req.getDeptId()) && deptService.getById(req.getDeptId()) == null){
|
||||
throw new ServiceException(Message.DEPT_ID_NOT_EXIST);
|
||||
}
|
||||
|
@ -216,24 +209,30 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
|
|||
if(this.getOne(accountWrapper) != null && originalEntity == null){
|
||||
throw new ServiceException(Message.ACCOUNT_EXIST);
|
||||
}
|
||||
if(originalEntity == null || (StrUtil.isNotBlank(req.getMobile()) && !originalEntity.getMobile().equals(req.getMobile()))){
|
||||
LambdaQueryWrapper<UserEntity> mobileWrapper = Wrappers.lambdaQuery(UserEntity.class).eq(StrUtil.isNotBlank(req.getMobile()), UserEntity::getMobile, req.getMobile()).eq(UserEntity::getDelFlag, Constants.DEL_FLAG_0);
|
||||
if(this.getOne(mobileWrapper) != null){
|
||||
if(StrUtil.isNotBlank(req.getMobile())){
|
||||
LambdaQueryWrapper<UserEntity> mobileWrapper = Wrappers.lambdaQuery(UserEntity.class).eq(UserEntity::getMobile, req.getMobile()).eq(UserEntity::getDelFlag, Constants.DEL_FLAG_0);
|
||||
List<UserEntity> mobileUserList = this.list(mobileWrapper);
|
||||
if((originalEntity == null && !mobileUserList.isEmpty()) || (originalEntity != null && !originalEntity.getMobile().equals(req.getMobile()) && !mobileUserList.isEmpty())){
|
||||
throw new ServiceException(Message.MOBILE_EXIST);
|
||||
|
||||
}
|
||||
}
|
||||
if(originalEntity == null || (StrUtil.isNotBlank(req.getEmail()) && !originalEntity.getEmail().equals(req.getEmail()))){
|
||||
LambdaQueryWrapper<UserEntity> emailWrapper = Wrappers.lambdaQuery(UserEntity.class).eq(StrUtil.isNotBlank(req.getEmail()), UserEntity::getEmail, req.getEmail()).eq(UserEntity::getDelFlag, Constants.DEL_FLAG_0);
|
||||
if(this.getOne(emailWrapper) != null){
|
||||
if(StrUtil.isNotBlank(req.getEmail())){
|
||||
LambdaQueryWrapper<UserEntity> emailWrapper = Wrappers.lambdaQuery(UserEntity.class).eq(UserEntity::getEmail, req.getEmail()).eq(UserEntity::getDelFlag, Constants.DEL_FLAG_0);
|
||||
List<UserEntity> emailUserList = this.list(emailWrapper);
|
||||
if((originalEntity == null && !emailUserList.isEmpty()) || (originalEntity != null && !originalEntity.getEmail().equals(req.getEmail()) && emailUserList.size() > 1)){
|
||||
throw new ServiceException(Message.EMAIL_EXIST);
|
||||
|
||||
}
|
||||
}
|
||||
if(originalEntity == null || (StrUtil.isNotBlank(req.getIdentityCard()) && !originalEntity.getIdentityCard().equals(req.getIdentityCard()))){
|
||||
LambdaQueryWrapper<UserEntity> emailWrapper = Wrappers.lambdaQuery(UserEntity.class).eq(StrUtil.isNotBlank(req.getIdentityCard()), UserEntity::getIdentityCard, req.getIdentityCard()).eq(UserEntity::getDelFlag, Constants.DEL_FLAG_0);
|
||||
if(this.getOne(emailWrapper) != null){
|
||||
if(StrUtil.isNotBlank(req.getIdentityCard())){
|
||||
LambdaQueryWrapper<UserEntity> identifyCardWrapper = Wrappers.lambdaQuery(UserEntity.class).eq(UserEntity::getIdentityCard, req.getIdentityCard()).eq(UserEntity::getDelFlag, Constants.DEL_FLAG_0);
|
||||
List<UserEntity> identifyCardUserList = this.list(identifyCardWrapper);
|
||||
if((originalEntity == null && !identifyCardUserList.isEmpty()) || (originalEntity != null && !originalEntity.getIdentityCard().equals(req.getIdentityCard()) && identifyCardUserList.size() > 1)){
|
||||
throw new ServiceException(Message.IDENTITY_CARD_EXIST);
|
||||
}
|
||||
}
|
||||
return Converts.INSTANCE.toUserEntity(req);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.constant.Constants;
|
||||
import com.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.domain.entity.VideoFileInfoEntity;
|
||||
import com.dite.znpt.domain.vo.VideoFileInfoListReq;
|
||||
|
@ -12,15 +12,13 @@ import com.dite.znpt.domain.vo.VideoFileInfoReq;
|
|||
import com.dite.znpt.domain.vo.VideoFileInfoResp;
|
||||
import com.dite.znpt.enums.FilePathEnum;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.VideoFileInfoMapper;
|
||||
import com.dite.znpt.service.PartService;
|
||||
import com.dite.znpt.service.VideoFileInfoService;
|
||||
import com.dite.znpt.mapper.VideoFileInfoMapper;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
@ -120,7 +118,7 @@ public class VideoFileInfoServiceImpl extends ServiceImpl<VideoFileInfoMapper, V
|
|||
throw new ServiceException(Message.IMAGE_IS_EMPTY);
|
||||
}
|
||||
String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
String path_prefix = FilePathEnum.VIDEO.getFileAbsolutePath().concat(dateStr).concat(FileUtil.FILE_SEPARATOR);
|
||||
String path_prefix = FilePathEnum.VIDEO.getFileAbsolutePathPrefix().concat(dateStr).concat(FileUtil.FILE_SEPARATOR);
|
||||
if (!FileUtil.exist(path_prefix)) {
|
||||
FileUtil.mkdir(path_prefix);
|
||||
}
|
||||
|
@ -129,7 +127,7 @@ public class VideoFileInfoServiceImpl extends ServiceImpl<VideoFileInfoMapper, V
|
|||
VideoFileInfoEntity info = BeanUtil.copyProperties(infoReq, VideoFileInfoEntity.class);
|
||||
String path = path_prefix + multipartFile.getOriginalFilename();
|
||||
FileUtil.writeBytes(multipartFile.getBytes(), path);
|
||||
info.setFilePath(FilePathEnum.VIDEO.getUrlPath() + StrUtil.removePrefix(path, FilePathEnum.VIDEO.getFileAbsolutePath()).replace(FileUtil.FILE_SEPARATOR, StrUtil.SLASH));
|
||||
info.setFilePath(FilePathEnum.VIDEO.getUrlPath() + StrUtil.removePrefix(path, FilePathEnum.VIDEO.getFileAbsolutePathPrefix()).replace(FileUtil.FILE_SEPARATOR, StrUtil.SLASH));
|
||||
result.add(info);
|
||||
}
|
||||
baseMapper.insert(result);
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
package com.dite.znpt.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ModelUtil {
|
||||
|
||||
public static void xywh2xyxy(float[] bbox) {
|
||||
float x = bbox[0];
|
||||
float y = bbox[1];
|
||||
float w = bbox[2];
|
||||
float h = bbox[3];
|
||||
|
||||
bbox[0] = x - w * 0.5f;
|
||||
bbox[1] = y - h * 0.5f;
|
||||
bbox[2] = x + w * 0.5f;
|
||||
bbox[3] = y + h * 0.5f;
|
||||
}
|
||||
|
||||
public static float[][] transposeMatrix(float[][] m) {
|
||||
float[][] temp = new float[m[0].length][m.length];
|
||||
for (int i = 0; i < m.length; i++)
|
||||
for (int j = 0; j < m[0].length; j++)
|
||||
temp[j][i] = m[i][j];
|
||||
return temp;
|
||||
}
|
||||
|
||||
//返回最大值的索引
|
||||
public static int argmax(float[] a) {
|
||||
float re = -Float.MAX_VALUE;
|
||||
int arg = -1;
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
if (a[i] >= re) {
|
||||
re = a[i];
|
||||
arg = i;
|
||||
}
|
||||
}
|
||||
return arg;
|
||||
}
|
||||
|
||||
public static List<float[]> nonMaxSuppression(List<float[]> bboxes, float iouThreshold) {
|
||||
|
||||
List<float[]> bestBboxes = new ArrayList<>();
|
||||
|
||||
bboxes.sort(Comparator.comparing(a -> a[4]));
|
||||
|
||||
while (!bboxes.isEmpty()) {
|
||||
float[] bestBbox = bboxes.remove(bboxes.size() - 1);
|
||||
bestBboxes.add(bestBbox);
|
||||
bboxes = bboxes.stream().filter(a -> computeIOU(a, bestBbox) < iouThreshold).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return bestBboxes;
|
||||
}
|
||||
|
||||
public static float computeIOU(float[] box1, float[] box2) {
|
||||
|
||||
float area1 = (box1[2] - box1[0]) * (box1[3] - box1[1]);
|
||||
float area2 = (box2[2] - box2[0]) * (box2[3] - box2[1]);
|
||||
|
||||
float left = Math.max(box1[0], box2[0]);
|
||||
float top = Math.max(box1[1], box2[1]);
|
||||
float right = Math.min(box1[2], box2[2]);
|
||||
float bottom = Math.min(box1[3], box2[3]);
|
||||
|
||||
float interArea = Math.max(right - left, 0) * Math.max(bottom - top, 0);
|
||||
float unionArea = area1 + area2 - interArea;
|
||||
return Math.max(interArea / unionArea, 1e-8f);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,5 @@
|
|||
package com.dite.znpt.util;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/5/19/周一 15:09
|
||||
|
@ -11,4 +9,5 @@ import lombok.Data;
|
|||
public interface ValidationGroup {
|
||||
interface Insert {} // 增
|
||||
interface Update {} // 改
|
||||
interface Request {} // 其他类型
|
||||
}
|
||||
|
|
|
@ -9,14 +9,14 @@
|
|||
FROM defect d
|
||||
LEFT JOIN image i ON d.image_id = i.image_id
|
||||
LEFT JOIN image_collect ic ON ic.collect_id = i.collect_id
|
||||
LEFT JOIN part p ON ic.part_id = p.part_id
|
||||
LEFT JOIN part p ON i.part_id = p.part_id
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
# AND (d.defect_name LIKE concat('%', #{keyword,jdbcType=VARCHAR}, '%') OR d.defect_code LIKE concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
|
||||
</if>
|
||||
<if test="turbineId != null and turbineId != ''">
|
||||
AND p.turbine_id = #{turbineId}
|
||||
</if>
|
||||
<if test="partId != null and partId != ''">
|
||||
AND i.part_id = #{partId}
|
||||
</if>
|
||||
<if test="defectType != null and defectType != ''">
|
||||
AND d.defect_type = #{defectType}
|
||||
</if>
|
||||
|
|
|
@ -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
|
||||
ic.shooting_method, ic.shooting_distance,ic.collector_name, i.image_type, i.image_path, ic.image_source, i.review_state
|
||||
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
|
||||
|
@ -16,9 +16,15 @@
|
|||
<if test="turbineId != null and turbineId != ''">
|
||||
AND p.turbine_id = #{turbineId}
|
||||
</if>
|
||||
<if test="partId != null and partId != ''">
|
||||
AND p.part_id = #{partId}
|
||||
</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 test="reviewState != null">
|
||||
and i.review_state = #{reviewState}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
@ -28,6 +34,7 @@
|
|||
<result property="imagePath" column="image_path"></result>
|
||||
<result property="imageSize" column="image_size"></result>
|
||||
<result property="imageResolution" column="image_resolution"></result>
|
||||
<result property="reviewState" column="review_state"></result>
|
||||
<association property="imageExifInfo">
|
||||
<result property="imageWidth" column="image_width"></result>
|
||||
<result property="imageHeight" column="image_height"></result>
|
||||
|
@ -53,6 +60,7 @@
|
|||
<result property="shootingMethod" column="shooting_method"></result>
|
||||
<result property="shootingDistance" column="shooting_distance"></result>
|
||||
<result property="collectorName" column="collector_name"></result>
|
||||
<result property="imageSource" column="image_source"></result>
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
|
@ -60,7 +68,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, i.review_state
|
||||
FROM image i
|
||||
LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id
|
||||
WHERE i.image_id = #{imageId}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dite.znpt.mapper.InspectionReportMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,4 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dite.znpt.mapper.MaintainSuggestionMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dite.znpt.mapper.ModelConfigMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
a.model_id, a.model_name, a.model_path, a.conf_threshold,
|
||||
a.nms_threshold, a.update_by, a.create_time, a.create_by,
|
||||
a.update_time
|
||||
</sql>
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ModelConfigResp">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from model_config a
|
||||
<where>
|
||||
<if test="modelId != null and modelId != ''">
|
||||
and a.model_id = #{modelId}
|
||||
</if>
|
||||
<if test="modelName != null and modelName != ''">
|
||||
and a.model_name like concat ('%', #{modelName}, '%')
|
||||
</if>
|
||||
<if test="modelPath != null and modelPath != ''">
|
||||
and a.model_path like concat ('%', #{modelPath}, '%')
|
||||
</if>
|
||||
<if test="confThreshold != null">
|
||||
and a.conf_threshold >= #{confThreshold}
|
||||
</if>
|
||||
<if test="nmsThreshold != null">
|
||||
and a.nms_threshold >= #{nmsThreshold}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
<mapper namespace="com.dite.znpt.mapper.TConstructionMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
a.construction_id, a.project_id, a.turbine_code, a.start_time,
|
||||
a.construction_id, a.project_id, a.turbine_id, a.start_time,
|
||||
a.end_time, a.temperature, a.wind_speed, a.image_count,
|
||||
a.weather_code, a.status_id, a.created_at
|
||||
</sql>
|
||||
|
@ -22,8 +22,8 @@
|
|||
<if test="projectId != null and projectId != ''">
|
||||
and a.project_id like concat ('%', #{projectId}, '%')
|
||||
</if>
|
||||
<if test="turbineCode != null and turbineCode != ''">
|
||||
and a.turbine_code like concat ('%', #{turbineCode}, '%')
|
||||
<if test="turbineId != null and turbineId != ''">
|
||||
and a.turbine_id like concat ('%', #{turbineId}, '%')
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
and a.start_time = #{startTime}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue